1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-04 00:33:13 +02:00

Rename function string_explode to string_split

This commit is contained in:
Sebastien Helleu
2009-06-28 19:49:32 +02:00
parent 4a89b4ae59
commit 2f7a5a4147
37 changed files with 236 additions and 232 deletions
+2 -2
View File
@@ -430,7 +430,7 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window,
content = gui_bar_window_content_get_with_filling (bar_window, window);
if (content)
{
items = string_explode (content, "\n", 0, 0, &items_count);
items = string_split (content, "\n", 0, 0, &items_count);
if (items_count == 0)
{
if (CONFIG_INTEGER(bar_window->bar->options[GUI_BAR_OPTION_SIZE]) == 0)
@@ -594,7 +594,7 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window,
}
}
if (items)
string_free_exploded (items);
string_free_split (items);
free (content);
}
else
+3 -3
View File
@@ -546,8 +546,8 @@ gui_bar_window_content_get_with_filling (struct t_gui_bar_window *bar_window,
i, sub);
if (ptr_content && ptr_content[0])
{
split_items[i][sub] = string_explode (ptr_content,
"\n", 0, 0, NULL);
split_items[i][sub] = string_split (ptr_content,
"\n", 0, 0, NULL);
for (j = 0; split_items[i][sub][j]; j++)
{
total_items++;
@@ -665,7 +665,7 @@ gui_bar_window_content_get_with_filling (struct t_gui_bar_window *bar_window,
for (sub = 0; sub < bar_window->items_subcount[i]; sub++)
{
if (split_items[i][sub])
string_free_exploded (split_items[i][sub]);
string_free_split (split_items[i][sub]);
}
free (split_items[i]);
}
+13 -13
View File
@@ -681,7 +681,7 @@ gui_bar_free_items_array (struct t_gui_bar *bar)
for (i = 0; i < bar->items_count; i++)
{
if (bar->items_array[i])
string_free_exploded (bar->items_array[i]);
string_free_split (bar->items_array[i]);
}
if (bar->items_array)
{
@@ -710,7 +710,7 @@ gui_bar_set_items_array (struct t_gui_bar *bar, const char *items)
if (items && items[0])
{
tmp_array = string_explode (items, ",", 0, 0, &count);
tmp_array = string_split (items, ",", 0, 0, &count);
if (count > 0)
{
bar->items_count = count;
@@ -718,11 +718,11 @@ gui_bar_set_items_array (struct t_gui_bar *bar, const char *items)
bar->items_array = malloc (count * sizeof (*bar->items_array));
for (i = 0; i < count; i++)
{
bar->items_array[i] = string_explode (tmp_array[i], "+", 0, 0,
&(bar->items_subcount[i]));
bar->items_array[i] = string_split (tmp_array[i], "+", 0, 0,
&(bar->items_subcount[i]));
}
}
string_free_exploded (tmp_array);
string_free_split (tmp_array);
}
}
@@ -856,14 +856,14 @@ gui_bar_config_change_conditions (void *data, struct t_config_option *option)
if (ptr_bar)
{
if (ptr_bar->conditions_array)
string_free_exploded (ptr_bar->conditions_array);
string_free_split (ptr_bar->conditions_array);
if (CONFIG_STRING(ptr_bar->options[GUI_BAR_OPTION_CONDITIONS])
&& CONFIG_STRING(ptr_bar->options[GUI_BAR_OPTION_CONDITIONS])[0])
{
ptr_bar->conditions_array = string_explode (CONFIG_STRING(ptr_bar->options[GUI_BAR_OPTION_CONDITIONS]),
",", 0, 0,
&ptr_bar->conditions_count);
ptr_bar->conditions_array = string_split (CONFIG_STRING(ptr_bar->options[GUI_BAR_OPTION_CONDITIONS]),
",", 0, 0,
&ptr_bar->conditions_count);
}
else
{
@@ -1523,9 +1523,9 @@ gui_bar_new_with_options (const char *name,
new_bar->options[GUI_BAR_OPTION_CONDITIONS] = conditions;
if (CONFIG_STRING(conditions) && CONFIG_STRING(conditions)[0])
{
new_bar->conditions_array = string_explode (CONFIG_STRING(conditions),
",", 0, 0,
&new_bar->conditions_count);
new_bar->conditions_array = string_split (CONFIG_STRING(conditions),
",", 0, 0,
&new_bar->conditions_count);
}
else
{
@@ -2165,7 +2165,7 @@ gui_bar_free (struct t_gui_bar *bar)
config_file_option_free (bar->options[i]);
}
if (bar->conditions_array)
string_free_exploded (bar->conditions_array);
string_free_split (bar->conditions_array);
gui_bar_free_items_array (bar);
free (bar);
+2 -2
View File
@@ -85,10 +85,10 @@ struct t_gui_bar
/* internal vars */
int conditions_count; /* number of conditions */
char **conditions_array; /* exploded bar conditions */
char **conditions_array; /* bar conditions (after split) */
int items_count; /* number of bar items */
int *items_subcount; /* number of sub items */
char ***items_array; /* exploded bar items */
char ***items_array; /* bar items (after split) */
struct t_gui_bar_window *bar_window; /* pointer to bar window */
/* (for type root only) */
int bar_refresh_needed; /* refresh for bar is needed? */
+9 -7
View File
@@ -872,16 +872,16 @@ gui_buffer_set_highlight_tags (struct t_gui_buffer *buffer,
if (buffer->highlight_tags)
free (buffer->highlight_tags);
if (buffer->highlight_tags_array)
string_free_exploded (buffer->highlight_tags_array);
string_free_split (buffer->highlight_tags_array);
if (new_highlight_tags)
{
buffer->highlight_tags = strdup (new_highlight_tags);
if (buffer->highlight_tags)
{
buffer->highlight_tags_array = string_explode (new_highlight_tags,
",", 0, 0,
&buffer->highlight_tags_count);
buffer->highlight_tags_array = string_split (new_highlight_tags,
",", 0, 0,
&buffer->highlight_tags_count);
}
}
else
@@ -1548,7 +1548,7 @@ gui_buffer_close (struct t_gui_buffer *buffer)
if (buffer->highlight_tags)
free (buffer->highlight_tags);
if (buffer->highlight_tags_array)
string_free_exploded (buffer->highlight_tags_array);
string_free_split (buffer->highlight_tags_array);
gui_keyboard_free_all (&buffer->keys, &buffer->last_key);
gui_buffer_local_var_remove_all (buffer);
@@ -2288,7 +2288,8 @@ gui_buffer_dump_hexa (struct t_gui_buffer *buffer)
message_without_colors : "(null)");
if (message_without_colors)
free (message_without_colors);
tags = string_build_with_exploded ((const char **)ptr_line->data->tags_array, ",");
tags = string_build_with_split_string ((const char **)ptr_line->data->tags_array,
",");
log_printf (" tags: %s", (tags) ? tags : "(none)");
if (tags)
free (tags);
@@ -2450,7 +2451,8 @@ gui_buffer_print_log ()
while (ptr_line)
{
num--;
tags = string_build_with_exploded ((const char **)ptr_line->data->tags_array, ",");
tags = string_build_with_split_string ((const char **)ptr_line->data->tags_array,
",");
log_printf (" line N-%05d: y:%d, str_time:'%s', tags:'%s', "
"displayed:%d, highlight:%d, refresh_needed:%d, prefix:'%s'",
num, ptr_line->data->y, ptr_line->data->str_time,
+3 -3
View File
@@ -373,8 +373,8 @@ gui_filter_new (int enabled, const char *name, const char *buffer_name,
if (tags)
{
new_filter->tags = (tags) ? strdup (tags) : NULL;
new_filter->tags_array = string_explode (tags, ",", 0, 0,
&new_filter->tags_count);
new_filter->tags_array = string_split (tags, ",", 0, 0,
&new_filter->tags_count);
}
else
{
@@ -443,7 +443,7 @@ gui_filter_free (struct t_gui_filter *filter)
if (filter->tags)
free (filter->tags);
if (filter->tags_array)
string_free_exploded (filter->tags_array);
string_free_split (filter->tags_array);
if (filter->regex)
free (filter->regex);
if (filter->regex_prefix)
+3 -3
View File
@@ -483,7 +483,7 @@ gui_line_remove_from_list (struct t_gui_buffer *buffer,
if (line->data->str_time)
free (line->data->str_time);
if (line->data->tags_array)
string_free_exploded (line->data->tags_array);
string_free_split (line->data->tags_array);
if (line->data->prefix)
free (line->data->prefix);
if (line->data->message)
@@ -692,8 +692,8 @@ gui_line_add (struct t_gui_buffer *buffer, time_t date,
NULL : gui_chat_get_time_string (date);
if (tags)
{
new_line->data->tags_array = string_explode (tags, ",", 0, 0,
&new_line->data->tags_count);
new_line->data->tags_array = string_split (tags, ",", 0, 0,
&new_line->data->tags_count);
}
else
{