2
* Copyright (C) 2003-2012 Sebastien Helleu <flashcode@flashtux.org>
2
* weechat-plugin.h - header to compile WeeChat plugins
4
* Copyright (C) 2003-2013 Sebastien Helleu <flashcode@flashtux.org>
4
6
* This file is part of WeeChat, the extensible chat client.
17
19
* along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
21
* weechat-plugin.h: this header is designed to be distributed with
22
* WeeChat plugins, in order to compile them
25
22
#ifndef __WEECHAT_WEECHAT_PLUGIN_H
26
23
#define __WEECHAT_WEECHAT_PLUGIN_H 1
45
42
* some functions in this file, then please update API version below.
48
/* API version (used to check that plugin has same API and can be loaded) */
49
#define WEECHAT_PLUGIN_API_VERSION "20120827-01"
46
* API version (used to check that plugin has same API and can be loaded):
47
* please change the date with current one; for a second change at same
48
* date, increment the 01, otherwise please keep 01.
50
#define WEECHAT_PLUGIN_API_VERSION "20121208-01"
51
52
/* macros for defining plugin infos */
52
53
#define WEECHAT_PLUGIN_NAME(__name) \
138
139
#define WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR 7
139
140
#define WEECHAT_HOOK_CONNECT_MEMORY_ERROR 8
140
141
#define WEECHAT_HOOK_CONNECT_TIMEOUT 9
142
#define WEECHAT_HOOK_CONNECT_SOCKET_ERROR 10
142
144
/* action for gnutls callback: verify or set certificate */
143
145
#define WEECHAT_HOOK_CONNECT_GNUTLS_CB_VERIFY_CERT 0
246
248
int (*string_decode_base64) (const char *from, char *to);
247
249
int (*string_is_command_char) (const char *string);
248
250
const char *(*string_input_for_buffer) (const char *string);
251
char *(*string_eval_expression )(const char *expr,
252
struct t_hashtable *pointers,
253
struct t_hashtable *extra_vars);
250
255
/* UTF-8 strings */
251
256
int (*utf8_has_8bits) (const char *string);
834
840
struct t_hdata *(*hdata_new) (struct t_weechat_plugin *plugin,
835
841
const char *hdata_name, const char *var_prev,
836
842
const char *var_next,
843
int create_allowed, int delete_allowed,
838
844
int (*callback_update)(void *data,
839
845
struct t_hdata *hdata,
1003
1009
weechat_plugin->string_is_command_char(__string)
1004
1010
#define weechat_string_input_for_buffer(__string) \
1005
1011
weechat_plugin->string_input_for_buffer(__string)
1012
#define weechat_string_eval_expression(__expr, __pointers, \
1014
weechat_plugin->string_eval_expression(__expr, __pointers, \
1007
1017
/* UTF-8 strings */
1008
1018
#define weechat_utf8_has_8bits(__string) \
1330
1340
weechat_plugin->hook_process_hashtable(weechat_plugin, __command, \
1331
1341
__options, __timeout, \
1332
1342
__callback, __callback_data)
1333
#define weechat_hook_connect(__proxy, __address, __port, __sock, \
1334
__ipv6, __gnutls_sess, __gnutls_cb, \
1343
#define weechat_hook_connect(__proxy, __address, __port, __ipv6, \
1344
__retry, __gnutls_sess, __gnutls_cb, \
1335
1345
__gnutls_dhkey_size, __gnutls_priorities, \
1336
__local_hostname, __callback, __data) \
1346
__local_hostname, __callback, __data) \
1337
1347
weechat_plugin->hook_connect(weechat_plugin, __proxy, __address, \
1338
__port, __sock, __ipv6, __gnutls_sess, \
1339
__gnutls_cb, __gnutls_dhkey_size, \
1348
__port, __ipv6, __retry, \
1349
__gnutls_sess, __gnutls_cb, \
1350
__gnutls_dhkey_size, \
1340
1351
__gnutls_priorities, __local_hostname, \
1341
1352
__callback, __data)
1342
1353
#define weechat_hook_print(__buffer, __tags, __msg, __strip__colors, \
1611
1622
#define weechat_hdata_new(__hdata_name, __var_prev, __var_next, \
1612
__delete_allowed, __callback_update, \
1613
__callback_update_data) \
1623
__create_allowed, __delete_allowed, \
1624
__callback_update, __callback_update_data) \
1614
1625
weechat_plugin->hdata_new(weechat_plugin, __hdata_name, __var_prev, \
1615
__var_next, __delete_allowed, \
1616
__callback_update, \
1626
__var_next, __create_allowed, \
1627
__delete_allowed, __callback_update, \
1617
1628
__callback_update_data)
1618
1629
#define weechat_hdata_new_var(__hdata, __name, __offset, __type, \
1619
1630
__update_allowed, __array_size, \