static char *file_rename_error_message(int err);
static void cf_write_failure_alert_box(const char *filename, int err);
static void cf_close_failure_alert_box(const char *filename, int err);
-static gboolean copy_binary_file(char *from_filename, char *to_filename);
+static gboolean copy_binary_file(const char *from_filename, const char *to_filename);
/* Update the progress bar this many times when reading a file. */
#define N_PROGBAR_UPDATES 100
gboolean
-cf_open(capture_file *cf, char *fname, gboolean is_tempfile, int *err)
+cf_open(capture_file *cf, const char *fname, gboolean is_tempfile, int *err)
{
wtap *wth;
gchar *err_info;
#ifdef HAVE_LIBPCAP
gboolean
-cf_start_tail(capture_file *cf, char *fname, gboolean is_tempfile, int *err)
+cf_start_tail(capture_file *cf, const char *fname, gboolean is_tempfile, int *err)
{
gchar *capture_msg;
gboolean status;
}
gboolean
-cf_save(capture_file *cf, char *fname, packet_range_t *range, guint save_format)
+cf_save(capture_file *cf, const char *fname, packet_range_t *range, guint save_format)
{
gchar *from_filename;
const gchar *name_ptr;
}
char *
-cf_read_error_message(int err, gchar *err_info)
+cf_read_error_message(int err, const gchar *err_info)
{
static char errmsg_errno[1024+1];
* displays a simple dialog window with the error message.
*/
static gboolean
-copy_binary_file(char *from_filename, char *to_filename)
+copy_binary_file(const char *from_filename, const char *to_filename)
{
int from_fd, to_fd, nread, nwritten, err;
guint8 pd[65536];
* @param is_tempfile is this a temporary file?
* @return TRUE on success, FALSE on failure
*/
-gboolean cf_open(capture_file *cf, char *fname, gboolean is_tempfile, int *err);
+gboolean cf_open(capture_file *cf, const char *fname, gboolean is_tempfile, int *err);
/**
* Close a capture file.
* @param err the error code, if an error had occured
* @return TRUE on success, FALSE on failure
*/
-gboolean cf_start_tail(capture_file *cf, char *fname, gboolean is_tempfile, int *err);
+gboolean cf_start_tail(capture_file *cf, const char *fname, gboolean is_tempfile, int *err);
/**
* Read packets from the "end" of a capture file.
* @param save_format the format of the file to save (libpcap, ...)
* @return TRUE on success, FALSE on failure
*/
-gboolean cf_save(capture_file * cf, char *fname, packet_range_t *range, guint save_format);
+gboolean cf_save(capture_file * cf, const char *fname, packet_range_t *range, guint save_format);
/**
* Get a displayable name of the capture file.
* @param err_info the additional info about this error (e.g. filename)
* @return statically allocated error message
*/
-char *cf_read_error_message(int err, gchar *err_info);
+char *cf_read_error_message(int err, const gchar *err_info);
/**
* Merge two (or more) capture files into one.