summaryrefslogtreecommitdiff
path: root/file.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-04-01 23:44:29 +0000
committerGuy Harris <guy@alum.mit.edu>2013-04-01 23:44:29 +0000
commitd94275940164f0b40d12d1caa709b113360491c2 (patch)
treec2db98b41c1d80160f286af62b5d94f6959359c7 /file.h
parentf8965b7b2cddad13ca785b283dc05d59c3af2438 (diff)
downloadwireshark-d94275940164f0b40d12d1caa709b113360491c2.tar.gz
Add routines to file.c to indicate whether:
a save can be done ("can" in the sense of "there's something to save" and in the sense of "we can write that something out"); a "save as" can be done (in the sense of "we can write what we have out"); there's unsaved data to save (which might be unsaved changes or might be a temporary file full of packets); and use them as appropriate. This means that the "unsaved data" indicator in the UI will be turned on for temporary files full of packets as well as for files with unsaved changes; that's what we want. svn path=/trunk/; revision=48693
Diffstat (limited to 'file.h')
-rw-r--r--file.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/file.h b/file.h
index ae9fb8cc00..774b5264eb 100644
--- a/file.h
+++ b/file.h
@@ -201,15 +201,40 @@ void cf_fake_continue_tail(capture_file *cf);
cf_read_status_t cf_finish_tail(capture_file *cf, int *err);
/**
- * Determine whether this capture file (or a range of it) can be saved
+ * Determine whether this capture file (or a range of it) can be written
* in any format using Wiretap rather than by copying the raw data.
*
* @param cf the capture file to check
- * @return TRUE if it can be saved, FALSE if it can't
+ * @return TRUE if it can be written, FALSE if it can't
*/
gboolean cf_can_write_with_wiretap(capture_file *cf);
/**
+ * Determine whether this capture file can be saved with a "save" operation;
+ * if there's nothing unsaved, it can't.
+ *
+ * @param cf the capture file to check
+ * @return TRUE if it can be saved, FALSE if it can't
+ */
+gboolean cf_can_save(capture_file *cf);
+
+/**
+ * Determine whether this capture file can be saved with a "save as" operation.
+ *
+ * @param cf the capture file to check
+ * @return TRUE if it can be saved, FALSE if it can't
+ */
+gboolean cf_can_save_as(capture_file *cf);
+
+/**
+ * Determine whether this capture file has unsaved data.
+ *
+ * @param cf the capture file to check
+ * @return TRUE if it has unsaved data, FALSE if it doesn't
+ */
+gboolean cf_not_saved(capture_file *cf);
+
+/**
* Save all packets in a capture file to a new file, and, if that succeeds,
* make that file the current capture file. If there's already a file with
* that name, do a "safe save", writing to a temporary file in the same