configfile.c: constify
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 5 Mar 2016 14:17:10 +0000 (15:17 +0100)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 5 Mar 2016 14:17:10 +0000 (15:17 +0100)
src/daemon/collectd.c
src/daemon/configfile.c
src/daemon/configfile.h

index a745d7d..a970d03 100644 (file)
@@ -518,7 +518,7 @@ int main (int argc, char **argv)
        struct sigaction sig_term_action;
        struct sigaction sig_usr1_action;
        struct sigaction sig_pipe_action;
        struct sigaction sig_term_action;
        struct sigaction sig_usr1_action;
        struct sigaction sig_pipe_action;
-       char *configfile = CONFIGFILE;
+       const char *configfile = CONFIGFILE;
        int test_config  = 0;
        int test_readall = 0;
        const char *basedir;
        int test_config  = 0;
        int test_readall = 0;
        const char *basedir;
index 89b0be0..8a7621d 100644 (file)
@@ -72,15 +72,15 @@ typedef struct cf_complex_callback_s
 
 typedef struct cf_value_map_s
 {
 
 typedef struct cf_value_map_s
 {
-       char *key;
+       const char *key;
        int (*func) (oconfig_item_t *);
 } cf_value_map_t;
 
 typedef struct cf_global_option_s
 {
        int (*func) (oconfig_item_t *);
 } cf_value_map_t;
 
 typedef struct cf_global_option_s
 {
-       char *key;
+       const char *key;
        char *value;
        char *value;
-       char *def;
+       const char *def;
 } cf_global_option_t;
 
 /*
 } cf_global_option_t;
 
 /*
@@ -381,7 +381,7 @@ static int dispatch_value (oconfig_item_t *ci)
 static int dispatch_block_plugin (oconfig_item_t *ci)
 {
        int i;
 static int dispatch_block_plugin (oconfig_item_t *ci)
 {
        int i;
-       char *name;
+       const char *name;
 
        cf_complex_callback_t *cb;
 
 
        cf_complex_callback_t *cb;
 
@@ -1115,7 +1115,7 @@ int cf_register_complex (const char *type, int (*callback) (oconfig_item_t *))
        return (0);
 } /* int cf_register_complex */
 
        return (0);
 } /* int cf_register_complex */
 
-int cf_read (char *filename)
+int cf_read (const char *filename)
 {
        oconfig_item_t *conf;
        int i;
 {
        oconfig_item_t *conf;
        int i;
index 5bc9b30..648246b 100644 (file)
@@ -87,7 +87,7 @@ int cf_register_complex (const char *type, int (*callback) (oconfig_item_t *));
  *  Returns zero upon success and non-zero otherwise. A error-message will have
  *  been printed in this case.
  */
  *  Returns zero upon success and non-zero otherwise. A error-message will have
  *  been printed in this case.
  */
-int cf_read (char *filename);
+int cf_read (const char *filename);
 
 int global_option_set (const char *option, const char *value);
 const char *global_option_get (const char *option);
 
 int global_option_set (const char *option, const char *value);
 const char *global_option_get (const char *option);