core: add comments after some #endif

v2.8-utf8proc
Sébastien Helleu 2015-04-30 21:15:30 +02:00
parent 499f36a7cf
commit 71dd64678c
45 changed files with 230 additions and 232 deletions

View File

@ -140,7 +140,7 @@ weechat_backtrace_addr2line (int number, void *address, const char *symbol)
(void) symbol;
/* no backtrace possible, we display nothing */
#endif
#endif /* HAVE_BACKTRACE */
}
/*
@ -154,7 +154,7 @@ weechat_backtrace ()
void *trace[BACKTRACE_MAX];
int trace_size, i;
char **symbols;
#endif
#endif /* HAVE_BACKTRACE */
weechat_backtrace_printf ("======= WeeChat backtrace =======");
weechat_backtrace_printf ("(written by WeeChat %s, compiled on %s %s)",
@ -173,7 +173,7 @@ weechat_backtrace ()
#else
weechat_backtrace_printf (" No backtrace info (no debug info available "
"or no backtrace possible on your system).");
#endif
#endif /* HAVE_BACKTRACE */
weechat_backtrace_printf ("======= End of backtrace =======");
}

View File

@ -267,7 +267,7 @@ debug_memory ()
gui_chat_printf (NULL,
_("Memory usage not available (function \"mallinfo\" not "
"found)"));
#endif
#endif /* HAVE_MALLINFO */
}
/*
@ -533,7 +533,7 @@ debug_libs_cb (void *data, const char *signal, const char *type_data,
#else
gui_chat_printf (NULL, " gcrypt: (?)%s",
(weechat_no_gcrypt) ? " (not initialized)" : "");
#endif
#endif /* GCRYPT_VERSION */
/* display gnutls version */
#ifdef HAVE_GNUTLS
@ -544,24 +544,24 @@ debug_libs_cb (void *data, const char *signal, const char *type_data,
#else
gui_chat_printf (NULL, " gnutls: (?)%s",
(weechat_no_gnutls) ? " (not initialized)" : "");
#endif
#endif /* GNUTLS_VERSION */
#else
gui_chat_printf (NULL, " gnutls: (not available)");
#endif
#endif /* HAVE_GNUTLS */
/* display curl version */
#ifdef LIBCURL_VERSION
gui_chat_printf (NULL, " curl: %s", LIBCURL_VERSION);
#else
gui_chat_printf (NULL, " curl: (?)");
#endif
#endif /* LIBCURL_VERSION */
/* display zlib version */
#ifdef ZLIB_VERSION
gui_chat_printf (NULL, " zlib: %s", ZLIB_VERSION);
#else
gui_chat_printf (NULL, " zlib: (?)");
#endif
#endif /* ZLIB_VERSION */
return WEECHAT_RC_OK;
}

View File

@ -2055,7 +2055,7 @@ hook_connect (struct t_weechat_plugin *plugin, const char *proxy,
struct t_hook_connect *new_hook_connect;
#ifdef HOOK_CONNECT_MAX_SOCKETS
int i;
#endif
#endif /* HOOK_CONNECT_MAX_SOCKETS */
#ifndef HAVE_GNUTLS
/* make C compiler happy */
@ -2063,7 +2063,7 @@ hook_connect (struct t_weechat_plugin *plugin, const char *proxy,
(void) gnutls_cb;
(void) gnutls_dhkey_size;
(void) gnutls_priorities;
#endif
#endif /* HAVE_GNUTLS */
if (!address || (port <= 0) || !callback)
return NULL;
@ -2095,7 +2095,7 @@ hook_connect (struct t_weechat_plugin *plugin, const char *proxy,
new_hook_connect->gnutls_dhkey_size = gnutls_dhkey_size;
new_hook_connect->gnutls_priorities = (gnutls_priorities) ?
strdup (gnutls_priorities) : NULL;
#endif
#endif /* HAVE_GNUTLS */
new_hook_connect->local_hostname = (local_hostname) ?
strdup (local_hostname) : NULL;
new_hook_connect->child_read = -1;
@ -2115,7 +2115,7 @@ hook_connect (struct t_weechat_plugin *plugin, const char *proxy,
new_hook_connect->sock_v4[i] = -1;
new_hook_connect->sock_v6[i] = -1;
}
#endif
#endif /* HOOK_CONNECT_MAX_SOCKETS */
hook_add_to_list (new_hook);
@ -2155,7 +2155,7 @@ hook_connect_gnutls_verify_certificates (gnutls_session_t tls_session)
return rc;
}
#endif
#endif /* HAVE_GNUTLS */
/*
* Sets certificates.
@ -2171,7 +2171,7 @@ hook_connect_gnutls_set_certificates (gnutls_session_t tls_session,
gnutls_retr2_st *answer)
#else
gnutls_retr_st *answer)
#endif
#endif /* LIBGNUTLS_VERSION_NUMBER >= 0x020b00 */
{
struct t_hook *ptr_hook;
int rc;
@ -2196,7 +2196,7 @@ hook_connect_gnutls_set_certificates (gnutls_session_t tls_session,
return rc;
}
#endif
#endif /* HAVE_GNUTLS */
/*
* Hooks a message printed by WeeChat.
@ -3579,7 +3579,7 @@ unhook (struct t_hook *hook)
#ifdef HAVE_GNUTLS
if (HOOK_CONNECT(hook, gnutls_priorities))
free (HOOK_CONNECT(hook, gnutls_priorities));
#endif
#endif /* HAVE_GNUTLS */
if (HOOK_CONNECT(hook, local_hostname))
free (HOOK_CONNECT(hook, local_hostname));
if (HOOK_CONNECT(hook, hook_child_timer))
@ -3613,7 +3613,7 @@ unhook (struct t_hook *hook)
if (HOOK_CONNECT(hook, sock_v6[i]) != -1)
close (HOOK_CONNECT(hook, sock_v6[i]));
}
#endif
#endif /* HOOK_CONNECT_MAX_SOCKETS */
break;
case HOOK_TYPE_PRINT:
if (HOOK_PRINT(hook, tags_array))
@ -3932,7 +3932,7 @@ hook_add_to_infolist_pointer (struct t_infolist *infolist, struct t_hook *hook)
return 0;
if (!infolist_new_var_integer (ptr_item, "gnutls_dhkey_size", HOOK_CONNECT(hook, gnutls_dhkey_size)))
return 0;
#endif
#endif /* HAVE_GNUTLS */
if (!infolist_new_var_string (ptr_item, "local_hostname", HOOK_CONNECT(hook, local_hostname)))
return 0;
if (!infolist_new_var_integer (ptr_item, "child_read", HOOK_CONNECT(hook, child_read)))
@ -4396,7 +4396,7 @@ hook_print_log ()
log_printf (" gnutls_cb . . . . . . : 0x%lx", HOOK_CONNECT(ptr_hook, gnutls_cb));
log_printf (" gnutls_dhkey_size . . : %d", HOOK_CONNECT(ptr_hook, gnutls_dhkey_size));
log_printf (" gnutls_priorities . . : '%s'", HOOK_CONNECT(ptr_hook, gnutls_priorities));
#endif
#endif /* HAVE_GNUTLS */
log_printf (" local_hostname. . . . : '%s'", HOOK_CONNECT(ptr_hook, local_hostname));
log_printf (" child_read. . . . . . : %d", HOOK_CONNECT(ptr_hook, child_read));
log_printf (" child_write . . . . . : %d", HOOK_CONNECT(ptr_hook, child_write));
@ -4415,7 +4415,7 @@ hook_print_log ()
log_printf (" sock_v4[%d]. . . . . . : '%d'", HOOK_CONNECT(ptr_hook, sock_v4[i]));
log_printf (" sock_v6[%d]. . . . . . : '%d'", HOOK_CONNECT(ptr_hook, sock_v6[i]));
}
#endif
#endif /* HOOK_CONNECT_MAX_SOCKETS */
}
break;
case HOOK_TYPE_PRINT:

View File

@ -249,9 +249,9 @@ typedef int (gnutls_callback_t)(void *data, gnutls_session_t tls_session,
gnutls_retr2_st *answer,
#else
gnutls_retr_st *answer,
#endif
#endif /* LIBGNUTLS_VERSION_NUMBER >= 0x020b00 */
int action);
#endif
#endif /* HAVE_GNUTLS */
struct t_hook_connect
{
@ -267,7 +267,7 @@ struct t_hook_connect
gnutls_callback_t *gnutls_cb; /* GnuTLS callback during handshake */
int gnutls_dhkey_size; /* Diffie Hellman Key Exchange size */
char *gnutls_priorities; /* GnuTLS priorities */
#endif
#endif /* HAVE_GNUTLS */
char *local_hostname; /* force local hostname (optional) */
int child_read; /* to read data in pipe from child */
int child_write; /* to write data in pipe for child */
@ -283,7 +283,7 @@ struct t_hook_connect
#ifdef HOOK_CONNECT_MAX_SOCKETS
int sock_v4[HOOK_CONNECT_MAX_SOCKETS]; /* IPv4 sockets for connecting */
int sock_v6[HOOK_CONNECT_MAX_SOCKETS]; /* IPv6 sockets for connecting */
#endif
#endif /* HOOK_CONNECT_MAX_SOCKETS */
};
/* hook print */
@ -506,8 +506,8 @@ extern int hook_connect_gnutls_set_certificates (gnutls_session_t tls_session,
gnutls_retr2_st *answer);
#else
gnutls_retr_st *answer);
#endif
#endif
#endif /* LIBGNUTLS_VERSION_NUMBER >= 0x020b00 */
#endif /* HAVE_GNUTLS */
extern struct t_hook *hook_print (struct t_weechat_plugin *plugin,
struct t_gui_buffer *buffer,
const char *tags, const char *message,

View File

@ -98,7 +98,7 @@ log_open (const char *filename, const char *mode)
return 0;
}
}
#endif
#endif /* HAVE_FLOCK */
return 1;
}
@ -224,7 +224,7 @@ log_close ()
{
#ifdef HAVE_FLOCK
flock (fileno (weechat_log_file), LOCK_UN);
#endif
#endif /* HAVE_FLOCK */
fclose (weechat_log_file);
weechat_log_file = NULL;
}

View File

@ -67,7 +67,7 @@ int network_init_gnutls_ok = 0;
#ifdef HAVE_GNUTLS
gnutls_certificate_credentials_t gnutls_xcred; /* GnuTLS client credentials */
#endif
#endif /* HAVE_GNUTLS */
/*
@ -110,7 +110,7 @@ network_set_gnutls_ca_file ()
}
free (ca_path);
}
#endif
#endif /* HAVE_GNUTLS */
}
/*
@ -130,14 +130,14 @@ network_init_gnutls ()
#if LIBGNUTLS_VERSION_NUMBER >= 0x02090a /* 2.9.10 */
gnutls_certificate_set_verify_function (gnutls_xcred,
&hook_connect_gnutls_verify_certificates);
#endif
#endif /* LIBGNUTLS_VERSION_NUMBER >= 0x02090a */
#if LIBGNUTLS_VERSION_NUMBER >= 0x020b00 /* 2.11.0 */
gnutls_certificate_set_retrieve_function (gnutls_xcred,
&hook_connect_gnutls_set_certificates);
#else
gnutls_certificate_client_set_retrieve_function (gnutls_xcred,
&hook_connect_gnutls_set_certificates);
#endif
#endif /* LIBGNUTLS_VERSION_NUMBER >= 0x020b00 */
}
#endif /* HAVE_GNUTLS */
@ -159,7 +159,7 @@ network_end ()
gnutls_certificate_free_credentials (gnutls_xcred);
gnutls_global_deinit();
}
#endif
#endif /* HAVE_GNUTLS */
network_init_gnutls_ok = 0;
}
}
@ -753,7 +753,7 @@ network_connect_child (struct t_hook *hook_connect)
char msg_buf[CMSG_SPACE(sizeof (sock))];
struct iovec iov[1];
char iov_data[1] = { 0 };
#endif
#endif /* HOOK_CONNECT_MAX_SOCKETS */
/*
* indicates that something is wrong with whichever group of
* servers is being tried first after connecting, so start at
@ -800,7 +800,7 @@ network_connect_child (struct t_hook *hook_connect)
hints.ai_socktype = SOCK_STREAM;
#ifdef AI_ADDRCONFIG
hints.ai_flags = AI_ADDRCONFIG;
#endif
#endif /* AI_ADDRCONFIG */
if (ptr_proxy)
{
hints.ai_family = (CONFIG_BOOLEAN(ptr_proxy->options[PROXY_OPTION_IPV6])) ?
@ -868,7 +868,7 @@ network_connect_child (struct t_hook *hook_connect)
hints.ai_socktype = SOCK_STREAM;
#ifdef AI_ADDRCONFIG
hints.ai_flags = AI_ADDRCONFIG;
#endif
#endif /* AI_ADDRCONFIG */
rc = getaddrinfo (HOOK_CONNECT(hook_connect, local_hostname),
NULL, &hints, &res_local);
if (rc != 0)
@ -1070,7 +1070,7 @@ network_connect_child (struct t_hook *hook_connect)
sock = socket (ptr_res->ai_family,
ptr_res->ai_socktype,
ptr_res->ai_protocol);
#endif
#endif /* HOOK_CONNECT_MAX_SOCKETS */
if (sock < 0)
{
status_str[0] = '0' + WEECHAT_HOOK_CONNECT_SOCKET_ERROR;
@ -1201,7 +1201,7 @@ network_connect_child (struct t_hook *hook_connect)
#else
num_written = write (HOOK_CONNECT(hook_connect, child_write), &sock, sizeof (sock));
(void) num_written;
#endif
#endif /* HOOK_CONNECT_MAX_SOCKETS */
}
else
{
@ -1313,7 +1313,7 @@ network_connect_gnutls_handshake_fd_cb (void *arg_hook_connect, int fd)
unhook (hook_connect);
return WEECHAT_RC_OK;
}
#endif
#endif /* LIBGNUTLS_VERSION_NUMBER < 0x02090a */
unhook (HOOK_CONNECT(hook_connect, handshake_hook_fd));
(void) (HOOK_CONNECT(hook_connect, callback))
(hook_connect->callback_data,
@ -1325,7 +1325,7 @@ network_connect_gnutls_handshake_fd_cb (void *arg_hook_connect, int fd)
return WEECHAT_RC_OK;
}
#endif
#endif /* HAVE_GNUTLS */
/*
* Timer callback for timeout of handshake.
@ -1356,7 +1356,7 @@ network_connect_gnutls_handshake_timer_cb (void *arg_hook_connect,
return WEECHAT_RC_OK;
}
#endif
#endif /* HAVE_GNUTLS */
/*
* Reads connection progress from child process.
@ -1371,7 +1371,7 @@ network_connect_child_read_cb (void *arg_hook_connect, int fd)
long size_msg;
#ifdef HAVE_GNUTLS
int rc, direction;
#endif
#endif /* HAVE_GNUTLS */
int sock;
#ifdef HOOK_CONNECT_MAX_SOCKETS
int i;
@ -1381,7 +1381,7 @@ network_connect_child_read_cb (void *arg_hook_connect, int fd)
char msg_buf[CMSG_SPACE(sizeof (sock))];
struct iovec iov[1];
char iov_data[1];
#endif
#endif /* HOOK_CONNECT_MAX_SOCKETS */
/* make C compiler happy */
(void) fd;
@ -1461,7 +1461,7 @@ network_connect_child_read_cb (void *arg_hook_connect, int fd)
if (HOOK_CONNECT(hook_connect, sock_v6[i]) == sock)
HOOK_CONNECT(hook_connect, sock_v6[i]) = -1;
}
#endif
#endif /* HOOK_CONNECT_MAX_SOCKETS */
HOOK_CONNECT(hook_connect, sock) = sock;
@ -1545,9 +1545,9 @@ network_connect_child_read_cb (void *arg_hook_connect, int fd)
free (cb_ip_address);
return WEECHAT_RC_OK;
}
#endif
#endif /* LIBGNUTLS_VERSION_NUMBER < 0x02090a */
}
#endif
#endif /* HAVE_GNUTLS */
}
else
{
@ -1610,10 +1610,10 @@ network_connect_with_fork (struct t_hook *hook_connect)
int i;
#else
int child_socket[2];
#endif
#endif /* HOOK_CONNECT_MAX_SOCKETS */
#ifdef HAVE_GNUTLS
const char *pos_error;
#endif
#endif /* HAVE_GNUTLS */
pid_t pid;
#ifdef HAVE_GNUTLS
@ -1647,7 +1647,7 @@ network_connect_with_fork (struct t_hook *hook_connect)
gnutls_transport_set_ptr (*HOOK_CONNECT(hook_connect, gnutls_sess),
(gnutls_transport_ptr_t) ((unsigned long) HOOK_CONNECT(hook_connect, sock)));
}
#endif
#endif /* HAVE_GNUTLS */
/* create pipe for child process */
if (pipe (child_pipe) < 0)
@ -1681,7 +1681,7 @@ network_connect_with_fork (struct t_hook *hook_connect)
HOOK_CONNECT(hook_connect, sock_v4[i]) = socket (AF_INET, SOCK_STREAM, 0);
HOOK_CONNECT(hook_connect, sock_v6[i]) = socket (AF_INET6, SOCK_STREAM, 0);
}
#endif
#endif /* HOOK_CONNECT_MAX_SOCKETS */
switch (pid = fork ())
{
@ -1700,7 +1700,7 @@ network_connect_with_fork (struct t_hook *hook_connect)
close (HOOK_CONNECT(hook_connect, child_read));
#ifndef HOOK_CONNECT_MAX_SOCKETS
close (HOOK_CONNECT(hook_connect, child_recv));
#endif
#endif /* HOOK_CONNECT_MAX_SOCKETS */
network_connect_child (hook_connect);
_exit (EXIT_SUCCESS);
}
@ -1711,7 +1711,7 @@ network_connect_with_fork (struct t_hook *hook_connect)
#ifndef HOOK_CONNECT_MAX_SOCKETS
close (HOOK_CONNECT(hook_connect, child_send));
HOOK_CONNECT(hook_connect, child_send) = -1;
#endif
#endif /* HOOK_CONNECT_MAX_SOCKETS */
HOOK_CONNECT(hook_connect, hook_child_timer) = hook_timer (hook_connect->plugin,
CONFIG_INTEGER(config_network_connection_timeout) * 1000,
0, 1,

View File

@ -43,7 +43,7 @@
#else
#define ICONV_CONST
#endif
#endif
#endif /* ICONV_CONST */
#include "weechat.h"
#include "wee-string.h"
@ -2123,7 +2123,7 @@ string_iconv (int from_utf8, const char *from_code, const char *to_code,
char *ptr_inbuf_shift;
int done;
size_t err, inbytesleft, outbytesleft;
#endif
#endif /* HAVE_ICONV */
if (!string)
return NULL;

View File

@ -938,23 +938,23 @@ weeurl_set_proxy (CURL *curl, struct t_proxy *proxy)
curl_easy_setopt (curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
break;
case PROXY_TYPE_SOCKS4:
#if LIBCURL_VERSION_NUM < 0x070A00
#if LIBCURL_VERSION_NUM < 0x070A00 /* 7.10.0 */
/* proxy socks4 not supported in Curl < 7.10 */
return;
#endif
#endif /* LIBCURL_VERSION_NUM < 0x070A00 */
curl_easy_setopt (curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
break;
case PROXY_TYPE_SOCKS5:
#if LIBCURL_VERSION_NUM < 0x070A00
#if LIBCURL_VERSION_NUM < 0x070A00 /* 7.10.0 */
/* proxy socks5 not supported in Curl < 7.10 */
return;
#endif
#endif /* LIBCURL_VERSION_NUM < 0x070A00 */
#if LIBCURL_VERSION_NUM >= 0x071200 /* 7.18.0 */
curl_easy_setopt (curl, CURLOPT_PROXYTYPE,
CURLPROXY_SOCKS5_HOSTNAME);
#else
curl_easy_setopt (curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
#endif
#endif /* LIBCURL_VERSION_NUM >= 0x071200 */
break;
}
@ -980,7 +980,7 @@ weeurl_set_proxy (CURL *curl, struct t_proxy *proxy)
curl_easy_setopt (curl, CURLOPT_PROXYPASSWORD,
CONFIG_STRING(proxy->options[PROXY_OPTION_PASSWORD]));
}
#endif
#endif /* LIBCURL_VERSION_NUM >= 0x071301 */
}
/*

View File

@ -180,7 +180,7 @@ util_setrlimit_resource (const char *resource_name, long limit)
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
resource_name);
}
#endif
#endif /* HAVE_SYS_RESOURCE_H */
/*
* Sets resource limits using value of option "weechat.startup.sys_rlimit".
@ -222,7 +222,7 @@ util_setrlimit ()
}
string_free_split (items);
}
#endif
#endif /* HAVE_SYS_RESOURCE_H */
}
/*

View File

@ -580,13 +580,13 @@ weechat_init (int argc, char *argv[], void (*gui_init_cb)())
bindtextdomain (PACKAGE, LOCALEDIR);
bind_textdomain_codeset (PACKAGE, "UTF-8");
textdomain (PACKAGE);
#endif
#endif /* ENABLE_NLS */
#ifdef HAVE_LANGINFO_CODESET
weechat_local_charset = strdup (nl_langinfo (CODESET));
#else
weechat_local_charset = strdup ("");
#endif
#endif /* HAVE_LANGINFO_CODESET */
utf8_init ();
/* catch signals */

View File

@ -35,20 +35,20 @@
#include <libintl.h>
#else
#include "../../intl/libintl.h"
#endif
#endif /* HAVE_LIBINTL_H */
#define _(string) gettext(string)
#define NG_(single,plural,number) ngettext(single,plural,number)
#ifdef gettext_noop
#define N_(string) gettext_noop(string)
#else
#define N_(string) (string)
#endif
#endif
#endif /* gettext_noop */
#endif /* defined(ENABLE_NLS) && !defined(_) */
#if !defined(_)
#define _(string) (string)
#define NG_(single,plural,number) (plural)
#define N_(string) (string)
#endif
#endif /* !defined(_) */
#define WEECHAT_COPYRIGHT_DATE "(C) 2003-2015"
@ -81,12 +81,12 @@
#else
#define DIR_SEPARATOR "/"
#define DIR_SEPARATOR_CHAR '/'
#endif
#endif /* _WIN32 */
/* some systems like GNU/Hurd do not define PATH_MAX */
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif
#endif /* PATH_MAX */
/* internal charset */
#define WEECHAT_INTERNAL_CHARSET "UTF-8"

View File

@ -252,7 +252,7 @@ gui_main_debug_libs ()
NCURSES_VERSION, NCURSES_VERSION_PATCH);
#else
gui_chat_printf (NULL, " ncurses: (?)");
#endif
#endif /* defined(NCURSES_VERSION) && defined(NCURSES_VERSION_PATCH) */
}
/*

View File

@ -28,10 +28,10 @@
#include <ncurses/term.h>
#else
#include <ncursesw/term.h>
#endif
#endif /* __sun */
#else
#include <term.h>
#endif
#endif /* HAVE_NCURSESW_CURSES_H */
/*
@ -50,5 +50,5 @@ gui_term_set_eat_newline_glitch (int value)
#else
/* make C compiler happy */
(void) value;
#endif
#endif /* HAVE_EAT_NEWLINE_GLITCH */
}

View File

@ -28,7 +28,7 @@
#include <ncurses.h>
#else
#include <curses.h>
#endif
#endif /* HAVE_NCURSESW_CURSES_H */
struct t_gui_buffer;
struct t_gui_line;
@ -39,7 +39,7 @@ struct t_gui_bar_window;
#ifndef A_ITALIC /* A_ITALIC is defined in ncurses >= 5.9 patch 20130831 */
#define A_ITALIC 0
#endif
#endif /* A_ITALIC */
#define A_ALL_ATTR A_BOLD | A_UNDERLINE | A_REVERSE | A_ITALIC

View File

@ -130,7 +130,7 @@ weechat_aspell_enchant_dict_describe_cb (const char *lang_tag,
if (country)
free (country);
}
#endif
#endif /* USE_ENCHANT */
/*
* Displays list of aspell dictionaries installed on system.
@ -146,7 +146,7 @@ weechat_aspell_command_speller_list_dicts ()
AspellDictInfoList *list;
AspellDictInfoEnumeration *elements;
const AspellDictInfo *dict;
#endif
#endif /* USE_ENCHANT */
weechat_printf (NULL, "");
weechat_printf (NULL,
@ -203,7 +203,7 @@ weechat_aspell_command_speller_list_dicts ()
delete_aspell_dict_info_enumeration (elements);
delete_aspell_config (config);
#endif
#endif /* USE_ENCHANT */
}
/*
@ -245,7 +245,7 @@ weechat_aspell_command_add_word (struct t_gui_buffer *buffer, const char *dict,
EnchantDict *new_speller, *ptr_speller;
#else
AspellSpeller *new_speller, *ptr_speller;
#endif
#endif /* USE_ENCHANT */
new_speller = NULL;
@ -310,7 +310,7 @@ weechat_aspell_command_add_word (struct t_gui_buffer *buffer, const char *dict,
}
else
goto error;
#endif
#endif /* USE_ENCHANT */
goto end;
@ -353,7 +353,7 @@ weechat_aspell_command_cb (void *data, struct t_gui_buffer *buffer,
"enchant"
#else
"aspell"
#endif
#endif /* USE_ENCHANT */
);
default_dict = weechat_config_string (weechat_aspell_config_check_default_dict);
weechat_printf (NULL,

View File

@ -74,7 +74,7 @@ weechat_aspell_completion_enchant_add_dict_cb (const char *lang_tag,
weechat_hook_completion_list_add ((struct t_gui_completion *)user_data,
lang_tag, 0, WEECHAT_LIST_POS_SORT);
}
#endif
#endif /* USE_ENCHANT */
/*
* Adds aspell dictionaries (only installed dictionaries) to completion list.
@ -91,7 +91,7 @@ weechat_aspell_completion_dicts_cb (void *data,
AspellDictInfoList *list;
AspellDictInfoEnumeration *elements;
const AspellDictInfo *dict;
#endif
#endif /* USE_ENCHANT */
/* make C compiler happy */
(void) data;
@ -115,7 +115,7 @@ weechat_aspell_completion_dicts_cb (void *data,
delete_aspell_dict_info_enumeration (elements);
delete_aspell_config (config);
#endif
#endif /* USE_ENCHANT */
return WEECHAT_RC_OK;
}

View File

@ -81,7 +81,7 @@ weechat_aspell_speller_dict_supported (const char *lang)
delete_aspell_config (config);
return rc;
#endif
#endif /* USE_ENCHANT */
}
/*
@ -127,7 +127,7 @@ weechat_aspell_speller_check_dictionaries (const char *dict_list)
EnchantDict *
#else
AspellSpeller *
#endif
#endif /* USE_ENCHANT */
weechat_aspell_speller_new (const char *lang)
{
#ifdef USE_ENCHANT
@ -136,7 +136,7 @@ weechat_aspell_speller_new (const char *lang)
AspellConfig *config;
AspellCanHaveError *ret;
AspellSpeller *new_speller;
#endif
#endif /* USE_ENCHANT */
struct t_infolist *infolist;
if (!lang)
@ -163,7 +163,7 @@ weechat_aspell_speller_new (const char *lang)
/* create a speller instance for the newly created cell */
config = new_aspell_config();
aspell_config_replace (config, "lang", lang);
#endif
#endif /* USE_ENCHANT */
/* apply all options */
infolist = weechat_infolist_get ("option", NULL, "aspell.option.*");
@ -177,7 +177,7 @@ weechat_aspell_speller_new (const char *lang)
aspell_config_replace (config,
weechat_infolist_string (infolist, "option_name"),
weechat_infolist_string (infolist, "value"));
#endif
#endif /* USE_ENCHANT */
}
weechat_infolist_free (infolist);
}
@ -197,14 +197,14 @@ weechat_aspell_speller_new (const char *lang)
}
new_speller = to_aspell_speller (ret);
#endif
#endif /* USE_ENCHANT */
weechat_hashtable_set (weechat_aspell_spellers, lang, new_speller);
#ifndef USE_ENCHANT
/* free configuration */
delete_aspell_config (config);
#endif
#endif /* USE_ENCHANT */
return new_speller;
}
@ -314,7 +314,7 @@ weechat_aspell_speller_free_value_cb (struct t_hashtable *hashtable,
EnchantDict *ptr_speller;
#else
AspellSpeller *ptr_speller;
#endif
#endif /* USE_ENCHANT */
/* make C compiler happy */
(void) hashtable;
@ -334,7 +334,7 @@ weechat_aspell_speller_free_value_cb (struct t_hashtable *hashtable,
ptr_speller = (AspellSpeller *)value;
aspell_speller_save_all_word_lists (ptr_speller);
delete_aspell_speller (ptr_speller);
#endif
#endif /* USE_ENCHANT */
}
/*
@ -353,7 +353,7 @@ weechat_aspell_speller_buffer_new (struct t_gui_buffer *buffer)
EnchantDict *ptr_speller;
#else
AspellSpeller *ptr_speller;
#endif
#endif /* USE_ENCHANT */
if (!buffer)
return NULL;
@ -380,7 +380,7 @@ weechat_aspell_speller_buffer_new (struct t_gui_buffer *buffer)
malloc ((num_dicts + 1) * sizeof (EnchantDict *));
#else
malloc ((num_dicts + 1) * sizeof (AspellSpeller *));
#endif
#endif /* USE_ENCHANT */
if (new_speller_buffer->spellers)
{
for (i = 0; i < num_dicts; i++)

View File

@ -27,7 +27,7 @@ struct t_aspell_speller_buffer
EnchantDict **spellers; /* enchant spellers for buffer */
#else
AspellSpeller **spellers; /* aspell spellers for buffer */
#endif
#endif /* USE_ENCHANT */
char *modifier_string; /* last modifier string */
int input_pos; /* position of cursor in input */
char *modifier_result; /* last modifier result */
@ -42,7 +42,7 @@ extern void weechat_aspell_speller_check_dictionaries (const char *dict_list);
extern EnchantDict *weechat_aspell_speller_new (const char *lang);
#else
extern AspellSpeller *weechat_aspell_speller_new (const char *lang);
#endif
#endif /* USE_ENCHANT */
extern void weechat_aspell_speller_remove_unused ();
extern struct t_aspell_speller_buffer *weechat_aspell_speller_buffer_new (struct t_gui_buffer *buffer);
extern int weechat_aspell_speller_init ();

View File

@ -54,7 +54,7 @@ int aspell_enabled = 0;
#ifdef USE_ENCHANT
EnchantBroker *broker = NULL;
#endif
#endif /* USE_ENCHANT */
/*
* aspell supported languages, updated on 2012-07-05
@ -483,7 +483,7 @@ weechat_aspell_check_word (struct t_aspell_speller_buffer *speller_buffer,
if (enchant_dict_check (speller_buffer->spellers[i], word, strlen (word)) == 0)
#else
if (aspell_speller_check (speller_buffer->spellers[i], word, -1) == 1)
#endif
#endif /* USE_ENCHANT */
return 1;
}
}
@ -513,7 +513,7 @@ weechat_aspell_get_suggestions (struct t_aspell_speller_buffer *speller_buffer,
#else
const AspellWordList *list;
AspellStringEnumeration *elements;
#endif
#endif /* USE_ENCHANT */
max_suggestions = weechat_config_integer (weechat_aspell_config_check_suggestions);
if (max_suggestions < 0)
@ -585,7 +585,7 @@ weechat_aspell_get_suggestions (struct t_aspell_speller_buffer *speller_buffer,
}
delete_aspell_string_enumeration (elements);
}
#endif
#endif /* USE_ENCHANT */
}
}
@ -1039,7 +1039,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
broker = enchant_broker_init ();
if (!broker)
return WEECHAT_RC_ERROR;
#endif
#endif /* USE_ENCHANT */
if (!weechat_aspell_speller_init ())
return WEECHAT_RC_ERROR;
@ -1095,7 +1095,7 @@ weechat_plugin_end (struct t_weechat_plugin *plugin)
#ifdef USE_ENCHANT
/* release enchant broker */
enchant_broker_free (broker);
#endif
#endif /* USE_ENCHANT */
return WEECHAT_RC_OK;
}

View File

@ -25,7 +25,7 @@
#include <enchant.h>
#else
#include <aspell.h>
#endif
#endif /* USE_ENCHANT */
#define weechat_plugin weechat_aspell_plugin
#define ASPELL_PLUGIN_NAME "aspell"
@ -38,7 +38,7 @@ struct t_aspell_code
#ifdef USE_ENCHANT
extern EnchantBroker *broker;
#endif
#endif /* USE_ENCHANT */
extern struct t_weechat_plugin *weechat_aspell_plugin;
extern int aspell_enabled;

View File

@ -797,7 +797,7 @@ weechat_guile_signal_debug_libs_cb (void *data, const char *signal,
SCM_MICRO_VERSION);
#else
weechat_printf (NULL, " %s: (?)", GUILE_PLUGIN_NAME);
#endif
#endif /* defined(SCM_MAJOR_VERSION) && defined(SCM_MINOR_VERSION) && defined(SCM_MICRO_VERSION) */
return WEECHAT_RC_OK;
}
@ -980,7 +980,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
* on unload (or exit)
*/
scm_install_gmp_memory_functions = 0;
#endif
#endif /* HAVE_GUILE_GMP_MEMORY_FUNCTIONS */
scm_init_guile ();

View File

@ -1049,7 +1049,7 @@ irc_config_check_gnutls_priorities (const char *priorities)
(void) priorities;
return NULL;
#endif
#endif /* HAVE_GNUTLS */
}
/*
@ -1064,10 +1064,10 @@ irc_config_server_check_value_cb (void *data,
int index_option, proxy_found;
const char *pos_error, *proxy_name;
struct t_infolist *infolist;
#ifdef HAVE_GNUTLS
#ifdef HAVE_GNUTLS
char **fingerprints, *str_sizes;
int i, j, rc, algo, length;
#endif
#endif /* HAVE_GNUTLS */
/* make C compiler happy */
(void) option;
@ -1119,7 +1119,7 @@ irc_config_server_check_value_cb (void *data,
}
break;
case IRC_SERVER_OPTION_SSL_FINGERPRINT:
#ifdef HAVE_GNUTLS
#ifdef HAVE_GNUTLS
if (value && value[0])
{
fingerprints = weechat_string_split (value, ",", 0, 0,
@ -1175,7 +1175,7 @@ irc_config_server_check_value_cb (void *data,
}
}
}
#endif
#endif /* HAVE_GNUTLS */
break;
}
}

View File

@ -29,8 +29,8 @@
#include <gnutls/gnutls.h>
#if LIBGNUTLS_VERSION_NUMBER >= 0x020a01 /* 2.10.1 */
#include <gnutls/abstract.h>
#endif
#endif
#endif /* LIBGNUTLS_VERSION_NUMBER >= 0x020a01 */
#endif /* HAVE_GNUTLS */
#include "../weechat-plugin.h"
#include "irc.h"
@ -146,7 +146,7 @@ irc_sasl_mechanism_ecdsa_nist256p_challenge (struct t_irc_server *server,
gnutls_ecc_curve_t curve;
gnutls_datum_t x, y, k;
char *pubkey, *pubkey_base64;
#endif
#endif /* LIBGNUTLS_VERSION_NUMBER >= 0x030300 */
answer_base64 = NULL;
string = NULL;
@ -236,7 +236,7 @@ irc_sasl_mechanism_ecdsa_nist256p_challenge (struct t_irc_server *server,
gnutls_free (y.data);
gnutls_free (k.data);
}
#endif
#endif /* LIBGNUTLS_VERSION_NUMBER >= 0x030300 */
/* import private key in an abstract key structure */
ret = gnutls_privkey_import_x509 (privkey, x509_privkey, 0); /* gnutls >= 2.11.0 */
@ -308,7 +308,7 @@ irc_sasl_mechanism_ecdsa_nist256p_challenge (struct t_irc_server *server,
weechat_prefix ("error"));
return NULL;
#endif
#endif /* defined(HAVE_GNUTLS) && (LIBGNUTLS_VERSION_NUMBER >= 0x030015) */
}
/*

View File

@ -35,7 +35,7 @@
#else
#include <sys/socket.h>
#include <sys/time.h>
#endif
#endif /* _WIN32 */
#include <sys/types.h>
#include <netdb.h>
#include <arpa/inet.h>
@ -44,7 +44,7 @@
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#include <gnutls/x509.h>
#endif
#endif /* HAVE_GNUTLS */
#include "../weechat-plugin.h"
#include "irc.h"
@ -132,7 +132,7 @@ char *irc_fingerprint_digest_algos_name[IRC_FINGERPRINT_NUM_ALGOS] =
{ "SHA-1", "SHA-256", "SHA-512" };
int irc_fingerprint_digest_algos_size[IRC_FINGERPRINT_NUM_ALGOS] =
{ 160, 256, 512 };
#endif
#endif /* HAVE_GNUTLS */
void irc_server_reconnect (struct t_irc_server *server);
@ -1866,7 +1866,7 @@ irc_server_send (struct t_irc_server *server, const char *buffer, int size_buf)
if (server->ssl_connected)
rc = gnutls_record_send (server->gnutls_sess, buffer, size_buf);
else
#endif
#endif /* HAVE_GNUTLS */
rc = send (server->sock, buffer, size_buf, 0);
if (rc < 0)
@ -1881,7 +1881,7 @@ irc_server_send (struct t_irc_server *server, const char *buffer, int size_buf)
rc, gnutls_strerror (rc));
}
else
#endif
#endif /* HAVE_GNUTLS */
{
weechat_printf (
server->buffer,
@ -2744,7 +2744,7 @@ irc_server_recv_cb (void *data, int fd)
num_read = gnutls_record_recv (server->gnutls_sess, buffer,
sizeof (buffer) - 2);
else
#endif
#endif /* HAVE_GNUTLS */
num_read = recv (server->sock, buffer, sizeof (buffer) - 2, 0);
if (num_read > 0)
@ -2762,7 +2762,7 @@ irc_server_recv_cb (void *data, int fd)
*/
end_recv = 0;
}
#endif
#endif /* HAVE_GNUTLS */
}
else
{
@ -2788,7 +2788,7 @@ irc_server_recv_cb (void *data, int fd)
}
}
else
#endif
#endif /* HAVE_GNUTLS */
{
if ((num_read == 0)
|| ((errno != EAGAIN) && (errno != EWOULDBLOCK)))
@ -3159,7 +3159,7 @@ irc_server_close_connection (struct t_irc_server *server)
gnutls_bye (server->gnutls_sess, GNUTLS_SHUT_WR);
gnutls_deinit (server->gnutls_sess);
}
#endif
#endif /* HAVE_GNUTLS */
}
if (server->sock != -1)
{
@ -3167,7 +3167,7 @@ irc_server_close_connection (struct t_irc_server *server)
closesocket (server->sock);
#else
close (server->sock);
#endif
#endif /* _WIN32 */
server->sock = -1;
}
@ -3542,7 +3542,7 @@ irc_server_connect_cb (void *data, int status, int gnutls_rc, int sock,
}
#else
(void) gnutls_rc;
#endif
#endif /* HAVE_GNUTLS */
irc_server_close_connection (server);
server->current_retry++;
irc_server_switch_address (server, 1);
@ -3737,7 +3737,7 @@ irc_server_fingerprint_search_algo_with_size (int size)
/* digest algorithm not found */
return -1;
}
#endif
#endif /* HAVE_GNUTLS */
/*
* Returns a string with sizes of allowed fingerprint,
@ -3769,7 +3769,7 @@ irc_server_fingerprint_str_sizes ()
return strdup (str_sizes);
}
#endif
#endif /* HAVE_GNUTLS */
/*
* Compares two fingerprints: one hexadecimal (given by user), the second binary
@ -3919,7 +3919,7 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session,
gnutls_retr2_st *answer,
#else
gnutls_retr_st *answer,
#endif
#endif /* LIBGNUTLS_VERSION_NUMBER >= 0x020b00 */
int action)
{
struct t_irc_server *server;
@ -3927,7 +3927,7 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session,
gnutls_retr2_st tls_struct;
#else
gnutls_retr_st tls_struct;
#endif
#endif /* LIBGNUTLS_VERSION_NUMBER >= 0x020b00 */
gnutls_x509_crt_t cert_temp;
const gnutls_datum_t *cert_list;
gnutls_datum_t filedatum;
@ -3939,7 +3939,7 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session,
#if LIBGNUTLS_VERSION_NUMBER >= 0x010706 /* 1.7.6 */
gnutls_datum_t cinfo;
int rinfo;
#endif
#endif /* LIBGNUTLS_VERSION_NUMBER >= 0x010706 */
/* make C compiler happy */
(void) req_ca;
@ -4039,7 +4039,7 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session,
#else
rinfo = gnutls_x509_crt_print (cert_temp,
GNUTLS_CRT_PRINT_ONELINE, &cinfo);
#endif
#endif /* LIBGNUTLS_VERSION_NUMBER < 0x020400 */
if (rinfo == 0)
{
weechat_printf (
@ -4052,7 +4052,7 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session,
weechat_prefix ("network"), cinfo.data);
gnutls_free (cinfo.data);
}
#endif
#endif /* LIBGNUTLS_VERSION_NUMBER >= 0x010706 */
/* check dates, only if fingerprint is not set */
if (!fingerprint || !fingerprint[0])
{
@ -4226,7 +4226,7 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session,
tls_struct.key_type = GNUTLS_PRIVKEY_X509;
#else
tls_struct.type = GNUTLS_CRT_X509;
#endif
#endif /* LIBGNUTLS_VERSION_NUMBER >= 0x020b00 */
tls_struct.ncerts = 1;
tls_struct.deinit_all = 0;
tls_struct.cert.x509 = &server->tls_cert;
@ -4241,7 +4241,7 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session,
rinfo = gnutls_x509_crt_print (server->tls_cert,
GNUTLS_CRT_PRINT_ONELINE,
&cinfo);
#endif
#endif /* LIBGNUTLS_VERSION_NUMBER < 0x020400 */
if (rinfo == 0)
{
weechat_printf (
@ -4253,7 +4253,7 @@ irc_server_gnutls_callback (void *data, gnutls_session_t tls_session,
weechat_prefix ("network"), cinfo.data);
gnutls_free (cinfo.data);
}
#endif
#endif /* LIBGNUTLS_VERSION_NUMBER >= 0x010706 */
memcpy (answer, &tls_struct, sizeof (tls_struct));
free (cert_str);
}
@ -4417,7 +4417,7 @@ irc_server_connect (struct t_irc_server *server)
weechat_prefix ("error"), IRC_PLUGIN_NAME);
return 0;
}
#endif
#endif /* HAVE_GNUTLS */
if (proxy_type)
{
weechat_printf (
@ -4501,7 +4501,7 @@ irc_server_connect (struct t_irc_server *server)
IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_LOCAL_HOSTNAME),
&irc_server_connect_cb,
server);
#endif
#endif /* HAVE_GNUTLS */
/* send signal "irc_server_connecting" with server name */
(void) weechat_hook_signal_send ("irc_server_connecting",
@ -5206,7 +5206,7 @@ irc_server_hdata_server_cb (void *data, const char *hdata_name)
WEECHAT_HDATA_VAR(struct t_irc_server, gnutls_sess, OTHER, 0, NULL, NULL);
WEECHAT_HDATA_VAR(struct t_irc_server, tls_cert, OTHER, 0, NULL, NULL);
WEECHAT_HDATA_VAR(struct t_irc_server, tls_cert_key, OTHER, 0, NULL, NULL);
#endif
#endif /* HAVE_GNUTLS */
WEECHAT_HDATA_VAR(struct t_irc_server, unterminated_message, STRING, 0, NULL, NULL);
WEECHAT_HDATA_VAR(struct t_irc_server, nicks_count, INTEGER, 0, NULL, NULL);
WEECHAT_HDATA_VAR(struct t_irc_server, nicks_array, STRING, 0, "nicks_count", NULL);
@ -5785,7 +5785,7 @@ irc_server_print_log ()
weechat_log_printf (" disconnected . . . . : %d", ptr_server->disconnected);
#ifdef HAVE_GNUTLS
weechat_log_printf (" gnutls_sess. . . . . : 0x%lx", ptr_server->gnutls_sess);
#endif
#endif /* HAVE_GNUTLS */
weechat_log_printf (" unterminated_message : '%s'", ptr_server->unterminated_message);
weechat_log_printf (" nicks_count. . . . . : %d", ptr_server->nicks_count);
weechat_log_printf (" nicks_array. . . . . : 0x%lx", ptr_server->nicks_array);

View File

@ -26,11 +26,11 @@
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#endif /* HAVE_GNUTLS */
#ifndef NI_MAXHOST
#define NI_MAXHOST 256
#endif
#endif /* NI_MAXHOST */
enum t_irc_server_sasl_fail
{
@ -174,7 +174,7 @@ struct t_irc_server
gnutls_session_t gnutls_sess; /* gnutls session (only if SSL is used) */
gnutls_x509_crt_t tls_cert; /* certificate used if ssl_cert is set */
gnutls_x509_privkey_t tls_cert_key; /* key used if ssl_cert is set */
#endif
#endif /* HAVE_GNUTLS */
char *unterminated_message; /* beginning of a message in input buf */
int nicks_count; /* number of nicknames */
char **nicks_array; /* nicknames (after split) */
@ -252,13 +252,13 @@ enum t_irc_fingerprint_digest_algo
/* number of digest algorithms */
IRC_FINGERPRINT_NUM_ALGOS,
};
#endif
#endif /* HAVE_GNUTLS */
extern struct t_irc_server *irc_servers;
#ifdef HAVE_GNUTLS
extern const int gnutls_cert_type_prio[];
extern const int gnutls_prot_prio[];
#endif
#endif /* HAVE_GNUTLS */
extern struct t_irc_message *irc_recv_msgq, *irc_msgq_last_msg;
extern char *irc_server_sasl_fail_string[];
extern char *irc_server_options[][2];
@ -323,7 +323,7 @@ extern struct t_gui_buffer *irc_server_create_buffer (struct t_irc_server *serve
#ifdef HAVE_GNUTLS
int irc_server_fingerprint_search_algo_with_size (int size);
char *irc_server_fingerprint_str_sizes ();
#endif
#endif /* HAVE_GNUTLS */
extern int irc_server_connect (struct t_irc_server *server);
extern void irc_server_auto_connect (int auto_connect);
extern void irc_server_autojoin_channels ();

View File

@ -28,10 +28,10 @@
#define EXPORT extern "C" __declspec (dllexport)
#else
#define EXPORT extern "C"
#endif
#endif /* _WIN32 */
#else
#define EXPORT
#endif
#endif /* __cplusplus */
#define weechat_plugin weechat_js_plugin
#define JS_PLUGIN_NAME "javascript"

View File

@ -359,7 +359,7 @@ logger_get_mask_expanded (struct t_gui_buffer *buffer, const char *mask)
weechat_config_string (logger_config_file_replacement_char));
#else
mask_decoded3 = strdup (mask_decoded2);
#endif
#endif /* __CYGWIN__ */
if (!mask_decoded3)
goto end;

View File

@ -294,7 +294,7 @@ weechat_lua_register_lib (lua_State *L, const char *libname,
luaL_setfuncs (L, lua_api_funcs, 0);
#else
luaL_register (L, libname, lua_api_funcs);
#endif
#endif /* LUA_VERSION_NUM >= 502 */
luaL_newmetatable (L, "weechat");
lua_pushliteral (L, "__index");
@ -375,7 +375,7 @@ weechat_lua_load (const char *filename)
luaopen_math (lua_current_interpreter);
luaopen_io (lua_current_interpreter);
luaopen_debug (lua_current_interpreter);
#endif
#endif /* LUA_VERSION_NUM */
weechat_lua_register_lib (lua_current_interpreter, "weechat",
weechat_lua_api_funcs,
@ -385,7 +385,7 @@ weechat_lua_load (const char *filename)
if (luaL_dostring (lua_current_interpreter, weechat_lua_code) != 0)
#else
if (lua_dostring (lua_current_interpreter, weechat_lua_code) != 0)
#endif
#endif /* LUA_VERSION_NUM */
{
weechat_printf (NULL,
weechat_gettext ("%s%s: unable to redirect stdout "
@ -800,7 +800,7 @@ weechat_lua_signal_debug_libs_cb (void *data, const char *signal,
weechat_printf (NULL, " %s: %s", LUA_PLUGIN_NAME, LUA_VERSION);
#else
weechat_printf (NULL, " %s: (?)", LUA_PLUGIN_NAME);
#endif
#endif /* LUA_VERSION */
return WEECHAT_RC_OK;
}

View File

@ -94,7 +94,7 @@
#ifdef NO_PERL_MULTIPLICITY
#undef MULTIPLICITY
#endif
#endif /* NO_PERL_MULTIPLICITY */
extern void boot_DynaLoader (pTHX_ CV* cv);
@ -169,7 +169,7 @@ API_FUNC(register)
perl_current_script->interpreter = perl_current_interpreter;
#else
perl_current_script->interpreter = SvPV_nolen (eval_pv ("__PACKAGE__", TRUE));
#endif
#endif /* MULTIPLICITY */
}
else
{

View File

@ -49,7 +49,7 @@ struct t_plugin_script *perl_registered_script = NULL;
const char *perl_current_script_filename = NULL;
#ifdef MULTIPLICITY
PerlInterpreter *perl_current_interpreter = NULL;
#endif
#endif /* MULTIPLICITY */
int perl_quit_or_upgrade = 0;
/*
@ -78,13 +78,13 @@ char *perl_action_autoload_list = NULL;
#ifdef NO_PERL_MULTIPLICITY
#undef MULTIPLICITY
#endif
#endif /* NO_PERL_MULTIPLICITY */
#ifndef MULTIPLICITY
#define PKG_NAME_PREFIX "WeechatPerlPackage"
static PerlInterpreter *perl_main = NULL;
int perl_num = 0;
#endif
#endif /* MULTIPLICITY */
char *perl_args[] = { "", "-e", "0", "-w", NULL };
int perl_args_count = 4;
@ -93,7 +93,7 @@ char *perl_weechat_code =
{
#ifndef MULTIPLICITY
"package %s;"
#endif
#endif /* MULTIPLICITY */
"$SIG{__WARN__} = sub { weechat::print('', 'perl\twarning: '.$_[0]) };"
"$SIG{__DIE__} = sub { weechat::print('', 'perl\terror: '.$_[0]) };"
"do '%s';"
@ -204,7 +204,7 @@ weechat_perl_exec (struct t_plugin_script *script,
struct t_plugin_script *old_perl_current_script;
#ifdef MULTIPLICITY
void *old_context;
#endif
#endif /* MULTIPLICITY */
old_perl_current_script = perl_current_script;
perl_current_script = script;
@ -224,7 +224,7 @@ weechat_perl_exec (struct t_plugin_script *script,
snprintf (func, length, "%s::%s",
(char *) ((script->interpreter) ? script->interpreter : perl_main),
function);
#endif
#endif /* MULTIPLICITY */
dSP;
ENTER;
@ -322,7 +322,7 @@ weechat_perl_exec (struct t_plugin_script *script,
PERL_SET_CONTEXT (old_context);
#else
free (func);
#endif
#endif /* MULTIPLICITY */
if (!ret_value && (mem_err == 1))
{
@ -353,7 +353,7 @@ weechat_perl_load (const char *filename)
int length;
#ifndef MULTIPLICITY
char pkgname[64];
#endif
#endif /* MULTIPLICITY */
temp_script.filename = NULL;
temp_script.interpreter = NULL;
@ -414,7 +414,7 @@ weechat_perl_load (const char *filename)
if (!perl_code)
return 0;
snprintf (perl_code, length, perl_weechat_code, pkgname, filename);
#endif
#endif /* MULTIPLICITY */
eval_pv (perl_code, TRUE);
free (perl_code);
@ -432,7 +432,7 @@ weechat_perl_load (const char *filename)
#ifdef MULTIPLICITY
perl_destruct (perl_current_interpreter);
perl_free (perl_current_interpreter);
#endif
#endif /* MULTIPLICITY */
if (perl_current_script && (perl_current_script != &temp_script))
{
plugin_script_remove (weechat_perl_plugin,
@ -453,14 +453,14 @@ weechat_perl_load (const char *filename)
#ifdef MULTIPLICITY
perl_destruct (perl_current_interpreter);
perl_free (perl_current_interpreter);
#endif
#endif /* MULTIPLICITY */
return 0;
}
perl_current_script = perl_registered_script;
#ifndef MULTIPLICITY
perl_current_script->interpreter = strdup (pkgname);
#endif
#endif /* MULTIPLICITY */
/*
* set input/close callbacks for buffers created by this script
@ -512,7 +512,7 @@ weechat_perl_unload (struct t_plugin_script *script)
#ifdef MULTIPLICITY
PERL_SET_CONTEXT (script->interpreter);
#endif
#endif /* MULTIPLICITY */
if (script->shutdown_func && script->shutdown_func[0])
{
@ -549,7 +549,7 @@ weechat_perl_unload (struct t_plugin_script *script)
#else
if (interpreter)
free (interpreter);
#endif
#endif /* MULTIPLICITY */
(void) weechat_hook_signal_send ("perl_script_unloaded",
WEECHAT_HOOK_SIGNAL_STRING, filename);
@ -832,7 +832,7 @@ weechat_perl_signal_debug_libs_cb (void *data, const char *signal,
weechat_printf (NULL, " %s: %s", PERL_PLUGIN_NAME, PERL_VERSION_STRING);
#else
weechat_printf (NULL, " %s: (?)", PERL_PLUGIN_NAME);
#endif
#endif /* PERL_VERSION_STRING */
return WEECHAT_RC_OK;
}
@ -971,13 +971,11 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
int a;
char **perl_args_local;
char *perl_env[] = {};
#endif
#ifdef PERL_SYS_INIT3
a = perl_args_count;
perl_args_local = perl_args;
(void) perl_env;
PERL_SYS_INIT3 (&a, (char ***)&perl_args_local, (char ***)&perl_env);
#endif
#endif /* PERL_SYS_INIT3 */
weechat_perl_plugin = plugin;
@ -996,7 +994,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
perl_construct (perl_main);
perl_parse (perl_main, weechat_perl_api_init, perl_args_count,
perl_args, NULL);
#endif
#endif /* MULTIPLICITY */
init.callback_command = &weechat_perl_command_cb;
init.callback_completion = &weechat_perl_completion_cb;
@ -1042,7 +1040,7 @@ weechat_plugin_end (struct t_weechat_plugin *plugin)
perl_free (perl_main);
perl_main = NULL;
}
#endif
#endif /* MULTIPLICITY */
#if defined(PERL_SYS_TERM) && !defined(__FreeBSD__) && !defined(WIN32) && !defined(__CYGWIN__) && !(defined(__APPLE__) && defined(__MACH__))
/*

View File

@ -35,7 +35,7 @@ extern struct t_plugin_script *perl_registered_script;
extern const char *perl_current_script_filename;
#ifdef MULTIPLICITY
extern PerlInterpreter *perl_current_interpreter;
#endif
#endif /* MULTIPLICITY */
extern HV *weechat_perl_hashtable_to_hash (struct t_hashtable *hashtable);
extern struct t_hashtable *weechat_perl_hash_to_hashtable (SV *hash, int size,

View File

@ -84,7 +84,7 @@ static struct PyModuleDef moduleDefOutputs = {
NULL,
NULL
};
#endif
#endif /* PY_MAJOR_VERSION >= 3 */
/*
* string used to execute action "install":
@ -498,7 +498,7 @@ weechat_python_output (PyObject *self, PyObject *args)
static PyObject *weechat_python_init_module_weechat ()
#else
void weechat_python_init_module_weechat ()
#endif
#endif /* PY_MAJOR_VERSION >= 3 */
{
PyObject *weechat_module, *weechat_dict;
@ -508,7 +508,7 @@ void weechat_python_init_module_weechat ()
#else
/* python <= 2.x */
weechat_module = Py_InitModule ("weechat", weechat_python_funcs);
#endif
#endif /* PY_MAJOR_VERSION >= 3 */
if (!weechat_module)
{
@ -520,7 +520,7 @@ void weechat_python_init_module_weechat ()
return NULL;
#else
return;
#endif
#endif /* PY_MAJOR_VERSION >= 3 */
}
/* define some constants */
@ -574,7 +574,7 @@ void weechat_python_init_module_weechat ()
#if PY_MAJOR_VERSION >= 3
return weechat_module;
#endif
#endif /* PY_MAJOR_VERSION >= 3 */
}
/*
@ -591,7 +591,7 @@ weechat_python_load (const char *filename)
char *argv[] = { "__weechat_plugin__" , NULL };
#if PY_MAJOR_VERSION >= 3
wchar_t *wargv[] = { NULL, NULL };
#endif
#endif /* PY_MAJOR_VERSION >= 3 */
FILE *fp;
PyObject *weechat_outputs, *python_path, *path;
const char *weechat_home;
@ -636,7 +636,7 @@ weechat_python_load (const char *filename)
#else
/* python <= 2.x */
PySys_SetArgv(1, argv);
#endif
#endif /* PY_MAJOR_VERSION >= 3 */
if (!python_current_interpreter)
{
@ -667,7 +667,7 @@ weechat_python_load (const char *filename)
#else
/* python <= 2.x */
path = PyBytes_FromString (str_home);
#endif
#endif /* PY_MAJOR_VERSION >= 3 */
if (path != NULL)
{
PyList_Insert (python_path, 0, path);
@ -684,7 +684,7 @@ weechat_python_load (const char *filename)
/* python <= 2.x */
weechat_outputs = Py_InitModule("weechatOutputs",
weechat_python_output_funcs);
#endif
#endif /* PY_MAJOR_VERSION >= 3 */
if (!weechat_outputs)
{
@ -1149,7 +1149,7 @@ weechat_python_signal_debug_libs_cb (void *data, const char *signal,
weechat_printf (NULL, " %s: %s", PYTHON_PLUGIN_NAME, PY_VERSION);
#else
weechat_printf (NULL, " %s: (?)", PYTHON_PLUGIN_NAME);
#endif
#endif /* PY_VERSION */
return WEECHAT_RC_OK;
}

View File

@ -32,7 +32,7 @@
#define PyBytes_Check PyString_Check
#define PyBytes_FromString PyString_FromString
#define PyUnicode_FromString PyString_FromString
#endif
#endif /* PY_VERSION_HEX < 0x02060000 */
#if PY_MAJOR_VERSION >= 3
/* check of integer with Python >= 3.x */
@ -40,7 +40,7 @@
#else
/* check of integer with Python <= 2.x */
#define PY_INTEGER_CHECK(x) (PyInt_Check(x) || PyLong_Check(x))
#endif
#endif /* PY_MAJOR_VERSION >= 3 */
extern struct t_weechat_plugin *weechat_python_plugin;

View File

@ -260,7 +260,7 @@ relay_client_handshake_timer_cb (void *data, int remaining_calls)
/* handshake in progress, we will try again on next call to timer */
return WEECHAT_RC_OK;
}
#endif
#endif /* HAVE_GNUTLS */
/*
* Reads text data from a client: splits data on '\n' and keep a partial message
@ -451,7 +451,7 @@ relay_client_recv_cb (void *arg_client, int fd)
num_read = gnutls_record_recv (client->gnutls_sess, buffer,
sizeof (buffer) - 1);
else
#endif
#endif /* HAVE_GNUTLS */
num_read = recv (client->sock, buffer, sizeof (buffer) - 1, 0);
if (num_read > 0)
@ -555,7 +555,7 @@ relay_client_recv_cb (void *arg_client, int fd)
}
}
else
#endif
#endif /* HAVE_GNUTLS */
{
if ((num_read == 0)
|| ((errno != EAGAIN) && (errno != EWOULDBLOCK)))
@ -785,7 +785,7 @@ relay_client_send (struct t_relay_client *client, const char *data,
if (client->ssl)
num_sent = gnutls_record_send (client->gnutls_sess, ptr_data, data_size);
else
#endif
#endif /* HAVE_GNUTLS */
num_sent = send (client->sock, ptr_data, data_size, 0);
if (num_sent >= 0)
@ -839,7 +839,7 @@ relay_client_send (struct t_relay_client *client, const char *data,
}
}
else
#endif
#endif /* HAVE_GNUTLS */
{
if ((errno == EAGAIN) || (errno == EWOULDBLOCK))
{
@ -917,7 +917,7 @@ relay_client_timer_cb (void *data, int remaining_calls)
ptr_client->outqueue->data_size);
}
else
#endif
#endif /* HAVE_GNUTLS */
{
num_sent = send (ptr_client->sock,
ptr_client->outqueue->data,
@ -1006,7 +1006,7 @@ relay_client_timer_cb (void *data, int remaining_calls)
}
}
else
#endif
#endif /* HAVE_GNUTLS */
{
if ((errno == EAGAIN) || (errno == EWOULDBLOCK))
{
@ -1052,7 +1052,7 @@ relay_client_new (int sock, const char *address, struct t_relay_server *server)
#ifdef HAVE_GNUTLS
int bits;
struct t_config_option *ptr_option;
#endif
#endif /* HAVE_GNUTLS */
new_client = malloc (sizeof (*new_client));
if (new_client)
@ -1064,7 +1064,7 @@ relay_client_new (int sock, const char *address, struct t_relay_server *server)
#ifdef HAVE_GNUTLS
new_client->hook_timer_handshake = NULL;
new_client->gnutls_handshake_ok = 0;
#endif
#endif /* HAVE_GNUTLS */
new_client->websocket = 0;
new_client->http_headers = NULL;
new_client->address = strdup ((address) ? address : "?");
@ -1127,7 +1127,7 @@ relay_client_new (int sock, const char *address, struct t_relay_server *server)
#else
/* default for old gnutls */
bits = 1024;
#endif
#endif /* LIBGNUTLS_VERSION_NUMBER >= 0x020c00 */
gnutls_dh_params_generate2 (*relay_gnutls_dh_params, bits);
gnutls_certificate_set_dh_params (relay_gnutls_x509_cred,
*relay_gnutls_dh_params);
@ -1148,7 +1148,7 @@ relay_client_new (int sock, const char *address, struct t_relay_server *server)
&relay_client_handshake_timer_cb,
new_client);
}
#endif
#endif /* HAVE_GNUTLS */
new_client->protocol_data = NULL;
switch (new_client->protocol)
@ -1232,7 +1232,7 @@ relay_client_new_with_infolist (struct t_infolist *infolist)
new_client->gnutls_sess = NULL;
new_client->hook_timer_handshake = NULL;
new_client->gnutls_handshake_ok = 0;
#endif
#endif /* HAVE_GNUTLS */
new_client->websocket = weechat_infolist_integer (infolist, "websocket");
new_client->http_headers = NULL;
new_client->address = strdup (weechat_infolist_string (infolist, "address"));
@ -1330,7 +1330,7 @@ relay_client_set_status (struct t_relay_client *client,
client->hook_timer_handshake = NULL;
}
client->gnutls_handshake_ok = 0;
#endif
#endif /* HAVE_GNUTLS */
if (client->hook_fd)
{
weechat_unhook (client->hook_fd);
@ -1376,13 +1376,13 @@ relay_client_set_status (struct t_relay_client *client,
#ifdef HAVE_GNUTLS
if (client->ssl && client->gnutls_handshake_ok)
gnutls_bye (client->gnutls_sess, GNUTLS_SHUT_WR);
#endif
#endif /* HAVE_GNUTLS */
close (client->sock);
client->sock = -1;
#ifdef HAVE_GNUTLS
if (client->ssl)
gnutls_deinit (client->gnutls_sess);
#endif
#endif /* HAVE_GNUTLS */
}
}
@ -1428,7 +1428,7 @@ relay_client_free (struct t_relay_client *client)
#ifdef HAVE_GNUTLS
if (client->hook_timer_handshake)
weechat_unhook (client->hook_timer_handshake);
#endif
#endif /* HAVE_GNUTLS */
if (client->http_headers)
weechat_hashtable_free (client->http_headers);
if (client->hook_fd)
@ -1540,7 +1540,7 @@ relay_client_add_to_infolist (struct t_infolist *infolist,
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "gnutls_handshake_ok", client->gnutls_handshake_ok))
return 0;
#endif
#endif /* HAVE_GNUTLS */
if (!weechat_infolist_new_var_integer (ptr_item, "websocket", client->websocket))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "address", client->address))
@ -1617,7 +1617,7 @@ relay_client_print_log ()
weechat_log_printf (" gnutls_sess . . . . . : 0x%lx", ptr_client->gnutls_sess);
weechat_log_printf (" hook_timer_handshake. : 0x%lx", ptr_client->hook_timer_handshake);
weechat_log_printf (" gnutls_handshake_ok . : 0x%lx", ptr_client->gnutls_handshake_ok);
#endif
#endif /* HAVE_GNUTLS */
weechat_log_printf (" websocket . . . . . . : %d", ptr_client->websocket);
weechat_log_printf (" http_headers. . . . . : 0x%lx (hashtable: '%s')",
ptr_client->http_headers,

View File

@ -22,7 +22,7 @@
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#endif /* HAVE_GNUTLS */
struct t_relay_server;
@ -80,7 +80,7 @@ struct t_relay_client
gnutls_session_t gnutls_sess; /* gnutls session (only if SSL used) */
struct t_hook *hook_timer_handshake; /* timer for doing gnutls handshake*/
int gnutls_handshake_ok; /* 1 if handshake was done and OK */
#endif
#endif /* HAVE_GNUTLS */
int websocket; /* 0=not a ws, 1=init ws, 2=ws ready */
struct t_hashtable *http_headers; /* HTTP headers for websocket */
char *address; /* string with IP address */

View File

@ -237,7 +237,7 @@ relay_config_check_network_ssl_priorities (void *data,
(void) value;
return 1;
#endif
#endif /* HAVE_GNUTLS */
}
/*
@ -258,7 +258,7 @@ relay_config_change_network_ssl_priorities (void *data,
gnutls_priority_deinit (*relay_gnutls_priority_cache);
relay_network_set_priority ();
}
#endif
#endif /* HAVE_GNUTLS */
}
/*
@ -490,7 +490,7 @@ relay_config_create_option_port (void *data,
weechat_prefix ("error"), RELAY_PLUGIN_NAME);
rc = WEECHAT_CONFIG_OPTION_SET_ERROR;
}
#endif
#endif /* HAVE_GNUTLS */
if (rc != WEECHAT_CONFIG_OPTION_SET_ERROR)
{

View File

@ -23,7 +23,7 @@
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#endif /* HAVE_GNUTLS */
#include "../weechat-plugin.h"
#include "relay.h"
@ -38,7 +38,7 @@ int relay_network_init_ssl_cert_key_ok = 0;
gnutls_certificate_credentials_t relay_gnutls_x509_cred;
gnutls_priority_t *relay_gnutls_priority_cache = NULL;
gnutls_dh_params_t *relay_gnutls_dh_params = NULL;
#endif
#endif /* HAVE_GNUTLS */
/*
@ -100,7 +100,7 @@ relay_network_set_ssl_cert_key (int verbose)
#else
/* make C compiler happy */
(void) verbose;
#endif
#endif /* HAVE_GNUTLS */
}
/*
@ -122,7 +122,7 @@ relay_network_set_priority ()
free (relay_gnutls_priority_cache);
relay_gnutls_priority_cache = NULL;
}
#endif
#endif /* HAVE_GNUTLS */
}
/*
@ -142,7 +142,7 @@ relay_network_init ()
relay_gnutls_priority_cache = malloc (sizeof (*relay_gnutls_priority_cache));
if (relay_gnutls_priority_cache)
relay_network_set_priority ();
#endif
#endif /* HAVE_GNUTLS */
relay_network_init_ok = 1;
}
@ -169,7 +169,7 @@ relay_network_end ()
relay_gnutls_dh_params = NULL;
}
gnutls_certificate_free_credentials (relay_gnutls_x509_cred);
#endif
#endif /* HAVE_GNUTLS */
relay_network_init_ok = 0;
}
}

View File

@ -22,7 +22,7 @@
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
#endif
#endif /* HAVE_GNUTLS */
extern int relay_network_init_ok;
extern int relay_network_init_ssl_cert_key_ok;
@ -31,7 +31,7 @@ extern int relay_network_init_ssl_cert_key_ok;
extern gnutls_certificate_credentials_t relay_gnutls_x509_cred;
extern gnutls_priority_t *relay_gnutls_priority_cache;
extern gnutls_dh_params_t *relay_gnutls_dh_params;
#endif
#endif /* HAVE_GNUTLS */
extern void relay_network_set_ssl_cert_key (int verbose);
extern void relay_network_set_priority ();

View File

@ -429,7 +429,7 @@ relay_server_create_socket (struct t_relay_server *server)
return 0;
}
}
#endif
#endif /* IPV6_V6ONLY */
/* set option SO_REUSEADDR to 1 */
set = 1;

View File

@ -22,7 +22,7 @@
#ifdef HAVE_GNUTLS
#define RELAY_SERVER_GNUTLS_DH_BITS 1024
#endif
#endif /* HAVE_GNUTLS */
struct t_relay_server
{

View File

@ -970,7 +970,7 @@ weechat_ruby_signal_debug_libs_cb (void *data, const char *signal,
weechat_printf (NULL, " %s: %s", RUBY_PLUGIN_NAME, ruby_version);
#else
weechat_printf (NULL, " %s: (?)", RUBY_PLUGIN_NAME);
#endif
#endif /* HAVE_RUBY_VERSION_H */
return WEECHAT_RC_OK;
}

View File

@ -713,7 +713,7 @@ weechat_tcl_signal_debug_libs_cb (void *data, const char *signal,
weechat_printf (NULL, " %s: %s", TCL_PLUGIN_NAME, TCL_VERSION);
#else
weechat_printf (NULL, " %s: (?)", TCL_PLUGIN_NAME);
#endif
#endif /* TCL_VERSION */
return WEECHAT_RC_OK;
}

View File

@ -24,7 +24,7 @@
#ifdef __cplusplus
extern "C" {
#endif
#endif /* __cplusplus */
#include <sys/types.h>
#include <sys/socket.h>
@ -32,7 +32,7 @@ extern "C" {
/* some systems like GNU/Hurd do not define PATH_MAX */
#ifndef PATH_MAX
#define PATH_MAX 4096
#endif
#endif /* PATH_MAX */
struct t_config_option;
struct t_gui_window;
@ -1816,6 +1816,6 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
#ifdef __cplusplus
}
#endif
#endif /* __cplusplus */
#endif /* WEECHAT_WEECHAT_PLUGIN_H */

View File

@ -1140,7 +1140,7 @@ xfer_add_cb (void *data, const char *signal, const char *type_data,
free (dir1);
free (dir2);
}
#endif
#endif /* _WIN32 */
/* check if file exists */
if (stat (filename2, &st) == -1)
{

View File

@ -110,7 +110,7 @@ enum t_xfer_hash_status
#else
#define DIR_SEPARATOR "/"
#define DIR_SEPARATOR_CHAR '/'
#endif
#endif /* _WIN32 */
/* macros for type/status */