1
0
mirror of https://github.com/irssi/irssi.git synced 2025-01-03 14:56:47 -05:00

Merge pull request #1246 from ailin-nemui/wrong-prefixes

correct wrong function prefixes

Module authors will have to adapt these changes:

    [M] 'constant I_INPUT_READ'    {G_INPUT_READ}
    [M] 'constant I_INPUT_WRITE'    {G_INPUT_WRITE}
    [M] 'function int i_input_add(GIOChannel*, int, GInputFunction, void*)'    {g_input_add}
    [M] 'function int i_input_add_full(GIOChannel*, int, int, GInputFunction, void*)'    {g_input_add_full}
    [M] 'function int i_input_add_poll(int, int, int, GInputFunction, void*)'    {g_input_add_poll}
    [M] 'function GIOChannel* i_io_channel_new(int)'    {g_io_channel_new}
    [M] 'function int i_io_channel_read_block(GIOChannel*, void*, int)'    {g_io_channel_read_block}
    [M] 'function int i_io_channel_write_block(GIOChannel*, void*, int)'    {g_io_channel_write_block}
    [M] 'function int i_istr_cmp(gconstpointer, gconstpointer)'    {g_istr_cmp}
    [M] 'function int i_istr_equal(gconstpointer, gconstpointer)'    {g_istr_equal}
    [M] 'function guint i_istr_hash(gconstpointer)'    {g_istr_hash}
    [M] 'function void i_log_func(const char*, GLogLevelFlags, const char*)'    {glog_func}
    [M] 'function GSList* i_slist_delete_string(GSList*, const char*, GDestroyNotify)'    {gslist_delete_string}
    [M] 'function GSList* i_slist_find_icase_string(GSList*, const char*)'    {gslist_find_icase_string}
    [M] 'function GSList* i_slist_find_string(GSList*, const char*)'    {gslist_find_string}
    [M] 'function void* i_slist_foreach_find(GSList*, FOREACH_FIND_FUNC, void*)'    {gslist_foreach_find}
    [M] 'function void i_slist_free_full(GSList*, GDestroyNotify)'    {gslist_free_full}
    [M] 'function GSList* i_slist_remove_string(GSList*, const char*)'    {gslist_remove_string}
    [M] 'function char* i_slist_to_string(GSList*, const char*)'    {gslist_to_string}
This commit is contained in:
ailin-nemui 2021-01-30 21:09:26 +01:00 committed by GitHub
commit db9aa817d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
46 changed files with 181 additions and 231 deletions

View File

@ -6,7 +6,7 @@
#define IRSSI_GLOBAL_CONFIG "irssi.conf" /* config file name in /etc/ */ #define IRSSI_GLOBAL_CONFIG "irssi.conf" /* config file name in /etc/ */
#define IRSSI_HOME_CONFIG "config" /* config file name in ~/.irssi/ */ #define IRSSI_HOME_CONFIG "config" /* config file name in ~/.irssi/ */
#define IRSSI_ABI_VERSION 32 #define IRSSI_ABI_VERSION 33
#define DEFAULT_SERVER_ADD_PORT 6667 #define DEFAULT_SERVER_ADD_PORT 6667
#define DEFAULT_SERVER_ADD_TLS_PORT 6697 #define DEFAULT_SERVER_ADD_TLS_PORT 6697
@ -45,15 +45,14 @@ typedef guint64 uoff_t;
#define PRIuUOFF_T G_GUINT64_FORMAT #define PRIuUOFF_T G_GUINT64_FORMAT
/* input functions */ /* input functions */
#define G_INPUT_READ (1 << 0) #define I_INPUT_READ (1 << 0)
#define G_INPUT_WRITE (1 << 1) #define I_INPUT_WRITE (1 << 1)
typedef void (*GInputFunction) (void *data, GIOChannel *source, int condition); typedef void (*GInputFunction) (void *data, GIOChannel *source, int condition);
int g_input_add(GIOChannel *source, int condition, int i_input_add(GIOChannel *source, int condition, GInputFunction function, void *data);
GInputFunction function, void *data); int i_input_add_full(GIOChannel *source, int priority, int condition, GInputFunction function,
int g_input_add_full(GIOChannel *source, int priority, int condition, void *data);
GInputFunction function, void *data);
/* return full path for ~/.irssi */ /* return full path for ~/.irssi */
const char *get_irssi_dir(void); const char *get_irssi_dir(void);

View File

@ -126,9 +126,8 @@ CHANNEL_REC *channel_find(SERVER_REC *server, const char *name)
return channel_find_server(server, name); return channel_find_server(server, name);
/* find from any server */ /* find from any server */
return gslist_foreach_find(servers, return i_slist_foreach_find(servers, (FOREACH_FIND_FUNC) channel_find_server,
(FOREACH_FIND_FUNC) channel_find_server, (void *) name);
(void *) name);
} }
void channel_change_name(CHANNEL_REC *channel, const char *name) void channel_change_name(CHANNEL_REC *channel, const char *name)
@ -153,9 +152,8 @@ void channel_change_visible_name(CHANNEL_REC *channel, const char *name)
static CHANNEL_REC *channel_find_servers(GSList *servers, const char *name) static CHANNEL_REC *channel_find_servers(GSList *servers, const char *name)
{ {
return gslist_foreach_find(servers, return i_slist_foreach_find(servers, (FOREACH_FIND_FUNC) channel_find_server,
(FOREACH_FIND_FUNC) channel_find_server, (void *) name);
(void *) name);
} }
static GSList *servers_find_chatnet_except(SERVER_REC *server) static GSList *servers_find_chatnet_except(SERVER_REC *server)

View File

@ -431,7 +431,7 @@ static void command_calc_options(COMMAND_REC *rec, const char *options)
g_strfreev(optlist); g_strfreev(optlist);
/* linked list -> string[] */ /* linked list -> string[] */
str = gslist_to_string(list, " "); str = i_slist_to_string(list, " ");
rec->options = g_strsplit(str, " ", -1); rec->options = g_strsplit(str, " ", -1);
g_free(str); g_free(str);
@ -740,8 +740,7 @@ int cmd_get_params(const char *data, gpointer *free_me, int count, ...)
opthash = (GHashTable **) va_arg(args, GHashTable **); opthash = (GHashTable **) va_arg(args, GHashTable **);
rec->options = *opthash = rec->options = *opthash =
g_hash_table_new((GHashFunc) g_istr_hash, g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
(GCompareFunc) g_istr_equal);
ignore_unknown = count & PARAM_FLAG_UNKNOWN_OPTIONS; ignore_unknown = count & PARAM_FLAG_UNKNOWN_OPTIONS;
error = get_cmd_options(&datad, ignore_unknown, error = get_cmd_options(&datad, ignore_unknown,
@ -832,7 +831,7 @@ void commands_remove_module(const char *module)
COMMAND_REC *rec = tmp->data; COMMAND_REC *rec = tmp->data;
next = tmp->next; next = tmp->next;
modlist = gslist_find_string(rec->modules, module); modlist = i_slist_find_string(rec->modules, module);
if (modlist != NULL) if (modlist != NULL)
command_module_unbind_all(rec, modlist->data); command_module_unbind_all(rec, modlist->data);
} }
@ -866,8 +865,7 @@ static int cmd_protocol_match(COMMAND_REC *cmd, SERVER_REC *server)
#define alias_runstack_pop(alias) \ #define alias_runstack_pop(alias) \
alias_runstack = g_slist_remove(alias_runstack, alias) alias_runstack = g_slist_remove(alias_runstack, alias)
#define alias_runstack_find(alias) \ #define alias_runstack_find(alias) (i_slist_find_icase_string(alias_runstack, alias) != NULL)
(gslist_find_icase_string(alias_runstack, alias) != NULL)
static void parse_command(const char *command, int expand_aliases, static void parse_command(const char *command, int expand_aliases,
SERVER_REC *server, void *item) SERVER_REC *server, void *item)

View File

@ -561,7 +561,7 @@ static void log_read_config(void)
if (node != NULL) if (node != NULL)
log_items_read_config(node, log); log_items_read_config(node, log);
if (log->autoopen || gslist_find_string(fnames, log->fname)) if (log->autoopen || i_slist_find_string(fnames, log->fname))
log_start_logging(log); log_start_logging(log);
} }

View File

@ -37,15 +37,15 @@ static int irssi_io_invoke(GIOChannel *source, GIOCondition condition,
if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) { if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) {
/* error, we have to call the function.. */ /* error, we have to call the function.. */
if (rec->condition & G_IO_IN) if (rec->condition & G_IO_IN)
icond |= G_INPUT_READ; icond |= I_INPUT_READ;
else else
icond |= G_INPUT_WRITE; icond |= I_INPUT_WRITE;
} }
if (condition & (G_IO_IN | G_IO_PRI)) if (condition & (G_IO_IN | G_IO_PRI))
icond |= G_INPUT_READ; icond |= I_INPUT_READ;
if (condition & G_IO_OUT) if (condition & G_IO_OUT)
icond |= G_INPUT_WRITE; icond |= I_INPUT_WRITE;
if (rec->condition & icond) if (rec->condition & icond)
rec->function(rec->data, source, icond); rec->function(rec->data, source, icond);
@ -53,8 +53,8 @@ static int irssi_io_invoke(GIOChannel *source, GIOCondition condition,
return TRUE; return TRUE;
} }
int g_input_add_full(GIOChannel *source, int priority, int condition, int i_input_add_full(GIOChannel *source, int priority, int condition, GInputFunction function,
GInputFunction function, void *data) void *data)
{ {
IRSSI_INPUT_REC *rec; IRSSI_INPUT_REC *rec;
unsigned int result; unsigned int result;
@ -66,9 +66,9 @@ int g_input_add_full(GIOChannel *source, int priority, int condition,
rec->data = data; rec->data = data;
cond = (GIOCondition) (G_IO_ERR|G_IO_HUP|G_IO_NVAL); cond = (GIOCondition) (G_IO_ERR|G_IO_HUP|G_IO_NVAL);
if (condition & G_INPUT_READ) if (condition & I_INPUT_READ)
cond |= G_IO_IN|G_IO_PRI; cond |= G_IO_IN|G_IO_PRI;
if (condition & G_INPUT_WRITE) if (condition & I_INPUT_WRITE)
cond |= G_IO_OUT; cond |= G_IO_OUT;
result = g_io_add_watch_full(source, priority, cond, result = g_io_add_watch_full(source, priority, cond,
@ -77,19 +77,16 @@ int g_input_add_full(GIOChannel *source, int priority, int condition,
return result; return result;
} }
int g_input_add(GIOChannel *source, int condition, int i_input_add(GIOChannel *source, int condition, GInputFunction function, void *data)
GInputFunction function, void *data)
{ {
return g_input_add_full(source, G_PRIORITY_DEFAULT, condition, return i_input_add_full(source, G_PRIORITY_DEFAULT, condition, function, data);
function, data);
} }
/* easy way to bypass glib polling of io channel internal buffer */ /* easy way to bypass glib polling of io channel internal buffer */
int g_input_add_poll(int fd, int priority, int condition, int i_input_add_poll(int fd, int priority, int condition, GInputFunction function, void *data)
GInputFunction function, void *data)
{ {
GIOChannel *source = g_io_channel_unix_new(fd); GIOChannel *source = g_io_channel_unix_new(fd);
int ret = g_input_add_full(source, priority, condition, function, data); int ret = i_input_add_full(source, priority, condition, function, data);
g_io_channel_unref(source); g_io_channel_unref(source);
return ret; return ret;
} }
@ -170,7 +167,7 @@ int strarray_find(char **array, const char *item)
return -1; return -1;
} }
GSList *gslist_find_string(GSList *list, const char *key) GSList *i_slist_find_string(GSList *list, const char *key)
{ {
for (; list != NULL; list = list->next) for (; list != NULL; list = list->next)
if (g_strcmp0(list->data, key) == 0) return list; if (g_strcmp0(list->data, key) == 0) return list;
@ -178,7 +175,7 @@ GSList *gslist_find_string(GSList *list, const char *key)
return NULL; return NULL;
} }
GSList *gslist_find_icase_string(GSList *list, const char *key) GSList *i_slist_find_icase_string(GSList *list, const char *key)
{ {
for (; list != NULL; list = list->next) for (; list != NULL; list = list->next)
if (g_ascii_strcasecmp(list->data, key) == 0) return list; if (g_ascii_strcasecmp(list->data, key) == 0) return list;
@ -186,7 +183,7 @@ GSList *gslist_find_icase_string(GSList *list, const char *key)
return NULL; return NULL;
} }
void *gslist_foreach_find(GSList *list, FOREACH_FIND_FUNC func, const void *data) void *i_slist_foreach_find(GSList *list, FOREACH_FIND_FUNC func, const void *data)
{ {
void *ret; void *ret;
@ -200,7 +197,7 @@ void *gslist_foreach_find(GSList *list, FOREACH_FIND_FUNC func, const void *data
return NULL; return NULL;
} }
void gslist_free_full (GSList *list, GDestroyNotify free_func) void i_slist_free_full(GSList *list, GDestroyNotify free_func)
{ {
GSList *tmp; GSList *tmp;
@ -213,7 +210,7 @@ void gslist_free_full (GSList *list, GDestroyNotify free_func)
g_slist_free(list); g_slist_free(list);
} }
GSList *gslist_remove_string (GSList *list, const char *str) GSList *i_slist_remove_string(GSList *list, const char *str)
{ {
GSList *l; GSList *l;
@ -224,7 +221,7 @@ GSList *gslist_remove_string (GSList *list, const char *str)
return list; return list;
} }
GSList *gslist_delete_string (GSList *list, const char *str, GDestroyNotify free_func) GSList *i_slist_delete_string(GSList *list, const char *str, GDestroyNotify free_func)
{ {
GSList *l; GSList *l;
@ -258,7 +255,7 @@ char *gslistptr_to_string(GSList *list, int offset, const char *delimiter)
} }
/* `list' contains char* */ /* `list' contains char* */
char *gslist_to_string(GSList *list, const char *delimiter) char *i_slist_to_string(GSList *list, const char *delimiter)
{ {
GString *str; GString *str;
char *ret; char *ret;
@ -411,17 +408,17 @@ char *convert_home(const char *path)
} }
} }
int g_istr_equal(gconstpointer v, gconstpointer v2) int i_istr_equal(gconstpointer v, gconstpointer v2)
{ {
return g_ascii_strcasecmp((const char *) v, (const char *) v2) == 0; return g_ascii_strcasecmp((const char *) v, (const char *) v2) == 0;
} }
int g_istr_cmp(gconstpointer v, gconstpointer v2) int i_istr_cmp(gconstpointer v, gconstpointer v2)
{ {
return g_ascii_strcasecmp((const char *) v, (const char *) v2); return g_ascii_strcasecmp((const char *) v, (const char *) v2);
} }
guint g_istr_hash(gconstpointer v) guint i_istr_hash(gconstpointer v)
{ {
const signed char *p; const signed char *p;
guint32 h = 5381; guint32 h = 5381;

View File

@ -1,8 +1,7 @@
#ifndef IRSSI_CORE_MISC_H #ifndef IRSSI_CORE_MISC_H
#define IRSSI_CORE_MISC_H #define IRSSI_CORE_MISC_H
int g_input_add_poll(int fd, int priority, int condition, int i_input_add_poll(int fd, int priority, int condition, GInputFunction function, void *data);
GInputFunction function, void *data);
/* `str' should be type char[MAX_INT_STRLEN] */ /* `str' should be type char[MAX_INT_STRLEN] */
#define ltoa(str, num) \ #define ltoa(str, num) \
@ -20,21 +19,21 @@ int g_timeval_cmp(const GTimeVal *tv1, const GTimeVal *tv2) G_GNUC_DEPRECATED;
long get_timeval_diff(const GTimeVal *tv1, const GTimeVal *tv2) G_GNUC_DEPRECATED; long get_timeval_diff(const GTimeVal *tv1, const GTimeVal *tv2) G_GNUC_DEPRECATED;
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
GSList *gslist_find_string(GSList *list, const char *key); GSList *i_slist_find_string(GSList *list, const char *key);
GSList *gslist_find_icase_string(GSList *list, const char *key); GSList *i_slist_find_icase_string(GSList *list, const char *key);
GList *glist_find_string(GList *list, const char *key); GList *glist_find_string(GList *list, const char *key);
GList *glist_find_icase_string(GList *list, const char *key); GList *glist_find_icase_string(GList *list, const char *key);
GSList *gslist_remove_string (GSList *list, const char *str) G_GNUC_DEPRECATED; GSList *i_slist_remove_string(GSList *list, const char *str) G_GNUC_DEPRECATED;
GSList *gslist_delete_string (GSList *list, const char *str, GDestroyNotify free_func); GSList *i_slist_delete_string(GSList *list, const char *str, GDestroyNotify free_func);
void gslist_free_full (GSList *list, GDestroyNotify free_func); void i_slist_free_full(GSList *list, GDestroyNotify free_func);
void *gslist_foreach_find(GSList *list, FOREACH_FIND_FUNC func, const void *data); void *i_slist_foreach_find(GSList *list, FOREACH_FIND_FUNC func, const void *data);
/* `list' contains pointer to structure with a char* to string. */ /* `list' contains pointer to structure with a char* to string. */
char *gslistptr_to_string(GSList *list, int offset, const char *delimiter); char *gslistptr_to_string(GSList *list, int offset, const char *delimiter);
/* `list' contains char* */ /* `list' contains char* */
char *gslist_to_string(GSList *list, const char *delimiter); char *i_slist_to_string(GSList *list, const char *delimiter);
GList *optlist_remove_known(const char *cmd, GHashTable *optlist); GList *optlist_remove_known(const char *cmd, GHashTable *optlist);
@ -42,11 +41,11 @@ GList *optlist_remove_known(const char *cmd, GHashTable *optlist);
char *convert_home(const char *path); char *convert_home(const char *path);
/* Case-insensitive string hash functions */ /* Case-insensitive string hash functions */
int g_istr_equal(gconstpointer v, gconstpointer v2); int i_istr_equal(gconstpointer v, gconstpointer v2);
unsigned int g_istr_hash(gconstpointer v); unsigned int i_istr_hash(gconstpointer v);
/* Case-insensitive GCompareFunc func */ /* Case-insensitive GCompareFunc func */
int g_istr_cmp(gconstpointer v, gconstpointer v2); int i_istr_cmp(gconstpointer v, gconstpointer v2);
/* Find `mask' from `data', you can use * and ? wildcards. */ /* Find `mask' from `data', you can use * and ? wildcards. */
int match_wildcards(const char *mask, const char *data); int match_wildcards(const char *mask, const char *data);

View File

@ -97,8 +97,7 @@ void net_disconnect_later(GIOChannel *handle)
rec = g_new(NET_DISCONNECT_REC, 1); rec = g_new(NET_DISCONNECT_REC, 1);
rec->created = time(NULL); rec->created = time(NULL);
rec->handle = handle; rec->handle = handle;
rec->tag = g_input_add(handle, G_INPUT_READ, rec->tag = i_input_add(handle, I_INPUT_READ, (GInputFunction) sig_disconnect, rec);
(GInputFunction) sig_disconnect, rec);
if (timeout_tag == -1) { if (timeout_tag == -1) {
timeout_tag = g_timeout_add(10000, (GSourceFunc) timeout_tag = g_timeout_add(10000, (GSourceFunc)

View File

@ -62,9 +62,9 @@ int net_gethostbyname_nonblock(const char *addr, GIOChannel *pipe, int reverse_l
rec.errlen = errorstr == NULL ? 0 : strlen(errorstr)+1; rec.errlen = errorstr == NULL ? 0 : strlen(errorstr)+1;
} }
g_io_channel_write_block(pipe, &rec, sizeof(rec)); i_io_channel_write_block(pipe, &rec, sizeof(rec));
if (rec.errlen != 0) if (rec.errlen != 0)
g_io_channel_write_block(pipe, (void *) errorstr, rec.errlen); i_io_channel_write_block(pipe, (void *) errorstr, rec.errlen);
if (pid == 0) if (pid == 0)
_exit(99); _exit(99);
@ -82,7 +82,7 @@ int net_gethostbyname_return(GIOChannel *pipe, RESOLVED_IP_REC *rec)
fcntl(g_io_channel_unix_get_fd(pipe), F_SETFL, O_NONBLOCK); fcntl(g_io_channel_unix_get_fd(pipe), F_SETFL, O_NONBLOCK);
/* get ip+error */ /* get ip+error */
if (g_io_channel_read_block(pipe, rec, sizeof(*rec)) == -1) { if (i_io_channel_read_block(pipe, rec, sizeof(*rec)) == -1) {
rec->errorstr = g_strdup_printf("Host name lookup: %s", rec->errorstr = g_strdup_printf("Host name lookup: %s",
g_strerror(errno)); g_strerror(errno));
return -1; return -1;
@ -92,7 +92,7 @@ int net_gethostbyname_return(GIOChannel *pipe, RESOLVED_IP_REC *rec)
/* read error string, if we can't read everything for some /* read error string, if we can't read everything for some
reason, just ignore it. */ reason, just ignore it. */
rec->errorstr = g_malloc0(rec->errlen+1); rec->errorstr = g_malloc0(rec->errlen+1);
g_io_channel_read_block(pipe, rec->errorstr, rec->errlen); i_io_channel_read_block(pipe, rec->errorstr, rec->errlen);
} }
return 0; return 0;

View File

@ -132,8 +132,7 @@ int net_sendbuffer_send(NET_SENDBUF_REC *rec, const void *data, int size)
/* everything couldn't be sent. */ /* everything couldn't be sent. */
if (rec->send_tag == -1) { if (rec->send_tag == -1) {
rec->send_tag = rec->send_tag =
g_input_add(rec->handle, G_INPUT_WRITE, i_input_add(rec->handle, I_INPUT_WRITE, (GInputFunction) sig_sendbuffer, rec);
(GInputFunction) sig_sendbuffer, rec);
} }
return buffer_add(rec, data, size) ? 0 : -1; return buffer_add(rec, data, size) ? 0 : -1;

View File

@ -39,7 +39,7 @@ union sockaddr_union {
#define SIZEOF_SOCKADDR(so) ((so).sa.sa_family == AF_INET6 ? \ #define SIZEOF_SOCKADDR(so) ((so).sa.sa_family == AF_INET6 ? \
sizeof(so.sin6) : sizeof(so.sin)) sizeof(so.sin6) : sizeof(so.sin))
GIOChannel *g_io_channel_new(int handle) GIOChannel *i_io_channel_new(int handle)
{ {
GIOChannel *chan; GIOChannel *chan;
chan = g_io_channel_unix_new(handle); chan = g_io_channel_unix_new(handle);
@ -48,7 +48,7 @@ GIOChannel *g_io_channel_new(int handle)
return chan; return chan;
} }
int g_io_channel_write_block(GIOChannel *channel, void *data, int len) int i_io_channel_write_block(GIOChannel *channel, void *data, int len)
{ {
gsize ret; gsize ret;
int sent; int sent;
@ -63,7 +63,7 @@ int g_io_channel_write_block(GIOChannel *channel, void *data, int len)
return sent < len ? -1 : 0; return sent < len ? -1 : 0;
} }
int g_io_channel_read_block(GIOChannel *channel, void *data, int len) int i_io_channel_read_block(GIOChannel *channel, void *data, int len)
{ {
time_t maxwait; time_t maxwait;
gsize ret; gsize ret;
@ -211,7 +211,7 @@ GIOChannel *net_connect_ip(IPADDR *ip, int port, IPADDR *my_ip)
if (handle == -1) if (handle == -1)
return (NULL); return (NULL);
return g_io_channel_new(handle); return i_io_channel_new(handle);
} }
/* Connect to named UNIX socket */ /* Connect to named UNIX socket */
@ -242,7 +242,7 @@ GIOChannel *net_connect_unix(const char *path)
return NULL; return NULL;
} }
return g_io_channel_new(handle); return i_io_channel_new(handle);
} }
/* Disconnect socket */ /* Disconnect socket */
@ -298,7 +298,7 @@ GIOChannel *net_listen(IPADDR *my_ip, int *port)
/* start listening */ /* start listening */
if (listen(handle, 1) >= 0) if (listen(handle, 1) >= 0)
return g_io_channel_new(handle); return i_io_channel_new(handle);
} }
} }
@ -327,7 +327,7 @@ GIOChannel *net_accept(GIOChannel *handle, IPADDR *addr, int *port)
if (port != NULL) *port = sin_get_port(&so); if (port != NULL) *port = sin_get_port(&so);
fcntl(ret, F_SETFL, O_NONBLOCK); fcntl(ret, F_SETFL, O_NONBLOCK);
return g_io_channel_new(ret); return i_io_channel_new(ret);
} }
/* Read data from socket, return number of bytes read, -1 = error */ /* Read data from socket, return number of bytes read, -1 = error */

View File

@ -31,13 +31,13 @@ struct _IPADDR {
extern IPADDR ip4_any; extern IPADDR ip4_any;
GIOChannel *g_io_channel_new(int handle); GIOChannel *i_io_channel_new(int handle);
/* Returns 1 if IPADDRs are the same. */ /* Returns 1 if IPADDRs are the same. */
/* Deprecated since it is unused. It will be deleted in a later release. */ /* Deprecated since it is unused. It will be deleted in a later release. */
int net_ip_compare(IPADDR *ip1, IPADDR *ip2) G_GNUC_DEPRECATED; int net_ip_compare(IPADDR *ip1, IPADDR *ip2) G_GNUC_DEPRECATED;
int g_io_channel_write_block(GIOChannel *channel, void *data, int len); int i_io_channel_write_block(GIOChannel *channel, void *data, int len);
int g_io_channel_read_block(GIOChannel *channel, void *data, int len); int i_io_channel_read_block(GIOChannel *channel, void *data, int len);
int net_connect_ip_handle(const IPADDR *ip, int port, const IPADDR *my_ip); int net_connect_ip_handle(const IPADDR *ip, int port, const IPADDR *my_ip);

View File

@ -456,8 +456,7 @@ static void sig_channel_created(CHANNEL_REC *channel)
{ {
g_return_if_fail(IS_CHANNEL(channel)); g_return_if_fail(IS_CHANNEL(channel));
channel->nicks = g_hash_table_new((GHashFunc) g_istr_hash, channel->nicks = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
(GCompareFunc) g_istr_equal);
} }
static void nicklist_remove_hash(gpointer key, NICK_REC *nick, static void nicklist_remove_hash(gpointer key, NICK_REC *nick,

View File

@ -184,10 +184,9 @@ static void server_connect_callback_init_ssl(SERVER_REC *server, GIOChannel *han
if (error & 1) { if (error & 1) {
if (server->connect_tag != -1) if (server->connect_tag != -1)
g_source_remove(server->connect_tag); g_source_remove(server->connect_tag);
server->connect_tag = g_input_add(handle, error == 1 ? G_INPUT_READ : G_INPUT_WRITE, server->connect_tag =
(GInputFunction) i_input_add(handle, error == 1 ? I_INPUT_READ : I_INPUT_WRITE,
server_connect_callback_init_ssl, (GInputFunction) server_connect_callback_init_ssl, server);
server);
return; return;
} }
@ -253,11 +252,9 @@ static void server_real_connect(SERVER_REC *server, IPADDR *ip,
if (server->connrec->use_tls) if (server->connrec->use_tls)
server_connect_callback_init_ssl(server, handle); server_connect_callback_init_ssl(server, handle);
else else
server->connect_tag = server->connect_tag =
g_input_add(handle, G_INPUT_WRITE | G_INPUT_READ, i_input_add(handle, I_INPUT_WRITE | I_INPUT_READ,
(GInputFunction) (GInputFunction) server_connect_callback_init, server);
server_connect_callback_init,
server);
} }
} }
@ -409,8 +406,8 @@ int server_start_connect(SERVER_REC *server)
return FALSE; return FALSE;
} }
server->connect_pipe[0] = g_io_channel_new(fd[0]); server->connect_pipe[0] = i_io_channel_new(fd[0]);
server->connect_pipe[1] = g_io_channel_new(fd[1]); server->connect_pipe[1] = i_io_channel_new(fd[1]);
connect_address = server->connrec->proxy != NULL ? connect_address = server->connrec->proxy != NULL ?
server->connrec->proxy : server->connrec->address; server->connrec->proxy : server->connrec->address;
@ -418,10 +415,8 @@ int server_start_connect(SERVER_REC *server)
net_gethostbyname_nonblock(connect_address, net_gethostbyname_nonblock(connect_address,
server->connect_pipe[1], 0); server->connect_pipe[1], 0);
server->connect_tag = server->connect_tag =
g_input_add(server->connect_pipe[0], G_INPUT_READ, i_input_add(server->connect_pipe[0], I_INPUT_READ,
(GInputFunction) (GInputFunction) server_connect_callback_readpipe, server);
server_connect_callback_readpipe,
server);
server->connect_time = time(NULL); server->connect_time = time(NULL);
lookup_servers = g_slist_append(lookup_servers, server); lookup_servers = g_slist_append(lookup_servers, server);

View File

@ -262,7 +262,7 @@ static void session_restore_server(CONFIG_NODE *node)
chatnet, password, nick); chatnet, password, nick);
if (conn != NULL) { if (conn != NULL) {
conn->reconnection = TRUE; conn->reconnection = TRUE;
conn->connect_handle = g_io_channel_new(handle); conn->connect_handle = i_io_channel_new(handle);
server = proto->server_init_connect(conn); server = proto->server_init_connect(conn);
server->version = g_strdup(config_node_get_str(node, "version", NULL)); server->version = g_strdup(config_node_get_str(node, "version", NULL));

View File

@ -613,9 +613,8 @@ void settings_check_module(const char *module)
} }
} }
if (count > 0) { if (count > 0) {
if (gslist_find_icase_string(last_invalid_modules, if (i_slist_find_icase_string(last_invalid_modules, module) == NULL) {
module) == NULL) { /* mark this module having invalid settings */
/* mark this module having invalid settings */
last_invalid_modules = last_invalid_modules =
g_slist_append(last_invalid_modules, g_slist_append(last_invalid_modules,
g_strdup(module)); g_strdup(module));
@ -876,8 +875,7 @@ static int sig_autosave(void)
void settings_init(void) void settings_init(void)
{ {
settings = g_hash_table_new((GHashFunc) g_istr_hash, settings = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
(GCompareFunc) g_istr_equal);
last_errors = NULL; last_errors = NULL;
last_invalid_modules = NULL; last_invalid_modules = NULL;

View File

@ -425,7 +425,8 @@ static GList *completion_get_settings(const char *key, SettingType type)
SETTINGS_REC *rec = tmp->data; SETTINGS_REC *rec = tmp->data;
if ((type == SETTING_TYPE_ANY || rec->type == type) && g_ascii_strncasecmp(rec->key, key, len) == 0) if ((type == SETTING_TYPE_ANY || rec->type == type) && g_ascii_strncasecmp(rec->key, key, len) == 0)
complist = g_list_insert_sorted(complist, g_strdup(rec->key), (GCompareFunc) g_istr_cmp); complist = g_list_insert_sorted(complist, g_strdup(rec->key),
(GCompareFunc) i_istr_cmp);
} }
g_slist_free(sets); g_slist_free(sets);
return complist; return complist;
@ -460,7 +461,8 @@ static GList *completion_get_aliases(const char *alias, char cmdchar)
be appended after command completions and kept in be appended after command completions and kept in
uppercase to show it's an alias */ uppercase to show it's an alias */
if (glist_find_icase_string(complist, word) == NULL) if (glist_find_icase_string(complist, word) == NULL)
complist = g_list_insert_sorted(complist, word, (GCompareFunc) g_istr_cmp); complist =
g_list_insert_sorted(complist, word, (GCompareFunc) i_istr_cmp);
else else
g_free(word); g_free(word);
} }
@ -489,7 +491,8 @@ static GList *completion_get_commands(const char *cmd, char cmdchar)
word = cmdchar == '\0' ? g_strdup(rec->cmd) : word = cmdchar == '\0' ? g_strdup(rec->cmd) :
g_strdup_printf("%c%s", cmdchar, rec->cmd); g_strdup_printf("%c%s", cmdchar, rec->cmd);
if (glist_find_icase_string(complist, word) == NULL) if (glist_find_icase_string(complist, word) == NULL)
complist = g_list_insert_sorted(complist, word, (GCompareFunc) g_istr_cmp); complist =
g_list_insert_sorted(complist, word, (GCompareFunc) i_istr_cmp);
else else
g_free(word); g_free(word);
} }
@ -523,7 +526,8 @@ static GList *completion_get_subcommands(const char *cmd)
continue; continue;
if (g_ascii_strncasecmp(rec->cmd, cmd, len) == 0) if (g_ascii_strncasecmp(rec->cmd, cmd, len) == 0)
complist = g_list_insert_sorted(complist, g_strdup(rec->cmd+skip), (GCompareFunc) g_istr_cmp); complist = g_list_insert_sorted(complist, g_strdup(rec->cmd + skip),
(GCompareFunc) i_istr_cmp);
} }
return complist; return complist;
} }

View File

@ -254,8 +254,7 @@ void fe_common_core_deinit(void)
signal_remove("channel destroyed", (SIGNAL_FUNC) sig_channel_destroyed); signal_remove("channel destroyed", (SIGNAL_FUNC) sig_channel_destroyed);
} }
void glog_func(const char *log_domain, GLogLevelFlags log_level, void i_log_func(const char *log_domain, GLogLevelFlags log_level, const char *message)
const char *message)
{ {
const char *reason; const char *reason;
@ -357,7 +356,7 @@ static void autoconnect_servers(void)
if (rec->autoconnect && if (rec->autoconnect &&
(rec->chatnet == NULL || (rec->chatnet == NULL ||
gslist_find_icase_string(chatnets, rec->chatnet) == NULL)) { i_slist_find_icase_string(chatnets, rec->chatnet) == NULL)) {
if (rec->chatnet != NULL) { if (rec->chatnet != NULL) {
chatnets = g_slist_append(chatnets, rec->chatnet); chatnets = g_slist_append(chatnets, rec->chatnet);
str = g_strdup_printf("-network %s %s %d", rec->chatnet, rec->address, rec->port); str = g_strdup_printf("-network %s %s %d", rec->chatnet, rec->address, rec->port);
@ -459,7 +458,7 @@ void fe_common_core_finish_init(void)
signal_add_first("setup changed", (SIGNAL_FUNC) sig_setup_changed); signal_add_first("setup changed", (SIGNAL_FUNC) sig_setup_changed);
/* _after_ windows are created.. */ /* _after_ windows are created.. */
g_log_set_default_handler((GLogFunc) glog_func, NULL); g_log_set_default_handler((GLogFunc) i_log_func, NULL);
if (setup_changed) if (setup_changed)
signal_emit("setup changed", 0); signal_emit("setup changed", 0);

View File

@ -302,9 +302,9 @@ static void process_exec(PROCESS_REC *rec, const char *cmd)
if (rec->pid != 0) { if (rec->pid != 0) {
/* parent process */ /* parent process */
GIOChannel *outio = g_io_channel_new(in[1]); GIOChannel *outio = i_io_channel_new(in[1]);
rec->in = g_io_channel_new(out[0]); rec->in = i_io_channel_new(out[0]);
rec->out = net_sendbuffer_create(outio, 0); rec->out = net_sendbuffer_create(outio, 0);
close(out[1]); close(out[1]);
@ -524,9 +524,8 @@ static void handle_exec(const char *args, GHashTable *optlist,
level = g_hash_table_lookup(optlist, "level"); level = g_hash_table_lookup(optlist, "level");
rec->level = level == NULL ? MSGLEVEL_CLIENTCRAP : level2bits(level, NULL); rec->level = level == NULL ? MSGLEVEL_CLIENTCRAP : level2bits(level, NULL);
rec->read_tag = g_input_add(rec->in, G_INPUT_READ, rec->read_tag =
(GInputFunction) sig_exec_input_reader, i_input_add(rec->in, I_INPUT_READ, (GInputFunction) sig_exec_input_reader, rec);
rec);
processes = g_slist_append(processes, rec); processes = g_slist_append(processes, rec);
if (rec->target == NULL && interactive) if (rec->target == NULL && interactive)

View File

@ -774,7 +774,7 @@ static void sig_channel_joined(CHANNEL_REC *channel)
} }
} }
static void g_hash_free_value(void *key, void *value) static void i_hash_free_value(void *key, void *value)
{ {
g_free(value); g_free(value);
} }
@ -825,7 +825,7 @@ void fe_messages_init(void)
void fe_messages_deinit(void) void fe_messages_deinit(void)
{ {
g_hash_table_foreach(printnicks, (GHFunc) g_hash_free_value, NULL); g_hash_table_foreach(printnicks, (GHFunc) i_hash_free_value, NULL);
g_hash_table_destroy(printnicks); g_hash_table_destroy(printnicks);
signal_remove("message public", (SIGNAL_FUNC) sig_message_public); signal_remove("message public", (SIGNAL_FUNC) sig_message_public);

View File

@ -56,8 +56,7 @@ THEME_REC *theme_create(const char *path, const char *name)
rec->name = g_strdup(name); rec->name = g_strdup(name);
rec->abstracts = g_hash_table_new((GHashFunc) g_str_hash, rec->abstracts = g_hash_table_new((GHashFunc) g_str_hash,
(GCompareFunc) g_str_equal); (GCompareFunc) g_str_equal);
rec->modules = g_hash_table_new((GHashFunc) g_istr_hash, rec->modules = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
(GCompareFunc) g_istr_equal);
themes = g_slist_append(themes, rec); themes = g_slist_append(themes, rec);
signal_emit("theme created", 1, rec); signal_emit("theme created", 1, rec);

View File

@ -84,7 +84,7 @@ static void print_mode(MODE_REC *rec)
tmp = modes; modes = NULL; tmp = modes; modes = NULL;
nicks = gslist_to_string(rec->nicks, ", "); nicks = i_slist_to_string(rec->nicks, ", ");
printformat(rec->channel->server, rec->channel->visible_name, rec->level, printformat(rec->channel->server, rec->channel->visible_name, rec->level,
IRCTXT_CHANMODE_CHANGE, rec->channel->visible_name, rec->mode, nicks, ""); IRCTXT_CHANMODE_CHANGE, rec->channel->visible_name, rec->mode, nicks, "");
g_free(nicks); g_free(nicks);

View File

@ -176,8 +176,7 @@ static void print_netjoins(NETJOIN_SERVER_REC *server, const char *filter_channe
/* save nicks to string, clear now_channels and remove the same /* save nicks to string, clear now_channels and remove the same
channels from old_channels list */ channels from old_channels list */
channels = g_hash_table_new((GHashFunc) g_istr_hash, channels = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
(GCompareFunc) g_istr_equal);
for (tmp = server->netjoins; tmp != NULL; tmp = next) { for (tmp = server->netjoins; tmp != NULL; tmp = next) {
NETJOIN_REC *rec = tmp->data; NETJOIN_REC *rec = tmp->data;
@ -213,8 +212,7 @@ static void print_netjoins(NETJOIN_SERVER_REC *server, const char *filter_channe
} }
/* remove the channel from old_channels too */ /* remove the channel from old_channels too */
old = gslist_find_icase_string(rec->old_channels, old = i_slist_find_icase_string(rec->old_channels, realchannel);
realchannel);
if (old != NULL) { if (old != NULL) {
void *data = old->data; void *data = old->data;
rec->old_channels = rec->old_channels =
@ -341,7 +339,7 @@ static void msg_join(IRC_SERVER_REC *server, const char *channel,
/* if this was not a channel they split from, treat it normally */ /* if this was not a channel they split from, treat it normally */
if (netjoin != NULL) { if (netjoin != NULL) {
if (!gslist_find_icase_string(netjoin->old_channels, channel)) if (!i_slist_find_icase_string(netjoin->old_channels, channel))
return; return;
} else { } else {
channels = split->channels; channels = split->channels;

View File

@ -46,7 +46,7 @@ static GSList *mask_add_once(GSList *list, const char *mask)
str = ptr == NULL ? g_strdup(mask) : str = ptr == NULL ? g_strdup(mask) :
g_strndup(mask, (int) (ptr-mask)); g_strndup(mask, (int) (ptr-mask));
if (gslist_find_icase_string(list, str) == NULL) if (i_slist_find_icase_string(list, str) == NULL)
return g_slist_append(list, str); return g_slist_append(list, str);
g_free(str); g_free(str);

View File

@ -102,8 +102,7 @@ void event_connected(IRC_SERVER_REC *server, const char *data, const char *from)
void irc_server_init_bare_minimum(IRC_SERVER_REC *server) { void irc_server_init_bare_minimum(IRC_SERVER_REC *server) {
server->rawlog = rawlog_create(); server->rawlog = rawlog_create();
server->isupport = g_hash_table_new((GHashFunc) g_istr_hash, server->isupport = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
(GCompareFunc) g_istr_equal);
/* set the standards */ /* set the standards */
g_hash_table_insert(server->isupport, g_strdup("CHANMODES"), g_strdup("beI,k,l,imnpst")); g_hash_table_insert(server->isupport, g_strdup("CHANMODES"), g_strdup("beI,k,l,imnpst"));

View File

@ -85,9 +85,8 @@ static void sig_input(void);
void input_listen_init(int handle) void input_listen_init(int handle)
{ {
readtag = g_input_add_poll(handle, readtag = i_input_add_poll(handle, G_PRIORITY_HIGH, I_INPUT_READ,
G_PRIORITY_HIGH, G_INPUT_READ, (GInputFunction) sig_input, NULL);
(GInputFunction) sig_input, NULL);
} }
void input_listen_deinit(void) void input_listen_deinit(void)

View File

@ -1376,12 +1376,6 @@ void textbuffer_view_remove_lines_by_level(TEXT_BUFFER_VIEW_REC *view, int level
term_refresh_thaw(); term_refresh_thaw();
} }
static int g_free_true(void *data)
{
g_free(data);
return TRUE;
}
/* Remove all lines from buffer. */ /* Remove all lines from buffer. */
void textbuffer_view_remove_all_lines(TEXT_BUFFER_VIEW_REC *view) void textbuffer_view_remove_all_lines(TEXT_BUFFER_VIEW_REC *view)
{ {
@ -1389,8 +1383,8 @@ void textbuffer_view_remove_all_lines(TEXT_BUFFER_VIEW_REC *view)
textbuffer_remove_all_lines(view->buffer); textbuffer_remove_all_lines(view->buffer);
g_hash_table_foreach_remove(view->bookmarks, g_hash_table_foreach(view->bookmarks, (GHFunc) g_free, NULL);
(GHRFunc) g_free_true, NULL); g_hash_table_remove_all(view->bookmarks);
textbuffer_view_reset_cache(view); textbuffer_view_reset_cache(view);
textbuffer_view_clear(view); textbuffer_view_clear(view);

View File

@ -31,19 +31,18 @@ int irc_cap_toggle (IRC_SERVER_REC *server, char *cap, int enable)
/* If the negotiation hasn't been completed yet just queue the requests */ /* If the negotiation hasn't been completed yet just queue the requests */
if (!server->cap_complete) { if (!server->cap_complete) {
if (enable && !gslist_find_string(server->cap_queue, cap)) { if (enable && !i_slist_find_string(server->cap_queue, cap)) {
server->cap_queue = g_slist_prepend(server->cap_queue, g_strdup(cap)); server->cap_queue = g_slist_prepend(server->cap_queue, g_strdup(cap));
return TRUE; return TRUE;
} } else if (!enable && i_slist_find_string(server->cap_queue, cap)) {
else if (!enable && gslist_find_string(server->cap_queue, cap)) { server->cap_queue = i_slist_delete_string(server->cap_queue, cap, g_free);
server->cap_queue = gslist_delete_string(server->cap_queue, cap, g_free);
return TRUE; return TRUE;
} }
return FALSE; return FALSE;
} }
if (enable && !gslist_find_string(server->cap_active, cap)) { if (enable && !i_slist_find_string(server->cap_active, cap)) {
/* Make sure the required cap is supported by the server */ /* Make sure the required cap is supported by the server */
if (!g_hash_table_lookup_extended(server->cap_supported, cap, NULL, NULL)) if (!g_hash_table_lookup_extended(server->cap_supported, cap, NULL, NULL))
return FALSE; return FALSE;
@ -51,8 +50,7 @@ int irc_cap_toggle (IRC_SERVER_REC *server, char *cap, int enable)
signal_emit("server cap req", 2, server, cap); signal_emit("server cap req", 2, server, cap);
irc_send_cmdv(server, "CAP REQ %s", cap); irc_send_cmdv(server, "CAP REQ %s", cap);
return TRUE; return TRUE;
} } else if (!enable && i_slist_find_string(server->cap_active, cap)) {
else if (!enable && gslist_find_string(server->cap_active, cap)) {
char *negcap = g_strdup_printf("-%s", cap); char *negcap = g_strdup_printf("-%s", cap);
signal_emit("server cap req", 2, server, negcap); signal_emit("server cap req", 2, server, negcap);
@ -200,7 +198,7 @@ static void event_cap (IRC_SERVER_REC *server, char *args, char *nick, char *add
} }
/* Clear the queue here */ /* Clear the queue here */
gslist_free_full(server->cap_queue, (GDestroyNotify) g_free); i_slist_free_full(server->cap_queue, (GDestroyNotify) g_free);
server->cap_queue = NULL; server->cap_queue = NULL;
/* If the server doesn't support any cap we requested close the negotiation here */ /* If the server doesn't support any cap we requested close the negotiation here */
@ -223,8 +221,9 @@ static void event_cap (IRC_SERVER_REC *server, char *args, char *nick, char *add
disable = (*caps[i] == '-'); disable = (*caps[i] == '-');
if (disable) if (disable)
server->cap_active = gslist_delete_string(server->cap_active, caps[i] + 1, g_free); server->cap_active =
else if (!gslist_find_string(server->cap_active, caps[i])) i_slist_delete_string(server->cap_active, caps[i] + 1, g_free);
else if (!i_slist_find_string(server->cap_active, caps[i]))
server->cap_active = g_slist_prepend(server->cap_active, g_strdup(caps[i])); server->cap_active = g_slist_prepend(server->cap_active, g_strdup(caps[i]));
if (!strcmp(caps[i], "sasl")) if (!strcmp(caps[i], "sasl"))
@ -273,7 +272,7 @@ static void event_cap (IRC_SERVER_REC *server, char *args, char *nick, char *add
cap_emit_signal(server, "delete", key); cap_emit_signal(server, "delete", key);
/* The server removed this CAP, remove it from the list /* The server removed this CAP, remove it from the list
* of the active ones if we had requested it */ * of the active ones if we had requested it */
server->cap_active = gslist_delete_string(server->cap_active, key, g_free); server->cap_active = i_slist_delete_string(server->cap_active, key, g_free);
/* We don't transfer the ownership of those two /* We don't transfer the ownership of those two
* variables this time, just free them when we're done. */ * variables this time, just free them when we're done. */
g_free(key); g_free(key);

View File

@ -283,8 +283,7 @@ static void server_init(IRC_SERVER_REC *server)
g_free(cmd); g_free(cmd);
} }
server->isupport = g_hash_table_new((GHashFunc) g_istr_hash, server->isupport = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
(GCompareFunc) g_istr_equal);
/* set the standards */ /* set the standards */
g_hash_table_insert(server->isupport, g_strdup("CHANMODES"), g_strdup("beI,k,l,imnpst")); g_hash_table_insert(server->isupport, g_strdup("CHANMODES"), g_strdup("beI,k,l,imnpst"));
@ -417,10 +416,9 @@ static void sig_connected(IRC_SERVER_REC *server)
(QUERY_REC *(*)(SERVER_REC *, const char *)) irc_query_find; (QUERY_REC *(*)(SERVER_REC *, const char *)) irc_query_find;
server->nick_comp_func = irc_nickcmp_rfc1459; server->nick_comp_func = irc_nickcmp_rfc1459;
server->splits = g_hash_table_new((GHashFunc) g_istr_hash, server->splits = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
(GCompareFunc) g_istr_equal);
if (!server->session_reconnect) if (!server->session_reconnect)
server_init(server); server_init(server);
} }
@ -445,7 +443,7 @@ static void sig_destroyed(IRC_SERVER_REC *server)
g_slist_free(server->cmdqueue); g_slist_free(server->cmdqueue);
server->cmdqueue = NULL; server->cmdqueue = NULL;
gslist_free_full(server->cap_active, (GDestroyNotify) g_free); i_slist_free_full(server->cap_active, (GDestroyNotify) g_free);
server->cap_active = NULL; server->cap_active = NULL;
if (server->cap_supported) { if (server->cap_supported) {
@ -453,7 +451,7 @@ static void sig_destroyed(IRC_SERVER_REC *server)
server->cap_supported = NULL; server->cap_supported = NULL;
} }
gslist_free_full(server->cap_queue, (GDestroyNotify) g_free); i_slist_free_full(server->cap_queue, (GDestroyNotify) g_free);
server->cap_queue = NULL; server->cap_queue = NULL;
/* was g_free_and_null, but can't use on a GString */ /* was g_free_and_null, but can't use on a GString */

View File

@ -106,8 +106,8 @@ static void sig_session_restore_server(IRC_SERVER_REC *server,
server->connrec->sasl_password = g_strdup(config_node_get_str(node, "sasl_password", NULL)); server->connrec->sasl_password = g_strdup(config_node_get_str(node, "sasl_password", NULL));
if (server->isupport == NULL) { if (server->isupport == NULL) {
server->isupport = g_hash_table_new((GHashFunc) g_istr_hash, server->isupport =
(GCompareFunc) g_istr_equal); g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
} }
node = config_node_section(NULL, node, "isupport", -1); node = config_node_section(NULL, node, "isupport", -1);

View File

@ -491,10 +491,8 @@ static void irc_init_server(IRC_SERVER_REC *server)
if (!IS_IRC_SERVER(server)) if (!IS_IRC_SERVER(server))
return; return;
server->readtag = server->readtag = i_input_add(net_sendbuffer_handle(server->handle), I_INPUT_READ,
g_input_add(net_sendbuffer_handle(server->handle), (GInputFunction) irc_parse_incoming, server);
G_INPUT_READ,
(GInputFunction) irc_parse_incoming, server);
} }
void irc_irc_init(void) void irc_irc_init(void)

View File

@ -219,7 +219,7 @@ static char *signal_list_move(GSList **signals, const char *event)
GSList *link; GSList *link;
char *linkevent, *linksignal; char *linkevent, *linksignal;
link = gslist_find_string(*signals, event); link = i_slist_find_string(*signals, event);
if (link == NULL) if (link == NULL)
return NULL; return NULL;

View File

@ -355,8 +355,7 @@ static void dcc_chat_listen(CHAT_DCC_REC *dcc)
memcpy(&dcc->addr, &ip, sizeof(IPADDR)); memcpy(&dcc->addr, &ip, sizeof(IPADDR));
net_ip2host(&dcc->addr, dcc->addrstr); net_ip2host(&dcc->addr, dcc->addrstr);
dcc->port = port; dcc->port = port;
dcc->tagread = g_input_add(handle, G_INPUT_READ, dcc->tagread = i_input_add(handle, I_INPUT_READ, (GInputFunction) dcc_chat_input, dcc);
(GInputFunction) dcc_chat_input, dcc);
signal_emit("dcc connected", 1, dcc); signal_emit("dcc connected", 1, dcc);
} }
@ -379,8 +378,7 @@ static void sig_chat_connected(CHAT_DCC_REC *dcc)
dcc->starttime = time(NULL); dcc->starttime = time(NULL);
dcc->sendbuf = net_sendbuffer_create(dcc->handle, 0); dcc->sendbuf = net_sendbuffer_create(dcc->handle, 0);
dcc->tagread = g_input_add(dcc->handle, G_INPUT_READ, dcc->tagread = i_input_add(dcc->handle, I_INPUT_READ, (GInputFunction) dcc_chat_input, dcc);
(GInputFunction) dcc_chat_input, dcc);
signal_emit("dcc connected", 1, dcc); signal_emit("dcc connected", 1, dcc);
} }
@ -397,9 +395,8 @@ static void dcc_chat_connect(CHAT_DCC_REC *dcc)
dcc->handle = dcc_connect_ip(&dcc->addr, dcc->port); dcc->handle = dcc_connect_ip(&dcc->addr, dcc->port);
if (dcc->handle != NULL) { if (dcc->handle != NULL) {
dcc->tagconn = g_input_add(dcc->handle, dcc->tagconn = i_input_add(dcc->handle, I_INPUT_WRITE | I_INPUT_READ,
G_INPUT_WRITE | G_INPUT_READ, (GInputFunction) sig_chat_connected, dcc);
(GInputFunction) sig_chat_connected, dcc);
} else { } else {
/* error connecting */ /* error connecting */
signal_emit("dcc error connect", 1, dcc); signal_emit("dcc error connect", 1, dcc);
@ -428,8 +425,8 @@ static void dcc_chat_passive(CHAT_DCC_REC *dcc)
cmd_return_error(CMDERR_ERRNO); cmd_return_error(CMDERR_ERRNO);
dcc->handle = handle; dcc->handle = handle;
dcc->tagconn = g_input_add(dcc->handle, G_INPUT_READ, dcc->tagconn =
(GInputFunction) dcc_chat_listen, dcc); i_input_add(dcc->handle, I_INPUT_READ, (GInputFunction) dcc_chat_listen, dcc);
/* Let's send the reply to the other client! */ /* Let's send the reply to the other client! */
dcc_ip2str(&own_ip, host); dcc_ip2str(&own_ip, host);
@ -508,8 +505,7 @@ static void cmd_dcc_chat(const char *data, IRC_SERVER_REC *server)
dcc->handle = handle; dcc->handle = handle;
dcc->tagconn = dcc->tagconn =
g_input_add(dcc->handle, G_INPUT_READ, i_input_add(dcc->handle, I_INPUT_READ, (GInputFunction) dcc_chat_listen, dcc);
(GInputFunction) dcc_chat_listen, dcc);
/* send the chat request */ /* send the chat request */
signal_emit("dcc request send", 1, dcc); signal_emit("dcc request send", 1, dcc);

View File

@ -112,9 +112,8 @@ void dcc_get_send_received(GET_DCC_REC *dcc)
last 1-3 bytes should be sent later. these happen probably last 1-3 bytes should be sent later. these happen probably
never, but I just want to do it right.. :) */ never, but I just want to do it right.. :) */
if (dcc->tagwrite == -1) { if (dcc->tagwrite == -1) {
dcc->tagwrite = g_input_add(dcc->handle, G_INPUT_WRITE, dcc->tagwrite =
(GInputFunction) sig_dccget_send, i_input_add(dcc->handle, I_INPUT_WRITE, (GInputFunction) sig_dccget_send, dcc);
dcc);
} }
} }
@ -285,8 +284,8 @@ void sig_dccget_connected(GET_DCC_REC *dcc)
dcc_close(DCC(dcc)); dcc_close(DCC(dcc));
return; return;
} }
dcc->tagread = g_input_add(dcc->handle, G_INPUT_READ, dcc->tagread =
(GInputFunction) sig_dccget_receive, dcc); i_input_add(dcc->handle, I_INPUT_READ, (GInputFunction) sig_dccget_receive, dcc);
signal_emit("dcc connected", 1, dcc); signal_emit("dcc connected", 1, dcc);
if (dcc->from_dccserver) { if (dcc->from_dccserver) {
@ -311,11 +310,8 @@ void dcc_get_connect(GET_DCC_REC *dcc)
dcc->handle = dcc_connect_ip(&dcc->addr, dcc->port); dcc->handle = dcc_connect_ip(&dcc->addr, dcc->port);
if (dcc->handle != NULL) { if (dcc->handle != NULL) {
dcc->tagconn = dcc->tagconn = i_input_add(dcc->handle, I_INPUT_WRITE | I_INPUT_READ,
g_input_add(dcc->handle, (GInputFunction) sig_dccget_connected, dcc);
G_INPUT_WRITE | G_INPUT_READ,
(GInputFunction) sig_dccget_connected,
dcc);
} else { } else {
/* error connecting */ /* error connecting */
signal_emit("dcc error connect", 1, dcc); signal_emit("dcc error connect", 1, dcc);
@ -344,8 +340,8 @@ static void dcc_get_listen(GET_DCC_REC *dcc)
net_ip2host(&dcc->addr, dcc->addrstr); net_ip2host(&dcc->addr, dcc->addrstr);
dcc->port = port; dcc->port = port;
dcc->tagconn = g_input_add(handle, G_INPUT_READ | G_INPUT_WRITE, dcc->tagconn = i_input_add(handle, I_INPUT_READ | I_INPUT_WRITE,
(GInputFunction) sig_dccget_connected, dcc); (GInputFunction) sig_dccget_connected, dcc);
} }
void dcc_get_passive(GET_DCC_REC *dcc) void dcc_get_passive(GET_DCC_REC *dcc)
@ -361,8 +357,7 @@ void dcc_get_passive(GET_DCC_REC *dcc)
cmd_return_error(CMDERR_ERRNO); cmd_return_error(CMDERR_ERRNO);
dcc->handle = handle; dcc->handle = handle;
dcc->tagconn = g_input_add(dcc->handle, G_INPUT_READ, dcc->tagconn = i_input_add(dcc->handle, I_INPUT_READ, (GInputFunction) dcc_get_listen, dcc);
(GInputFunction) dcc_get_listen, dcc);
/* Let's send the reply to the other client! */ /* Let's send the reply to the other client! */
dcc_ip2str(&own_ip, host); dcc_ip2str(&own_ip, host);

View File

@ -336,10 +336,8 @@ static void dcc_send_connected(SEND_DCC_REC *dcc)
net_ip2host(&dcc->addr, dcc->addrstr); net_ip2host(&dcc->addr, dcc->addrstr);
dcc->port = port; dcc->port = port;
dcc->tagread = g_input_add(handle, G_INPUT_READ, dcc->tagread = i_input_add(handle, I_INPUT_READ, (GInputFunction) dcc_send_read_size, dcc);
(GInputFunction) dcc_send_read_size, dcc); dcc->tagwrite = i_input_add(handle, I_INPUT_WRITE, (GInputFunction) dcc_send_data, dcc);
dcc->tagwrite = g_input_add(handle, G_INPUT_WRITE,
(GInputFunction) dcc_send_data, dcc);
signal_emit("dcc connected", 1, dcc); signal_emit("dcc connected", 1, dcc);
} }
@ -352,12 +350,10 @@ static void dcc_send_connect(SEND_DCC_REC *dcc)
if (dcc->handle != NULL) { if (dcc->handle != NULL) {
dcc->starttime = time(NULL); dcc->starttime = time(NULL);
dcc->tagread = g_input_add(dcc->handle, G_INPUT_READ, dcc->tagread = i_input_add(dcc->handle, I_INPUT_READ,
(GInputFunction) dcc_send_read_size, (GInputFunction) dcc_send_read_size, dcc);
dcc); dcc->tagwrite =
dcc->tagwrite = g_input_add(dcc->handle, G_INPUT_WRITE, i_input_add(dcc->handle, I_INPUT_WRITE, (GInputFunction) dcc_send_data, dcc);
(GInputFunction) dcc_send_data,
dcc);
signal_emit("dcc connected", 1, dcc); signal_emit("dcc connected", 1, dcc);
} else { } else {
/* error connecting */ /* error connecting */
@ -436,9 +432,8 @@ static int dcc_send_one_file(int queue, const char *target, const char *fname,
dcc->queue = queue; dcc->queue = queue;
dcc->file_quoted = strchr(fname, ' ') != NULL; dcc->file_quoted = strchr(fname, ' ') != NULL;
if (!passive) { if (!passive) {
dcc->tagconn = g_input_add(handle, G_INPUT_READ, dcc->tagconn =
(GInputFunction) dcc_send_connected, i_input_add(handle, I_INPUT_READ, (GInputFunction) dcc_send_connected, dcc);
dcc);
} }
/* Generate an ID for this send if using passive protocol */ /* Generate an ID for this send if using passive protocol */

View File

@ -183,8 +183,8 @@ static void dcc_server_listen(SERVER_DCC_REC *dcc)
memcpy(&newdcc->addr, &ip, sizeof(IPADDR)); memcpy(&newdcc->addr, &ip, sizeof(IPADDR));
net_ip2host(&newdcc->addr, newdcc->addrstr); net_ip2host(&newdcc->addr, newdcc->addrstr);
newdcc->port = port; newdcc->port = port;
newdcc->tagread = g_input_add(handle, G_INPUT_READ, newdcc->tagread =
(GInputFunction) dcc_server_input, newdcc); i_input_add(handle, I_INPUT_READ, (GInputFunction) dcc_server_input, newdcc);
signal_emit("dcc connected", 1, newdcc); signal_emit("dcc connected", 1, newdcc);
} }
@ -210,8 +210,8 @@ static void dcc_server_msg(SERVER_DCC_REC *dcc, const char *msg)
memcpy(&dccchat->addr, &dcc->addr, sizeof(IPADDR)); memcpy(&dccchat->addr, &dcc->addr, sizeof(IPADDR));
net_ip2host(&dccchat->addr, dccchat->addrstr); net_ip2host(&dccchat->addr, dccchat->addrstr);
dccchat->port = dcc->port; dccchat->port = dcc->port;
dccchat->tagread = g_input_add(dccchat->handle, G_INPUT_READ, dccchat->tagread = i_input_add(dccchat->handle, I_INPUT_READ,
(GInputFunction) dcc_chat_input, dccchat); (GInputFunction) dcc_chat_input, dccchat);
dcc->connection_established = 1; dcc->connection_established = 1;
signal_emit("dcc connected", 1, dccchat); signal_emit("dcc connected", 1, dccchat);
@ -347,8 +347,8 @@ static void cmd_dcc_server(const char *data, IRC_SERVER_REC *server)
dcc = dcc_server_create(server, flags); dcc = dcc_server_create(server, flags);
dcc->handle = handle; dcc->handle = handle;
dcc->port = atoi(port); dcc->port = atoi(port);
dcc->tagconn = g_input_add(dcc->handle, G_INPUT_READ, dcc->tagconn =
(GInputFunction) dcc_server_listen, dcc); i_input_add(dcc->handle, I_INPUT_READ, (GInputFunction) dcc_server_listen, dcc);
signal_emit("dcc server started", 1, dcc); signal_emit("dcc server started", 1, dcc);

View File

@ -55,7 +55,7 @@ void dcc_unregister_type(const char *type)
{ {
GSList *pos; GSList *pos;
pos = gslist_find_string(dcc_types, type); pos = i_slist_find_string(dcc_types, type);
if (pos != NULL) { if (pos != NULL) {
void *tmp = pos->data; void *tmp = pos->data;
dcc_types = g_slist_remove(dcc_types, pos->data); dcc_types = g_slist_remove(dcc_types, pos->data);
@ -65,7 +65,7 @@ void dcc_unregister_type(const char *type)
int dcc_str2type(const char *str) int dcc_str2type(const char *str)
{ {
if (gslist_find_string(dcc_types, str) == NULL) if (i_slist_find_string(dcc_types, str) == NULL)
return -1; return -1;
return module_get_uniq_id_str("DCC", str); return module_get_uniq_id_str("DCC", str);

View File

@ -120,8 +120,7 @@ static void flood_init_server(IRC_SERVER_REC *server)
rec = g_new0(MODULE_SERVER_REC, 1); rec = g_new0(MODULE_SERVER_REC, 1);
MODULE_DATA_SET(server, rec); MODULE_DATA_SET(server, rec);
rec->floodlist = g_hash_table_new((GHashFunc) g_istr_hash, rec->floodlist = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
(GCompareFunc) g_istr_equal);
} }
static void flood_hash_destroy(const char *key, FLOOD_REC *flood) static void flood_hash_destroy(const char *key, FLOOD_REC *flood)

View File

@ -279,7 +279,7 @@ static void ison_check_parts(IRC_SERVER_REC *server)
NOTIFY_NICK_REC *rec = tmp->data; NOTIFY_NICK_REC *rec = tmp->data;
next = tmp->next; next = tmp->next;
if (gslist_find_icase_string(mserver->ison_tempusers, rec->nick) != NULL) if (i_slist_find_icase_string(mserver->ison_tempusers, rec->nick) != NULL)
continue; continue;
notifylist_left(server, rec); notifylist_left(server, rec);

View File

@ -74,7 +74,7 @@ static GIOChannel *net_listen_unix(const char *path)
goto error_unlink; goto error_unlink;
} }
return g_io_channel_new(handle); return i_io_channel_new(handle);
error_unlink: error_unlink:
unlink(sa.sun_path); unlink(sa.sun_path);
@ -99,7 +99,7 @@ static GIOChannel *net_accept_unix(GIOChannel *handle)
return NULL; return NULL;
fcntl(ret, F_SETFL, O_NONBLOCK); fcntl(ret, F_SETFL, O_NONBLOCK);
return g_io_channel_new(ret); return i_io_channel_new(ret);
} }
static void remove_client(CLIENT_REC *rec) static void remove_client(CLIENT_REC *rec)
@ -470,8 +470,7 @@ static void sig_listen(LISTEN_REC *listen)
rec->server = servers == NULL ? NULL : rec->server = servers == NULL ? NULL :
IRC_SERVER(server_find_chatnet(listen->ircnet)); IRC_SERVER(server_find_chatnet(listen->ircnet));
} }
rec->recv_tag = g_input_add(handle, G_INPUT_READ, rec->recv_tag = i_input_add(handle, I_INPUT_READ, (GInputFunction) sig_listen_client, rec);
(GInputFunction) sig_listen_client, rec);
proxy_clients = g_slist_prepend(proxy_clients, rec); proxy_clients = g_slist_prepend(proxy_clients, rec);
listen->clients = g_slist_prepend(listen->clients, rec); listen->clients = g_slist_prepend(listen->clients, rec);
@ -739,8 +738,7 @@ static void add_listen(const char *ircnet, int port, const char *port_or_path)
rec->port = port; rec->port = port;
rec->port_or_path = g_strdup(port_or_path); rec->port_or_path = g_strdup(port_or_path);
rec->tag = g_input_add(rec->handle, G_INPUT_READ, rec->tag = i_input_add(rec->handle, I_INPUT_READ, (GInputFunction) sig_listen, rec);
(GInputFunction) sig_listen, rec);
proxy_listens = g_slist_append(proxy_listens, rec); proxy_listens = g_slist_append(proxy_listens, rec);
} }

View File

@ -20,13 +20,13 @@
#include "module.h" #include "module.h"
static int g_istr_equal(gconstpointer v, gconstpointer v2) static int i_istr_equal(gconstpointer v, gconstpointer v2)
{ {
return g_ascii_strcasecmp((const char *) v, (const char *) v2) == 0; return g_ascii_strcasecmp((const char *) v, (const char *) v2) == 0;
} }
/* a char* hash function from ASU */ /* a char* hash function from ASU */
static unsigned int g_istr_hash(gconstpointer v) static unsigned int i_istr_hash(gconstpointer v)
{ {
const char *s = (const char *) v; const char *s = (const char *) v;
unsigned int h = 0, g; unsigned int h = 0, g;
@ -314,7 +314,7 @@ CONFIG_REC *config_open(const char *fname, int create_mode)
rec->create_mode = create_mode; rec->create_mode = create_mode;
rec->mainnode = g_new0(CONFIG_NODE, 1); rec->mainnode = g_new0(CONFIG_NODE, 1);
rec->mainnode->type = NODE_TYPE_BLOCK; rec->mainnode->type = NODE_TYPE_BLOCK;
rec->cache = g_hash_table_new((GHashFunc) g_istr_hash, (GCompareFunc) g_istr_equal); rec->cache = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
rec->cache_nodes = g_hash_table_new((GHashFunc) g_direct_hash, (GCompareFunc) g_direct_equal); rec->cache_nodes = g_hash_table_new((GHashFunc) g_direct_hash, (GCompareFunc) g_direct_equal);
return rec; return rec;

View File

@ -107,7 +107,7 @@ static void emit_event(GIOChannel *pipe, enum key_gen_status status, gcry_error_
event.status = status; event.status = status;
event.error = error; event.error = error;
g_io_channel_write_block(pipe, &event, sizeof(event)); i_io_channel_write_block(pipe, &event, sizeof(event));
} }
/* /*
@ -137,7 +137,7 @@ static void read_key_gen_status(struct key_gen_worker *worker, GIOChannel *pipe)
fcntl(g_io_channel_unix_get_fd(pipe), F_SETFL, O_NONBLOCK); fcntl(g_io_channel_unix_get_fd(pipe), F_SETFL, O_NONBLOCK);
if (g_io_channel_read_block(pipe, &event, sizeof(event)) == -1) { if (i_io_channel_read_block(pipe, &event, sizeof(event)) == -1) {
printformat(NULL, NULL, MSGLEVEL_CLIENTERROR, printformat(NULL, NULL, MSGLEVEL_CLIENTERROR,
TXT_OTR_KEYGEN_FAILED, TXT_OTR_KEYGEN_FAILED,
key_gen_state.account_name, key_gen_state.account_name,
@ -244,15 +244,16 @@ void key_gen_run(struct otr_user_state *ustate, const char *account_name)
return; return;
} }
worker->pipes[0] = g_io_channel_new(fd[0]); worker->pipes[0] = i_io_channel_new(fd[0]);
worker->pipes[1] = g_io_channel_new(fd[1]); worker->pipes[1] = i_io_channel_new(fd[1]);
pid = fork(); pid = fork();
if (pid > 0) { if (pid > 0) {
/* Parent process */ /* Parent process */
pidwait_add(pid); pidwait_add(pid);
worker->tag = g_input_add(worker->pipes[0], G_INPUT_READ, (GInputFunction)read_key_gen_status, worker); worker->tag = i_input_add(worker->pipes[0], I_INPUT_READ,
(GInputFunction) read_key_gen_status, worker);
return; return;
} }

View File

@ -258,14 +258,14 @@ CODE:
int int
INPUT_READ() INPUT_READ()
CODE: CODE:
RETVAL = G_INPUT_READ; RETVAL = I_INPUT_READ;
OUTPUT: OUTPUT:
RETVAL RETVAL
int int
INPUT_WRITE() INPUT_WRITE()
CODE: CODE:
RETVAL = G_INPUT_WRITE; RETVAL = I_INPUT_WRITE;
OUTPUT: OUTPUT:
RETVAL RETVAL

View File

@ -26,7 +26,7 @@ static void perl_settings_remove(const char *key)
g_return_if_fail(script != NULL); g_return_if_fail(script != NULL);
list = g_hash_table_lookup(perl_settings, script); list = g_hash_table_lookup(perl_settings, script);
pos = gslist_find_icase_string(list, key); pos = i_slist_find_icase_string(list, key);
if (pos != NULL) { if (pos != NULL) {
list = g_slist_remove(list, pos->data); list = g_slist_remove(list, pos->data);
g_hash_table_insert(perl_settings, script, list); g_hash_table_insert(perl_settings, script, list);

View File

@ -664,7 +664,7 @@ static void perl_unregister_protocol(CHAT_PROTOCOL_REC *rec)
GSList *item; GSList *item;
void *data; void *data;
item = gslist_find_icase_string(use_protocols, rec->name); item = i_slist_find_icase_string(use_protocols, rec->name);
if (item != NULL) { if (item != NULL) {
data = item->data; data = item->data;
use_protocols = g_slist_remove(use_protocols, data); use_protocols = g_slist_remove(use_protocols, data);

View File

@ -139,8 +139,8 @@ int perl_input_add(int source, int condition, SV *func, SV *data, int once)
rec->func = perl_func_sv_inc(func, pkg); rec->func = perl_func_sv_inc(func, pkg);
rec->data = SvREFCNT_inc(data); rec->data = SvREFCNT_inc(data);
rec->tag = g_input_add_poll(source, G_PRIORITY_DEFAULT, condition, rec->tag = i_input_add_poll(source, G_PRIORITY_DEFAULT, condition,
(GInputFunction) perl_source_event, rec); (GInputFunction) perl_source_event, rec);
perl_sources = g_slist_append(perl_sources, rec); perl_sources = g_slist_append(perl_sources, rec);
return rec->tag; return rec->tag;

View File

@ -102,8 +102,7 @@ static void server_destroy_flood_tear_down(ServerDestroyFloodData *fixture, cons
static void irc_server_init_bare_minimum(IRC_SERVER_REC *server) static void irc_server_init_bare_minimum(IRC_SERVER_REC *server)
{ {
server->isupport = g_hash_table_new((GHashFunc) g_istr_hash, server->isupport = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
(GCompareFunc) g_istr_equal);
/* set the standards */ /* set the standards */
g_hash_table_insert(server->isupport, g_strdup("CHANMODES"), g_strdup("beI,k,l,imnpst")); g_hash_table_insert(server->isupport, g_strdup("CHANMODES"), g_strdup("beI,k,l,imnpst"));