X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=uci.h;h=ac85105443a0b5fac31c23baca7bd6dfd17f4e24;hp=7cd7eb9fe6256398a9776cc301ec434e740d57d2;hb=5faea6dcdf54d0ac085298b87c0799551bdcfdbd;hpb=a453ffddff2ce0c0c7fd21826bb4ae1544829553 diff --git a/uci.h b/uci.h index 7cd7eb9..ac85105 100644 --- a/uci.h +++ b/uci.h @@ -2,9 +2,9 @@ * libuci - Library for the Unified Configuration Interface * Copyright (C) 2008 Felix Fietkau * - * this program is free software; you can redistribute it and/or modify - * it under the terms of the gnu lesser general public license version 2.1 - * as published by the free software foundation + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 2.1 + * as published by the Free Software Foundation * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -15,10 +15,27 @@ #ifndef __LIBUCI_H #define __LIBUCI_H +/* + * you can use these defines to enable debugging behavior for + * apps compiled against libuci: + * + * #define UCI_DEBUG_TYPECAST: + * enable uci_element typecast checking at run time + * + */ + +#ifdef DEBUG_ALL +#define UCI_DEBUG +#define UCI_DEBUG_TYPECAST +#endif + +#include #include #include #define UCI_CONFDIR "/etc/config" +#define UCI_SAVEDIR "/tmp/.uci" +#define UCI_FILEMODE 0600 enum { @@ -28,31 +45,50 @@ enum UCI_ERR_NOTFOUND, UCI_ERR_IO, UCI_ERR_PARSE, + UCI_ERR_DUPLICATE, UCI_ERR_UNKNOWN, UCI_ERR_LAST }; +struct uci_list; struct uci_list { - void *next; - void *prev; + struct uci_list *next; + struct uci_list *prev; }; -struct uci_config; +struct uci_element; +struct uci_package; struct uci_section; struct uci_option; +struct uci_history; +struct uci_context; +struct uci_backend; struct uci_parse_context; /** - * uci_alloc: Allocate a new uci context + * uci_parse_tuple: Parse an uci tuple + * @ctx: uci context + * @str: input string + * @package: output package pointer + * @section: output section pointer + * @option: output option pointer + * @value: output value pointer + * + * format: [.
[.