weechat-plugin.h 119 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948
  1. /*
  2. * weechat-plugin.h - header to compile WeeChat plugins
  3. *
  4. * Copyright (C) 2003-2017 Sébastien Helleu <flashcode@flashtux.org>
  5. *
  6. * This file is part of WeeChat, the extensible chat client.
  7. *
  8. * WeeChat is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * WeeChat is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. #ifndef WEECHAT_WEECHAT_PLUGIN_H
  22. #define WEECHAT_WEECHAT_PLUGIN_H 1
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif /* __cplusplus */
  26. #include <sys/types.h>
  27. #include <sys/socket.h>
  28. /* some systems like GNU/Hurd do not define PATH_MAX */
  29. #ifndef PATH_MAX
  30. #define PATH_MAX 4096
  31. #endif /* PATH_MAX */
  32. struct t_config_option;
  33. struct t_gui_window;
  34. struct t_gui_buffer;
  35. struct t_gui_bar;
  36. struct t_gui_bar_item;
  37. struct t_gui_completion;
  38. struct t_infolist;
  39. struct t_infolist_item;
  40. struct t_weelist;
  41. struct t_hashtable;
  42. struct t_hdata;
  43. struct timeval;
  44. /*
  45. * IMPORTANT NOTE for WeeChat developers: if you update, add or remove
  46. * some functions in this file, then please update API version below.
  47. */
  48. /*
  49. * API version (used to check that plugin has same API and can be loaded):
  50. * please change the date with current one; for a second change at same
  51. * date, increment the 01, otherwise please keep 01.
  52. */
  53. #define WEECHAT_PLUGIN_API_VERSION "20160618-01"
  54. /* macros for defining plugin infos */
  55. #define WEECHAT_PLUGIN_NAME(__name) \
  56. char weechat_plugin_name[] = __name; \
  57. char weechat_plugin_api_version[] = WEECHAT_PLUGIN_API_VERSION;
  58. #define WEECHAT_PLUGIN_AUTHOR(__author) \
  59. char weechat_plugin_author[] = __author;
  60. #define WEECHAT_PLUGIN_DESCRIPTION(__desc) \
  61. char weechat_plugin_description[] = __desc;
  62. #define WEECHAT_PLUGIN_VERSION(__version) \
  63. char weechat_plugin_version[] = __version;
  64. #define WEECHAT_PLUGIN_LICENSE(__license) \
  65. char weechat_plugin_license[] = __license;
  66. #define WEECHAT_PLUGIN_PRIORITY(__priority) \
  67. int weechat_plugin_priority = __priority;
  68. /* return codes for plugin functions */
  69. #define WEECHAT_RC_OK 0
  70. #define WEECHAT_RC_OK_EAT 1
  71. #define WEECHAT_RC_ERROR -1
  72. /* return codes for config read functions/callbacks */
  73. #define WEECHAT_CONFIG_READ_OK 0
  74. #define WEECHAT_CONFIG_READ_MEMORY_ERROR -1
  75. #define WEECHAT_CONFIG_READ_FILE_NOT_FOUND -2
  76. /* return codes for config write functions/callbacks */
  77. #define WEECHAT_CONFIG_WRITE_OK 0
  78. #define WEECHAT_CONFIG_WRITE_ERROR -1
  79. #define WEECHAT_CONFIG_WRITE_MEMORY_ERROR -2
  80. /* null value for option */
  81. #define WEECHAT_CONFIG_OPTION_NULL "null"
  82. /* return codes for config option set */
  83. #define WEECHAT_CONFIG_OPTION_SET_OK_CHANGED 2
  84. #define WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE 1
  85. #define WEECHAT_CONFIG_OPTION_SET_ERROR 0
  86. #define WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND -1
  87. /* return codes for config option unset */
  88. #define WEECHAT_CONFIG_OPTION_UNSET_OK_NO_RESET 0
  89. #define WEECHAT_CONFIG_OPTION_UNSET_OK_RESET 1
  90. #define WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED 2
  91. #define WEECHAT_CONFIG_OPTION_UNSET_ERROR -1
  92. /* list management (order of elements) */
  93. #define WEECHAT_LIST_POS_SORT "sort"
  94. #define WEECHAT_LIST_POS_BEGINNING "beginning"
  95. #define WEECHAT_LIST_POS_END "end"
  96. /* type for keys and values in hashtable */
  97. #define WEECHAT_HASHTABLE_INTEGER "integer"
  98. #define WEECHAT_HASHTABLE_STRING "string"
  99. #define WEECHAT_HASHTABLE_POINTER "pointer"
  100. #define WEECHAT_HASHTABLE_BUFFER "buffer"
  101. #define WEECHAT_HASHTABLE_TIME "time"
  102. /* types for hdata */
  103. #define WEECHAT_HDATA_OTHER 0
  104. #define WEECHAT_HDATA_CHAR 1
  105. #define WEECHAT_HDATA_INTEGER 2
  106. #define WEECHAT_HDATA_LONG 3
  107. #define WEECHAT_HDATA_STRING 4
  108. #define WEECHAT_HDATA_POINTER 5
  109. #define WEECHAT_HDATA_TIME 6
  110. #define WEECHAT_HDATA_HASHTABLE 7
  111. #define WEECHAT_HDATA_SHARED_STRING 8
  112. /* flags for hdata lists */
  113. #define WEECHAT_HDATA_LIST_CHECK_POINTERS 1
  114. /* buffer hotlist */
  115. #define WEECHAT_HOTLIST_LOW "0"
  116. #define WEECHAT_HOTLIST_MESSAGE "1"
  117. #define WEECHAT_HOTLIST_PRIVATE "2"
  118. #define WEECHAT_HOTLIST_HIGHLIGHT "3"
  119. /*
  120. * process return code (for callback):
  121. * if >= 0, the process ended and it's return code of command
  122. * if -1, the process is still running
  123. * if -2, the process ended with an error
  124. * if -3, the callback is called in the child process (exec of function)
  125. * (note: the return code -3 is NEVER sent to script plugins,
  126. * it can be used only in C API)
  127. */
  128. #define WEECHAT_HOOK_PROCESS_RUNNING -1
  129. #define WEECHAT_HOOK_PROCESS_ERROR -2
  130. #define WEECHAT_HOOK_PROCESS_CHILD -3
  131. /* connect status for connection hooked */
  132. #define WEECHAT_HOOK_CONNECT_OK 0
  133. #define WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND 1
  134. #define WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND 2
  135. #define WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED 3
  136. #define WEECHAT_HOOK_CONNECT_PROXY_ERROR 4
  137. #define WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR 5
  138. #define WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR 6
  139. #define WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR 7
  140. #define WEECHAT_HOOK_CONNECT_MEMORY_ERROR 8
  141. #define WEECHAT_HOOK_CONNECT_TIMEOUT 9
  142. #define WEECHAT_HOOK_CONNECT_SOCKET_ERROR 10
  143. /* action for gnutls callback: verify or set certificate */
  144. #define WEECHAT_HOOK_CONNECT_GNUTLS_CB_VERIFY_CERT 0
  145. #define WEECHAT_HOOK_CONNECT_GNUTLS_CB_SET_CERT 1
  146. /* type of data for signal hooked */
  147. #define WEECHAT_HOOK_SIGNAL_STRING "string"
  148. #define WEECHAT_HOOK_SIGNAL_INT "int"
  149. #define WEECHAT_HOOK_SIGNAL_POINTER "pointer"
  150. /* macro to format string with variable args, using dynamic buffer size */
  151. #define weechat_va_format(__format) \
  152. va_list argptr; \
  153. int vaa_size, vaa_num; \
  154. char *vbuffer, *vaa_buffer2; \
  155. vaa_size = 1024; \
  156. vbuffer = malloc (vaa_size); \
  157. if (vbuffer) \
  158. { \
  159. while (1) \
  160. { \
  161. va_start (argptr, __format); \
  162. vaa_num = vsnprintf (vbuffer, vaa_size, __format, argptr); \
  163. va_end (argptr); \
  164. if ((vaa_num >= 0) && (vaa_num < vaa_size)) \
  165. break; \
  166. vaa_size = (vaa_num >= 0) ? vaa_num + 1 : vaa_size * 2; \
  167. vaa_buffer2 = realloc (vbuffer, vaa_size); \
  168. if (!vaa_buffer2) \
  169. { \
  170. free (vbuffer); \
  171. vbuffer = NULL; \
  172. break; \
  173. } \
  174. vbuffer = vaa_buffer2; \
  175. } \
  176. }
  177. /*
  178. * macro to return error in case of missing arguments in callback of
  179. * hook_command
  180. */
  181. #define WEECHAT_COMMAND_MIN_ARGS(__min_args, __option) \
  182. if (argc < __min_args) \
  183. { \
  184. weechat_printf_date_tags ( \
  185. NULL, 0, "no_filter", \
  186. _("%sToo few arguments for command \"%s%s%s\" " \
  187. "(help on command: /help %s)"), \
  188. weechat_prefix ("error"), \
  189. argv[0], \
  190. (__option && __option[0]) ? " " : "", \
  191. (__option && __option[0]) ? __option : "", \
  192. argv[0] + 1); \
  193. return WEECHAT_RC_ERROR; \
  194. }
  195. /* macro to return error in callback of hook_command */
  196. #define WEECHAT_COMMAND_ERROR \
  197. { \
  198. weechat_printf_date_tags ( \
  199. NULL, 0, "no_filter", \
  200. _("%sError with command \"%s\" " \
  201. "(help on command: /help %s)"), \
  202. weechat_prefix ("error"), \
  203. argv_eol[0], \
  204. argv[0] + 1); \
  205. return WEECHAT_RC_ERROR; \
  206. }
  207. struct t_weechat_plugin
  208. {
  209. /* plugin variables */
  210. char *filename; /* name of plugin on disk */
  211. void *handle; /* handle of plugin (given by dlopen)*/
  212. char *name; /* short name */
  213. char *description; /* description */
  214. char *author; /* author */
  215. char *version; /* plugin version */
  216. char *license; /* license */
  217. char *charset; /* charset used by plugin */
  218. int priority; /* plugin priority (default is 1000) */
  219. int initialized; /* plugin initialized? (init called) */
  220. int debug; /* debug level for plugin (0=off) */
  221. struct t_weechat_plugin *prev_plugin; /* link to previous plugin */
  222. struct t_weechat_plugin *next_plugin; /* link to next plugin */
  223. /*
  224. * plugin functions (API)
  225. * WeeChat developers: if you add functions in API, update value of
  226. * constant WEECHAT_PLUGIN_API_VERSION
  227. */
  228. /* plugins */
  229. const char *(*plugin_get_name) (struct t_weechat_plugin *plugin);
  230. /* strings */
  231. void (*charset_set) (struct t_weechat_plugin *plugin, const char *charset);
  232. char *(*iconv_to_internal) (const char *charset, const char *string);
  233. char *(*iconv_from_internal) (const char *charset, const char *string);
  234. const char *(*gettext) (const char *string);
  235. const char *(*ngettext) (const char *single, const char *plural, int count);
  236. char *(*strndup) (const char *string, int length);
  237. void (*string_tolower) (char *string);
  238. void (*string_toupper) (char *string);
  239. int (*strcasecmp) (const char *string1, const char *string2);
  240. int (*strcasecmp_range) (const char *string1, const char *string2,
  241. int range);
  242. int (*strncasecmp) (const char *string1, const char *string2, int max);
  243. int (*strncasecmp_range) (const char *string1, const char *string2,
  244. int max, int range);
  245. int (*strcmp_ignore_chars) (const char *string1, const char *string2,
  246. const char *chars_ignored, int case_sensitive);
  247. const char *(*strcasestr) (const char *string, const char *search);
  248. int (*strlen_screen) (const char *string);
  249. int (*string_match) (const char *string, const char *mask,
  250. int case_sensitive);
  251. char *(*string_replace) (const char *string, const char *search,
  252. const char *replace);
  253. char *(*string_expand_home) (const char *path);
  254. char *(*string_eval_path_home) (const char *path,
  255. struct t_hashtable *pointers,
  256. struct t_hashtable *extra_vars,
  257. struct t_hashtable *options);
  258. char *(*string_remove_quotes) (const char *string, const char *quotes);
  259. char *(*string_strip) (const char *string, int left, int right,
  260. const char *chars);
  261. char *(*string_convert_escaped_chars) (const char *string);
  262. char *(*string_mask_to_regex) (const char *mask);
  263. const char *(*string_regex_flags) (const char *regex, int default_flags,
  264. int *flags);
  265. int (*string_regcomp) (void *preg, const char *regex, int default_flags);
  266. int (*string_has_highlight) (const char *string,
  267. const char *highlight_words);
  268. int (*string_has_highlight_regex) (const char *string, const char *regex);
  269. char *(*string_replace_regex) (const char *string, void *regex,
  270. const char *replace,
  271. const char reference_char,
  272. char *(*callback)(void *data,
  273. const char *text),
  274. void *callback_data);
  275. char **(*string_split) (const char *string, const char *separators,
  276. int keep_eol, int num_items_max, int *num_items);
  277. char **(*string_split_shell) (const char *string, int *num_items);
  278. void (*string_free_split) (char **split_string);
  279. char *(*string_build_with_split_string) (const char **split_string,
  280. const char *separator);
  281. char **(*string_split_command) (const char *command, char separator);
  282. void (*string_free_split_command) (char **split_command);
  283. char *(*string_format_size) (unsigned long long size);
  284. char *(*string_remove_color) (const char *string, const char *replacement);
  285. void (*string_encode_base64) (const char *from, int length, char *to);
  286. int (*string_decode_base64) (const char *from, char *to);
  287. char *(*string_hex_dump) (const char *data, int data_size,
  288. int bytes_per_line, const char *prefix,
  289. const char *suffix);
  290. int (*string_is_command_char) (const char *string);
  291. const char *(*string_input_for_buffer) (const char *string);
  292. char *(*string_eval_expression )(const char *expr,
  293. struct t_hashtable *pointers,
  294. struct t_hashtable *extra_vars,
  295. struct t_hashtable *options);
  296. /* UTF-8 strings */
  297. int (*utf8_has_8bits) (const char *string);
  298. int (*utf8_is_valid) (const char *string, int length, char **error);
  299. void (*utf8_normalize) (char *string, char replacement);
  300. const char *(*utf8_prev_char) (const char *string_start,
  301. const char *string);
  302. const char *(*utf8_next_char) (const char *string);
  303. int (*utf8_char_int) (const char *string);
  304. int (*utf8_char_size) (const char *string);
  305. int (*utf8_strlen) (const char *string);
  306. int (*utf8_strnlen) (const char *string, int bytes);
  307. int (*utf8_strlen_screen) (const char *string);
  308. int (*utf8_charcmp) (const char *string1, const char *string2);
  309. int (*utf8_charcasecmp) (const char *string1, const char *string2);
  310. int (*utf8_char_size_screen) (const char *string);
  311. const char *(*utf8_add_offset) (const char *string, int offset);
  312. int (*utf8_real_pos) (const char *string, int pos);
  313. int (*utf8_pos) (const char *string, int real_pos);
  314. char *(*utf8_strndup) (const char *string, int length);
  315. /* directories/files */
  316. int (*mkdir_home) (const char *directory, int mode);
  317. int (*mkdir) (const char *directory, int mode);
  318. int (*mkdir_parents) (const char *directory, int mode);
  319. void (*exec_on_files) (const char *directory, int hidden_files,
  320. void (*callback)(void *data, const char *filename),
  321. void *callback_data);
  322. char *(*file_get_content) (const char *filename);
  323. /* util */
  324. int (*util_timeval_cmp) (struct timeval *tv1, struct timeval *tv2);
  325. long long (*util_timeval_diff) (struct timeval *tv1, struct timeval *tv2);
  326. void (*util_timeval_add) (struct timeval *tv, long long interval);
  327. const char *(*util_get_time_string) (const time_t *date);
  328. int (*util_version_number) (const char *version);
  329. /* sorted lists */
  330. struct t_weelist *(*list_new) ();
  331. struct t_weelist_item *(*list_add) (struct t_weelist *weelist,
  332. const char *data,
  333. const char *where,
  334. void *user_data);
  335. struct t_weelist_item *(*list_search) (struct t_weelist *weelist,
  336. const char *data);
  337. int (*list_search_pos) (struct t_weelist *weelist,
  338. const char *data);
  339. struct t_weelist_item *(*list_casesearch) (struct t_weelist *weelist,
  340. const char *data);
  341. int (*list_casesearch_pos) (struct t_weelist *weelist,
  342. const char *data);
  343. struct t_weelist_item *(*list_get) (struct t_weelist *weelist,
  344. int position);
  345. void (*list_set) (struct t_weelist_item *item, const char *value);
  346. struct t_weelist_item *(*list_next) (struct t_weelist_item *item);
  347. struct t_weelist_item *(*list_prev) (struct t_weelist_item *item);
  348. const char *(*list_string) (struct t_weelist_item *item);
  349. int (*list_size) (struct t_weelist *weelist);
  350. void (*list_remove) (struct t_weelist *weelist,
  351. struct t_weelist_item *item);
  352. void (*list_remove_all) (struct t_weelist *weelist);
  353. void (*list_free) (struct t_weelist *weelist);
  354. /* hash tables */
  355. struct t_hashtable *(*hashtable_new) (int size,
  356. const char *type_keys,
  357. const char *type_values,
  358. unsigned long long (*callback_hash_key)(struct t_hashtable *hashtable,
  359. const void *key),
  360. int (*callback_keycmp)(struct t_hashtable *hashtable,
  361. const void *key1,
  362. const void *key2));
  363. struct t_hashtable_item *(*hashtable_set_with_size) (struct t_hashtable *hashtable,
  364. const void *key,
  365. int key_size,
  366. const void *value,
  367. int value_size);
  368. struct t_hashtable_item *(*hashtable_set) (struct t_hashtable *hashtable,
  369. const void *key,
  370. const void *value);
  371. void *(*hashtable_get) (struct t_hashtable *hashtable, const void *key);
  372. int (*hashtable_has_key) (struct t_hashtable *hashtable, const void *key);
  373. void (*hashtable_map) (struct t_hashtable *hashtable,
  374. void (*callback_map) (void *data,
  375. struct t_hashtable *hashtable,
  376. const void *key,
  377. const void *value),
  378. void *callback_map_data);
  379. void (*hashtable_map_string) (struct t_hashtable *hashtable,
  380. void (*callback_map) (void *data,
  381. struct t_hashtable *hashtable,
  382. const char *key,
  383. const char *value),
  384. void *callback_map_data);
  385. struct t_hashtable *(*hashtable_dup) (struct t_hashtable *hashtable);
  386. int (*hashtable_get_integer) (struct t_hashtable *hashtable,
  387. const char *property);
  388. const char *(*hashtable_get_string) (struct t_hashtable *hashtable,
  389. const char *property);
  390. void (*hashtable_set_pointer) (struct t_hashtable *hashtable,
  391. const char *property,
  392. void *pointer);
  393. int (*hashtable_add_to_infolist) (struct t_hashtable *hashtable,
  394. struct t_infolist_item *infolist_item,
  395. const char *prefix);
  396. void (*hashtable_remove) (struct t_hashtable *hashtable, const void *key);
  397. void (*hashtable_remove_all) (struct t_hashtable *hashtable);
  398. void (*hashtable_free) (struct t_hashtable *hashtable);
  399. /* config files */
  400. struct t_config_file *(*config_new) (struct t_weechat_plugin *plugin,
  401. const char *name,
  402. int (*callback_reload)(const void *pointer,
  403. void *data,
  404. struct t_config_file *config_file),
  405. const void *callback_reload_pointer,
  406. void *callback_reload_data);
  407. struct t_config_section *(*config_new_section) (struct t_config_file *config_file,
  408. const char *name,
  409. int user_can_add_options,
  410. int user_can_delete_options,
  411. int (*callback_read)(const void *pointer,
  412. void *data,
  413. struct t_config_file *config_file,
  414. struct t_config_section *section,
  415. const char *option_name,
  416. const char *value),
  417. const void *callback_read_pointer,
  418. void *callback_read_data,
  419. int (*callback_write)(const void *pointer,
  420. void *data,
  421. struct t_config_file *config_file,
  422. const char *section_name),
  423. const void *callback_write_pointer,
  424. void *callback_write_data,
  425. int (*callback_write_default)(const void *pointer,
  426. void *data,
  427. struct t_config_file *config_file,
  428. const char *section_name),
  429. const void *callback_write_default_pointer,
  430. void *callback_write_default_data,
  431. int (*callback_create_option)(const void *pointer,
  432. void *data,
  433. struct t_config_file *config_file,
  434. struct t_config_section *section,
  435. const char *option_name,
  436. const char *value),
  437. const void *callback_create_option_pointer,
  438. void *callback_create_option_data,
  439. int (*callback_delete_option)(const void *pointer,
  440. void *data,
  441. struct t_config_file *config_file,
  442. struct t_config_section *section,
  443. struct t_config_option *option),
  444. const void *callback_delete_option_pointer,
  445. void *callback_delete_option_data);
  446. struct t_config_section *(*config_search_section) (struct t_config_file *config_file,
  447. const char *section_name);
  448. struct t_config_option *(*config_new_option) (struct t_config_file *config_file,
  449. struct t_config_section *section,
  450. const char *name,
  451. const char *type,
  452. const char *description,
  453. const char *string_values,
  454. int min,
  455. int max,
  456. const char *default_value,
  457. const char *value,
  458. int null_value_allowed,
  459. int (*callback_check_value)(const void *pointer,
  460. void *data,
  461. struct t_config_option *option,
  462. const char *value),
  463. const void *callback_check_value_pointer,
  464. void *callback_check_value_data,
  465. void (*callback_change)(const void *pointer,
  466. void *data,
  467. struct t_config_option *option),
  468. const void *callback_change_pointer,
  469. void *callback_change_data,
  470. void (*callback_delete)(const void *pointer,
  471. void *data,
  472. struct t_config_option *option),
  473. const void *callback_delete_pointer,
  474. void *callback_delete_data);
  475. struct t_config_option *(*config_search_option) (struct t_config_file *config_file,
  476. struct t_config_section *section,
  477. const char *option_name);
  478. void (*config_search_section_option) (struct t_config_file *config_file,
  479. struct t_config_section *section,
  480. const char *option_name,
  481. struct t_config_section **section_found,
  482. struct t_config_option **option_found);
  483. void (*config_search_with_string) (const char *option_name,
  484. struct t_config_file **config_file,
  485. struct t_config_section **section,
  486. struct t_config_option **option,
  487. char **pos_option_name);
  488. int (*config_string_to_boolean) (const char *text);
  489. int (*config_option_reset) (struct t_config_option *option,
  490. int run_callback);
  491. int (*config_option_set) (struct t_config_option *option,
  492. const char *value, int run_callback);
  493. int (*config_option_set_null) (struct t_config_option *option,
  494. int run_callback);
  495. int (*config_option_unset) (struct t_config_option *option);
  496. void (*config_option_rename) (struct t_config_option *option,
  497. const char *new_name);
  498. void *(*config_option_get_pointer) (struct t_config_option *option,
  499. const char *property);
  500. int (*config_option_is_null) (struct t_config_option *option);
  501. int (*config_option_default_is_null) (struct t_config_option *option);
  502. int (*config_boolean) (struct t_config_option *option);
  503. int (*config_boolean_default) (struct t_config_option *option);
  504. int (*config_integer) (struct t_config_option *option);
  505. int (*config_integer_default) (struct t_config_option *option);
  506. const char *(*config_string) (struct t_config_option *option);
  507. const char *(*config_string_default) (struct t_config_option *option);
  508. const char *(*config_color) (struct t_config_option *option);
  509. const char *(*config_color_default) (struct t_config_option *option);
  510. int (*config_write_option) (struct t_config_file *config_file,
  511. struct t_config_option *option);
  512. int (*config_write_line) (struct t_config_file *config_file,
  513. const char *option_name,
  514. const char *value, ...);
  515. int (*config_write) (struct t_config_file *config_file);
  516. int (*config_read) (struct t_config_file *config_file);
  517. int (*config_reload) (struct t_config_file *config_file);
  518. void (*config_option_free) (struct t_config_option *option);
  519. void (*config_section_free_options) (struct t_config_section *section);
  520. void (*config_section_free) (struct t_config_section *section);
  521. void (*config_free) (struct t_config_file *config_file);
  522. struct t_config_option *(*config_get) (const char *option_name);
  523. const char *(*config_get_plugin) (struct t_weechat_plugin *plugin,
  524. const char *option_name);
  525. int (*config_is_set_plugin) (struct t_weechat_plugin *plugin,
  526. const char *option_name);
  527. int (*config_set_plugin) (struct t_weechat_plugin *plugin,
  528. const char *option_name, const char *value);
  529. void (*config_set_desc_plugin) (struct t_weechat_plugin *plugin,
  530. const char *option_name,
  531. const char *description);
  532. int (*config_unset_plugin) (struct t_weechat_plugin *plugin,
  533. const char *option_name);
  534. /* key bindings */
  535. int (*key_bind) (const char *context, struct t_hashtable *keys);
  536. int (*key_unbind) (const char *context, const char *key);
  537. /* display */
  538. const char *(*prefix) (const char *prefix);
  539. const char *(*color) (const char *color_name);
  540. void (*printf_date_tags) (struct t_gui_buffer *buffer, time_t date,
  541. const char *tags, const char *message, ...);
  542. void (*printf_y) (struct t_gui_buffer *buffer, int y,
  543. const char *message, ...);
  544. void (*log_printf) (const char *message, ...);
  545. /* hooks */
  546. struct t_hook *(*hook_command) (struct t_weechat_plugin *plugin,
  547. const char *command,
  548. const char *description,
  549. const char *args,
  550. const char *args_description,
  551. const char *completion,
  552. int (*callback)(const void *pointer,
  553. void *data,
  554. struct t_gui_buffer *buffer,
  555. int argc, char **argv,
  556. char **argv_eol),
  557. const void *callback_pointer,
  558. void *callback_data);
  559. struct t_hook *(*hook_command_run) (struct t_weechat_plugin *plugin,
  560. const char *command,
  561. int (*callback)(const void *pointer,
  562. void *data,
  563. struct t_gui_buffer *buffer,
  564. const char *command),
  565. const void *callback_pointer,
  566. void *callback_data);
  567. struct t_hook *(*hook_timer) (struct t_weechat_plugin *plugin,
  568. long interval,
  569. int align_second,
  570. int max_calls,
  571. int (*callback)(const void *pointer,
  572. void *data,
  573. int remaining_calls),
  574. const void *callback_pointer,
  575. void *callback_data);
  576. struct t_hook *(*hook_fd) (struct t_weechat_plugin *plugin,
  577. int fd,
  578. int flag_read,
  579. int flag_write,
  580. int flag_exception,
  581. int (*callback)(const void *pointer,
  582. void *data,
  583. int fd),
  584. const void *callback_pointer,
  585. void *callback_data);
  586. struct t_hook *(*hook_process) (struct t_weechat_plugin *plugin,
  587. const char *command,
  588. int timeout,
  589. int (*callback)(const void *pointer,
  590. void *data,
  591. const char *command,
  592. int return_code,
  593. const char *out,
  594. const char *err),
  595. const void *callback_pointer,
  596. void *callback_data);
  597. struct t_hook *(*hook_process_hashtable) (struct t_weechat_plugin *plugin,
  598. const char *command,
  599. struct t_hashtable *options,
  600. int timeout,
  601. int (*callback)(const void *pointer,
  602. void *data,
  603. const char *command,
  604. int return_code,
  605. const char *out,
  606. const char *err),
  607. const void *callback_pointer,
  608. void *callback_data);
  609. struct t_hook *(*hook_connect) (struct t_weechat_plugin *plugin,
  610. const char *proxy,
  611. const char *address,
  612. int port,
  613. int ipv6,
  614. int retry,
  615. void *gnutls_sess, void *gnutls_cb,
  616. int gnutls_dhkey_size,
  617. const char *gnutls_priorities,
  618. const char *local_hostname,
  619. int (*callback)(const void *pointer,
  620. void *data,
  621. int status,
  622. int gnutls_rc,
  623. int sock,
  624. const char *error,
  625. const char *ip_address),
  626. const void *callback_pointer,
  627. void *callback_data);
  628. struct t_hook *(*hook_print) (struct t_weechat_plugin *plugin,
  629. struct t_gui_buffer *buffer,
  630. const char *tags,
  631. const char *message,
  632. int strip_colors,
  633. int (*callback)(const void *pointer,
  634. void *data,
  635. struct t_gui_buffer *buffer,
  636. time_t date,
  637. int tags_count,
  638. const char **tags,
  639. int displayed,
  640. int highlight,
  641. const char *prefix,
  642. const char *message),
  643. const void *callback_pointer,
  644. void *callback_data);
  645. struct t_hook *(*hook_signal) (struct t_weechat_plugin *plugin,
  646. const char *signal,
  647. int (*callback)(const void *pointer,
  648. void *data,
  649. const char *signal,
  650. const char *type_data,
  651. void *signal_data),
  652. const void *callback_pointer,
  653. void *callback_data);
  654. int (*hook_signal_send) (const char *signal, const char *type_data,
  655. void *signal_data);
  656. struct t_hook *(*hook_hsignal) (struct t_weechat_plugin *plugin,
  657. const char *signal,
  658. int (*callback)(const void *pointer,
  659. void *data,
  660. const char *signal,
  661. struct t_hashtable *hashtable),
  662. const void *callback_pointer,
  663. void *callback_data);
  664. int (*hook_hsignal_send) (const char *signal,
  665. struct t_hashtable *hashtable);
  666. struct t_hook *(*hook_config) (struct t_weechat_plugin *plugin,
  667. const char *option,
  668. int (*callback)(const void *pointer,
  669. void *data,
  670. const char *option,
  671. const char *value),
  672. const void *callback_pointer,
  673. void *callback_data);
  674. struct t_hook *(*hook_completion) (struct t_weechat_plugin *plugin,
  675. const char *completion_item,
  676. const char *description,
  677. int (*callback)(const void *pointer,
  678. void *data,
  679. const char *completion_item,
  680. struct t_gui_buffer *buffer,
  681. struct t_gui_completion *completion),
  682. const void *callback_pointer,
  683. void *callback_data);
  684. const char *(*hook_completion_get_string) (struct t_gui_completion *completion,
  685. const char *property);
  686. void (*hook_completion_list_add) (struct t_gui_completion *completion,
  687. const char *word,
  688. int nick_completion,
  689. const char *where);
  690. struct t_hook *(*hook_modifier) (struct t_weechat_plugin *plugin,
  691. const char *modifier,
  692. char *(*callback)(const void *pointer,
  693. void *data,
  694. const char *modifier,
  695. const char *modifier_data,
  696. const char *string),
  697. const void *callback_pointer,
  698. void *callback_data);
  699. char *(*hook_modifier_exec) (struct t_weechat_plugin *plugin,
  700. const char *modifier,
  701. const char *modifier_data,
  702. const char *string);
  703. struct t_hook *(*hook_info) (struct t_weechat_plugin *plugin,
  704. const char *info_name,
  705. const char *description,
  706. const char *args_description,
  707. const char *(*callback)(const void *pointer,
  708. void *data,
  709. const char *info_name,
  710. const char *arguments),
  711. const void *callback_pointer,
  712. void *callback_data);
  713. struct t_hook *(*hook_info_hashtable) (struct t_weechat_plugin *plugin,
  714. const char *info_name,
  715. const char *description,
  716. const char *args_description,
  717. const char *output_description,
  718. struct t_hashtable *(*callback)(const void *pointer,
  719. void *data,
  720. const char *info_name,
  721. struct t_hashtable *hashtable),
  722. const void *callback_pointer,
  723. void *callback_data);
  724. struct t_hook *(*hook_infolist) (struct t_weechat_plugin *plugin,
  725. const char *infolist_name,
  726. const char *description,
  727. const char *pointer_description,
  728. const char *args_description,
  729. struct t_infolist *(*callback)(const void *cb_pointer,
  730. void *data,
  731. const char *infolist_name,
  732. void *obj_pointer,
  733. const char *arguments),
  734. const void *callback_pointer,
  735. void *callback_data);
  736. struct t_hook *(*hook_hdata) (struct t_weechat_plugin *plugin,
  737. const char *hdata_name,
  738. const char *description,
  739. struct t_hdata *(*callback)(const void *pointer,
  740. void *data,
  741. const char *hdata_name),
  742. const void *callback_pointer,
  743. void *callback_data);
  744. struct t_hook *(*hook_focus) (struct t_weechat_plugin *plugin,
  745. const char *area,
  746. struct t_hashtable *(*callback)(const void *pointer,
  747. void *data,
  748. struct t_hashtable *info),
  749. const void *callback_pointer,
  750. void *callback_data);
  751. void (*hook_set) (struct t_hook *hook, const char *property,
  752. const char *value);
  753. void (*unhook) (struct t_hook *hook);
  754. void (*unhook_all) (struct t_weechat_plugin *plugin,
  755. const char *subplugin);
  756. /* buffers */
  757. struct t_gui_buffer *(*buffer_new) (struct t_weechat_plugin *plugin,
  758. const char *name,
  759. int (*input_callback)(const void *pointer,
  760. void *data,
  761. struct t_gui_buffer *buffer,
  762. const char *input_data),
  763. const void *input_callback_pointer,
  764. void *input_callback_data,
  765. int (*close_callback)(const void *pointer,
  766. void *data,
  767. struct t_gui_buffer *buffer),
  768. const void *close_callback_pointer,
  769. void *close_callback_data);
  770. struct t_gui_buffer *(*buffer_search) (const char *plugin, const char *name);
  771. struct t_gui_buffer *(*buffer_search_main) ();
  772. void (*buffer_clear) (struct t_gui_buffer *buffer);
  773. void (*buffer_close) (struct t_gui_buffer *buffer);
  774. void (*buffer_merge) (struct t_gui_buffer *buffer,
  775. struct t_gui_buffer *target_buffer);
  776. void (*buffer_unmerge) (struct t_gui_buffer *buffer, int number);
  777. int (*buffer_get_integer) (struct t_gui_buffer *buffer,
  778. const char *property);
  779. const char *(*buffer_get_string) (struct t_gui_buffer *buffer,
  780. const char *property);
  781. void *(*buffer_get_pointer) (struct t_gui_buffer *buffer,
  782. const char *property);
  783. void (*buffer_set) (struct t_gui_buffer *buffer, const char *property,
  784. const char *value);
  785. void (*buffer_set_pointer) (struct t_gui_buffer *buffer,
  786. const char *property, void *pointer);
  787. char *(*buffer_string_replace_local_var) (struct t_gui_buffer *buffer,
  788. const char *string);
  789. int (*buffer_match_list) (struct t_gui_buffer *buffer, const char *string);
  790. /* windows */
  791. struct t_gui_window *(*window_search_with_buffer) (struct t_gui_buffer *buffer);
  792. int (*window_get_integer) (struct t_gui_window *window,
  793. const char *property);
  794. const char *(*window_get_string) (struct t_gui_window *window,
  795. const char *property);
  796. void *(*window_get_pointer) (struct t_gui_window *window,
  797. const char *property);
  798. void (*window_set_title) (const char *title);
  799. /* nicklist */
  800. struct t_gui_nick_group *(*nicklist_add_group) (struct t_gui_buffer *buffer,
  801. struct t_gui_nick_group *parent_group,
  802. const char *name,
  803. const char *color,
  804. int visible);
  805. struct t_gui_nick_group *(*nicklist_search_group) (struct t_gui_buffer *buffer,
  806. struct t_gui_nick_group *from_group,
  807. const char *name);
  808. struct t_gui_nick *(*nicklist_add_nick) (struct t_gui_buffer *buffer,
  809. struct t_gui_nick_group *group,
  810. const char *name,
  811. const char *color,
  812. const char *prefix,
  813. const char *prefix_color,
  814. int visible);
  815. struct t_gui_nick *(*nicklist_search_nick) (struct t_gui_buffer *buffer,
  816. struct t_gui_nick_group *from_group,
  817. const char *name);
  818. void (*nicklist_remove_group) (struct t_gui_buffer *buffer,
  819. struct t_gui_nick_group *group);
  820. void (*nicklist_remove_nick) (struct t_gui_buffer *buffer,
  821. struct t_gui_nick *nick);
  822. void (*nicklist_remove_all) (struct t_gui_buffer *buffer);
  823. void (*nicklist_get_next_item) (struct t_gui_buffer *buffer,
  824. struct t_gui_nick_group **group,
  825. struct t_gui_nick **nick);
  826. int (*nicklist_group_get_integer) (struct t_gui_buffer *buffer,
  827. struct t_gui_nick_group *group,
  828. const char *property);
  829. const char *(*nicklist_group_get_string) (struct t_gui_buffer *buffer,
  830. struct t_gui_nick_group *group,
  831. const char *property);
  832. void *(*nicklist_group_get_pointer) (struct t_gui_buffer *buffer,
  833. struct t_gui_nick_group *group,
  834. const char *property);
  835. void (*nicklist_group_set) (struct t_gui_buffer *buffer,
  836. struct t_gui_nick_group *group,
  837. const char *property, const char *value);
  838. int (*nicklist_nick_get_integer) (struct t_gui_buffer *buffer,
  839. struct t_gui_nick *nick,
  840. const char *property);
  841. const char *(*nicklist_nick_get_string) (struct t_gui_buffer *buffer,
  842. struct t_gui_nick *nick,
  843. const char *property);
  844. void *(*nicklist_nick_get_pointer) (struct t_gui_buffer *buffer,
  845. struct t_gui_nick *nick,
  846. const char *property);
  847. void (*nicklist_nick_set) (struct t_gui_buffer *buffer,
  848. struct t_gui_nick *nick,
  849. const char *property, const char *value);
  850. /* bars */
  851. struct t_gui_bar_item *(*bar_item_search) (const char *name);
  852. struct t_gui_bar_item *(*bar_item_new) (struct t_weechat_plugin *plugin,
  853. const char *name,
  854. char *(*build_callback)(const void *pointer,
  855. void *data,
  856. struct t_gui_bar_item *item,
  857. struct t_gui_window *window,
  858. struct t_gui_buffer *buffer,
  859. struct t_hashtable *extra_info),
  860. const void *build_callback_pointer,
  861. void *build_callback_data);
  862. void (*bar_item_update) (const char *name);
  863. void (*bar_item_remove) (struct t_gui_bar_item *item);
  864. struct t_gui_bar *(*bar_search) (const char *name);
  865. struct t_gui_bar *(*bar_new) (const char *name,
  866. const char *hidden,
  867. const char *priority,
  868. const char *type,
  869. const char *condition,
  870. const char *position,
  871. const char *filling_top_bottom,
  872. const char *filling_left_right,
  873. const char *size,
  874. const char *size_max,
  875. const char *color_fg,
  876. const char *color_delim,
  877. const char *color_bg,
  878. const char *separator,
  879. const char *items);
  880. int (*bar_set) (struct t_gui_bar *bar, const char *property,
  881. const char *value);
  882. void (*bar_update) (const char *name);
  883. void (*bar_remove) (struct t_gui_bar *bar);
  884. /* command */
  885. int (*command) (struct t_weechat_plugin *plugin,
  886. struct t_gui_buffer *buffer, const char *command);
  887. /* network */
  888. int (*network_pass_proxy) (const char *proxy, int sock,
  889. const char *address, int port);
  890. int (*network_connect_to) (const char *proxy,
  891. struct sockaddr *address,
  892. socklen_t address_length);
  893. /* infos */
  894. const char *(*info_get) (struct t_weechat_plugin *plugin,
  895. const char *info_name,
  896. const char *arguments);
  897. struct t_hashtable *(*info_get_hashtable) (struct t_weechat_plugin *plugin,
  898. const char *info_name,
  899. struct t_hashtable *hashtable);
  900. /* infolists */
  901. struct t_infolist *(*infolist_new) (struct t_weechat_plugin *plugin);
  902. struct t_infolist_item *(*infolist_new_item) (struct t_infolist *infolist);
  903. struct t_infolist_var *(*infolist_new_var_integer) (struct t_infolist_item *item,
  904. const char *name,
  905. int value);
  906. struct t_infolist_var *(*infolist_new_var_string) (struct t_infolist_item *item,
  907. const char *name,
  908. const char *value);
  909. struct t_infolist_var *(*infolist_new_var_pointer) (struct t_infolist_item *item,
  910. const char *name,
  911. void *pointer);
  912. struct t_infolist_var *(*infolist_new_var_buffer) (struct t_infolist_item *item,
  913. const char *name,
  914. void *pointer,
  915. int size);
  916. struct t_infolist_var *(*infolist_new_var_time) (struct t_infolist_item *item,
  917. const char *name,
  918. time_t time);
  919. struct t_infolist_var *(*infolist_search_var) (struct t_infolist *infolist,
  920. const char *name);
  921. struct t_infolist *(*infolist_get) (struct t_weechat_plugin *plugin,
  922. const char *infolist_name,
  923. void *pointer,
  924. const char *arguments);
  925. int (*infolist_next) (struct t_infolist *infolist);
  926. int (*infolist_prev) (struct t_infolist *infolist);
  927. void (*infolist_reset_item_cursor) (struct t_infolist *infolist);
  928. const char *(*infolist_fields) (struct t_infolist *infolist);
  929. int (*infolist_integer) (struct t_infolist *infolist, const char *var);
  930. const char *(*infolist_string) (struct t_infolist *infolist, const char *var);
  931. void *(*infolist_pointer) (struct t_infolist *infolist, const char *var);
  932. void *(*infolist_buffer) (struct t_infolist *infolist, const char *var,
  933. int *size);
  934. time_t (*infolist_time) (struct t_infolist *infolist, const char *var);
  935. void (*infolist_free) (struct t_infolist *infolist);
  936. /* hdata */
  937. struct t_hdata *(*hdata_new) (struct t_weechat_plugin *plugin,
  938. const char *hdata_name, const char *var_prev,
  939. const char *var_next,
  940. int create_allowed, int delete_allowed,
  941. int (*callback_update)(void *data,
  942. struct t_hdata *hdata,
  943. void *pointer,
  944. struct t_hashtable *hashtable),
  945. void *callback_update_data);
  946. void (*hdata_new_var) (struct t_hdata *hdata, const char *name, int offset,
  947. int type, int update_allowed, const char *array_size,
  948. const char *hdata_name);
  949. void (*hdata_new_list) (struct t_hdata *hdata, const char *name,
  950. void *pointer, int flags);
  951. struct t_hdata *(*hdata_get) (struct t_weechat_plugin *plugin,
  952. const char *hdata_name);
  953. int (*hdata_get_var_offset) (struct t_hdata *hdata, const char *name);
  954. int (*hdata_get_var_type) (struct t_hdata *hdata, const char *name);
  955. const char *(*hdata_get_var_type_string) (struct t_hdata *hdata,
  956. const char *name);
  957. int (*hdata_get_var_array_size) (struct t_hdata *hdata, void *pointer,
  958. const char *name);
  959. const char *(*hdata_get_var_array_size_string) (struct t_hdata *hdata,
  960. void *pointer,
  961. const char *name);
  962. const char *(*hdata_get_var_hdata) (struct t_hdata *hdata,
  963. const char *name);
  964. void *(*hdata_get_var) (struct t_hdata *hdata, void *pointer,
  965. const char *name);
  966. void *(*hdata_get_var_at_offset) (struct t_hdata *hdata, void *pointer,
  967. int offset);
  968. void *(*hdata_get_list) (struct t_hdata *hdata, const char *name);
  969. int (*hdata_check_pointer) (struct t_hdata *hdata, void *list,
  970. void *pointer);
  971. void *(*hdata_move) (struct t_hdata *hdata, void *pointer, int count);
  972. void *(*hdata_search) (struct t_hdata *hdata, void *pointer,
  973. const char *search, int move);
  974. char (*hdata_char) (struct t_hdata *hdata, void *pointer,
  975. const char *name);
  976. int (*hdata_integer) (struct t_hdata *hdata, void *pointer,
  977. const char *name);
  978. long (*hdata_long) (struct t_hdata *hdata, void *pointer,
  979. const char *name);
  980. const char *(*hdata_string) (struct t_hdata *hdata, void *pointer,
  981. const char *name);
  982. void *(*hdata_pointer) (struct t_hdata *hdata, void *pointer,
  983. const char *name);
  984. time_t (*hdata_time) (struct t_hdata *hdata, void *pointer,
  985. const char *name);
  986. struct t_hashtable *(*hdata_hashtable) (struct t_hdata *hdata,
  987. void *pointer, const char *name);
  988. int (*hdata_set) (struct t_hdata *hdata, void *pointer, const char *name,
  989. const char *value);
  990. int (*hdata_update) (struct t_hdata *hdata, void *pointer,
  991. struct t_hashtable *hashtable);
  992. const char *(*hdata_get_string) (struct t_hdata *hdata,
  993. const char *property);
  994. /* upgrade */
  995. struct t_upgrade_file *(*upgrade_new) (const char *filename,
  996. int (*callback_read)(const void *pointer,
  997. void *data,
  998. struct t_upgrade_file *upgrade_file,
  999. int object_id,
  1000. struct t_infolist *infolist),
  1001. const void *callback_read_pointer,
  1002. void *callback_read_data);
  1003. int (*upgrade_write_object) (struct t_upgrade_file *upgrade_file,
  1004. int object_id,
  1005. struct t_infolist *infolist);
  1006. int (*upgrade_read) (struct t_upgrade_file *upgrade_file);
  1007. void (*upgrade_close) (struct t_upgrade_file *upgrade_file);
  1008. };
  1009. extern int weechat_plugin_init (struct t_weechat_plugin *plugin,
  1010. int argc, char *argv[]);
  1011. extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
  1012. /* macros for easy call to plugin API */
  1013. /* plugins */
  1014. #define weechat_plugin_get_name(__plugin) \
  1015. (weechat_plugin->plugin_get_name)(__plugin)
  1016. /* strings */
  1017. #define weechat_charset_set(__charset) \
  1018. (weechat_plugin->charset_set)(weechat_plugin, __charset)
  1019. #define weechat_iconv_to_internal(__charset, __string) \
  1020. (weechat_plugin->iconv_to_internal)(__charset, __string)
  1021. #define weechat_iconv_from_internal(__charset, __string) \
  1022. (weechat_plugin->iconv_from_internal)(__charset, __string)
  1023. #ifndef WEECHAT_H
  1024. #ifndef _
  1025. #define _(string) (weechat_plugin->gettext)(string)
  1026. #endif /* _ */
  1027. #ifndef N_
  1028. #define N_(string) (string)
  1029. #endif /* N_ */
  1030. #ifndef NG_
  1031. #define NG_(single,plural,number) \
  1032. (weechat_plugin->ngettext)(single, plural, number)
  1033. #endif /* NG_ */
  1034. #endif /* WEECHAT_H */
  1035. #define weechat_gettext(string) (weechat_plugin->gettext)(string)
  1036. #define weechat_ngettext(single,plural,number) \
  1037. (weechat_plugin->ngettext)(single, plural, number)
  1038. #define weechat_strndup(__string, __length) \
  1039. (weechat_plugin->strndup)(__string, __length)
  1040. #define weechat_string_tolower(__string) \
  1041. (weechat_plugin->string_tolower)(__string)
  1042. #define weechat_string_toupper(__string) \
  1043. (weechat_plugin->string_toupper)(__string)
  1044. #define weechat_strcasecmp(__string1, __string2) \
  1045. (weechat_plugin->strcasecmp)(__string1, __string2)
  1046. #define weechat_strcasecmp_range(__string1, __string2, __range) \
  1047. (weechat_plugin->strcasecmp_range)(__string1, __string2, __range)
  1048. #define weechat_strncasecmp(__string1, __string2, __max) \
  1049. (weechat_plugin->strncasecmp)(__string1, __string2, __max)
  1050. #define weechat_strncasecmp_range(__string1, __string2, __max, __range) \
  1051. (weechat_plugin->strncasecmp_range)(__string1, __string2, __max, \
  1052. __range)
  1053. #define weechat_strcmp_ignore_chars(__string1, __string2, \
  1054. __chars_ignored, __case_sensitive) \
  1055. (weechat_plugin->strcmp_ignore_chars)(__string1, __string2, \
  1056. __chars_ignored, \
  1057. __case_sensitive)
  1058. #define weechat_strcasestr(__string, __search) \
  1059. (weechat_plugin->strcasestr)(__string, __search)
  1060. #define weechat_strlen_screen(__string) \
  1061. (weechat_plugin->strlen_screen)(__string)
  1062. #define weechat_string_match(__string, __mask, __case_sensitive) \
  1063. (weechat_plugin->string_match)(__string, __mask, __case_sensitive)
  1064. #define weechat_string_replace(__string, __search, __replace) \
  1065. (weechat_plugin->string_replace)(__string, __search, __replace)
  1066. #define weechat_string_expand_home(__path) \
  1067. (weechat_plugin->string_expand_home)(__path)
  1068. #define weechat_string_eval_path_home(__path, __pointers, \
  1069. __extra_vars, __options) \
  1070. (weechat_plugin->string_eval_path_home)(__path, __pointers, \
  1071. __extra_vars, __options)
  1072. #define weechat_string_remove_quotes(__string, __quotes) \
  1073. (weechat_plugin->string_remove_quotes)(__string, __quotes)
  1074. #define weechat_string_strip(__string, __left, __right, __chars) \
  1075. (weechat_plugin->string_strip)(__string, __left, __right, __chars)
  1076. #define weechat_string_convert_escaped_chars(__string) \
  1077. (weechat_plugin->string_convert_escaped_chars)(__string)
  1078. #define weechat_string_mask_to_regex(__mask) \
  1079. (weechat_plugin->string_mask_to_regex)(__mask)
  1080. #define weechat_string_regex_flags(__regex, __default_flags, __flags) \
  1081. (weechat_plugin->string_regex_flags)(__regex, __default_flags, \
  1082. __flags)
  1083. #define weechat_string_regcomp(__preg, __regex, __default_flags) \
  1084. (weechat_plugin->string_regcomp)(__preg, __regex, __default_flags)
  1085. #define weechat_string_has_highlight(__string, __highlight_words) \
  1086. (weechat_plugin->string_has_highlight)(__string, __highlight_words)
  1087. #define weechat_string_has_highlight_regex(__string, __regex) \
  1088. (weechat_plugin->string_has_highlight_regex)(__string, __regex)
  1089. #define weechat_string_replace_regex(__string, __regex, __replace, \
  1090. __reference_char, __callback, \
  1091. __callback_data) \
  1092. (weechat_plugin->string_replace_regex)(__string, __regex, \
  1093. __replace, \
  1094. __reference_char, \
  1095. __callback, \
  1096. __callback_data)
  1097. #define weechat_string_split(__string, __separator, __eol, __max, \
  1098. __num_items) \
  1099. (weechat_plugin->string_split)(__string, __separator, __eol, \
  1100. __max, __num_items)
  1101. #define weechat_string_split_shell(__string, __num_items) \
  1102. (weechat_plugin->string_split_shell)(__string, __num_items)
  1103. #define weechat_string_free_split(__split_string) \
  1104. (weechat_plugin->string_free_split)(__split_string)
  1105. #define weechat_string_build_with_split_string(__split_string, \
  1106. __separator) \
  1107. (weechat_plugin->string_build_with_split_string)(__split_string, \
  1108. __separator)
  1109. #define weechat_string_split_command(__command, __separator) \
  1110. (weechat_plugin->string_split_command)(__command, __separator)
  1111. #define weechat_string_free_split_command(__split_command) \
  1112. (weechat_plugin->string_free_split_command)(__split_command)
  1113. #define weechat_string_format_size(__size) \
  1114. (weechat_plugin->string_format_size)(__size)
  1115. #define weechat_string_remove_color(__string, __replacement) \
  1116. (weechat_plugin->string_remove_color)(__string, __replacement)
  1117. #define weechat_string_encode_base64(__from, __length, __to) \
  1118. (weechat_plugin->string_encode_base64)(__from, __length, __to)
  1119. #define weechat_string_decode_base64(__from, __to) \
  1120. (weechat_plugin->string_decode_base64)(__from, __to)
  1121. #define weechat_string_hex_dump(__data, __data_size, __bytes_per_line, \
  1122. __prefix, __suffix) \
  1123. (weechat_plugin->string_hex_dump)(__data, __data_size, \
  1124. __bytes_per_line, __prefix, \
  1125. __suffix)
  1126. #define weechat_string_is_command_char(__string) \
  1127. (weechat_plugin->string_is_command_char)(__string)
  1128. #define weechat_string_input_for_buffer(__string) \
  1129. (weechat_plugin->string_input_for_buffer)(__string)
  1130. #define weechat_string_eval_expression(__expr, __pointers, \
  1131. __extra_vars, __options) \
  1132. (weechat_plugin->string_eval_expression)(__expr, __pointers, \
  1133. __extra_vars, __options)
  1134. /* UTF-8 strings */
  1135. #define weechat_utf8_has_8bits(__string) \
  1136. (weechat_plugin->utf8_has_8bits)(__string)
  1137. #define weechat_utf8_is_valid(__string, __length, __error) \
  1138. (weechat_plugin->utf8_is_valid)(__string, __length, __error)
  1139. #define weechat_utf8_normalize(__string, __char) \
  1140. (weechat_plugin->utf8_normalize)(__string, __char)
  1141. #define weechat_utf8_prev_char(__start, __string) \
  1142. (weechat_plugin->utf8_prev_char)(__start, __string)
  1143. #define weechat_utf8_next_char(__string) \
  1144. (weechat_plugin->utf8_next_char)(__string)
  1145. #define weechat_utf8_char_int(__string) \
  1146. (weechat_plugin->utf8_char_int)(__string)
  1147. #define weechat_utf8_char_size(__string) \
  1148. (weechat_plugin->utf8_char_size)(__string)
  1149. #define weechat_utf8_strlen(__string) \
  1150. (weechat_plugin->utf8_strlen)(__string)
  1151. #define weechat_utf8_strnlen(__string, __bytes) \
  1152. (weechat_plugin->utf8_strnlen)(__string, __bytes)
  1153. #define weechat_utf8_strlen_screen(__string) \
  1154. (weechat_plugin->utf8_strlen_screen)(__string)
  1155. #define weechat_utf8_charcmp(__string1, __string2) \
  1156. (weechat_plugin->utf8_charcmp)(__string1, __string2)
  1157. #define weechat_utf8_charcasecmp(__string1, __string2) \
  1158. (weechat_plugin->utf8_charcasecmp)(__string1, __string2)
  1159. #define weechat_utf8_char_size_screen(__string) \
  1160. (weechat_plugin->utf8_char_size_screen)(__string)
  1161. #define weechat_utf8_add_offset(__string, __offset) \
  1162. (weechat_plugin->utf8_add_offset)(__string, __offset)
  1163. #define weechat_utf8_real_pos(__string, __pos) \
  1164. (weechat_plugin->utf8_real_pos)(__string, __pos)
  1165. #define weechat_utf8_pos(__string, __real_pos) \
  1166. (weechat_plugin->utf8_pos)(__string, __real_pos)
  1167. #define weechat_utf8_strndup(__string, __length) \
  1168. (weechat_plugin->utf8_strndup)(__string, __length)
  1169. /* directories */
  1170. #define weechat_mkdir_home(__directory, __mode) \
  1171. (weechat_plugin->mkdir_home)(__directory, __mode)
  1172. #define weechat_mkdir(__directory, __mode) \
  1173. (weechat_plugin->mkdir)(__directory, __mode)
  1174. #define weechat_mkdir_parents(__directory, __mode) \
  1175. (weechat_plugin->mkdir_parents)(__directory, __mode)
  1176. #define weechat_exec_on_files(__directory, __hidden_files, __callback, \
  1177. __callback_data) \
  1178. (weechat_plugin->exec_on_files)(__directory, __hidden_files, \
  1179. __callback, __callback_data)
  1180. #define weechat_file_get_content(__filename) \
  1181. (weechat_plugin->file_get_content)(__filename)
  1182. /* util */
  1183. #define weechat_util_timeval_cmp(__time1, __time2) \
  1184. (weechat_plugin->util_timeval_cmp)(__time1, __time2)
  1185. #define weechat_util_timeval_diff(__time1, __time2) \
  1186. (weechat_plugin->util_timeval_diff)(__time1, __time2)
  1187. #define weechat_util_timeval_add(__time, __interval) \
  1188. (weechat_plugin->util_timeval_add)(__time, __interval)
  1189. #define weechat_util_get_time_string(__date) \
  1190. (weechat_plugin->util_get_time_string)(__date)
  1191. #define weechat_util_version_number(__version) \
  1192. (weechat_plugin->util_version_number)(__version)
  1193. /* sorted list */
  1194. #define weechat_list_new() \
  1195. (weechat_plugin->list_new)()
  1196. #define weechat_list_add(__list, __string, __where, __user_data) \
  1197. (weechat_plugin->list_add)(__list, __string, __where, __user_data)
  1198. #define weechat_list_search(__list, __string) \
  1199. (weechat_plugin->list_search)(__list, __string)
  1200. #define weechat_list_search_pos(__list, __string) \
  1201. (weechat_plugin->list_search_pos)(__list, __string)
  1202. #define weechat_list_casesearch(__list, __string) \
  1203. (weechat_plugin->list_casesearch)(__list, __string)
  1204. #define weechat_list_casesearch_pos(__list, __string) \
  1205. (weechat_plugin->list_casesearch_pos)(__list, __string)
  1206. #define weechat_list_get(__list, __index) \
  1207. (weechat_plugin->list_get)(__list, __index)
  1208. #define weechat_list_set(__item, __value) \
  1209. (weechat_plugin->list_set)(__item, __value)
  1210. #define weechat_list_next(__item) \
  1211. (weechat_plugin->list_next)(__item)
  1212. #define weechat_list_prev(__item) \
  1213. (weechat_plugin->list_prev)(__item)
  1214. #define weechat_list_string(__item) \
  1215. (weechat_plugin->list_string)(__item)
  1216. #define weechat_list_size(__list) \
  1217. (weechat_plugin->list_size)(__list)
  1218. #define weechat_list_remove(__list, __item) \
  1219. (weechat_plugin->list_remove)(__list, __item)
  1220. #define weechat_list_remove_all(__list) \
  1221. (weechat_plugin->list_remove_all)(__list)
  1222. #define weechat_list_free(__list) \
  1223. (weechat_plugin->list_free)(__list)
  1224. /* hash tables */
  1225. #define weechat_hashtable_new(__size, __type_keys, __type_values, \
  1226. __callback_hash_key, __callback_keycmp) \
  1227. (weechat_plugin->hashtable_new)(__size, __type_keys, __type_values, \
  1228. __callback_hash_key, \
  1229. __callback_keycmp)
  1230. #define weechat_hashtable_set_with_size(__hashtable, __key, __key_size, \
  1231. __value, __value_size) \
  1232. (weechat_plugin->hashtable_set_with_size)(__hashtable, __key, \
  1233. __key_size, __value, \
  1234. __value_size)
  1235. #define weechat_hashtable_set(__hashtable, __key, __value) \
  1236. (weechat_plugin->hashtable_set)(__hashtable, __key, __value)
  1237. #define weechat_hashtable_get(__hashtable, __key) \
  1238. (weechat_plugin->hashtable_get)(__hashtable, __key)
  1239. #define weechat_hashtable_has_key(__hashtable, __key) \
  1240. (weechat_plugin->hashtable_has_key)(__hashtable, __key)
  1241. #define weechat_hashtable_map(__hashtable, __cb_map, __cb_map_data) \
  1242. (weechat_plugin->hashtable_map)(__hashtable, __cb_map, \
  1243. __cb_map_data)
  1244. #define weechat_hashtable_map_string(__hashtable, __cb_map, \
  1245. __cb_map_data) \
  1246. (weechat_plugin->hashtable_map_string)(__hashtable, __cb_map, \
  1247. __cb_map_data)
  1248. #define weechat_hashtable_dup(__hashtable) \
  1249. (weechat_plugin->hashtable_dup)(__hashtable)
  1250. #define weechat_hashtable_get_integer(__hashtable, __property) \
  1251. (weechat_plugin->hashtable_get_integer)(__hashtable, __property)
  1252. #define weechat_hashtable_get_string(__hashtable, __property) \
  1253. (weechat_plugin->hashtable_get_string)(__hashtable, __property)
  1254. #define weechat_hashtable_set_pointer(__hashtable, __property, \
  1255. __pointer) \
  1256. (weechat_plugin->hashtable_set_pointer)(__hashtable, __property, \
  1257. __pointer)
  1258. #define weechat_hashtable_add_to_infolist(__hashtable, __infolist_item, \
  1259. __prefix) \
  1260. (weechat_plugin->hashtable_add_to_infolist)(__hashtable, \
  1261. __infolist_item, \
  1262. __prefix)
  1263. #define weechat_hashtable_remove(__hashtable, __key) \
  1264. (weechat_plugin->hashtable_remove)(__hashtable, __key)
  1265. #define weechat_hashtable_remove_all(__hashtable) \
  1266. (weechat_plugin->hashtable_remove_all)(__hashtable)
  1267. #define weechat_hashtable_free(__hashtable) \
  1268. (weechat_plugin->hashtable_free)(__hashtable)
  1269. /* config files */
  1270. #define weechat_config_new(__name, __callback_reload, \
  1271. __callback_reload_pointer, \
  1272. __callback_reload_data) \
  1273. (weechat_plugin->config_new)(weechat_plugin, __name, \
  1274. __callback_reload, \
  1275. __callback_reload_pointer, \
  1276. __callback_reload_data)
  1277. #define weechat_config_new_section(__config, __name, \
  1278. __user_can_add_options, \
  1279. __user_can_delete_options, \
  1280. __cb_read, \
  1281. __cb_read_pointer, \
  1282. __cb_read_data, \
  1283. __cb_write_std, \
  1284. __cb_write_std_pointer, \
  1285. __cb_write_std_data, \
  1286. __cb_write_def, \
  1287. __cb_write_def_pointer, \
  1288. __cb_write_def_data, \
  1289. __cb_create_option, \
  1290. __cb_create_option_pointer, \
  1291. __cb_create_option_data, \
  1292. __cb_delete_option, \
  1293. __cb_delete_option_pointer, \
  1294. __cb_delete_option_data) \
  1295. (weechat_plugin->config_new_section)(__config, __name, \
  1296. __user_can_add_options, \
  1297. __user_can_delete_options, \
  1298. __cb_read, \
  1299. __cb_read_pointer, \
  1300. __cb_read_data, \
  1301. __cb_write_std, \
  1302. __cb_write_std_pointer, \
  1303. __cb_write_std_data, \
  1304. __cb_write_def, \
  1305. __cb_write_def_pointer, \
  1306. __cb_write_def_data, \
  1307. __cb_create_option, \
  1308. __cb_create_option_pointer, \
  1309. __cb_create_option_data, \
  1310. __cb_delete_option, \
  1311. __cb_delete_option_pointer, \
  1312. __cb_delete_option_data)
  1313. #define weechat_config_search_section(__config, __name) \
  1314. (weechat_plugin->config_search_section)(__config, __name)
  1315. #define weechat_config_new_option(__config, __section, __name, __type, \
  1316. __desc, __string_values, __min, \
  1317. __max, __default, __value, \
  1318. __null_value_allowed, \
  1319. __callback_check, \
  1320. __callback_check_pointer, \
  1321. __callback_check_data, \
  1322. __callback_change, \
  1323. __callback_change_pointer, \
  1324. __callback_change_data, \
  1325. __callback_delete, \
  1326. __callback_delete_pointer, \
  1327. __callback_delete_data) \
  1328. (weechat_plugin->config_new_option)(__config, __section, __name, \
  1329. __type, __desc, \
  1330. __string_values, \
  1331. __min, __max, __default, \
  1332. __value, \
  1333. __null_value_allowed, \
  1334. __callback_check, \
  1335. __callback_check_pointer, \
  1336. __callback_check_data, \
  1337. __callback_change, \
  1338. __callback_change_pointer, \
  1339. __callback_change_data, \
  1340. __callback_delete, \
  1341. __callback_delete_pointer, \
  1342. __callback_delete_data)
  1343. #define weechat_config_search_option(__config, __section, __name) \
  1344. (weechat_plugin->config_search_option)(__config, __section, __name)
  1345. #define weechat_config_search_section_option(__config, __section, \
  1346. __name, __section_found, \
  1347. __option_found) \
  1348. (weechat_plugin->config_search_section_option)(__config, __section, \
  1349. __name, \
  1350. __section_found, \
  1351. __option_found);
  1352. #define weechat_config_search_with_string(__name, __config, __section, \
  1353. __option, __pos_option) \
  1354. (weechat_plugin->config_search_with_string)(__name, __config, \
  1355. __section, __option, \
  1356. __pos_option);
  1357. #define weechat_config_string_to_boolean(__string) \
  1358. (weechat_plugin->config_string_to_boolean)(__string)
  1359. #define weechat_config_option_reset(__option, __run_callback) \
  1360. (weechat_plugin->config_option_reset)(__option, __run_callback)
  1361. #define weechat_config_option_set(__option, __value, __run_callback) \
  1362. (weechat_plugin->config_option_set)(__option, __value, \
  1363. __run_callback)
  1364. #define weechat_config_option_set_null(__option, __run_callback) \
  1365. (weechat_plugin->config_option_set_null)(__option, __run_callback)
  1366. #define weechat_config_option_unset(__option) \
  1367. (weechat_plugin->config_option_unset)(__option)
  1368. #define weechat_config_option_rename(__option, __new_name) \
  1369. (weechat_plugin->config_option_rename)(__option, __new_name)
  1370. #define weechat_config_option_get_pointer(__option, __property) \
  1371. (weechat_plugin->config_option_get_pointer)(__option, __property)
  1372. #define weechat_config_option_is_null(__option) \
  1373. (weechat_plugin->config_option_is_null)(__option)
  1374. #define weechat_config_option_default_is_null(__option) \
  1375. (weechat_plugin->config_option_default_is_null)(__option)
  1376. #define weechat_config_boolean(__option) \
  1377. (weechat_plugin->config_boolean)(__option)
  1378. #define weechat_config_boolean_default(__option) \
  1379. (weechat_plugin->config_boolean_default)(__option)
  1380. #define weechat_config_integer(__option) \
  1381. (weechat_plugin->config_integer)(__option)
  1382. #define weechat_config_integer_default(__option) \
  1383. (weechat_plugin->config_integer_default)(__option)
  1384. #define weechat_config_string(__option) \
  1385. (weechat_plugin->config_string)(__option)
  1386. #define weechat_config_string_default(__option) \
  1387. (weechat_plugin->config_string_default)(__option)
  1388. #define weechat_config_color(__option) \
  1389. (weechat_plugin->config_color)(__option)
  1390. #define weechat_config_color_default(__option) \
  1391. (weechat_plugin->config_color_default)(__option)
  1392. #define weechat_config_write_option(__config, __option) \
  1393. (weechat_plugin->config_write_option)(__config, __option)
  1394. #define weechat_config_write_line(__config, __option, __value...) \
  1395. (weechat_plugin->config_write_line)(__config, __option, ##__value)
  1396. #define weechat_config_write(__config) \
  1397. (weechat_plugin->config_write)(__config)
  1398. #define weechat_config_read(__config) \
  1399. (weechat_plugin->config_read)(__config)
  1400. #define weechat_config_reload(__config) \
  1401. (weechat_plugin->config_reload)(__config)
  1402. #define weechat_config_option_free(__option) \
  1403. (weechat_plugin->config_option_free)(__option)
  1404. #define weechat_config_section_free_options(__section) \
  1405. (weechat_plugin->config_section_free_options)(__section)
  1406. #define weechat_config_section_free(__section) \
  1407. (weechat_plugin->config_section_free)(__section)
  1408. #define weechat_config_free(__config) \
  1409. (weechat_plugin->config_free)(__config)
  1410. #define weechat_config_get(__option) \
  1411. (weechat_plugin->config_get)(__option)
  1412. #define weechat_config_get_plugin(__option) \
  1413. (weechat_plugin->config_get_plugin)(weechat_plugin, __option)
  1414. #define weechat_config_is_set_plugin(__option) \
  1415. (weechat_plugin->config_is_set_plugin)(weechat_plugin, __option)
  1416. #define weechat_config_set_plugin(__option, __value) \
  1417. (weechat_plugin->config_set_plugin)(weechat_plugin, __option, \
  1418. __value)
  1419. #define weechat_config_set_desc_plugin(__option, __description) \
  1420. (weechat_plugin->config_set_desc_plugin)(weechat_plugin, __option, \
  1421. __description)
  1422. #define weechat_config_unset_plugin(__option) \
  1423. (weechat_plugin->config_unset_plugin)(weechat_plugin, __option)
  1424. /* key bindings */
  1425. #define weechat_key_bind(__context, __keys) \
  1426. (weechat_plugin->key_bind)(__context, __keys)
  1427. #define weechat_key_unbind(__context, __key) \
  1428. (weechat_plugin->key_unbind)(__context, __key)
  1429. /* display */
  1430. #define weechat_prefix(__prefix) \
  1431. (weechat_plugin->prefix)(__prefix)
  1432. #define weechat_color(__color_name) \
  1433. (weechat_plugin->color)(__color_name)
  1434. #define weechat_printf(__buffer, __message, __argz...) \
  1435. (weechat_plugin->printf_date_tags)(__buffer, 0, NULL, __message, \
  1436. ##__argz)
  1437. #define weechat_printf_date_tags(__buffer, __date, __tags, __message, \
  1438. __argz...) \
  1439. (weechat_plugin->printf_date_tags)(__buffer, __date, __tags, \
  1440. __message, ##__argz)
  1441. #define weechat_printf_y(__buffer, __y, __message, __argz...) \
  1442. (weechat_plugin->printf_y)(__buffer, __y, __message, ##__argz)
  1443. #define weechat_log_printf(__message, __argz...) \
  1444. (weechat_plugin->log_printf)(__message, ##__argz)
  1445. /* hooks */
  1446. #define weechat_hook_command(__command, __description, __args, \
  1447. __args_desc, __completion, __callback, \
  1448. __pointer, __data) \
  1449. (weechat_plugin->hook_command)(weechat_plugin, __command, \
  1450. __description, __args, __args_desc, \
  1451. __completion, __callback, __pointer, \
  1452. __data)
  1453. #define weechat_hook_command_run(__command, __callback, __pointer, \
  1454. __data) \
  1455. (weechat_plugin->hook_command_run)(weechat_plugin, __command, \
  1456. __callback, __pointer, __data)
  1457. #define weechat_hook_timer(__interval, __align_second, __max_calls, \
  1458. __callback, __pointer, __data) \
  1459. (weechat_plugin->hook_timer)(weechat_plugin, __interval, \
  1460. __align_second, __max_calls, \
  1461. __callback, __pointer, __data)
  1462. #define weechat_hook_fd(__fd, __flag_read, __flag_write, \
  1463. __flag_exception, __callback, __pointer, \
  1464. __data) \
  1465. (weechat_plugin->hook_fd)(weechat_plugin, __fd, __flag_read, \
  1466. __flag_write, __flag_exception, \
  1467. __callback, __pointer, __data)
  1468. #define weechat_hook_process(__command, __timeout, __callback, \
  1469. __callback_pointer, __callback_data) \
  1470. (weechat_plugin->hook_process)(weechat_plugin, __command, \
  1471. __timeout, __callback, \
  1472. __callback_pointer, __callback_data)
  1473. #define weechat_hook_process_hashtable(__command, __options, __timeout, \
  1474. __callback, __callback_pointer, \
  1475. __callback_data) \
  1476. (weechat_plugin->hook_process_hashtable)(weechat_plugin, __command, \
  1477. __options, __timeout, \
  1478. __callback, \
  1479. __callback_pointer, \
  1480. __callback_data)
  1481. #define weechat_hook_connect(__proxy, __address, __port, __ipv6, \
  1482. __retry, __gnutls_sess, __gnutls_cb, \
  1483. __gnutls_dhkey_size, __gnutls_priorities, \
  1484. __local_hostname, __callback, __pointer, \
  1485. __data) \
  1486. (weechat_plugin->hook_connect)(weechat_plugin, __proxy, __address, \
  1487. __port, __ipv6, __retry, \
  1488. __gnutls_sess, __gnutls_cb, \
  1489. __gnutls_dhkey_size, \
  1490. __gnutls_priorities, \
  1491. __local_hostname, \
  1492. __callback, __pointer, __data)
  1493. #define weechat_hook_print(__buffer, __tags, __msg, __strip__colors, \
  1494. __callback, __pointer, __data) \
  1495. (weechat_plugin->hook_print)(weechat_plugin, __buffer, __tags, \
  1496. __msg, __strip__colors, __callback, \
  1497. __pointer, __data)
  1498. #define weechat_hook_signal(__signal, __callback, __pointer, __data) \
  1499. (weechat_plugin->hook_signal)(weechat_plugin, __signal, __callback, \
  1500. __pointer, __data)
  1501. #define weechat_hook_signal_send(__signal, __type_data, __signal_data) \
  1502. (weechat_plugin->hook_signal_send)(__signal, __type_data, \
  1503. __signal_data)
  1504. #define weechat_hook_hsignal(__signal, __callback, __pointer, __data) \
  1505. (weechat_plugin->hook_hsignal)(weechat_plugin, __signal, \
  1506. __callback, __pointer, __data)
  1507. #define weechat_hook_hsignal_send(__signal, __hashtable) \
  1508. (weechat_plugin->hook_hsignal_send)(__signal, __hashtable)
  1509. #define weechat_hook_config(__option, __callback, __pointer, __data) \
  1510. (weechat_plugin->hook_config)(weechat_plugin, __option, __callback, \
  1511. __pointer, __data)
  1512. #define weechat_hook_completion(__completion, __description, \
  1513. __callback, __pointer, __data) \
  1514. (weechat_plugin->hook_completion)(weechat_plugin, __completion, \
  1515. __description, __callback, \
  1516. __pointer, __data)
  1517. #define weechat_hook_completion_get_string(__completion, __property) \
  1518. (weechat_plugin->hook_completion_get_string)(__completion, \
  1519. __property)
  1520. #define weechat_hook_completion_list_add(__completion, __word, \
  1521. __nick_completion, __where) \
  1522. (weechat_plugin->hook_completion_list_add)(__completion, __word, \
  1523. __nick_completion, \
  1524. __where)
  1525. #define weechat_hook_modifier(__modifier, __callback, __pointer, \
  1526. __data) \
  1527. (weechat_plugin->hook_modifier)(weechat_plugin, __modifier, \
  1528. __callback, __pointer, __data)
  1529. #define weechat_hook_modifier_exec(__modifier, __modifier_data, \
  1530. __string) \
  1531. (weechat_plugin->hook_modifier_exec)(weechat_plugin, __modifier, \
  1532. __modifier_data, __string)
  1533. #define weechat_hook_info(__info_name, __description, \
  1534. __args_description, __callback, __pointer, \
  1535. __data) \
  1536. (weechat_plugin->hook_info)(weechat_plugin, __info_name, \
  1537. __description, __args_description, \
  1538. __callback, __pointer, __data)
  1539. #define weechat_hook_info_hashtable(__info_name, __description, \
  1540. __args_description, \
  1541. __output_description, \
  1542. __callback, \
  1543. __pointer, \
  1544. __data) \
  1545. (weechat_plugin->hook_info_hashtable)(weechat_plugin, __info_name, \
  1546. __description, \
  1547. __args_description, \
  1548. __output_description, \
  1549. __callback, __pointer, \
  1550. __data)
  1551. #define weechat_hook_infolist(__infolist_name, __description, \
  1552. __pointer_description, \
  1553. __args_description, __callback, \
  1554. __pointer, __data) \
  1555. (weechat_plugin->hook_infolist)(weechat_plugin, __infolist_name, \
  1556. __description, \
  1557. __pointer_description, \
  1558. __args_description, __callback, \
  1559. __pointer, __data)
  1560. #define weechat_hook_hdata(__hdata_name, __description, __callback, \
  1561. __pointer, __data) \
  1562. (weechat_plugin->hook_hdata)(weechat_plugin, __hdata_name, \
  1563. __description, __callback, __pointer, \
  1564. __data)
  1565. #define weechat_hook_focus(__area, __callback, __pointer, __data) \
  1566. (weechat_plugin->hook_focus)(weechat_plugin, __area, __callback, \
  1567. __pointer, __data)
  1568. #define weechat_hook_set(__hook, __property, __value) \
  1569. (weechat_plugin->hook_set)(__hook, __property, __value)
  1570. #define weechat_unhook(__hook) \
  1571. (weechat_plugin->unhook)( __hook)
  1572. #define weechat_unhook_all(__subplugin) \
  1573. (weechat_plugin->unhook_all)(weechat_plugin, __subplugin)
  1574. /* buffers */
  1575. #define weechat_buffer_new(__name, __input_callback, \
  1576. __input_callback_pointer, \
  1577. __input_callback_data, \
  1578. __close_callback, \
  1579. __close_callback_pointer, \
  1580. __close_callback_data) \
  1581. (weechat_plugin->buffer_new)(weechat_plugin, __name, \
  1582. __input_callback, \
  1583. __input_callback_pointer, \
  1584. __input_callback_data, \
  1585. __close_callback, \
  1586. __close_callback_pointer, \
  1587. __close_callback_data)
  1588. #define weechat_buffer_search(__plugin, __name) \
  1589. (weechat_plugin->buffer_search)(__plugin, __name)
  1590. #define weechat_buffer_search_main() \
  1591. (weechat_plugin->buffer_search_main)()
  1592. #define weechat_current_buffer() \
  1593. (weechat_plugin->buffer_search)(NULL, NULL)
  1594. #define weechat_buffer_clear(__buffer) \
  1595. (weechat_plugin->buffer_clear)(__buffer)
  1596. #define weechat_buffer_close(__buffer) \
  1597. (weechat_plugin->buffer_close)(__buffer)
  1598. #define weechat_buffer_merge(__buffer, __target_buffer) \
  1599. (weechat_plugin->buffer_merge)(__buffer, __target_buffer)
  1600. #define weechat_buffer_unmerge(__buffer, __number) \
  1601. (weechat_plugin->buffer_unmerge)(__buffer, __number)
  1602. #define weechat_buffer_get_integer(__buffer, __property) \
  1603. (weechat_plugin->buffer_get_integer)(__buffer, __property)
  1604. #define weechat_buffer_get_string(__buffer, __property) \
  1605. (weechat_plugin->buffer_get_string)(__buffer, __property)
  1606. #define weechat_buffer_get_pointer(__buffer, __property) \
  1607. (weechat_plugin->buffer_get_pointer)(__buffer, __property)
  1608. #define weechat_buffer_set(__buffer, __property, __value) \
  1609. (weechat_plugin->buffer_set)(__buffer, __property, __value)
  1610. #define weechat_buffer_set_pointer(__buffer, __property, __pointer) \
  1611. (weechat_plugin->buffer_set_pointer)(__buffer, __property, \
  1612. __pointer)
  1613. #define weechat_buffer_string_replace_local_var(__buffer, __string) \
  1614. (weechat_plugin->buffer_string_replace_local_var)(__buffer, \
  1615. __string)
  1616. #define weechat_buffer_match_list(__buffer, __string) \
  1617. (weechat_plugin->buffer_match_list)(__buffer, __string)
  1618. /* windows */
  1619. #define weechat_window_search_with_buffer(__buffer) \
  1620. (weechat_plugin->window_search_with_buffer)(__buffer)
  1621. #define weechat_window_get_integer(__window, __property) \
  1622. (weechat_plugin->window_get_integer)(__window, __property)
  1623. #define weechat_window_get_string(__window, __property) \
  1624. (weechat_plugin->window_get_string)(__window, __property)
  1625. #define weechat_window_get_pointer(__window, __property) \
  1626. (weechat_plugin->window_get_pointer)(__window, __property)
  1627. #define weechat_current_window() \
  1628. (weechat_plugin->window_get_pointer)(NULL, "current")
  1629. #define weechat_window_set_title(__title) \
  1630. (weechat_plugin->window_set_title)(__title)
  1631. /* nicklist */
  1632. #define weechat_nicklist_add_group(__buffer, __parent_group, __name, \
  1633. __color, __visible) \
  1634. (weechat_plugin->nicklist_add_group)(__buffer, __parent_group, \
  1635. __name, __color, __visible)
  1636. #define weechat_nicklist_search_group(__buffer, __from_group, __name) \
  1637. (weechat_plugin->nicklist_search_group)(__buffer, __from_group, \
  1638. __name)
  1639. #define weechat_nicklist_add_nick(__buffer, __group, __name, __color, \
  1640. __prefix, __prefix_color, __visible) \
  1641. (weechat_plugin->nicklist_add_nick)(__buffer, __group, __name, \
  1642. __color, __prefix, \
  1643. __prefix_color, __visible)
  1644. #define weechat_nicklist_search_nick(__buffer, __from_group, __name) \
  1645. (weechat_plugin->nicklist_search_nick)(__buffer, __from_group, \
  1646. __name)
  1647. #define weechat_nicklist_remove_group(__buffer, __group) \
  1648. (weechat_plugin->nicklist_remove_group)(__buffer, __group)
  1649. #define weechat_nicklist_remove_nick(__buffer, __nick) \
  1650. (weechat_plugin->nicklist_remove_nick)(__buffer, __nick)
  1651. #define weechat_nicklist_remove_all(__buffer) \
  1652. (weechat_plugin->nicklist_remove_all)(__buffer)
  1653. #define weechat_nicklist_get_next_item(__buffer, __group, __nick) \
  1654. (weechat_plugin->nicklist_get_next_item)(__buffer, __group, __nick)
  1655. #define weechat_nicklist_group_get_integer(__buffer, __group, \
  1656. __property) \
  1657. (weechat_plugin->nicklist_group_get_integer)(__buffer, __group, \
  1658. __property)
  1659. #define weechat_nicklist_group_get_string(__buffer, __group, \
  1660. __property) \
  1661. (weechat_plugin->nicklist_group_get_string)(__buffer, __group, \
  1662. __property)
  1663. #define weechat_nicklist_group_get_pointer(__buffer, __group, \
  1664. __property) \
  1665. (weechat_plugin->nicklist_group_get_pointer)(__buffer, __group, \
  1666. __property)
  1667. #define weechat_nicklist_group_set(__buffer, __group, __property, \
  1668. __value) \
  1669. (weechat_plugin->nicklist_group_set)(__buffer, __group, __property, \
  1670. __value)
  1671. #define weechat_nicklist_nick_get_integer(__buffer, __nick, __property) \
  1672. (weechat_plugin->nicklist_nick_get_integer)(__buffer, __nick, \
  1673. __property)
  1674. #define weechat_nicklist_nick_get_string(__buffer, __nick, __property) \
  1675. (weechat_plugin->nicklist_nick_get_string)(__buffer, __nick, \
  1676. __property)
  1677. #define weechat_nicklist_nick_get_pointer(__buffer, __nick, __property) \
  1678. (weechat_plugin->nicklist_nick_get_pointer)(__buffer, __nick, \
  1679. __property)
  1680. #define weechat_nicklist_nick_set(__buffer, __nick, __property, \
  1681. __value) \
  1682. (weechat_plugin->nicklist_nick_set)(__buffer, __nick, __property, \
  1683. __value)
  1684. /* bars */
  1685. #define weechat_bar_item_search(__name) \
  1686. (weechat_plugin->bar_item_search)(__name)
  1687. #define weechat_bar_item_new(__name, __build_callback, \
  1688. __build_callback_pointer, \
  1689. __build_callback_data) \
  1690. (weechat_plugin->bar_item_new)(weechat_plugin, __name, \
  1691. __build_callback, \
  1692. __build_callback_pointer, \
  1693. __build_callback_data)
  1694. #define weechat_bar_item_update(__name) \
  1695. (weechat_plugin->bar_item_update)(__name)
  1696. #define weechat_bar_item_remove(__item) \
  1697. (weechat_plugin->bar_item_remove)(__item)
  1698. #define weechat_bar_search(__name) \
  1699. (weechat_plugin->bar_search)(__name)
  1700. #define weechat_bar_new(__name, __hidden, __priority, __type, \
  1701. __condition, __position, __filling_top_bottom, \
  1702. __filling_left_right, __size, __size_max, \
  1703. __color_fg, __color_delim, __color_bg, \
  1704. __separator, __items) \
  1705. (weechat_plugin->bar_new)(__name, __hidden, __priority, __type, \
  1706. __condition, __position, \
  1707. __filling_top_bottom, \
  1708. __filling_left_right, \
  1709. __size, __size_max, __color_fg, \
  1710. __color_delim, __color_bg, __separator, \
  1711. __items)
  1712. #define weechat_bar_set(__bar, __property, __value) \
  1713. (weechat_plugin->bar_set)(__bar, __property, __value)
  1714. #define weechat_bar_update(__name) \
  1715. (weechat_plugin->bar_update)(__name)
  1716. #define weechat_bar_remove(__bar) \
  1717. (weechat_plugin->bar_remove)(__bar)
  1718. /* command */
  1719. #define weechat_command(__buffer, __command) \
  1720. (weechat_plugin->command)(weechat_plugin, __buffer, __command)
  1721. /* network */
  1722. #define weechat_network_pass_proxy(__proxy, __sock, __address, __port) \
  1723. (weechat_plugin->network_pass_proxy)(__proxy, __sock, __address, \
  1724. __port)
  1725. #define weechat_network_connect_to(__proxy, __address, \
  1726. __address_length) \
  1727. (weechat_plugin->network_connect_to)(__proxy, __address, \
  1728. __address_length)
  1729. /* infos */
  1730. #define weechat_info_get(__info_name, __arguments) \
  1731. (weechat_plugin->info_get)(weechat_plugin, __info_name, \
  1732. __arguments)
  1733. #define weechat_info_get_hashtable(__info_name, __hashtable) \
  1734. (weechat_plugin->info_get_hashtable)(weechat_plugin, __info_name, \
  1735. __hashtable)
  1736. /* infolists */
  1737. #define weechat_infolist_new() \
  1738. (weechat_plugin->infolist_new)(weechat_plugin)
  1739. #define weechat_infolist_new_item(__list) \
  1740. (weechat_plugin->infolist_new_item)(__list)
  1741. #define weechat_infolist_new_var_integer(__item, __name, __value) \
  1742. (weechat_plugin->infolist_new_var_integer)(__item, __name, __value)
  1743. #define weechat_infolist_new_var_string(__item, __name, __value) \
  1744. (weechat_plugin->infolist_new_var_string)(__item, __name, __value)
  1745. #define weechat_infolist_new_var_pointer(__item, __name, __pointer) \
  1746. (weechat_plugin->infolist_new_var_pointer)(__item, __name, \
  1747. __pointer)
  1748. #define weechat_infolist_new_var_buffer(__item, __name, __buffer, \
  1749. __size) \
  1750. (weechat_plugin->infolist_new_var_buffer)(__item, __name, __buffer, \
  1751. __size)
  1752. #define weechat_infolist_new_var_time(__item, __name, __time) \
  1753. (weechat_plugin->infolist_new_var_time)(__item, __name, __time)
  1754. #define weechat_infolist_search_var(__list, __name) \
  1755. (weechat_plugin->infolist_search_var)(__list, __name)
  1756. #define weechat_infolist_get(__infolist_name, __pointer, __arguments) \
  1757. (weechat_plugin->infolist_get)(weechat_plugin, __infolist_name, \
  1758. __pointer, __arguments)
  1759. #define weechat_infolist_next(__list) \
  1760. (weechat_plugin->infolist_next)(__list)
  1761. #define weechat_infolist_prev(__list) \
  1762. (weechat_plugin->infolist_prev)(__list)
  1763. #define weechat_infolist_reset_item_cursor(__list) \
  1764. (weechat_plugin->infolist_reset_item_cursor)(__list)
  1765. #define weechat_infolist_fields(__list) \
  1766. (weechat_plugin->infolist_fields)(__list)
  1767. #define weechat_infolist_integer(__item, __var) \
  1768. (weechat_plugin->infolist_integer)(__item, __var)
  1769. #define weechat_infolist_string(__item, __var) \
  1770. (weechat_plugin->infolist_string)(__item, __var)
  1771. #define weechat_infolist_pointer(__item, __var) \
  1772. (weechat_plugin->infolist_pointer)(__item, __var)
  1773. #define weechat_infolist_buffer(__item, __var, __size) \
  1774. (weechat_plugin->infolist_buffer)(__item, __var, __size)
  1775. #define weechat_infolist_time(__item, __var) \
  1776. (weechat_plugin->infolist_time)(__item, __var)
  1777. #define weechat_infolist_free(__list) \
  1778. (weechat_plugin->infolist_free)(__list)
  1779. /* hdata */
  1780. #define weechat_hdata_new(__hdata_name, __var_prev, __var_next, \
  1781. __create_allowed, __delete_allowed, \
  1782. __callback_update, __callback_update_data) \
  1783. (weechat_plugin->hdata_new)(weechat_plugin, __hdata_name, \
  1784. __var_prev, __var_next, \
  1785. __create_allowed, __delete_allowed, \
  1786. __callback_update, \
  1787. __callback_update_data)
  1788. #define weechat_hdata_new_var(__hdata, __name, __offset, __type, \
  1789. __update_allowed, __array_size, \
  1790. __hdata_name) \
  1791. (weechat_plugin->hdata_new_var)(__hdata, __name, __offset, __type, \
  1792. __update_allowed, __array_size, \
  1793. __hdata_name)
  1794. #define WEECHAT_HDATA_VAR(__struct, __name, __type, __update_allowed, \
  1795. __array_size, __hdata_name) \
  1796. weechat_hdata_new_var (hdata, #__name, offsetof (__struct, __name), \
  1797. WEECHAT_HDATA_##__type, __update_allowed, \
  1798. __array_size, __hdata_name)
  1799. #define weechat_hdata_new_list(__hdata, __name, __pointer, __flags) \
  1800. (weechat_plugin->hdata_new_list)(__hdata, __name, __pointer, \
  1801. __flags)
  1802. #define WEECHAT_HDATA_LIST(__name, __flags) \
  1803. weechat_hdata_new_list (hdata, #__name, &(__name), __flags);
  1804. #define weechat_hdata_get(__hdata_name) \
  1805. (weechat_plugin->hdata_get)(weechat_plugin, __hdata_name)
  1806. #define weechat_hdata_get_var_offset(__hdata, __name) \
  1807. (weechat_plugin->hdata_get_var_offset)(__hdata, __name)
  1808. #define weechat_hdata_get_var_type(__hdata, __name) \
  1809. (weechat_plugin->hdata_get_var_type)(__hdata, __name)
  1810. #define weechat_hdata_get_var_type_string(__hdata, __name) \
  1811. (weechat_plugin->hdata_get_var_type_string)(__hdata, __name)
  1812. #define weechat_hdata_get_var_array_size(__hdata, __pointer, __name) \
  1813. (weechat_plugin->hdata_get_var_array_size)(__hdata, __pointer, \
  1814. __name)
  1815. #define weechat_hdata_get_var_array_size_string(__hdata, __pointer, \
  1816. __name) \
  1817. (weechat_plugin->hdata_get_var_array_size_string)(__hdata, \
  1818. __pointer, \
  1819. __name)
  1820. #define weechat_hdata_get_var_hdata(__hdata, __name) \
  1821. (weechat_plugin->hdata_get_var_hdata)(__hdata, __name)
  1822. #define weechat_hdata_get_var(__hdata, __pointer, __name) \
  1823. (weechat_plugin->hdata_get_var)(__hdata, __pointer, __name)
  1824. #define weechat_hdata_get_var_at_offset(__hdata, __pointer, __offset) \
  1825. (weechat_plugin->hdata_get_var_at_offset)(__hdata, __pointer, \
  1826. __offset)
  1827. #define weechat_hdata_get_list(__hdata, __name) \
  1828. (weechat_plugin->hdata_get_list)(__hdata, __name)
  1829. #define weechat_hdata_check_pointer(__hdata, __list, __pointer) \
  1830. (weechat_plugin->hdata_check_pointer)(__hdata, __list, __pointer)
  1831. #define weechat_hdata_move(__hdata, __pointer, __count) \
  1832. (weechat_plugin->hdata_move)(__hdata, __pointer, __count)
  1833. #define weechat_hdata_search(__hdata, __pointer, __search, __move) \
  1834. (weechat_plugin->hdata_search)(__hdata, __pointer, __search, \
  1835. __move)
  1836. #define weechat_hdata_char(__hdata, __pointer, __name) \
  1837. (weechat_plugin->hdata_char)(__hdata, __pointer, __name)
  1838. #define weechat_hdata_integer(__hdata, __pointer, __name) \
  1839. (weechat_plugin->hdata_integer)(__hdata, __pointer, __name)
  1840. #define weechat_hdata_long(__hdata, __pointer, __name) \
  1841. (weechat_plugin->hdata_long)(__hdata, __pointer, __name)
  1842. #define weechat_hdata_string(__hdata, __pointer, __name) \
  1843. (weechat_plugin->hdata_string)(__hdata, __pointer, __name)
  1844. #define weechat_hdata_pointer(__hdata, __pointer, __name) \
  1845. (weechat_plugin->hdata_pointer)(__hdata, __pointer, __name)
  1846. #define weechat_hdata_time(__hdata, __pointer, __name) \
  1847. (weechat_plugin->hdata_time)(__hdata, __pointer, __name)
  1848. #define weechat_hdata_hashtable(__hdata, __pointer, __name) \
  1849. (weechat_plugin->hdata_hashtable)(__hdata, __pointer, __name)
  1850. #define weechat_hdata_set(__hdata, __pointer, __name, __value) \
  1851. (weechat_plugin->hdata_set)(__hdata, __pointer, __name, __value)
  1852. #define weechat_hdata_update(__hdata, __pointer, __hashtable) \
  1853. (weechat_plugin->hdata_update)(__hdata, __pointer, __hashtable)
  1854. #define weechat_hdata_get_string(__hdata, __property) \
  1855. (weechat_plugin->hdata_get_string)(__hdata, __property)
  1856. /* upgrade */
  1857. #define weechat_upgrade_new(__filename, __callback_read, \
  1858. __callback_read_pointer, \
  1859. __callback_read_data) \
  1860. (weechat_plugin->upgrade_new)(__filename, __callback_read, \
  1861. __callback_read_pointer, \
  1862. __callback_read_data)
  1863. #define weechat_upgrade_write_object(__upgrade_file, __object_id, \
  1864. __infolist) \
  1865. (weechat_plugin->upgrade_write_object)(__upgrade_file, __object_id, \
  1866. __infolist)
  1867. #define weechat_upgrade_read(__upgrade_file) \
  1868. (weechat_plugin->upgrade_read)(__upgrade_file)
  1869. #define weechat_upgrade_close(__upgrade_file) \
  1870. (weechat_plugin->upgrade_close)(__upgrade_file)
  1871. #ifdef __cplusplus
  1872. }
  1873. #endif /* __cplusplus */
  1874. #endif /* WEECHAT_WEECHAT_PLUGIN_H */