summaryrefslogtreecommitdiff
path: root/degesch.c
diff options
context:
space:
mode:
Diffstat (limited to 'degesch.c')
-rw-r--r--degesch.c47
1 files changed, 24 insertions, 23 deletions
diff --git a/degesch.c b/degesch.c
index 9730ac8..951a9ad 100644
--- a/degesch.c
+++ b/degesch.c
@@ -2173,7 +2173,7 @@ irc_server_strncmp (struct server *s, const char *a, const char *b, size_t n)
static char *
irc_cut_nickname (const char *prefix)
{
- return str_cut_until (prefix, "!@");
+ return cstr_cut_until (prefix, "!@");
}
static const char *
@@ -3896,7 +3896,7 @@ transport_tls_init_cert (struct server *s, SSL *ssl, struct error **e)
return true;
bool result = false;
- char *path = resolve_config_filename (ssl_cert);
+ char *path = resolve_filename (ssl_cert, resolve_relative_config_filename);
if (!path)
error_set (e, "%s: %s", "Cannot open file", ssl_cert);
// XXX: perhaps we should read the file ourselves for better messages
@@ -4117,7 +4117,7 @@ irc_fetch_next_nickname (struct server *s)
{
struct str_vector v;
str_vector_init (&v);
- split_str_ignore_empty (get_config_string (s->config, "nicks"), ',', &v);
+ cstr_split_ignore_empty (get_config_string (s->config, "nicks"), ',', &v);
char *result = NULL;
if (s->nick_counter >= 0 && (size_t) s->nick_counter < v.len)
@@ -4336,7 +4336,7 @@ irc_initiate_connect (struct server *s)
struct str_vector servers;
str_vector_init (&servers);
- split_str_ignore_empty (addresses, ',', &servers);
+ cstr_split_ignore_empty (addresses, ',', &servers);
struct error *e = NULL;
if (!irc_initiate_connect_socks (s, &servers, &e) && !e)
@@ -4513,10 +4513,10 @@ irc_is_highlight (struct server *s, const char *message)
// Well, this is rather crude but it should make most users happy.
// Ideally we could do this at least in proper Unicode.
char *copy = xstrdup (message);
- transform_str (copy, s->irc_tolower);
+ cstr_transform (copy, s->irc_tolower);
char *nick = xstrdup (s->irc_user->nickname);
- transform_str (nick, s->irc_tolower);
+ cstr_transform (nick, s->irc_tolower);
// Special characters allowed in nicknames by RFC 2812: []\`_^{|} and -
// Also excluded from the ASCII: common user channel prefixes: +%@&~
@@ -4736,7 +4736,7 @@ irc_handle_cap (struct server *s, const struct irc_message *msg)
const char *args = "";
if (msg->params.len > 2)
- split_str_ignore_empty ((args = msg->params.vector[2]), ' ', &v);
+ cstr_split_ignore_empty ((args = msg->params.vector[2]), ' ', &v);
const char *subcommand = msg->params.vector[1];
if (!strcasecmp_ascii (subcommand, "ACK"))
@@ -5448,7 +5448,7 @@ irc_try_parse_welcome_for_userhost (struct server *s, const char *m)
{
struct str_vector v;
str_vector_init (&v);
- split_str_ignore_empty (m, ' ', &v);
+ cstr_split_ignore_empty (m, ' ', &v);
for (size_t i = 0; i < v.len; i++)
if (irc_try_parse_word_for_userhost (s, v.vector[i]))
break;
@@ -5484,7 +5484,7 @@ irc_handle_rpl_userhost (struct server *s, const struct irc_message *msg)
const char *response = msg->params.vector[1];
struct str_vector v;
str_vector_init (&v);
- split_str_ignore_empty (response, ' ', &v);
+ cstr_split_ignore_empty (response, ' ', &v);
for (size_t i = 0; i < v.len; i++)
{
@@ -5541,7 +5541,7 @@ irc_handle_rpl_namreply (struct server *s, const struct irc_message *msg)
// Just push the nicknames to a string vector to process later
struct channel *channel = str_map_find (&s->irc_channels, channel_name);
if (channel)
- split_str_ignore_empty (nicks, ' ', &channel->names_buf);
+ cstr_split_ignore_empty (nicks, ' ', &channel->names_buf);
}
static void
@@ -5828,7 +5828,7 @@ irc_handle_isupport_idchan (struct server *s, char *value)
struct str_vector v;
str_vector_init (&v);
- split_str_ignore_empty (value, ',', &v);
+ cstr_split_ignore_empty (value, ',', &v);
for (size_t i = 0; i < v.len; i++)
{
// Not using or validating the numeric part
@@ -5855,7 +5855,7 @@ irc_handle_isupport_chanmodes (struct server *s, char *value)
{
struct str_vector v;
str_vector_init (&v);
- split_str_ignore_empty (value, ',', &v);
+ cstr_split_ignore_empty (value, ',', &v);
if (v.len >= 4)
{
free (s->irc_chanmodes_list);
@@ -6373,7 +6373,7 @@ dump_matching_options
for (size_t i = 0; i < output->len; i++)
{
// Yeah, I know
- char *key = str_cut_until (output->vector[i], " ");
+ char *key = cstr_cut_until (output->vector[i], " ");
if (fnmatch (mask, key, 0))
str_vector_remove (output, i--);
free (key);
@@ -6841,7 +6841,7 @@ handle_command_set_assign
}
for (size_t i = 0; i < all->len; i++)
{
- char *key = str_cut_until (all->vector[i], " ");
+ char *key = cstr_cut_until (all->vector[i], " ");
handle_command_set_assign_item (ctx, key, new_, add, remove);
free (key);
}
@@ -7018,7 +7018,7 @@ handle_command_ctcp (struct handler_args *a)
return false;
char *tag = cut_word (&a->arguments);
- transform_str (tag, toupper_ascii);
+ cstr_transform (tag, toupper_ascii);
if (*a->arguments)
irc_send (a->s, "PRIVMSG %s :\x01%s %s\x01", target, tag, a->arguments);
@@ -7100,7 +7100,7 @@ handle_command_part (struct handler_args *a)
{
struct str_vector v;
str_vector_init (&v);
- split_str_ignore_empty (cut_word (&a->arguments), ' ', &v);
+ cstr_split_ignore_empty (cut_word (&a->arguments), ' ', &v);
for (size_t i = 0; i < v.len; i++)
part_channel (a->s, v.vector[i], a->arguments);
str_vector_free (&v);
@@ -7144,7 +7144,7 @@ handle_command_cycle (struct handler_args *a)
{
struct str_vector v;
str_vector_init (&v);
- split_str_ignore_empty (cut_word (&a->arguments), ' ', &v);
+ cstr_split_ignore_empty (cut_word (&a->arguments), ' ', &v);
for (size_t i = 0; i < v.len; i++)
cycle_channel (a->s, v.vector[i], a->arguments);
str_vector_free (&v);
@@ -7269,7 +7269,7 @@ mass_channel_mode_mask_list
{
struct str_vector v;
str_vector_init (&v);
- split_str_ignore_empty (a->arguments, ' ', &v);
+ cstr_split_ignore_empty (a->arguments, ' ', &v);
// XXX: this may be a bit too trivial; we could map also nicknames
// to information from WHO polling or userhost-in-names
@@ -7312,7 +7312,7 @@ handle_command_invite (struct handler_args *a)
{
struct str_vector v;
str_vector_init (&v);
- split_str_ignore_empty (a->arguments, ' ', &v);
+ cstr_split_ignore_empty (a->arguments, ' ', &v);
bool result = !!v.len;
for (size_t i = 0; i < v.len; i++)
@@ -7493,7 +7493,7 @@ handle_command_channel_mode
struct str_vector v;
str_vector_init (&v);
- split_str_ignore_empty (a->arguments, ' ', &v);
+ cstr_split_ignore_empty (a->arguments, ' ', &v);
mass_channel_mode (a->s, a->channel_name, adding, mode_char, &v);
str_vector_free (&v);
return true;
@@ -7822,7 +7822,7 @@ expand_alias_definition (const struct str *definition, const char *arguments)
{
struct str_vector v;
str_vector_init (&v);
- split_str_ignore_empty (arguments, ' ', &v);
+ cstr_split_ignore_empty (arguments, ' ', &v);
struct str expanded;
str_init (&expanded);
@@ -8115,7 +8115,7 @@ complete_option (struct app_context *ctx, struct completion *data,
char *mask = xstrdup_printf ("%s*", word);
for (size_t i = 0; i < options.len; i++)
{
- char *key = str_cut_until (options.vector[i], " ");
+ char *key = cstr_cut_until (options.vector[i], " ");
if (!fnmatch (mask, key, 0))
str_vector_add_owned (output, key);
else
@@ -8808,7 +8808,8 @@ load_configuration (struct app_context *ctx)
struct config_item_ *root = NULL;
struct error *e = NULL;
- char *filename = resolve_config_filename (PROGRAM_NAME ".conf");
+ char *filename = resolve_filename
+ (PROGRAM_NAME ".conf", resolve_relative_config_filename);
if (filename)
root = load_configuration_file (filename, &e);
else