make some string parameters const, as they are not changed inside
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 5 Feb 2005 11:00:04 +0000 (11:00 +0000)
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 5 Feb 2005 11:00:04 +0000 (11:00 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13298 f5534014-38df-0310-8fa8-9805f1628bb7

file.c
file.h

diff --git a/file.c b/file.c
index 9f59a1e6ebfc8aab0c965d0ee5d909f0fbe229ac..1e75cc602521480472388c715f8cc4aebd7a9833 100644 (file)
--- a/file.c
+++ b/file.c
@@ -132,7 +132,7 @@ static void cf_open_failure_alert_box(const char *filename, int err,
 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
@@ -143,7 +143,7 @@ static   gboolean copy_binary_file(char *from_filename, char *to_filename);
 
 
 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;
@@ -530,7 +530,7 @@ cf_read(capture_file *cf)
 
 #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;
@@ -3085,7 +3085,7 @@ save_packet(capture_file *cf _U_, frame_data *fdata,
 }
 
 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;
@@ -3429,7 +3429,7 @@ file_rename_error_message(int err)
 }
 
 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];
 
@@ -3564,7 +3564,7 @@ cf_reload(capture_file *cf) {
  * 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];
diff --git a/file.h b/file.h
index aba380a713821e63604b46ce9c3e6bcac9d74799..15e613d943f6b7a66f2af32634797b88b65d6a8a 100644 (file)
--- a/file.h
+++ b/file.h
@@ -56,7 +56,7 @@ typedef enum {
  * @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.
@@ -90,7 +90,7 @@ cf_read_status_t cf_read(capture_file *cf);
  * @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.
@@ -120,7 +120,7 @@ cf_read_status_t cf_finish_tail(capture_file *cf, int *err);
  * @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.
@@ -380,7 +380,7 @@ void cf_unmark_frame(capture_file *cf, frame_data *frame);
  * @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.