doc: fix examples of function weechat_hook_connect (plugin API reference)

v2.8-utf8proc
stfn 2013-01-20 17:02:10 +01:00 committed by Sebastien Helleu
parent 5f7733c4a7
commit 2dea08aba8
3 changed files with 18 additions and 18 deletions

View File

@ -7318,8 +7318,8 @@ C example:
[source,C]
----------------------------------------
int
my_connect_cb (void *data, int status, int gnutls_rc, const char *error,
const char *ip_address)
my_connect_cb (void *data, int status, int gnutls_rc, int sock,
const char *error, const char *ip_address)
{
switch (status)
{
@ -7362,7 +7362,7 @@ my_connect_cb (void *data, int status, int gnutls_rc, const char *error,
struct t_hook *my_connect_hook = weechat_hook_connect (NULL,
"my.server.org", 1234,
sock, 0,
1, 0,
NULL, NULL, 0, /* GnuTLS */
NULL,
&my_connect_cb, NULL);
@ -7373,11 +7373,11 @@ Script (Python):
[source,python]
----------------------------------------
# prototype
hook = weechat.hook_connect(proxy, address, port, sock, ipv6, local_hostname,
hook = weechat.hook_connect(proxy, address, port, ipv6, retry, local_hostname,
callback, callback_data)
# example
def my_connect_cb(data, status, gnutls_rc, error, ip_address):
def my_connect_cb(data, status, gnutls_rc, sock, error, ip_address):
if status == WEECHAT_HOOK_CONNECT_OK:
# ...
elif status == WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND:
@ -7402,7 +7402,7 @@ def my_connect_cb(data, status, gnutls_rc, error, ip_address):
# ...
return weechat.WEECHAT_RC_OK
hook = weechat.hook_connect("", "my.server.org", 1234, sock, 0, "",
hook = weechat.hook_connect("", "my.server.org", 1234, 1, 0, "",
"my_connect_cb", "")
----------------------------------------

View File

@ -7429,8 +7429,8 @@ Exemple en C :
[source,C]
----------------------------------------
int
my_connect_cb (void *data, int status, int gnutls_rc, const char *error,
const char *ip_address)
my_connect_cb (void *data, int status, int gnutls_rc, int sock,
const char *error, const char *ip_address)
{
switch (status)
{
@ -7473,7 +7473,7 @@ my_connect_cb (void *data, int status, int gnutls_rc, const char *error,
struct t_hook *my_connect_hook = weechat_hook_connect (NULL,
"my.server.org", 1234,
sock, 0,
1, 0,
NULL, NULL, 0, /* GnuTLS */
NULL,
&my_connect_cb, NULL);
@ -7484,11 +7484,11 @@ Script (Python) :
[source,python]
----------------------------------------
# prototype
hook = weechat.hook_connect(proxy, address, port, sock, ipv6, local_hostname,
hook = weechat.hook_connect(proxy, address, port, ipv6, retry, local_hostname,
callback, callback_data)
# exemple
def my_connect_cb(data, status, gnutls_rc, error, ip_address):
def my_connect_cb(data, status, gnutls_rc, sock, error, ip_address):
if status == WEECHAT_HOOK_CONNECT_OK:
# ...
elif status == WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND:
@ -7513,7 +7513,7 @@ def my_connect_cb(data, status, gnutls_rc, error, ip_address):
# ...
return weechat.WEECHAT_RC_OK
hook = weechat.hook_connect("", "my.server.org", 1234, sock, 0, "",
hook = weechat.hook_connect("", "my.server.org", 1234, 1, 0, "",
"my_connect_cb", "")
----------------------------------------

View File

@ -7360,8 +7360,8 @@ Esempio in C:
[source,C]
----------------------------------------
int
my_connect_cb (void *data, int status, int gnutls_rc, const char *error,
const char *ip_address)
my_connect_cb (void *data, int status, int gnutls_rc, int sock,
const char *error, const char *ip_address)
{
switch (status)
{
@ -7404,7 +7404,7 @@ my_connect_cb (void *data, int status, int gnutls_rc, const char *error,
struct t_hook *my_connect_hook = weechat_hook_connect (NULL,
"my.server.org", 1234,
sock, 0,
1, 0,
NULL, NULL, 0, /* GnuTLS */
NULL,
&my_connect_cb, NULL);
@ -7415,11 +7415,11 @@ Script (Python):
[source,python]
----------------------------------------
# prototipo
hook = weechat.hook_connect(proxy, address, port, sock, ipv6, local_hostname,
hook = weechat.hook_connect(proxy, address, port, ipv6, retry, local_hostname,
callback, callback_data)
# esempio
def my_connect_cb(data, status, gnutls_rc, error, ip_address):
def my_connect_cb(data, status, gnutls_rc, sock, error, ip_address):
if status == WEECHAT_HOOK_CONNECT_OK:
# ...
elif status == WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND:
@ -7444,7 +7444,7 @@ def my_connect_cb(data, status, gnutls_rc, error, ip_address):
# ...
return weechat.WEECHAT_RC_OK
hook = weechat.hook_connect("", "my.server.org", 1234, sock, 0, "",
hook = weechat.hook_connect("", "my.server.org", 1234, 1, 0, "",
"my_connect_cb", "")
----------------------------------------