diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2010-01-04 23:40:07 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2010-01-04 23:40:07 +0100 |
commit | d64aaed29bd6cd9f812c11103d965e505357d804 (patch) | |
tree | 4c973a1cfc4ed5dfe8ca57a35ca2800d676dcb2f /doc/en | |
parent | 6d211de00d48627517476420aabedfc13ec05921 (diff) | |
download | weechat-d64aaed29bd6cd9f812c11103d965e505357d804.zip |
Add missing arguments for hook_connect in plugin API reference
Diffstat (limited to 'doc/en')
-rw-r--r-- | doc/en/weechat_plugin_api.en.txt | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/doc/en/weechat_plugin_api.en.txt b/doc/en/weechat_plugin_api.en.txt index 62930d632..e31f2943f 100644 --- a/doc/en/weechat_plugin_api.en.txt +++ b/doc/en/weechat_plugin_api.en.txt @@ -5151,25 +5151,35 @@ Prototype: [source,C] ---------------------------------------- -struct t_hook *weechat_hook_connect (const char *address, +struct t_hook *weechat_hook_connect (const char *proxy, + const char *address, int port, int sock, int ipv6, void *gnutls_sess, + void *gnutls_cb, + int gnutls_dhkey_size, const char *local_hostname, int (*callback)(void *data, int status, + int gnutls_rc, + const char *errpr, const char *ip_address), void *callback_data); ---------------------------------------- Arguments: +* 'proxy': name of proxy to use for connection (optional, NULL means connection + without proxy) * 'address': name or IP address to connect to * 'port': port number * 'sock': socket used to connect * 'ipv6': 1 to use IPv6, 0 to use IPv4 * 'gnutls_sess': GnuTLS session (optional) +* 'gnutls_cb': GnuTLS callback (optional) +* 'gnutls_dhkey_size': size of the key used during the Diffie-Hellman Key + Exchange (GnuTLS) * 'callback': function called when connection is ok or failed, arguments: ** 'void *data': pointer ** 'int status': connection status: @@ -5182,6 +5192,8 @@ Arguments: *** 'WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR': GnuTLS init error *** 'WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR': GnuTLS handshake error *** 'WEECHAT_HOOK_CONNECT_MEMORY_ERROR': insufficient memory +** 'gnutls_rc': result value of 'gnutls_handshake()' +** 'const char *error': result value of 'gnutls_strerror(gnutls_rc)' ** 'const char *ip_address': IP address found * 'callback_data': pointer given to callback when it is called by WeeChat @@ -5194,7 +5206,8 @@ C example: [source,C] ---------------------------------------- int -my_connect_cb (void *data, int status, const char *ip_address) +my_connect_cb (void *data, int status, int gnutls_rc, const char *error, + const char *ip_address) { switch (status) { @@ -5229,8 +5242,11 @@ my_connect_cb (void *data, int status, const char *ip_address) return WEECHAT_RC_OK; } -struct t_hook *my_connect_hook = weechat_hook_connect ("my.server.org", 1234, - sock, 0, NULL, NULL, +struct t_hook *my_connect_hook = weechat_hook_connect (NULL, + "my.server.org", 1234, + sock, 0, + NULL, NULL, 0, /* GnuTLS */ + NULL, &my_connect_cb, NULL); ---------------------------------------- @@ -5239,11 +5255,11 @@ Script (Python): [source,python] ---------------------------------------- # prototype -hook = weechat.hook_connect(address, port, sock, ipv6, local_hostname, +hook = weechat.hook_connect(proxy, address, port, sock, ipv6, local_hostname, callback, callback_data) # example -def my_connect_cb(data, status, ip_address): +def my_connect_cb(data, status, gnutls_rc, error, ip_address): if status == WEECHAT_HOOK_CONNECT_OK: # ... elif status == WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND: @@ -5264,7 +5280,8 @@ def my_connect_cb(data, status, ip_address): # ... return weechat.WEECHAT_RC_OK -hook = weechat.hook_connect("my.server.org", 1234, sock, 0, "", "my_connect_cb", "") +hook = weechat.hook_connect("", "my.server.org", 1234, sock, 0, "", + "my_connect_cb", "") ---------------------------------------- weechat_hook_print |