weechat-plugin.h 124 KB

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