diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-06-28 19:49:32 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-06-28 19:49:32 +0200 |
commit | 2f7a5a4147d546753bef505cee4cd29aa3dcaf07 (patch) | |
tree | fff8de5328e269776da426566c5e4065efdaa18b /src/gui | |
parent | 4a89b4ae5900d02985e1d8641bc27f1690b9e94b (diff) | |
download | weechat-2f7a5a4147d546753bef505cee4cd29aa3dcaf07.zip |
Rename function string_explode to string_split
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/curses/gui-curses-bar-window.c | 4 | ||||
-rw-r--r-- | src/gui/gui-bar-window.c | 6 | ||||
-rw-r--r-- | src/gui/gui-bar.c | 26 | ||||
-rw-r--r-- | src/gui/gui-bar.h | 4 | ||||
-rw-r--r-- | src/gui/gui-buffer.c | 16 | ||||
-rw-r--r-- | src/gui/gui-filter.c | 6 | ||||
-rw-r--r-- | src/gui/gui-line.c | 6 |
7 files changed, 35 insertions, 33 deletions
diff --git a/src/gui/curses/gui-curses-bar-window.c b/src/gui/curses/gui-curses-bar-window.c index c4c8f2167..85342c8a2 100644 --- a/src/gui/curses/gui-curses-bar-window.c +++ b/src/gui/curses/gui-curses-bar-window.c @@ -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 diff --git a/src/gui/gui-bar-window.c b/src/gui/gui-bar-window.c index e97f20bd7..d610dbaf6 100644 --- a/src/gui/gui-bar-window.c +++ b/src/gui/gui-bar-window.c @@ -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]); } diff --git a/src/gui/gui-bar.c b/src/gui/gui-bar.c index 8e89d4d5f..9e0133187 100644 --- a/src/gui/gui-bar.c +++ b/src/gui/gui-bar.c @@ -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); diff --git a/src/gui/gui-bar.h b/src/gui/gui-bar.h index 2a8f79694..d79c81c3c 100644 --- a/src/gui/gui-bar.h +++ b/src/gui/gui-bar.h @@ -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? */ diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index 8eefc2ef1..3a79a4059 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -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, diff --git a/src/gui/gui-filter.c b/src/gui/gui-filter.c index b8e58b2e5..3aa2ce7a2 100644 --- a/src/gui/gui-filter.c +++ b/src/gui/gui-filter.c @@ -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) diff --git a/src/gui/gui-line.c b/src/gui/gui-line.c index 0cf9a5c8e..7f155cf5a 100644 --- a/src/gui/gui-line.c +++ b/src/gui/gui-line.c @@ -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 { |