more const stuff
authorFelix Fietkau <nbd@openwrt.org>
Mon, 26 May 2008 13:48:20 +0000 (15:48 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 26 May 2008 13:48:20 +0000 (15:48 +0200)
history.c
list.c
uci.h
uci_internal.h

index 73c1bf06ffaf845018009523dfc26303b11a5df3..ea6cf0ddbbe04719b33393c96f6c2506e7a55a2e 100644 (file)
--- a/history.c
+++ b/history.c
@@ -28,7 +28,7 @@
 
 /* record a change that was done to a package */
 void
 
 /* record a change that was done to a package */
 void
-uci_add_history(struct uci_context *ctx, struct uci_list *list, int cmd, char *section, char *option, char *value)
+uci_add_history(struct uci_context *ctx, struct uci_list *list, int cmd, const char *section, const char *option, const char *value)
 {
        struct uci_history *h;
        int size = strlen(section) + 1;
 {
        struct uci_history *h;
        int size = strlen(section) + 1;
diff --git a/list.c b/list.c
index d1208ac382b0d4a5e81e44cfbbd4d96bf05e3cad..02726213deb6977b14c00f3c81f24c395b454a03 100644 (file)
--- a/list.c
+++ b/list.c
@@ -307,7 +307,7 @@ int uci_del_element(struct uci_context *ctx, struct uci_element *e)
        return 0;
 }
 
        return 0;
 }
 
-int uci_set_element_value(struct uci_context *ctx, struct uci_element **element, char *value)
+int uci_set_element_value(struct uci_context *ctx, struct uci_element **element, const char *value)
 {
        /* NB: UCI_INTERNAL use means without history tracking */
        bool internal = ctx->internal;
 {
        /* NB: UCI_INTERNAL use means without history tracking */
        bool internal = ctx->internal;
@@ -399,7 +399,7 @@ int uci_rename(struct uci_context *ctx, struct uci_package *p, char *section, ch
        return 0;
 }
 
        return 0;
 }
 
-int uci_add_section(struct uci_context *ctx, struct uci_package *p, char *type, struct uci_section **res)
+int uci_add_section(struct uci_context *ctx, struct uci_package *p, const char *type, struct uci_section **res)
 {
        bool internal = ctx->internal;
        struct uci_section *s;
 {
        bool internal = ctx->internal;
        struct uci_section *s;
@@ -430,7 +430,7 @@ int uci_delete(struct uci_context *ctx, struct uci_package *p, char *section, ch
        return uci_del_element(ctx, e);
 }
 
        return uci_del_element(ctx, e);
 }
 
-int uci_set(struct uci_context *ctx, struct uci_package *p, char *section, char *option, char *value, struct uci_element **result)
+int uci_set(struct uci_context *ctx, struct uci_package *p, const char *section, const char *option, const char *value, struct uci_element **result)
 {
        /* NB: UCI_INTERNAL use means without history tracking */
        bool internal = ctx->internal;
 {
        /* NB: UCI_INTERNAL use means without history tracking */
        bool internal = ctx->internal;
diff --git a/uci.h b/uci.h
index be816fd95ca5cc64578c0a2521a8a223bb87c833..d17dee73e455cc464757d033d3b48c49a11b55cb 100644 (file)
--- a/uci.h
+++ b/uci.h
@@ -155,7 +155,7 @@ extern int uci_lookup(struct uci_context *ctx, struct uci_element **res, struct
  * @type: section type
  * @res: pointer to store a reference to the new section in
  */
  * @type: section type
  * @res: pointer to store a reference to the new section in
  */
-extern int uci_add_section(struct uci_context *ctx, struct uci_package *p, char *type, struct uci_section **res);
+extern int uci_add_section(struct uci_context *ctx, struct uci_package *p, const char *type, struct uci_section **res);
 
 /**
  * uci_set_element_value: Replace an element's value with a new one
 
 /**
  * uci_set_element_value: Replace an element's value with a new one
@@ -166,7 +166,7 @@ extern int uci_add_section(struct uci_context *ctx, struct uci_package *p, char
  * Only valid for uci_option and uci_section. Will replace the type string
  * when used with an uci_section
  */
  * Only valid for uci_option and uci_section. Will replace the type string
  * when used with an uci_section
  */
-extern int uci_set_element_value(struct uci_context *ctx, struct uci_element **element, char *value);
+extern int uci_set_element_value(struct uci_context *ctx, struct uci_element **element, const char *value);
 
 /**
  * uci_set: Set an element's value; create the element if necessary
 
 /**
  * uci_set: Set an element's value; create the element if necessary
@@ -177,7 +177,7 @@ extern int uci_set_element_value(struct uci_context *ctx, struct uci_element **e
  * @value: value (option) or type (section)
  * @result: store the updated element in this variable (optional)
  */
  * @value: value (option) or type (section)
  * @result: store the updated element in this variable (optional)
  */
-extern int uci_set(struct uci_context *ctx, struct uci_package *p, char *section, char *option, char *value, struct uci_element **result);
+extern int uci_set(struct uci_context *ctx, struct uci_package *p, const char *section, const char *option, const char *value, struct uci_element **result);
 
 /**
  * uci_rename: Rename an element
 
 /**
  * uci_rename: Rename an element
index 67a247352a8c1d809ed19d9ec44a8ab670fd65bf..eba014397f36bf3b01cdf18d13bd91111d3c3b7a 100644 (file)
@@ -43,7 +43,7 @@ __plugin void *uci_malloc(struct uci_context *ctx, size_t size);
 __plugin void *uci_realloc(struct uci_context *ctx, void *ptr, size_t size);
 __plugin char *uci_strdup(struct uci_context *ctx, const char *str);
 __plugin bool uci_validate_str(const char *str, bool name);
 __plugin void *uci_realloc(struct uci_context *ctx, void *ptr, size_t size);
 __plugin char *uci_strdup(struct uci_context *ctx, const char *str);
 __plugin bool uci_validate_str(const char *str, bool name);
-__plugin void uci_add_history(struct uci_context *ctx, struct uci_list *list, int cmd, char *section, char *option, char *value);
+__plugin void uci_add_history(struct uci_context *ctx, struct uci_list *list, int cmd, const char *section, const char *option, const char *value);
 __plugin void uci_free_history(struct uci_history *h);
 __plugin struct uci_package *uci_alloc_package(struct uci_context *ctx, const char *name);
 
 __plugin void uci_free_history(struct uci_history *h);
 __plugin struct uci_package *uci_alloc_package(struct uci_context *ctx, const char *name);