mirror of
https://github.com/weechat/weechat.git
synced 2026-06-29 22:36:38 +02:00
api: add function string_cut
This commit is contained in:
@@ -602,6 +602,7 @@ plugin_load (const char *filename, int init_plugin, int argc, char **argv)
|
||||
new_plugin->gettext = &plugin_api_gettext;
|
||||
new_plugin->ngettext = &plugin_api_ngettext;
|
||||
new_plugin->strndup = &string_strndup;
|
||||
new_plugin->string_cut = &string_cut;
|
||||
new_plugin->string_tolower = &string_tolower;
|
||||
new_plugin->string_toupper = &string_toupper;
|
||||
new_plugin->strcasecmp = &string_strcasecmp;
|
||||
|
||||
@@ -68,7 +68,7 @@ struct timeval;
|
||||
* please change the date with current one; for a second change at same
|
||||
* date, increment the 01, otherwise please keep 01.
|
||||
*/
|
||||
#define WEECHAT_PLUGIN_API_VERSION "20210703-01"
|
||||
#define WEECHAT_PLUGIN_API_VERSION "20210704-01"
|
||||
|
||||
/* macros for defining plugin infos */
|
||||
#define WEECHAT_PLUGIN_NAME(__name) \
|
||||
@@ -285,6 +285,8 @@ struct t_weechat_plugin
|
||||
const char *(*gettext) (const char *string);
|
||||
const char *(*ngettext) (const char *single, const char *plural, int count);
|
||||
char *(*strndup) (const char *string, int length);
|
||||
char *(*string_cut) (const char *string, int length, int count_suffix,
|
||||
int screen, const char *cut_suffix);
|
||||
void (*string_tolower) (char *string);
|
||||
void (*string_toupper) (char *string);
|
||||
int (*strcasecmp) (const char *string1, const char *string2);
|
||||
@@ -1192,6 +1194,10 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
|
||||
(weechat_plugin->ngettext)(single, plural, number)
|
||||
#define weechat_strndup(__string, __length) \
|
||||
(weechat_plugin->strndup)(__string, __length)
|
||||
#define weechat_string_cut(__string, __length, __count_suffix, \
|
||||
__screen, __cut_suffix) \
|
||||
(weechat_plugin->string_cut)(__string, __length, __count_suffix, \
|
||||
__screen, __cut_suffix)
|
||||
#define weechat_string_tolower(__string) \
|
||||
(weechat_plugin->string_tolower)(__string)
|
||||
#define weechat_string_toupper(__string) \
|
||||
|
||||
Reference in New Issue
Block a user