mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -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:
commit
db9aa817d5
13
src/common.h
13
src/common.h
@ -6,7 +6,7 @@
|
||||
#define IRSSI_GLOBAL_CONFIG "irssi.conf" /* config file name in /etc/ */
|
||||
#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_TLS_PORT 6697
|
||||
@ -45,15 +45,14 @@ typedef guint64 uoff_t;
|
||||
#define PRIuUOFF_T G_GUINT64_FORMAT
|
||||
|
||||
/* input functions */
|
||||
#define G_INPUT_READ (1 << 0)
|
||||
#define G_INPUT_WRITE (1 << 1)
|
||||
#define I_INPUT_READ (1 << 0)
|
||||
#define I_INPUT_WRITE (1 << 1)
|
||||
|
||||
typedef void (*GInputFunction) (void *data, GIOChannel *source, int condition);
|
||||
|
||||
int g_input_add(GIOChannel *source, int condition,
|
||||
GInputFunction function, void *data);
|
||||
int g_input_add_full(GIOChannel *source, int priority, int condition,
|
||||
GInputFunction function, void *data);
|
||||
int i_input_add(GIOChannel *source, int condition, GInputFunction function, void *data);
|
||||
int i_input_add_full(GIOChannel *source, int priority, int condition, GInputFunction function,
|
||||
void *data);
|
||||
|
||||
/* return full path for ~/.irssi */
|
||||
const char *get_irssi_dir(void);
|
||||
|
@ -126,9 +126,8 @@ CHANNEL_REC *channel_find(SERVER_REC *server, const char *name)
|
||||
return channel_find_server(server, name);
|
||||
|
||||
/* find from any server */
|
||||
return gslist_foreach_find(servers,
|
||||
(FOREACH_FIND_FUNC) channel_find_server,
|
||||
(void *) name);
|
||||
return i_slist_foreach_find(servers, (FOREACH_FIND_FUNC) channel_find_server,
|
||||
(void *) 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)
|
||||
{
|
||||
return gslist_foreach_find(servers,
|
||||
(FOREACH_FIND_FUNC) channel_find_server,
|
||||
(void *) name);
|
||||
return i_slist_foreach_find(servers, (FOREACH_FIND_FUNC) channel_find_server,
|
||||
(void *) name);
|
||||
}
|
||||
|
||||
static GSList *servers_find_chatnet_except(SERVER_REC *server)
|
||||
|
@ -431,7 +431,7 @@ static void command_calc_options(COMMAND_REC *rec, const char *options)
|
||||
g_strfreev(optlist);
|
||||
|
||||
/* linked list -> string[] */
|
||||
str = gslist_to_string(list, " ");
|
||||
str = i_slist_to_string(list, " ");
|
||||
rec->options = g_strsplit(str, " ", -1);
|
||||
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 **);
|
||||
|
||||
rec->options = *opthash =
|
||||
g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
|
||||
ignore_unknown = count & PARAM_FLAG_UNKNOWN_OPTIONS;
|
||||
error = get_cmd_options(&datad, ignore_unknown,
|
||||
@ -832,7 +831,7 @@ void commands_remove_module(const char *module)
|
||||
COMMAND_REC *rec = tmp->data;
|
||||
|
||||
next = tmp->next;
|
||||
modlist = gslist_find_string(rec->modules, module);
|
||||
modlist = i_slist_find_string(rec->modules, module);
|
||||
if (modlist != NULL)
|
||||
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) \
|
||||
alias_runstack = g_slist_remove(alias_runstack, alias)
|
||||
|
||||
#define alias_runstack_find(alias) \
|
||||
(gslist_find_icase_string(alias_runstack, alias) != NULL)
|
||||
#define alias_runstack_find(alias) (i_slist_find_icase_string(alias_runstack, alias) != NULL)
|
||||
|
||||
static void parse_command(const char *command, int expand_aliases,
|
||||
SERVER_REC *server, void *item)
|
||||
|
@ -561,7 +561,7 @@ static void log_read_config(void)
|
||||
if (node != NULL)
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -37,15 +37,15 @@ static int irssi_io_invoke(GIOChannel *source, GIOCondition condition,
|
||||
if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) {
|
||||
/* error, we have to call the function.. */
|
||||
if (rec->condition & G_IO_IN)
|
||||
icond |= G_INPUT_READ;
|
||||
icond |= I_INPUT_READ;
|
||||
else
|
||||
icond |= G_INPUT_WRITE;
|
||||
icond |= I_INPUT_WRITE;
|
||||
}
|
||||
|
||||
if (condition & (G_IO_IN | G_IO_PRI))
|
||||
icond |= G_INPUT_READ;
|
||||
icond |= I_INPUT_READ;
|
||||
if (condition & G_IO_OUT)
|
||||
icond |= G_INPUT_WRITE;
|
||||
icond |= I_INPUT_WRITE;
|
||||
|
||||
if (rec->condition & icond)
|
||||
rec->function(rec->data, source, icond);
|
||||
@ -53,8 +53,8 @@ static int irssi_io_invoke(GIOChannel *source, GIOCondition condition,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int g_input_add_full(GIOChannel *source, int priority, int condition,
|
||||
GInputFunction function, void *data)
|
||||
int i_input_add_full(GIOChannel *source, int priority, int condition, GInputFunction function,
|
||||
void *data)
|
||||
{
|
||||
IRSSI_INPUT_REC *rec;
|
||||
unsigned int result;
|
||||
@ -66,9 +66,9 @@ int g_input_add_full(GIOChannel *source, int priority, int condition,
|
||||
rec->data = data;
|
||||
|
||||
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;
|
||||
if (condition & G_INPUT_WRITE)
|
||||
if (condition & I_INPUT_WRITE)
|
||||
cond |= G_IO_OUT;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
int g_input_add(GIOChannel *source, int condition,
|
||||
GInputFunction function, void *data)
|
||||
int i_input_add(GIOChannel *source, int condition, GInputFunction function, void *data)
|
||||
{
|
||||
return g_input_add_full(source, G_PRIORITY_DEFAULT, condition,
|
||||
function, data);
|
||||
return i_input_add_full(source, G_PRIORITY_DEFAULT, condition, function, data);
|
||||
}
|
||||
|
||||
/* easy way to bypass glib polling of io channel internal buffer */
|
||||
int g_input_add_poll(int fd, int priority, int condition,
|
||||
GInputFunction function, void *data)
|
||||
int i_input_add_poll(int fd, int priority, int condition, GInputFunction function, void *data)
|
||||
{
|
||||
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);
|
||||
return ret;
|
||||
}
|
||||
@ -170,7 +167,7 @@ int strarray_find(char **array, const char *item)
|
||||
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)
|
||||
if (g_strcmp0(list->data, key) == 0) return list;
|
||||
@ -178,7 +175,7 @@ GSList *gslist_find_string(GSList *list, const char *key)
|
||||
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)
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@ -200,7 +197,7 @@ void *gslist_foreach_find(GSList *list, FOREACH_FIND_FUNC func, const void *data
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void gslist_free_full (GSList *list, GDestroyNotify free_func)
|
||||
void i_slist_free_full(GSList *list, GDestroyNotify free_func)
|
||||
{
|
||||
GSList *tmp;
|
||||
|
||||
@ -213,7 +210,7 @@ void gslist_free_full (GSList *list, GDestroyNotify free_func)
|
||||
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;
|
||||
|
||||
@ -224,7 +221,7 @@ GSList *gslist_remove_string (GSList *list, const char *str)
|
||||
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;
|
||||
|
||||
@ -258,7 +255,7 @@ char *gslistptr_to_string(GSList *list, int offset, const char *delimiter)
|
||||
}
|
||||
|
||||
/* `list' contains char* */
|
||||
char *gslist_to_string(GSList *list, const char *delimiter)
|
||||
char *i_slist_to_string(GSList *list, const char *delimiter)
|
||||
{
|
||||
GString *str;
|
||||
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;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
guint g_istr_hash(gconstpointer v)
|
||||
guint i_istr_hash(gconstpointer v)
|
||||
{
|
||||
const signed char *p;
|
||||
guint32 h = 5381;
|
||||
|
@ -1,8 +1,7 @@
|
||||
#ifndef IRSSI_CORE_MISC_H
|
||||
#define IRSSI_CORE_MISC_H
|
||||
|
||||
int g_input_add_poll(int fd, int priority, int condition,
|
||||
GInputFunction function, void *data);
|
||||
int i_input_add_poll(int fd, int priority, int condition, GInputFunction function, void *data);
|
||||
|
||||
/* `str' should be type char[MAX_INT_STRLEN] */
|
||||
#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;
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
GSList *gslist_find_string(GSList *list, const char *key);
|
||||
GSList *gslist_find_icase_string(GSList *list, const char *key);
|
||||
GSList *i_slist_find_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_icase_string(GList *list, const char *key);
|
||||
GSList *gslist_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_remove_string(GSList *list, const char *str) G_GNUC_DEPRECATED;
|
||||
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. */
|
||||
char *gslistptr_to_string(GSList *list, int offset, const char *delimiter);
|
||||
/* `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);
|
||||
|
||||
@ -42,11 +41,11 @@ GList *optlist_remove_known(const char *cmd, GHashTable *optlist);
|
||||
char *convert_home(const char *path);
|
||||
|
||||
/* Case-insensitive string hash functions */
|
||||
int g_istr_equal(gconstpointer v, gconstpointer v2);
|
||||
unsigned int g_istr_hash(gconstpointer v);
|
||||
int i_istr_equal(gconstpointer v, gconstpointer v2);
|
||||
unsigned int i_istr_hash(gconstpointer v);
|
||||
|
||||
/* 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. */
|
||||
int match_wildcards(const char *mask, const char *data);
|
||||
|
@ -97,8 +97,7 @@ void net_disconnect_later(GIOChannel *handle)
|
||||
rec = g_new(NET_DISCONNECT_REC, 1);
|
||||
rec->created = time(NULL);
|
||||
rec->handle = handle;
|
||||
rec->tag = g_input_add(handle, G_INPUT_READ,
|
||||
(GInputFunction) sig_disconnect, rec);
|
||||
rec->tag = i_input_add(handle, I_INPUT_READ, (GInputFunction) sig_disconnect, rec);
|
||||
|
||||
if (timeout_tag == -1) {
|
||||
timeout_tag = g_timeout_add(10000, (GSourceFunc)
|
||||
|
@ -62,9 +62,9 @@ int net_gethostbyname_nonblock(const char *addr, GIOChannel *pipe, int reverse_l
|
||||
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)
|
||||
g_io_channel_write_block(pipe, (void *) errorstr, rec.errlen);
|
||||
i_io_channel_write_block(pipe, (void *) errorstr, rec.errlen);
|
||||
|
||||
if (pid == 0)
|
||||
_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);
|
||||
|
||||
/* 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",
|
||||
g_strerror(errno));
|
||||
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
|
||||
reason, just ignore it. */
|
||||
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;
|
||||
|
@ -132,8 +132,7 @@ int net_sendbuffer_send(NET_SENDBUF_REC *rec, const void *data, int size)
|
||||
/* everything couldn't be sent. */
|
||||
if (rec->send_tag == -1) {
|
||||
rec->send_tag =
|
||||
g_input_add(rec->handle, G_INPUT_WRITE,
|
||||
(GInputFunction) sig_sendbuffer, rec);
|
||||
i_input_add(rec->handle, I_INPUT_WRITE, (GInputFunction) sig_sendbuffer, rec);
|
||||
}
|
||||
|
||||
return buffer_add(rec, data, size) ? 0 : -1;
|
||||
|
@ -39,7 +39,7 @@ union sockaddr_union {
|
||||
#define SIZEOF_SOCKADDR(so) ((so).sa.sa_family == AF_INET6 ? \
|
||||
sizeof(so.sin6) : sizeof(so.sin))
|
||||
|
||||
GIOChannel *g_io_channel_new(int handle)
|
||||
GIOChannel *i_io_channel_new(int handle)
|
||||
{
|
||||
GIOChannel *chan;
|
||||
chan = g_io_channel_unix_new(handle);
|
||||
@ -48,7 +48,7 @@ GIOChannel *g_io_channel_new(int handle)
|
||||
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;
|
||||
int sent;
|
||||
@ -63,7 +63,7 @@ int g_io_channel_write_block(GIOChannel *channel, void *data, int len)
|
||||
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;
|
||||
gsize ret;
|
||||
@ -211,7 +211,7 @@ GIOChannel *net_connect_ip(IPADDR *ip, int port, IPADDR *my_ip)
|
||||
if (handle == -1)
|
||||
return (NULL);
|
||||
|
||||
return g_io_channel_new(handle);
|
||||
return i_io_channel_new(handle);
|
||||
}
|
||||
|
||||
/* Connect to named UNIX socket */
|
||||
@ -242,7 +242,7 @@ GIOChannel *net_connect_unix(const char *path)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return g_io_channel_new(handle);
|
||||
return i_io_channel_new(handle);
|
||||
}
|
||||
|
||||
/* Disconnect socket */
|
||||
@ -298,7 +298,7 @@ GIOChannel *net_listen(IPADDR *my_ip, int *port)
|
||||
|
||||
/* start listening */
|
||||
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);
|
||||
|
||||
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 */
|
||||
|
@ -31,13 +31,13 @@ struct _IPADDR {
|
||||
|
||||
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. */
|
||||
/* 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 g_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_write_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);
|
||||
|
||||
|
@ -456,8 +456,7 @@ static void sig_channel_created(CHANNEL_REC *channel)
|
||||
{
|
||||
g_return_if_fail(IS_CHANNEL(channel));
|
||||
|
||||
channel->nicks = g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
channel->nicks = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
}
|
||||
|
||||
static void nicklist_remove_hash(gpointer key, NICK_REC *nick,
|
||||
|
@ -184,10 +184,9 @@ static void server_connect_callback_init_ssl(SERVER_REC *server, GIOChannel *han
|
||||
if (error & 1) {
|
||||
if (server->connect_tag != -1)
|
||||
g_source_remove(server->connect_tag);
|
||||
server->connect_tag = g_input_add(handle, error == 1 ? G_INPUT_READ : G_INPUT_WRITE,
|
||||
(GInputFunction)
|
||||
server_connect_callback_init_ssl,
|
||||
server);
|
||||
server->connect_tag =
|
||||
i_input_add(handle, error == 1 ? I_INPUT_READ : I_INPUT_WRITE,
|
||||
(GInputFunction) server_connect_callback_init_ssl, server);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -253,11 +252,9 @@ static void server_real_connect(SERVER_REC *server, IPADDR *ip,
|
||||
if (server->connrec->use_tls)
|
||||
server_connect_callback_init_ssl(server, handle);
|
||||
else
|
||||
server->connect_tag =
|
||||
g_input_add(handle, G_INPUT_WRITE | G_INPUT_READ,
|
||||
(GInputFunction)
|
||||
server_connect_callback_init,
|
||||
server);
|
||||
server->connect_tag =
|
||||
i_input_add(handle, I_INPUT_WRITE | I_INPUT_READ,
|
||||
(GInputFunction) server_connect_callback_init, server);
|
||||
}
|
||||
}
|
||||
|
||||
@ -409,8 +406,8 @@ int server_start_connect(SERVER_REC *server)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
server->connect_pipe[0] = g_io_channel_new(fd[0]);
|
||||
server->connect_pipe[1] = g_io_channel_new(fd[1]);
|
||||
server->connect_pipe[0] = i_io_channel_new(fd[0]);
|
||||
server->connect_pipe[1] = i_io_channel_new(fd[1]);
|
||||
|
||||
connect_address = server->connrec->proxy != NULL ?
|
||||
server->connrec->proxy : server->connrec->address;
|
||||
@ -418,10 +415,8 @@ int server_start_connect(SERVER_REC *server)
|
||||
net_gethostbyname_nonblock(connect_address,
|
||||
server->connect_pipe[1], 0);
|
||||
server->connect_tag =
|
||||
g_input_add(server->connect_pipe[0], G_INPUT_READ,
|
||||
(GInputFunction)
|
||||
server_connect_callback_readpipe,
|
||||
server);
|
||||
i_input_add(server->connect_pipe[0], I_INPUT_READ,
|
||||
(GInputFunction) server_connect_callback_readpipe, server);
|
||||
|
||||
server->connect_time = time(NULL);
|
||||
lookup_servers = g_slist_append(lookup_servers, server);
|
||||
|
@ -262,7 +262,7 @@ static void session_restore_server(CONFIG_NODE *node)
|
||||
chatnet, password, nick);
|
||||
if (conn != NULL) {
|
||||
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->version = g_strdup(config_node_get_str(node, "version", NULL));
|
||||
|
@ -613,9 +613,8 @@ void settings_check_module(const char *module)
|
||||
}
|
||||
}
|
||||
if (count > 0) {
|
||||
if (gslist_find_icase_string(last_invalid_modules,
|
||||
module) == NULL) {
|
||||
/* mark this module having invalid settings */
|
||||
if (i_slist_find_icase_string(last_invalid_modules, module) == NULL) {
|
||||
/* mark this module having invalid settings */
|
||||
last_invalid_modules =
|
||||
g_slist_append(last_invalid_modules,
|
||||
g_strdup(module));
|
||||
@ -876,8 +875,7 @@ static int sig_autosave(void)
|
||||
|
||||
void settings_init(void)
|
||||
{
|
||||
settings = g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
settings = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
|
||||
last_errors = NULL;
|
||||
last_invalid_modules = NULL;
|
||||
|
@ -425,7 +425,8 @@ static GList *completion_get_settings(const char *key, SettingType type)
|
||||
SETTINGS_REC *rec = tmp->data;
|
||||
|
||||
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);
|
||||
return complist;
|
||||
@ -460,7 +461,8 @@ static GList *completion_get_aliases(const char *alias, char cmdchar)
|
||||
be appended after command completions and kept in
|
||||
uppercase to show it's an alias */
|
||||
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
|
||||
g_free(word);
|
||||
}
|
||||
@ -489,7 +491,8 @@ static GList *completion_get_commands(const char *cmd, char cmdchar)
|
||||
word = cmdchar == '\0' ? g_strdup(rec->cmd) :
|
||||
g_strdup_printf("%c%s", cmdchar, rec->cmd);
|
||||
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
|
||||
g_free(word);
|
||||
}
|
||||
@ -523,7 +526,8 @@ static GList *completion_get_subcommands(const char *cmd)
|
||||
continue;
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -254,8 +254,7 @@ void fe_common_core_deinit(void)
|
||||
signal_remove("channel destroyed", (SIGNAL_FUNC) sig_channel_destroyed);
|
||||
}
|
||||
|
||||
void glog_func(const char *log_domain, GLogLevelFlags log_level,
|
||||
const char *message)
|
||||
void i_log_func(const char *log_domain, GLogLevelFlags log_level, const char *message)
|
||||
{
|
||||
const char *reason;
|
||||
|
||||
@ -357,7 +356,7 @@ static void autoconnect_servers(void)
|
||||
|
||||
if (rec->autoconnect &&
|
||||
(rec->chatnet == NULL ||
|
||||
gslist_find_icase_string(chatnets, rec->chatnet) == NULL)) {
|
||||
i_slist_find_icase_string(chatnets, rec->chatnet) == NULL)) {
|
||||
if (rec->chatnet != NULL) {
|
||||
chatnets = g_slist_append(chatnets, rec->chatnet);
|
||||
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);
|
||||
|
||||
/* _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)
|
||||
signal_emit("setup changed", 0);
|
||||
|
@ -302,9 +302,9 @@ static void process_exec(PROCESS_REC *rec, const char *cmd)
|
||||
|
||||
if (rec->pid != 0) {
|
||||
/* 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);
|
||||
|
||||
close(out[1]);
|
||||
@ -524,9 +524,8 @@ static void handle_exec(const char *args, GHashTable *optlist,
|
||||
level = g_hash_table_lookup(optlist, "level");
|
||||
rec->level = level == NULL ? MSGLEVEL_CLIENTCRAP : level2bits(level, NULL);
|
||||
|
||||
rec->read_tag = g_input_add(rec->in, G_INPUT_READ,
|
||||
(GInputFunction) sig_exec_input_reader,
|
||||
rec);
|
||||
rec->read_tag =
|
||||
i_input_add(rec->in, I_INPUT_READ, (GInputFunction) sig_exec_input_reader, rec);
|
||||
processes = g_slist_append(processes, rec);
|
||||
|
||||
if (rec->target == NULL && interactive)
|
||||
|
@ -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);
|
||||
}
|
||||
@ -825,7 +825,7 @@ void fe_messages_init(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);
|
||||
|
||||
signal_remove("message public", (SIGNAL_FUNC) sig_message_public);
|
||||
|
@ -56,8 +56,7 @@ THEME_REC *theme_create(const char *path, const char *name)
|
||||
rec->name = g_strdup(name);
|
||||
rec->abstracts = g_hash_table_new((GHashFunc) g_str_hash,
|
||||
(GCompareFunc) g_str_equal);
|
||||
rec->modules = g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
rec->modules = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
themes = g_slist_append(themes, rec);
|
||||
signal_emit("theme created", 1, rec);
|
||||
|
||||
|
@ -84,7 +84,7 @@ static void print_mode(MODE_REC *rec)
|
||||
|
||||
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,
|
||||
IRCTXT_CHANMODE_CHANGE, rec->channel->visible_name, rec->mode, nicks, "");
|
||||
g_free(nicks);
|
||||
|
@ -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
|
||||
channels from old_channels list */
|
||||
channels = g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
channels = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
for (tmp = server->netjoins; tmp != NULL; tmp = next) {
|
||||
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 */
|
||||
old = gslist_find_icase_string(rec->old_channels,
|
||||
realchannel);
|
||||
old = i_slist_find_icase_string(rec->old_channels, realchannel);
|
||||
if (old != NULL) {
|
||||
void *data = old->data;
|
||||
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 (netjoin != NULL) {
|
||||
if (!gslist_find_icase_string(netjoin->old_channels, channel))
|
||||
if (!i_slist_find_icase_string(netjoin->old_channels, channel))
|
||||
return;
|
||||
} else {
|
||||
channels = split->channels;
|
||||
|
@ -46,7 +46,7 @@ static GSList *mask_add_once(GSList *list, const char *mask)
|
||||
str = ptr == NULL ? g_strdup(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);
|
||||
|
||||
g_free(str);
|
||||
|
@ -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) {
|
||||
server->rawlog = rawlog_create();
|
||||
server->isupport = g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
server->isupport = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
|
||||
/* set the standards */
|
||||
g_hash_table_insert(server->isupport, g_strdup("CHANMODES"), g_strdup("beI,k,l,imnpst"));
|
||||
|
@ -85,9 +85,8 @@ static void sig_input(void);
|
||||
|
||||
void input_listen_init(int handle)
|
||||
{
|
||||
readtag = g_input_add_poll(handle,
|
||||
G_PRIORITY_HIGH, G_INPUT_READ,
|
||||
(GInputFunction) sig_input, NULL);
|
||||
readtag = i_input_add_poll(handle, G_PRIORITY_HIGH, I_INPUT_READ,
|
||||
(GInputFunction) sig_input, NULL);
|
||||
}
|
||||
|
||||
void input_listen_deinit(void)
|
||||
|
@ -1376,12 +1376,6 @@ void textbuffer_view_remove_lines_by_level(TEXT_BUFFER_VIEW_REC *view, int level
|
||||
term_refresh_thaw();
|
||||
}
|
||||
|
||||
static int g_free_true(void *data)
|
||||
{
|
||||
g_free(data);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Remove all lines from buffer. */
|
||||
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);
|
||||
|
||||
g_hash_table_foreach_remove(view->bookmarks,
|
||||
(GHRFunc) g_free_true, NULL);
|
||||
g_hash_table_foreach(view->bookmarks, (GHFunc) g_free, NULL);
|
||||
g_hash_table_remove_all(view->bookmarks);
|
||||
|
||||
textbuffer_view_reset_cache(view);
|
||||
textbuffer_view_clear(view);
|
||||
|
@ -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 (!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));
|
||||
return TRUE;
|
||||
}
|
||||
else if (!enable && gslist_find_string(server->cap_queue, cap)) {
|
||||
server->cap_queue = gslist_delete_string(server->cap_queue, cap, g_free);
|
||||
} else if (!enable && i_slist_find_string(server->cap_queue, cap)) {
|
||||
server->cap_queue = i_slist_delete_string(server->cap_queue, cap, g_free);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
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 */
|
||||
if (!g_hash_table_lookup_extended(server->cap_supported, cap, NULL, NULL))
|
||||
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);
|
||||
irc_send_cmdv(server, "CAP REQ %s", cap);
|
||||
return TRUE;
|
||||
}
|
||||
else if (!enable && gslist_find_string(server->cap_active, cap)) {
|
||||
} else if (!enable && i_slist_find_string(server->cap_active, cap)) {
|
||||
char *negcap = g_strdup_printf("-%s", cap);
|
||||
|
||||
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 */
|
||||
gslist_free_full(server->cap_queue, (GDestroyNotify) g_free);
|
||||
i_slist_free_full(server->cap_queue, (GDestroyNotify) g_free);
|
||||
server->cap_queue = NULL;
|
||||
|
||||
/* 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] == '-');
|
||||
|
||||
if (disable)
|
||||
server->cap_active = gslist_delete_string(server->cap_active, caps[i] + 1, g_free);
|
||||
else if (!gslist_find_string(server->cap_active, caps[i]))
|
||||
server->cap_active =
|
||||
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]));
|
||||
|
||||
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);
|
||||
/* The server removed this CAP, remove it from the list
|
||||
* 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
|
||||
* variables this time, just free them when we're done. */
|
||||
g_free(key);
|
||||
|
@ -283,8 +283,7 @@ static void server_init(IRC_SERVER_REC *server)
|
||||
g_free(cmd);
|
||||
}
|
||||
|
||||
server->isupport = g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
server->isupport = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
|
||||
/* set the standards */
|
||||
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;
|
||||
server->nick_comp_func = irc_nickcmp_rfc1459;
|
||||
|
||||
server->splits = g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
server->splits = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
|
||||
if (!server->session_reconnect)
|
||||
if (!server->session_reconnect)
|
||||
server_init(server);
|
||||
}
|
||||
|
||||
@ -445,7 +443,7 @@ static void sig_destroyed(IRC_SERVER_REC *server)
|
||||
g_slist_free(server->cmdqueue);
|
||||
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;
|
||||
|
||||
if (server->cap_supported) {
|
||||
@ -453,7 +451,7 @@ static void sig_destroyed(IRC_SERVER_REC *server)
|
||||
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;
|
||||
|
||||
/* was g_free_and_null, but can't use on a GString */
|
||||
|
@ -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));
|
||||
|
||||
if (server->isupport == NULL) {
|
||||
server->isupport = g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
server->isupport =
|
||||
g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
}
|
||||
|
||||
node = config_node_section(NULL, node, "isupport", -1);
|
||||
|
@ -491,10 +491,8 @@ static void irc_init_server(IRC_SERVER_REC *server)
|
||||
if (!IS_IRC_SERVER(server))
|
||||
return;
|
||||
|
||||
server->readtag =
|
||||
g_input_add(net_sendbuffer_handle(server->handle),
|
||||
G_INPUT_READ,
|
||||
(GInputFunction) irc_parse_incoming, server);
|
||||
server->readtag = i_input_add(net_sendbuffer_handle(server->handle), I_INPUT_READ,
|
||||
(GInputFunction) irc_parse_incoming, server);
|
||||
}
|
||||
|
||||
void irc_irc_init(void)
|
||||
|
@ -219,7 +219,7 @@ static char *signal_list_move(GSList **signals, const char *event)
|
||||
GSList *link;
|
||||
char *linkevent, *linksignal;
|
||||
|
||||
link = gslist_find_string(*signals, event);
|
||||
link = i_slist_find_string(*signals, event);
|
||||
if (link == NULL)
|
||||
return NULL;
|
||||
|
||||
|
@ -355,8 +355,7 @@ static void dcc_chat_listen(CHAT_DCC_REC *dcc)
|
||||
memcpy(&dcc->addr, &ip, sizeof(IPADDR));
|
||||
net_ip2host(&dcc->addr, dcc->addrstr);
|
||||
dcc->port = port;
|
||||
dcc->tagread = g_input_add(handle, G_INPUT_READ,
|
||||
(GInputFunction) dcc_chat_input, dcc);
|
||||
dcc->tagread = i_input_add(handle, I_INPUT_READ, (GInputFunction) dcc_chat_input, 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->sendbuf = net_sendbuffer_create(dcc->handle, 0);
|
||||
dcc->tagread = g_input_add(dcc->handle, G_INPUT_READ,
|
||||
(GInputFunction) dcc_chat_input, dcc);
|
||||
dcc->tagread = i_input_add(dcc->handle, I_INPUT_READ, (GInputFunction) dcc_chat_input, 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);
|
||||
if (dcc->handle != NULL) {
|
||||
dcc->tagconn = g_input_add(dcc->handle,
|
||||
G_INPUT_WRITE | G_INPUT_READ,
|
||||
(GInputFunction) sig_chat_connected, dcc);
|
||||
dcc->tagconn = i_input_add(dcc->handle, I_INPUT_WRITE | I_INPUT_READ,
|
||||
(GInputFunction) sig_chat_connected, dcc);
|
||||
} else {
|
||||
/* error connecting */
|
||||
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);
|
||||
|
||||
dcc->handle = handle;
|
||||
dcc->tagconn = g_input_add(dcc->handle, G_INPUT_READ,
|
||||
(GInputFunction) dcc_chat_listen, dcc);
|
||||
dcc->tagconn =
|
||||
i_input_add(dcc->handle, I_INPUT_READ, (GInputFunction) dcc_chat_listen, dcc);
|
||||
|
||||
/* Let's send the reply to the other client! */
|
||||
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->tagconn =
|
||||
g_input_add(dcc->handle, G_INPUT_READ,
|
||||
(GInputFunction) dcc_chat_listen, dcc);
|
||||
i_input_add(dcc->handle, I_INPUT_READ, (GInputFunction) dcc_chat_listen, dcc);
|
||||
|
||||
/* send the chat request */
|
||||
signal_emit("dcc request send", 1, dcc);
|
||||
|
@ -112,9 +112,8 @@ void dcc_get_send_received(GET_DCC_REC *dcc)
|
||||
last 1-3 bytes should be sent later. these happen probably
|
||||
never, but I just want to do it right.. :) */
|
||||
if (dcc->tagwrite == -1) {
|
||||
dcc->tagwrite = g_input_add(dcc->handle, G_INPUT_WRITE,
|
||||
(GInputFunction) sig_dccget_send,
|
||||
dcc);
|
||||
dcc->tagwrite =
|
||||
i_input_add(dcc->handle, I_INPUT_WRITE, (GInputFunction) sig_dccget_send, dcc);
|
||||
}
|
||||
}
|
||||
|
||||
@ -285,8 +284,8 @@ void sig_dccget_connected(GET_DCC_REC *dcc)
|
||||
dcc_close(DCC(dcc));
|
||||
return;
|
||||
}
|
||||
dcc->tagread = g_input_add(dcc->handle, G_INPUT_READ,
|
||||
(GInputFunction) sig_dccget_receive, dcc);
|
||||
dcc->tagread =
|
||||
i_input_add(dcc->handle, I_INPUT_READ, (GInputFunction) sig_dccget_receive, dcc);
|
||||
signal_emit("dcc connected", 1, dcc);
|
||||
|
||||
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);
|
||||
|
||||
if (dcc->handle != NULL) {
|
||||
dcc->tagconn =
|
||||
g_input_add(dcc->handle,
|
||||
G_INPUT_WRITE | G_INPUT_READ,
|
||||
(GInputFunction) sig_dccget_connected,
|
||||
dcc);
|
||||
dcc->tagconn = i_input_add(dcc->handle, I_INPUT_WRITE | I_INPUT_READ,
|
||||
(GInputFunction) sig_dccget_connected, dcc);
|
||||
} else {
|
||||
/* error connecting */
|
||||
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);
|
||||
dcc->port = port;
|
||||
|
||||
dcc->tagconn = g_input_add(handle, G_INPUT_READ | G_INPUT_WRITE,
|
||||
(GInputFunction) sig_dccget_connected, dcc);
|
||||
dcc->tagconn = i_input_add(handle, I_INPUT_READ | I_INPUT_WRITE,
|
||||
(GInputFunction) sig_dccget_connected, 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);
|
||||
|
||||
dcc->handle = handle;
|
||||
dcc->tagconn = g_input_add(dcc->handle, G_INPUT_READ,
|
||||
(GInputFunction) dcc_get_listen, dcc);
|
||||
dcc->tagconn = i_input_add(dcc->handle, I_INPUT_READ, (GInputFunction) dcc_get_listen, dcc);
|
||||
|
||||
/* Let's send the reply to the other client! */
|
||||
dcc_ip2str(&own_ip, host);
|
||||
|
@ -336,10 +336,8 @@ static void dcc_send_connected(SEND_DCC_REC *dcc)
|
||||
net_ip2host(&dcc->addr, dcc->addrstr);
|
||||
dcc->port = port;
|
||||
|
||||
dcc->tagread = g_input_add(handle, G_INPUT_READ,
|
||||
(GInputFunction) dcc_send_read_size, dcc);
|
||||
dcc->tagwrite = g_input_add(handle, G_INPUT_WRITE,
|
||||
(GInputFunction) dcc_send_data, dcc);
|
||||
dcc->tagread = i_input_add(handle, I_INPUT_READ, (GInputFunction) dcc_send_read_size, dcc);
|
||||
dcc->tagwrite = i_input_add(handle, I_INPUT_WRITE, (GInputFunction) dcc_send_data, dcc);
|
||||
|
||||
signal_emit("dcc connected", 1, dcc);
|
||||
}
|
||||
@ -352,12 +350,10 @@ static void dcc_send_connect(SEND_DCC_REC *dcc)
|
||||
if (dcc->handle != NULL) {
|
||||
dcc->starttime = time(NULL);
|
||||
|
||||
dcc->tagread = g_input_add(dcc->handle, G_INPUT_READ,
|
||||
(GInputFunction) dcc_send_read_size,
|
||||
dcc);
|
||||
dcc->tagwrite = g_input_add(dcc->handle, G_INPUT_WRITE,
|
||||
(GInputFunction) dcc_send_data,
|
||||
dcc);
|
||||
dcc->tagread = i_input_add(dcc->handle, I_INPUT_READ,
|
||||
(GInputFunction) dcc_send_read_size, dcc);
|
||||
dcc->tagwrite =
|
||||
i_input_add(dcc->handle, I_INPUT_WRITE, (GInputFunction) dcc_send_data, dcc);
|
||||
signal_emit("dcc connected", 1, dcc);
|
||||
} else {
|
||||
/* error connecting */
|
||||
@ -436,9 +432,8 @@ static int dcc_send_one_file(int queue, const char *target, const char *fname,
|
||||
dcc->queue = queue;
|
||||
dcc->file_quoted = strchr(fname, ' ') != NULL;
|
||||
if (!passive) {
|
||||
dcc->tagconn = g_input_add(handle, G_INPUT_READ,
|
||||
(GInputFunction) dcc_send_connected,
|
||||
dcc);
|
||||
dcc->tagconn =
|
||||
i_input_add(handle, I_INPUT_READ, (GInputFunction) dcc_send_connected, dcc);
|
||||
}
|
||||
|
||||
/* Generate an ID for this send if using passive protocol */
|
||||
|
@ -183,8 +183,8 @@ static void dcc_server_listen(SERVER_DCC_REC *dcc)
|
||||
memcpy(&newdcc->addr, &ip, sizeof(IPADDR));
|
||||
net_ip2host(&newdcc->addr, newdcc->addrstr);
|
||||
newdcc->port = port;
|
||||
newdcc->tagread = g_input_add(handle, G_INPUT_READ,
|
||||
(GInputFunction) dcc_server_input, newdcc);
|
||||
newdcc->tagread =
|
||||
i_input_add(handle, I_INPUT_READ, (GInputFunction) dcc_server_input, 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));
|
||||
net_ip2host(&dccchat->addr, dccchat->addrstr);
|
||||
dccchat->port = dcc->port;
|
||||
dccchat->tagread = g_input_add(dccchat->handle, G_INPUT_READ,
|
||||
(GInputFunction) dcc_chat_input, dccchat);
|
||||
dccchat->tagread = i_input_add(dccchat->handle, I_INPUT_READ,
|
||||
(GInputFunction) dcc_chat_input, dccchat);
|
||||
|
||||
dcc->connection_established = 1;
|
||||
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->handle = handle;
|
||||
dcc->port = atoi(port);
|
||||
dcc->tagconn = g_input_add(dcc->handle, G_INPUT_READ,
|
||||
(GInputFunction) dcc_server_listen, dcc);
|
||||
dcc->tagconn =
|
||||
i_input_add(dcc->handle, I_INPUT_READ, (GInputFunction) dcc_server_listen, dcc);
|
||||
|
||||
signal_emit("dcc server started", 1, dcc);
|
||||
|
||||
|
@ -55,7 +55,7 @@ void dcc_unregister_type(const char *type)
|
||||
{
|
||||
GSList *pos;
|
||||
|
||||
pos = gslist_find_string(dcc_types, type);
|
||||
pos = i_slist_find_string(dcc_types, type);
|
||||
if (pos != NULL) {
|
||||
void *tmp = 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)
|
||||
{
|
||||
if (gslist_find_string(dcc_types, str) == NULL)
|
||||
if (i_slist_find_string(dcc_types, str) == NULL)
|
||||
return -1;
|
||||
|
||||
return module_get_uniq_id_str("DCC", str);
|
||||
|
@ -120,8 +120,7 @@ static void flood_init_server(IRC_SERVER_REC *server)
|
||||
rec = g_new0(MODULE_SERVER_REC, 1);
|
||||
MODULE_DATA_SET(server, rec);
|
||||
|
||||
rec->floodlist = g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
rec->floodlist = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
}
|
||||
|
||||
static void flood_hash_destroy(const char *key, FLOOD_REC *flood)
|
||||
|
@ -279,7 +279,7 @@ static void ison_check_parts(IRC_SERVER_REC *server)
|
||||
NOTIFY_NICK_REC *rec = tmp->data;
|
||||
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;
|
||||
|
||||
notifylist_left(server, rec);
|
||||
|
@ -74,7 +74,7 @@ static GIOChannel *net_listen_unix(const char *path)
|
||||
goto error_unlink;
|
||||
}
|
||||
|
||||
return g_io_channel_new(handle);
|
||||
return i_io_channel_new(handle);
|
||||
|
||||
error_unlink:
|
||||
unlink(sa.sun_path);
|
||||
@ -99,7 +99,7 @@ static GIOChannel *net_accept_unix(GIOChannel *handle)
|
||||
return NULL;
|
||||
|
||||
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)
|
||||
@ -470,8 +470,7 @@ static void sig_listen(LISTEN_REC *listen)
|
||||
rec->server = servers == NULL ? NULL :
|
||||
IRC_SERVER(server_find_chatnet(listen->ircnet));
|
||||
}
|
||||
rec->recv_tag = g_input_add(handle, G_INPUT_READ,
|
||||
(GInputFunction) sig_listen_client, rec);
|
||||
rec->recv_tag = i_input_add(handle, I_INPUT_READ, (GInputFunction) sig_listen_client, rec);
|
||||
|
||||
proxy_clients = g_slist_prepend(proxy_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_or_path = g_strdup(port_or_path);
|
||||
|
||||
rec->tag = g_input_add(rec->handle, G_INPUT_READ,
|
||||
(GInputFunction) sig_listen, rec);
|
||||
rec->tag = i_input_add(rec->handle, I_INPUT_READ, (GInputFunction) sig_listen, rec);
|
||||
|
||||
proxy_listens = g_slist_append(proxy_listens, rec);
|
||||
}
|
||||
|
@ -20,13 +20,13 @@
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
/* 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;
|
||||
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->mainnode = g_new0(CONFIG_NODE, 1);
|
||||
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);
|
||||
|
||||
return rec;
|
||||
|
@ -107,7 +107,7 @@ static void emit_event(GIOChannel *pipe, enum key_gen_status status, gcry_error_
|
||||
event.status = status;
|
||||
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);
|
||||
|
||||
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,
|
||||
TXT_OTR_KEYGEN_FAILED,
|
||||
key_gen_state.account_name,
|
||||
@ -244,15 +244,16 @@ void key_gen_run(struct otr_user_state *ustate, const char *account_name)
|
||||
return;
|
||||
}
|
||||
|
||||
worker->pipes[0] = g_io_channel_new(fd[0]);
|
||||
worker->pipes[1] = g_io_channel_new(fd[1]);
|
||||
worker->pipes[0] = i_io_channel_new(fd[0]);
|
||||
worker->pipes[1] = i_io_channel_new(fd[1]);
|
||||
|
||||
pid = fork();
|
||||
|
||||
if (pid > 0) {
|
||||
/* Parent process */
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -258,14 +258,14 @@ CODE:
|
||||
int
|
||||
INPUT_READ()
|
||||
CODE:
|
||||
RETVAL = G_INPUT_READ;
|
||||
RETVAL = I_INPUT_READ;
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
int
|
||||
INPUT_WRITE()
|
||||
CODE:
|
||||
RETVAL = G_INPUT_WRITE;
|
||||
RETVAL = I_INPUT_WRITE;
|
||||
OUTPUT:
|
||||
RETVAL
|
||||
|
||||
|
@ -26,7 +26,7 @@ static void perl_settings_remove(const char *key)
|
||||
g_return_if_fail(script != NULL);
|
||||
|
||||
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) {
|
||||
list = g_slist_remove(list, pos->data);
|
||||
g_hash_table_insert(perl_settings, script, list);
|
||||
|
@ -664,7 +664,7 @@ static void perl_unregister_protocol(CHAT_PROTOCOL_REC *rec)
|
||||
GSList *item;
|
||||
void *data;
|
||||
|
||||
item = gslist_find_icase_string(use_protocols, rec->name);
|
||||
item = i_slist_find_icase_string(use_protocols, rec->name);
|
||||
if (item != NULL) {
|
||||
data = item->data;
|
||||
use_protocols = g_slist_remove(use_protocols, data);
|
||||
|
@ -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->data = SvREFCNT_inc(data);
|
||||
|
||||
rec->tag = g_input_add_poll(source, G_PRIORITY_DEFAULT, condition,
|
||||
(GInputFunction) perl_source_event, rec);
|
||||
rec->tag = i_input_add_poll(source, G_PRIORITY_DEFAULT, condition,
|
||||
(GInputFunction) perl_source_event, rec);
|
||||
|
||||
perl_sources = g_slist_append(perl_sources, rec);
|
||||
return rec->tag;
|
||||
|
@ -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)
|
||||
{
|
||||
server->isupport = g_hash_table_new((GHashFunc) g_istr_hash,
|
||||
(GCompareFunc) g_istr_equal);
|
||||
server->isupport = g_hash_table_new((GHashFunc) i_istr_hash, (GCompareFunc) i_istr_equal);
|
||||
|
||||
/* set the standards */
|
||||
g_hash_table_insert(server->isupport, g_strdup("CHANMODES"), g_strdup("beI,k,l,imnpst"));
|
||||
|
Loading…
Reference in New Issue
Block a user