/*
* Updated 1 Dec 10 jjm
*/
-
+
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <string.h>
#include <epan/filesystem.h>
-#include "file_util.h"
+#include <wsutil/file_util.h>
#include <epan/packet.h>
#include "color.h"
/* the currently active filters */
static GSList *color_filter_list = NULL;
-/* keep "old" deleted filters in this list until
+/* keep "old" deleted filters in this list until
* the dissection no longer needs them (e.g. file is closed) */
static GSList *color_filter_deleted_list = NULL;
static GSList *color_filter_valid_list = NULL;
* If found, clear it so that a filter can be "moved" up and down the list
*/
for ( i=1 ; i<=10 ; i++ ) {
- /* If we need to reset the temporary filter (filter==NULL), don't look
+ /* If we need to reset the temporary filter (filter==NULL), don't look
* for other rules with the same filter string
*/
- if( i!=filt_nr && filter==NULL )
+ if( i!=filt_nr && filter==NULL )
continue;
name = g_strdup_printf("%s%02d",TEMP_COLOR_PREFIX,i);
/* clone all list entries from tmp/edit to normal list */
color_filter_valid_list = NULL;
color_filter_valid_list = color_filter_list_clone(tmp_cfl);
- color_filter_valid_list = g_slist_concat(color_filter_valid_list,
+ color_filter_valid_list = g_slist_concat(color_filter_valid_list,
color_filter_list_clone(edit_cfl) );
/* compile all filter */
g_slist_foreach(color_filter_list, color_filter_compile_cb, NULL);
}
-gboolean
+gboolean
color_filters_used(void)
{
return color_filter_list != NULL && filters_enabled;
}
-gboolean
+gboolean
tmp_color_filters_used(void)
{
return tmp_colors_set;
}
/* skip # comments and invalid lines */
- if (c != '@') {
+ if (c != '@') {
skip_end_of_line = TRUE;
continue;
}
name_len *= 2;
name = g_realloc(name, name_len + 1);
}
- name[i++] = c;
+ name[i++] = c;
}
name[i] = '\0';
/* decide what file to open (from dfilter code) */
path = get_persconffile_path("colorfilters", TRUE, FALSE);
- if ((f = eth_fopen(path, "r")) == NULL) {
+ if ((f = ws_fopen(path, "r")) == NULL) {
if (errno != ENOENT) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"Could not open filter file\n\"%s\": %s.", path,
/* decide what file to open (from dfilter code) */
path = get_datafile_path("colorfilters");
- if ((f = eth_fopen(path, "r")) == NULL) {
+ if ((f = ws_fopen(path, "r")) == NULL) {
if (errno != ENOENT) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"Could not open global filter file\n\"%s\": %s.", path,
FILE *f;
gboolean ret;
- if ((f = eth_fopen(path, "r")) == NULL) {
+ if ((f = ws_fopen(path, "r")) == NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"Could not open\n%s\nfor reading: %s.",
path, strerror(errno));
data.f = f;
data.only_selected = only_selected;
-
+
fprintf(f,"# DO NOT EDIT THIS FILE! It was created by Wireshark\n");
g_slist_foreach(cfl, write_filter, &data);
return TRUE;
}
path = get_persconffile_path("colorfilters", TRUE, TRUE);
- if ((f = eth_fopen(path, "w+")) == NULL) {
+ if ((f = ws_fopen(path, "w+")) == NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"Could not open\n%s\nfor writing: %s.",
path, strerror(errno));
{
FILE *f;
- if ((f = eth_fopen(path, "w+")) == NULL) {
+ if ((f = ws_fopen(path, "w+")) == NULL) {
simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK,
"Could not open\n%s\nfor writing: %s.",
path, strerror(errno));