From 3c3a3a76bff23a0b1bc53d71346b209e9d2024e2 Mon Sep 17 00:00:00 2001 From: "7u83@mail.ru" <7u83@mail.ru@noemail.net> Date: Sun, 20 Jul 2014 19:51:45 +0000 Subject: [PATCH] Some work ... FossilOrigin-Name: 306c25d36c90892efdce236d31c810bd607ca014417315cced68d2f651efb404 --- src/wtp/wtp_conf_uci.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/wtp/wtp_conf_uci.c b/src/wtp/wtp_conf_uci.c index 314881fb..94332810 100644 --- a/src/wtp/wtp_conf_uci.c +++ b/src/wtp/wtp_conf_uci.c @@ -18,6 +18,15 @@ +static void * get_un_section(struct uci_package * pkg, const char *type) +{ +// struct uci_list * l = pkg->sections; + + +} + + + int read_config(const char * filename){ struct uci_context * ctx; @@ -30,6 +39,7 @@ int read_config(const char * filename){ struct uci_package * pkg; + int rc = uci_load(ctx, "./wtpconf", &pkg ); if (rc) { @@ -37,13 +47,31 @@ int read_config(const char * filename){ uci_get_errorstr(ctx, &errstr, ""); cw_log(LOG_ERR,"Fatal: Can't read config file: %s",errstr); } + printf ("PackagePath: %s\n",pkg->path); + + + struct uci_package *p; + p = uci_lookup_package(ctx,"tobias"); + + printf ("Package: %p\n",p); + + + + struct uci_section * section; - section = uci_lookup_section(ctx,pkg,"wtp"); + section = uci_lookup_section(ctx,pkg,NULL); if (!section) { goto errX; } - + + + const char *str; + str = uci_lookup_option_string(ctx,section,"name"); + + + printf("Option string: %s\n",str); + // struct uci_ptr * result; // char str[123] = "@wtp[0].name";