1
0
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:
Ailin Nemui 2021-01-05 21:35:18 +01:00
parent 8405c6970a
commit b5ddc55fe6
17 changed files with 47 additions and 53 deletions

View File

@ -126,8 +126,7 @@ 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);
} }
@ -153,8 +152,7 @@ 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);
} }

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);
@ -831,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);
} }
@ -865,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

@ -167,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;
@ -175,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;
@ -183,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;
@ -197,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;
@ -210,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;
@ -221,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;
@ -255,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;

View File

@ -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; 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);

View File

@ -613,8 +613,7 @@ 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,

View File

@ -357,7 +357,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);

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

@ -212,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 =
@ -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 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

@ -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

@ -443,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) {
@ -451,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

@ -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

@ -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

@ -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

@ -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);