~alivema4ever/ubuntu/trusty/weechat/lp-1299347-fix

« back to all changes in this revision

Viewing changes to src/plugins/weechat-plugin.h

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bouthenot
  • Date: 2013-01-23 18:44:36 UTC
  • mfrom: (1.1.23)
  • Revision ID: package-import@ubuntu.com-20130123184436-pillcj7jmtyyj00j
Tags: 0.4.0-1
* New upstream release.
* Bump Standards-Version to 3.9.4
* Remove UPGRADE_0.3 from doc (no more included in upstream sources).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2003-2012 Sebastien Helleu <flashcode@flashtux.org>
 
2
 * weechat-plugin.h - header to compile WeeChat plugins
 
3
 *
 
4
 * Copyright (C) 2003-2013 Sebastien Helleu <flashcode@flashtux.org>
3
5
 *
4
6
 * This file is part of WeeChat, the extensible chat client.
5
7
 *
17
19
 * along with WeeChat.  If not, see <http://www.gnu.org/licenses/>.
18
20
 */
19
21
 
20
 
/*
21
 
 * weechat-plugin.h: this header is designed to be distributed with
22
 
 *                   WeeChat plugins, in order to compile them
23
 
 */
24
 
 
25
22
#ifndef __WEECHAT_WEECHAT_PLUGIN_H
26
23
#define __WEECHAT_WEECHAT_PLUGIN_H 1
27
24
 
45
42
 * some functions in this file, then please update API version below.
46
43
 */
47
44
 
48
 
/* API version (used to check that plugin has same API and can be loaded) */
49
 
#define WEECHAT_PLUGIN_API_VERSION "20120827-01"
 
45
/*
 
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.
 
49
 */
 
50
#define WEECHAT_PLUGIN_API_VERSION "20121208-01"
50
51
 
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
141
143
 
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);
249
254
 
250
255
    /* UTF-8 strings */
251
256
    int (*utf8_has_8bits) (const char *string);
535
540
                                    const char *proxy,
536
541
                                    const char *address,
537
542
                                    int port,
538
 
                                    int sock,
539
543
                                    int ipv6,
 
544
                                    int retry,
540
545
                                    void *gnutls_sess, void *gnutls_cb,
541
546
                                    int gnutls_dhkey_size,
542
547
                                    const char *gnutls_priorities,
544
549
                                    int (*callback)(void *data,
545
550
                                                    int status,
546
551
                                                    int gnutls_rc,
 
552
                                                    int sock,
547
553
                                                    const char *error,
548
554
                                                    const char *ip_address),
549
555
                                    void *callback_data);
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,
837
 
                                  int delete_allowed,
 
843
                                  int create_allowed, int delete_allowed,
838
844
                                  int (*callback_update)(void *data,
839
845
                                                         struct t_hdata *hdata,
840
846
                                                         void *pointer,
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,              \
 
1013
                                       __extra_vars)                    \
 
1014
    weechat_plugin->string_eval_expression(__expr, __pointers,          \
 
1015
                                           __extra_vars)                \
1006
1016
 
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,    \
1609
1620
 
1610
1621
/* hdata */
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,           \