diff options
author | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2004-03-03 03:47:04 +0000 |
---|---|---|
committer | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2004-03-03 03:47:04 +0000 |
commit | 9ef4282e9e32e857f4d0cac9df6d58f2cba159f4 (patch) | |
tree | 723676ea31fe0615b4d0caca1491e5a21fe85c7a /plugin_cfg.c | |
parent | d0b39b590e56b191394cfcb6b8690de0fbd87957 (diff) | |
download | lcd4linux-9ef4282e9e32e857f4d0cac9df6d58f2cba159f4.tar.gz |
[lcd4linux @ 2004-03-03 03:47:04 by reinelt]
big patch from Martin Hejl:
- use qprintf() where appropriate
- save CPU cycles on gettimeofday()
- add quit() functions to free allocated memory
- fixed lots of memory leaks
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@384 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'plugin_cfg.c')
-rw-r--r-- | plugin_cfg.c | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/plugin_cfg.c b/plugin_cfg.c index 0a9f9c6..cf81d10 100644 --- a/plugin_cfg.c +++ b/plugin_cfg.c @@ -1,4 +1,4 @@ -/* $Id: plugin_cfg.c,v 1.5 2004/02/01 19:37:40 reinelt Exp $ +/* $Id: plugin_cfg.c,v 1.6 2004/03/03 03:47:04 reinelt Exp $ * * plugin for config file access * @@ -23,6 +23,13 @@ * * * $Log: plugin_cfg.c,v $ + * Revision 1.6 2004/03/03 03:47:04 reinelt + * big patch from Martin Hejl: + * - use qprintf() where appropriate + * - save CPU cycles on gettimeofday() + * - add quit() functions to free allocated memory + * - fixed lots of memory leaks + * * Revision 1.5 2004/02/01 19:37:40 reinelt * got rid of every strtok() incarnation. * @@ -87,13 +94,13 @@ static void load_variables (void) } else { expression=cfg_get_raw (section, l, ""); if (expression!=NULL && *expression!='\0') { - if (Eval(expression, &result)==0) { - debug ("Variable %s = '%s' (%f)", l, R2S(&result), R2N(&result)); - SetVariable (l, &result); - DelResult (&result); - } else { - error ("error evaluating variable '%s' from %s", list, cfg_source()); - } + if (Eval(expression, &result)==0) { + debug ("Variable %s = '%s' (%f)", l, R2S(&result), R2N(&result)); + SetVariable (l, &result); + DelResult (&result); + } else { + error ("error evaluating variable '%s' from %s", list, cfg_source()); + } } } l=p?p+1:NULL; @@ -127,12 +134,14 @@ static void my_cfg (RESULT *result, int argc, RESULT *argv[]) // buffer starts with '.', so cut off first char value=cfg_get("", buffer+1, ""); - + + // store result + SetResult(&result, R_STRING, value); + // free buffer again free (buffer); - // store result - SetResult(&result, R_STRING, value); + free(value); } @@ -146,3 +155,8 @@ int plugin_init_cfg (void) return 0; } + +void plugin_exit_cfg(void) +{ + +} |