diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2005-11-06 22:43:25 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2005-11-06 22:43:25 +0000 |
commit | c3187174bfe39f05c8aa8c6b411952e4b502477d (patch) | |
tree | 0eb95991cb932d74ca534ed0df29a3f2f256b1b8 /color_filters.c | |
parent | 4e954caec384454ebf4eb61140c466e8787daabe (diff) |
replace *a lot* of file related calls by their GLib counterparts. This is necessary for the switch to GTK 2.6 (at least on WIN32).
to do this, I've added file_util.h to wiretap (would file_compat.h be a better name?), and provide compat_macros like eth_open() instead of open(). While at it, move other file related things there, like #include <io.h>, definition of O_BINARY and alike, so it's all in one place.
deleted related things from config.h.win32
As of these massive changes, I'm almost certain that this will break the Unix build. I'll keep an eye on the buildbot so hopefully everything is working again soon.
svn path=/trunk/; revision=16403
Diffstat (limited to 'color_filters.c')
-rw-r--r-- | color_filters.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/color_filters.c b/color_filters.c index 8ee7e50752..8d7fcbb4c7 100644 --- a/color_filters.c +++ b/color_filters.c @@ -34,6 +34,7 @@ #include <string.h> #include <epan/filesystem.h> +#include "file_util.h" #include <epan/packet.h> #include "color.h" @@ -365,7 +366,7 @@ read_filters(void) /* decide what file to open (from dfilter code) */ path = get_persconffile_path("colorfilters", FALSE); - if ((f = fopen(path, "r")) == NULL) { + if ((f = eth_fopen(path, "r")) == NULL) { if (errno != ENOENT) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not open filter file\n\"%s\": %s.", path, @@ -392,7 +393,7 @@ read_global_filters(void) /* decide what file to open (from dfilter code) */ path = get_datafile_path("colorfilters"); - if ((f = fopen(path, "r")) == NULL) { + if ((f = eth_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, @@ -416,7 +417,7 @@ color_filters_import(gchar *path, gpointer arg) FILE *f; gboolean ret; - if ((f = fopen(path, "r")) == NULL) { + if ((f = eth_fopen(path, "r")) == NULL) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not open\n%s\nfor reading: %s.", path, strerror(errno)); @@ -488,7 +489,7 @@ color_filters_write(void) } path = get_persconffile_path("colorfilters", TRUE); - if ((f = fopen(path, "w+")) == NULL) { + if ((f = eth_fopen(path, "w+")) == NULL) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not open\n%s\nfor writing: %s.", path, strerror(errno)); @@ -525,7 +526,7 @@ color_filters_export(gchar *path, gboolean only_marked) { FILE *f; - if ((f = fopen(path, "w+")) == NULL) { + if ((f = eth_fopen(path, "w+")) == NULL) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "Could not open\n%s\nfor writing: %s.", path, strerror(errno)); |