summaryrefslogtreecommitdiff
path: root/ui/alert_box.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-04-18 14:02:18 -0700
committerGuy Harris <guy@alum.mit.edu>2017-04-18 21:02:54 +0000
commit1015fa04313893ba81bca678534fad7a4630d6c8 (patch)
treeae8efa94137f1d17818f19971c4a304abdc34f2a /ui/alert_box.h
parent870b3d2c0f46addafb6a7dab4278de48edc33535 (diff)
downloadwireshark-1015fa04313893ba81bca678534fad7a4630d6c8.tar.gz
Have a common "capture file close alert box" routine.
Take cf_close_failure_alert_box() and put it into libui, with the name cfile_close_failure_alert_box(). Use it not only in file.c but also in ui/export_pdu_ui_utils.c, ui/gtk/file_import_dlg.c, and ui/qt/import_text_dialog.cpp where the error we get back isn't necessarily an errno. Have ui/gtk/file_import_dlg.c and ui/qt/import_text_dialog.cpp also use cfile_open_failure_alert_box() on open errors. Change-Id: I987f339a23ea58609390306a319923e7f92d5c07 Reviewed-on: https://code.wireshark.org/review/21203 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/alert_box.h')
-rw-r--r--ui/alert_box.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/ui/alert_box.h b/ui/alert_box.h
index 9e19234e20..9b2588164a 100644
--- a/ui/alert_box.h
+++ b/ui/alert_box.h
@@ -53,6 +53,35 @@ extern void cfile_open_failure_alert_box(const char *filename, int err,
int file_type);
/*
+ * Alert box for a failed attempt to close a capture file.
+ * "err" is assumed to be a UNIX-style errno or a WTAP_ERR_ value;
+ * "err_info" is assumed to be a string giving further information for
+ * some WTAP_ERR_ values; "for_writing" is TRUE if the file is being
+ * opened for writing and FALSE if it's being opened for reading;
+ * "file_type" is a WTAP_FILE_TYPE_SUBTYPE_ value for the type of
+ * file being written (it's ignored for opening-for-reading errors).
+ *
+ * When closing a capture file:
+ *
+ * some information in the file that can't be determined until
+ * all packets have been written might be written to the file
+ * (such as a table of the file offsets of all packets);
+ *
+ * data buffered in the low-level file writing code might be
+ * flushed to the file;
+ *
+ * for remote file systems, data written to the file but not
+ * yet sent to the server might be sent to the server or, if
+ * that data was sent asynchronously, "out of space", "disk
+ * quota exceeded", or "I/O error" indications might have
+ * been received but not yet delivered, and the close operation
+ * could deliver them;
+ *
+ * so we have to check for write errors here.
+ */
+extern void cfile_close_failure_alert_box(const char *filename, int err);
+
+/*
* Alert box for a failed attempt to open or create a file.
* "err" is assumed to be a UNIX-style errno; "for_writing" is TRUE if
* the file is being opened for writing and FALSE if it's being opened