weechat-plugin.h 123 KB

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