X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=ucw%2Fdoc%2Fconf.txt;h=31698a62b9d6f4fafb8ad78a6c6b1c535844356d;hb=d84b9fd101d2bf3a72b9dc1d603c9b3960e8cb17;hp=5f9a88ccc4491f50f8d0185ddd4ccbfa1341854f;hpb=d5950e6ba69e13cbca6ca0e993451c393978c027;p=libucw.git diff --git a/ucw/doc/conf.txt b/ucw/doc/conf.txt index 5f9a88cc..31698a62 100644 --- a/ucw/doc/conf.txt +++ b/ucw/doc/conf.txt @@ -104,14 +104,14 @@ configuration files. #include #include - 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"; @@ -152,7 +152,7 @@ are three ways to do that: + 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 { @@ -164,7 +164,7 @@ For example, you can have an static array of five unsigned integers: *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 <> macro to find out the number of elements actually loaded. + @@ -189,11 +189,12 @@ First element of your structure must be <>. + The first example is list of strings and uses <>: - 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 } };