From a390d8386961109a8e182897753080538dce8625 Mon Sep 17 00:00:00 2001 From: reinelt Date: Sat, 10 Jan 2004 20:22:33 +0000 Subject: [lcd4linux @ 2004-01-10 20:22:33 by reinelt] added new function 'cfg_list()' (not finished yet) added layout.c (will replace processor.c someday) added widget_text.c (will be the first and most important widget) modified lcd4linux.c so that old-style configs should work, too git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@304 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- cfg.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) (limited to 'cfg.c') diff --git a/cfg.c b/cfg.c index bfcfde0..ddf9f4b 100644 --- a/cfg.c +++ b/cfg.c @@ -1,4 +1,4 @@ -/* $Id: cfg.c,v 1.23 2004/01/09 04:16:06 reinelt Exp $^ +/* $Id: cfg.c,v 1.24 2004/01/10 20:22:33 reinelt Exp $^ * * config file stuff * @@ -23,6 +23,12 @@ * * * $Log: cfg.c,v $ + * Revision 1.24 2004/01/10 20:22:33 reinelt + * added new function 'cfg_list()' (not finished yet) + * added layout.c (will replace processor.c someday) + * added widget_text.c (will be the first and most important widget) + * modified lcd4linux.c so that old-style configs should work, too + * * Revision 1.23 2004/01/09 04:16:06 reinelt * added 'section' argument to cfg_get(), but NULLed it on all calls by now. * @@ -314,6 +320,30 @@ int l4l_cfg_cmd (char *arg) } +char *l4l_cfg_list (char *section) +{ + int i, len; + char *key; + + // calculate key length + len=strlen(section)+1; + + // prepare search key + key=malloc(len+1); + strcpy (key, section); + strcat (key, "."); + + // search matching entries + for (i=0; i