mirror of
https://github.com/irssi/irssi.git
synced 2026-08-17 23:52:22 +02:00
Replace deprecated g_str[n]casecmp with g_ascii_str[n]cmp.
This commit is contained in:
parent
5ca9287182
commit
0d4f13d20f
63 changed files with 168 additions and 160 deletions
|
|
@ -102,7 +102,7 @@ CHANNEL_SETUP_REC *channel_setup_find(const char *channel,
|
|||
for (tmp = setupchannels; tmp != NULL; tmp = tmp->next) {
|
||||
CHANNEL_SETUP_REC *rec = tmp->data;
|
||||
|
||||
if (g_strcasecmp(rec->name, channel) == 0 &&
|
||||
if (g_ascii_strcasecmp(rec->name, channel) == 0 &&
|
||||
channel_chatnet_match(rec->chatnet, chatnet))
|
||||
return rec;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,6 @@ CHANNEL_SETUP_REC *channel_setup_find(const char *channel,
|
|||
|
||||
#define channel_chatnet_match(rec, chatnet) \
|
||||
((rec) == NULL || (rec)[0] == '\0' || \
|
||||
((chatnet) != NULL && g_strcasecmp(rec, chatnet) == 0))
|
||||
((chatnet) != NULL && g_ascii_strcasecmp(rec, chatnet) == 0))
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ static CHANNEL_REC *channel_find_server(SERVER_REC *server,
|
|||
for (tmp = server->channels; tmp != NULL; tmp = tmp->next) {
|
||||
CHANNEL_REC *rec = tmp->data;
|
||||
|
||||
if (g_strcasecmp(name, rec->name) == 0)
|
||||
if (g_ascii_strcasecmp(name, rec->name) == 0)
|
||||
return rec;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ static RECONNECT_REC *find_reconnect_server(int chat_type,
|
|||
|
||||
if (rec->conn->chat_type == chat_type) {
|
||||
count++; last_proto_match = rec;
|
||||
if (g_strcasecmp(rec->conn->address, addr) == 0) {
|
||||
if (g_ascii_strcasecmp(rec->conn->address, addr) == 0) {
|
||||
if (rec->conn->port == port)
|
||||
return rec;
|
||||
match = rec;
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ CHAT_PROTOCOL_REC *chat_protocol_find(const char *name)
|
|||
for (tmp = chat_protocols; tmp != NULL; tmp = tmp->next) {
|
||||
CHAT_PROTOCOL_REC *rec = tmp->data;
|
||||
|
||||
if (g_strcasecmp(rec->name, name) == 0)
|
||||
if (g_ascii_strcasecmp(rec->name, name) == 0)
|
||||
return rec;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ CHATNET_REC *chatnet_find(const char *name)
|
|||
for (tmp = chatnets; tmp != NULL; tmp = tmp->next) {
|
||||
CHATNET_REC *rec = tmp->data;
|
||||
|
||||
if (g_strcasecmp(rec->name, name) == 0)
|
||||
if (g_ascii_strcasecmp(rec->name, name) == 0)
|
||||
return rec;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ COMMAND_REC *command_find(const char *cmd)
|
|||
for (tmp = commands; tmp != NULL; tmp = tmp->next) {
|
||||
COMMAND_REC *rec = tmp->data;
|
||||
|
||||
if (g_strcasecmp(rec->cmd, cmd) == 0)
|
||||
if (g_ascii_strcasecmp(rec->cmd, cmd) == 0)
|
||||
return rec;
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ static COMMAND_MODULE_REC *command_module_find(COMMAND_REC *rec,
|
|||
for (tmp = rec->modules; tmp != NULL; tmp = tmp->next) {
|
||||
COMMAND_MODULE_REC *rec = tmp->data;
|
||||
|
||||
if (g_strcasecmp(rec->name, module) == 0)
|
||||
if (g_ascii_strcasecmp(rec->name, module) == 0)
|
||||
return rec;
|
||||
}
|
||||
|
||||
|
|
@ -110,7 +110,7 @@ int command_have_sub(const char *command)
|
|||
for (tmp = commands; tmp != NULL; tmp = tmp->next) {
|
||||
COMMAND_REC *rec = tmp->data;
|
||||
|
||||
if (g_strncasecmp(rec->cmd, command, len) == 0 &&
|
||||
if (g_ascii_strncasecmp(rec->cmd, command, len) == 0 &&
|
||||
rec->cmd[len] == ' ')
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -265,7 +265,7 @@ static const char *command_expand(char *cmd)
|
|||
for (tmp = commands; tmp != NULL; tmp = tmp->next) {
|
||||
COMMAND_REC *rec = tmp->data;
|
||||
|
||||
if (g_strncasecmp(rec->cmd, cmd, len) == 0 &&
|
||||
if (g_ascii_strncasecmp(rec->cmd, cmd, len) == 0 &&
|
||||
strchr(rec->cmd+len, ' ') == NULL) {
|
||||
if (rec->cmd[len] == '\0') {
|
||||
/* full match */
|
||||
|
|
@ -345,7 +345,7 @@ static GSList *optlist_find(GSList *optlist, const char *option)
|
|||
char *name = optlist->data;
|
||||
if (iscmdtype(*name)) name++;
|
||||
|
||||
if (g_strcasecmp(name, option) == 0)
|
||||
if (g_ascii_strcasecmp(name, option) == 0)
|
||||
return optlist;
|
||||
|
||||
optlist = optlist->next;
|
||||
|
|
@ -371,7 +371,7 @@ int command_have_option(const char *cmd, const char *option)
|
|||
for (tmp = rec->options; *tmp != NULL; tmp++) {
|
||||
char *name = iscmdtype(**tmp) ? (*tmp)+1 : *tmp;
|
||||
|
||||
if (g_strcasecmp(name, option) == 0)
|
||||
if (g_ascii_strcasecmp(name, option) == 0)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -531,7 +531,7 @@ static int option_find(char **array, const char *option)
|
|||
for (tmp = array; *tmp != NULL; tmp++, index++) {
|
||||
const char *text = *tmp + iscmdtype(**tmp);
|
||||
|
||||
if (g_strncasecmp(text, option, len) == 0) {
|
||||
if (g_ascii_strncasecmp(text, option, len) == 0) {
|
||||
if (text[len] == '\0') {
|
||||
/* full match */
|
||||
return index;
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ static int ignore_match_pattern(IGNORE_REC *rec, const char *text)
|
|||
|
||||
#define ignore_match_server(rec, server) \
|
||||
((rec)->servertag == NULL || \
|
||||
g_strcasecmp((server)->tag, (rec)->servertag) == 0)
|
||||
g_ascii_strcasecmp((server)->tag, (rec)->servertag) == 0)
|
||||
|
||||
int ignore_check(SERVER_REC *server, const char *nick, const char *host,
|
||||
const char *channel, const char *text, int level)
|
||||
|
|
@ -198,14 +198,14 @@ IGNORE_REC *ignore_find(const char *servertag, const char *mask,
|
|||
(servertag != NULL && rec->servertag == NULL))
|
||||
continue;
|
||||
|
||||
if (servertag != NULL && g_strcasecmp(servertag, rec->servertag) != 0)
|
||||
if (servertag != NULL && g_ascii_strcasecmp(servertag, rec->servertag) != 0)
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((rec->mask == NULL && mask != NULL) ||
|
||||
(rec->mask != NULL && mask == NULL)) continue;
|
||||
|
||||
if (rec->mask != NULL && g_strcasecmp(rec->mask, mask) != 0)
|
||||
if (rec->mask != NULL && g_ascii_strcasecmp(rec->mask, mask) != 0)
|
||||
continue;
|
||||
|
||||
if ((channels == NULL && rec->channels == NULL))
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ static int itemcmp(const char *patt, const char *item)
|
|||
|
||||
if (!strcmp(patt, "*"))
|
||||
return 0;
|
||||
return item ? g_strcasecmp(patt, item) : 1;
|
||||
return item ? g_ascii_strcasecmp(patt, item) : 1;
|
||||
}
|
||||
|
||||
LOG_ITEM_REC *log_item_find(LOG_REC *log, int type, const char *item,
|
||||
|
|
@ -262,7 +262,7 @@ LOG_ITEM_REC *log_item_find(LOG_REC *log, int type, const char *item,
|
|||
|
||||
if (rec->type == type && itemcmp(rec->name, item) == 0 &&
|
||||
(rec->servertag == NULL || (servertag != NULL &&
|
||||
g_strcasecmp(rec->servertag, servertag) == 0)))
|
||||
g_ascii_strcasecmp(rec->servertag, servertag) == 0)))
|
||||
return rec;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ static int check_mask(SERVER_REC *server, const char *mask,
|
|||
}
|
||||
|
||||
return wildcards ? match_wildcards(mask, str) :
|
||||
g_strcasecmp(mask, str) == 0;
|
||||
g_ascii_strcasecmp(mask, str) == 0;
|
||||
}
|
||||
|
||||
int mask_match(SERVER_REC *server, const char *mask,
|
||||
|
|
@ -117,7 +117,7 @@ int masks_match(SERVER_REC *server, const char *masks,
|
|||
mask = g_strdup_printf("%s!%s", nick, address);
|
||||
list = g_strsplit(masks, " ", -1);
|
||||
for (tmp = list; *tmp != NULL; tmp++) {
|
||||
if (g_strcasecmp(*tmp, nick) == 0) {
|
||||
if (g_ascii_strcasecmp(*tmp, nick) == 0) {
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ int find_substr(const char *list, const char *item)
|
|||
ptr = strchr(list, ' ');
|
||||
if (ptr == NULL) ptr = list+strlen(list);
|
||||
|
||||
if (g_strncasecmp(list, item, ptr-list) == 0 &&
|
||||
if (g_ascii_strncasecmp(list, item, ptr-list) == 0 &&
|
||||
item[ptr-list] == '\0')
|
||||
return TRUE;
|
||||
|
||||
|
|
@ -174,7 +174,7 @@ int strarray_find(char **array, const char *item)
|
|||
|
||||
index = 0;
|
||||
for (tmp = array; *tmp != NULL; tmp++, index++) {
|
||||
if (g_strcasecmp(*tmp, item) == 0)
|
||||
if (g_ascii_strcasecmp(*tmp, item) == 0)
|
||||
return index;
|
||||
}
|
||||
|
||||
|
|
@ -192,7 +192,7 @@ GSList *gslist_find_string(GSList *list, const char *key)
|
|||
GSList *gslist_find_icase_string(GSList *list, const char *key)
|
||||
{
|
||||
for (list = list; list != NULL; list = list->next)
|
||||
if (g_strcasecmp(list->data, key) == 0) return list;
|
||||
if (g_ascii_strcasecmp(list->data, key) == 0) return list;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -277,7 +277,7 @@ GList *glist_find_string(GList *list, const char *key)
|
|||
GList *glist_find_icase_string(GList *list, const char *key)
|
||||
{
|
||||
for (list = list; list != NULL; list = list->next)
|
||||
if (g_strcasecmp(list->data, key) == 0) return list;
|
||||
if (g_ascii_strcasecmp(list->data, key) == 0) return list;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -443,12 +443,12 @@ char *convert_home(const char *path)
|
|||
|
||||
int g_istr_equal(gconstpointer v, gconstpointer v2)
|
||||
{
|
||||
return g_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)
|
||||
{
|
||||
return g_strcasecmp((const char *) v, (const char *) v2);
|
||||
return g_ascii_strcasecmp((const char *) v, (const char *) v2);
|
||||
}
|
||||
|
||||
/* a char* hash function from ASU */
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ MODULE_REC *module_find(const char *name)
|
|||
for (tmp = modules; tmp != NULL; tmp = tmp->next) {
|
||||
MODULE_REC *rec = tmp->data;
|
||||
|
||||
if (g_strcasecmp(rec->name, name) == 0)
|
||||
if (g_ascii_strcasecmp(rec->name, name) == 0)
|
||||
return rec;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ static void get_nicks_same_hash(gpointer key, NICK_REC *nick,
|
|||
NICKLIST_GET_SAME_REC *rec)
|
||||
{
|
||||
while (nick != NULL) {
|
||||
if (g_strcasecmp(nick->nick, rec->nick) == 0) {
|
||||
if (g_ascii_strcasecmp(nick->nick, rec->nick) == 0) {
|
||||
rec->list = g_slist_append(rec->list, rec->channel);
|
||||
rec->list = g_slist_append(rec->list, nick);
|
||||
}
|
||||
|
|
@ -365,7 +365,7 @@ int nicklist_compare(NICK_REC *p1, NICK_REC *p2, const char *nick_prefix)
|
|||
if (p2 == NULL) return 1;
|
||||
|
||||
if (p1->prefixes[0] == p2->prefixes[0])
|
||||
return g_strcasecmp(p1->nick, p2->nick);
|
||||
return g_ascii_strcasecmp(p1->nick, p2->nick);
|
||||
|
||||
if (!p1->prefixes[0])
|
||||
return 1;
|
||||
|
|
@ -384,7 +384,7 @@ int nicklist_compare(NICK_REC *p1, NICK_REC *p2, const char *nick_prefix)
|
|||
}
|
||||
|
||||
/* we should never have gotten here... */
|
||||
return g_strcasecmp(p1->nick, p2->nick);
|
||||
return g_ascii_strcasecmp(p1->nick, p2->nick);
|
||||
}
|
||||
|
||||
static void nicklist_update_flags_list(SERVER_REC *server, int gone,
|
||||
|
|
@ -516,7 +516,8 @@ int nick_match_msg(CHANNEL_REC *channel, const char *msg, const char *nick)
|
|||
|
||||
/* first check for identical match */
|
||||
len = strlen(nick);
|
||||
if (g_strncasecmp(msg, nick, len) == 0 && !isalnumhigh((int) msg[len]))
|
||||
if (g_ascii_strncasecmp(msg, nick, len) == 0 &&
|
||||
!isalnumhigh((int) msg[len]))
|
||||
return TRUE;
|
||||
|
||||
orignick = nick;
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ static QUERY_REC *query_find_server(SERVER_REC *server, const char *nick)
|
|||
for (tmp = server->queries; tmp != NULL; tmp = tmp->next) {
|
||||
QUERY_REC *rec = tmp->data;
|
||||
|
||||
if (g_strcasecmp(rec->name, nick) == 0)
|
||||
if (g_ascii_strcasecmp(rec->name, nick) == 0)
|
||||
return rec;
|
||||
}
|
||||
|
||||
|
|
@ -117,7 +117,7 @@ QUERY_REC *query_find(SERVER_REC *server, const char *nick)
|
|||
for (tmp = queries; tmp != NULL; tmp = tmp->next) {
|
||||
QUERY_REC *rec = tmp->data;
|
||||
|
||||
if (g_strcasecmp(rec->name, nick) == 0)
|
||||
if (g_ascii_strcasecmp(rec->name, nick) == 0)
|
||||
return rec;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ server_connect_copy_skeleton(SERVER_CONNECT_REC *src, int connect_info)
|
|||
|
||||
#define sserver_connect_ok(rec, net) \
|
||||
(!(rec)->banned && (rec)->chatnet != NULL && \
|
||||
g_strcasecmp((rec)->chatnet, (net)) == 0)
|
||||
g_ascii_strcasecmp((rec)->chatnet, (net)) == 0)
|
||||
|
||||
static void sig_reconnect(SERVER_REC *server)
|
||||
{
|
||||
|
|
@ -283,7 +283,7 @@ static void sig_reconnect(SERVER_REC *server)
|
|||
SERVER_SETUP_REC *rec = tmp->data;
|
||||
|
||||
if (!use_next && server->connrec->port == rec->port &&
|
||||
g_strcasecmp(rec->address, server->connrec->address) == 0)
|
||||
g_ascii_strcasecmp(rec->address, server->connrec->address) == 0)
|
||||
use_next = TRUE;
|
||||
else if (use_next && sserver_connect_ok(rec, conn->chatnet)) {
|
||||
if (rec == sserver)
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ create_chatnet_conn(const char *dest, int port,
|
|||
SERVER_SETUP_REC *rec = tmp->data;
|
||||
|
||||
if (rec->chatnet == NULL ||
|
||||
g_strcasecmp(rec->chatnet, dest) != 0)
|
||||
g_ascii_strcasecmp(rec->chatnet, dest) != 0)
|
||||
continue;
|
||||
|
||||
if (!rec->last_failed) {
|
||||
|
|
@ -342,9 +342,9 @@ SERVER_SETUP_REC *server_setup_find(const char *address, int port,
|
|||
for (tmp = setupservers; tmp != NULL; tmp = tmp->next) {
|
||||
SERVER_SETUP_REC *rec = tmp->data;
|
||||
|
||||
if (g_strcasecmp(rec->address, address) == 0 &&
|
||||
if (g_ascii_strcasecmp(rec->address, address) == 0 &&
|
||||
(chatnet == NULL || rec->chatnet == NULL ||
|
||||
g_strcasecmp(rec->chatnet, chatnet) == 0)) {
|
||||
g_ascii_strcasecmp(rec->chatnet, chatnet) == 0)) {
|
||||
server = rec;
|
||||
if (rec->port == port)
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -553,7 +553,7 @@ SERVER_REC *server_find_tag(const char *tag)
|
|||
for (tmp = servers; tmp != NULL; tmp = tmp->next) {
|
||||
SERVER_REC *server = tmp->data;
|
||||
|
||||
if (g_strcasecmp(server->tag, tag) == 0)
|
||||
if (g_ascii_strcasecmp(server->tag, tag) == 0)
|
||||
return server;
|
||||
}
|
||||
|
||||
|
|
@ -570,7 +570,7 @@ SERVER_REC *server_find_lookup_tag(const char *tag)
|
|||
for (tmp = lookup_servers; tmp != NULL; tmp = tmp->next) {
|
||||
SERVER_REC *server = tmp->data;
|
||||
|
||||
if (g_strcasecmp(server->tag, tag) == 0)
|
||||
if (g_ascii_strcasecmp(server->tag, tag) == 0)
|
||||
return server;
|
||||
}
|
||||
|
||||
|
|
@ -588,7 +588,7 @@ SERVER_REC *server_find_chatnet(const char *chatnet)
|
|||
SERVER_REC *server = tmp->data;
|
||||
|
||||
if (server->connrec->chatnet != NULL &&
|
||||
g_strcasecmp(server->connrec->chatnet, chatnet) == 0)
|
||||
g_ascii_strcasecmp(server->connrec->chatnet, chatnet) == 0)
|
||||
return server;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue