#include <ucw/conf.h>
#include <ucw/getopt.h>
- static byte short_opts[] = CF_SHORT_OPTS "v";
+ static char short_opts[] = CF_SHORT_OPTS "v";
static struct option long_opts[] = {
CF_LONG_OPTS
{ "verbose", 0, 0, 'v' },
{ NULL, 0, 0, 0 }
};
- int verbose;
+ static int verbose;
int main(int argc, char *argv[]) {
cf_def_file = "default.cf";
+
For example, you can have an static array of five unsigned integers:
+
- static uns array = { 1, 2, 3, 4, 5 };
+ static uns array[] = { 1, 2, 3, 4, 5 };
+
static struct cf_section section = {
CF_ITEMS {
*Dynamic arrays*::
Similar to static array, but you provide pointer
to pointer to the given item (eg. if you want dynamic array of
- `int` s, you give `**int`). The parser allocates an array of needed
+ integers, you give `**int`). The parser allocates an array of needed
size. You can use the <<def_DARY_LEN,`DARY_LEN`>> macro to find out
the number of elements actually loaded.
+
+
The first example is list of strings and uses <<clist:simple,simple
lists>>:
- struct clist list;
++
+ static struct clist list;
+
static struct cf_section section = {
CF_ITEMS {
- CF_LIST("list", &list, &cf_string_list_cofnig),
+ CF_LIST("list", &list, &cf_string_list_config),
CF_END
}
};