aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/file_dlg.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2005-02-04 18:44:44 +0000
committerUlf Lamping <ulf.lamping@web.de>2005-02-04 18:44:44 +0000
commit0861927ce30146be75bcb57b6939c0fd9fee43b3 (patch)
treef2d0d9d8c5c3712358e4169b04391e0629dfd4af /gtk/file_dlg.c
parentd7ad33dc51e0e51e6cc2903ff0ac3ce806550ce4 (diff)
huge cleanup of capture file API (functions in file.c/file.h).
This includes: all functions in file.h now have a cf_ prefix, will have doxygen tags, will have the capture_file *cf as the first parameter and I tried to generalize the return values for non trivial functions. Hopefully, I didn't introduced any new bugs, as I had to change a lot of files... svn path=/trunk/; revision=13289
Diffstat (limited to 'gtk/file_dlg.c')
-rw-r--r--gtk/file_dlg.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/gtk/file_dlg.c b/gtk/file_dlg.c
index b4c3cf8546..8f35fd916f 100644
--- a/gtk/file_dlg.c
+++ b/gtk/file_dlg.c
@@ -676,7 +676,7 @@ file_open_ok_cb(GtkWidget *w, gpointer fs) {
}
/* Try to open the capture file. */
- if ((err = cf_open(cf_name, FALSE, &cfile)) != 0) {
+ if (cf_open(&cfile, cf_name, FALSE, &err) != CF_OK) {
/* We couldn't open it; don't dismiss the open dialog box,
just leave it around so that the user can, after they
dismiss the alert box popped up for the open error,
@@ -715,14 +715,14 @@ file_open_ok_cb(GtkWidget *w, gpointer fs) {
switch (cf_read(&cfile)) {
- case READ_SUCCESS:
- case READ_ERROR:
+ case CF_OK:
+ case CF_ERROR:
/* Just because we got an error, that doesn't mean we were unable
to read any of the file; we handle what we could get from the
file. */
break;
- case READ_ABORTED:
+ case CF_ABORTED:
/* The user bailed out of re-reading the capture file; the
capture file has been closed - just free the capture file name
string and return (without changing the last containing
@@ -1069,7 +1069,7 @@ file_merge_ok_cb(GtkWidget *w, gpointer fs) {
window_destroy(GTK_WIDGET (fs));
/* Try to open the merged capture file. */
- if ((err = cf_open(tmpname, TRUE /* temporary file */, &cfile)) != 0) {
+ if (cf_open(&cfile, tmpname, TRUE /* temporary file */, &err) != CF_OK) {
/* We couldn't open it; don't dismiss the open dialog box,
just leave it around so that the user can, after they
dismiss the alert box popped up for the open error,
@@ -1086,14 +1086,14 @@ file_merge_ok_cb(GtkWidget *w, gpointer fs) {
switch (cf_read(&cfile)) {
- case READ_SUCCESS:
- case READ_ERROR:
+ case CF_OK:
+ case CF_ERROR:
/* Just because we got an error, that doesn't mean we were unable
to read any of the file; we handle what we could get from the
file. */
break;
- case READ_ABORTED:
+ case CF_ABORTED:
/* The user bailed out of re-reading the capture file; the
capture file has been closed - just free the capture file name
string and return (without changing the last containing
@@ -1440,7 +1440,7 @@ file_save_as_ok_cb(GtkWidget *w _U_, gpointer fs) {
/* Write out the packets (all, or only the ones from the current
range) to the file with the specified name. */
- if (! cf_save(cf_name, &cfile, &range, filetype)) {
+ if (cf_save(&cfile, cf_name, &range, filetype) != CF_OK) {
/* The write failed; don't dismiss the open dialog box,
just leave it around so that the user can, after they
dismiss the alert box popped up for the error, try again. */
@@ -1458,7 +1458,7 @@ file_save_as_ok_cb(GtkWidget *w _U_, gpointer fs) {
}
/* The write succeeded; get rid of the file selection box. */
- /* cf_save might already closed our dialog! */
+ /* cf_save() might already closed our dialog! */
if (file_save_as_w)
window_destroy(GTK_WIDGET (fs));
@@ -1518,7 +1518,7 @@ file_save_as_destroy_cb(GtkWidget *win _U_, gpointer user_data _U_)
/* Reload a file using the current read and display filters */
void
file_reload_cmd_cb(GtkWidget *w _U_, gpointer data _U_) {
- cf_reload();
+ cf_reload(&cfile);
}
/******************** Color Filters *********************************/