mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
correct wrong function prefixes: gslist -> i_slist
This commit is contained in:
parent
8405c6970a
commit
b5ddc55fe6
@ -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);
|
||||
|
||||
@ -831,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);
|
||||
}
|
||||
@ -865,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);
|
||||
}
|
||||
|
||||
|
@ -167,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;
|
||||
@ -175,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;
|
||||
@ -183,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;
|
||||
|
||||
@ -197,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;
|
||||
|
||||
@ -210,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;
|
||||
|
||||
@ -221,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;
|
||||
|
||||
@ -255,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;
|
||||
|
@ -19,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);
|
||||
|
||||
|
@ -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));
|
||||
|
@ -357,7 +357,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);
|
||||
|
@ -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);
|
||||
|
@ -212,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 =
|
||||
@ -340,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);
|
||||
|
@ -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);
|
||||
|
@ -443,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) {
|
||||
@ -451,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 */
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user