X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=uci.h;h=65fb7d34cb1fb00a8804de0a2197ef5fb4a01725;hp=8784c43d3be0c674c9b38e53859eb2b49601bebc;hb=bc7b118f0a40709c985b54c96d826e9057c9f0dd;hpb=f7df28b4d0155c780fa46a09d2dbcf7825faebae diff --git a/uci.h b/uci.h index 8784c43..65fb7d3 100644 --- a/uci.h +++ b/uci.h @@ -67,7 +67,7 @@ extern void uci_perror(struct uci_context *ctx, const char *str); * @ctx: uci context * @name: name of the config file (relative to the config directory) */ -extern int uci_load(struct uci_context *ctx, const char *name); +extern int uci_load(struct uci_context *ctx, const char *name, struct uci_config **cfg); /** * uci_unload: Unload a config file from the uci context @@ -89,7 +89,7 @@ extern int uci_cleanup(struct uci_context *ctx); * * @ctx: uci context */ -extern char **uci_list_configs(struct uci_context *ctx); +extern char **uci_list_configs(); /* UCI data structures */ @@ -112,6 +112,7 @@ struct uci_parse_context /* private: */ struct uci_config *cfg; + struct uci_section *section; FILE *file; char *buf; char *reason; @@ -148,7 +149,7 @@ struct uci_option #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #endif -#define uci_list_empty(list) (list->next == ptr) +#define uci_list_empty(list) ((list)->next == (list)) #define uci_list_entry(_type, _ptr) \ ((struct uci_ ## _type *) ((char *)(_ptr) - offsetof(struct uci_ ## _type,list)))