aboutsummaryrefslogtreecommitdiffstats
path: root/plugin_cfg.c
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-06-26 09:27:21 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2004-06-26 09:27:21 +0000
commit1338a264d57ad5f74ce6f8283966020a8e978d2e (patch)
treeb14a2a596dd615ae17880b7007d6b2b78191af94 /plugin_cfg.c
parent55abb63f11967a147d26e4654cbbd7ab3f01a558 (diff)
downloadlcd4linux-1338a264d57ad5f74ce6f8283966020a8e978d2e.tar.gz
[lcd4linux @ 2004-06-26 09:27:20 by reinelt]
added '-W' to CFLAGS changed all C++ comments to C ones ('//' => '/* */') cleaned up a lot of signed/unsigned mistakes git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@480 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'plugin_cfg.c')
-rw-r--r--plugin_cfg.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/plugin_cfg.c b/plugin_cfg.c
index 874360c..abfe022 100644
--- a/plugin_cfg.c
+++ b/plugin_cfg.c
@@ -1,4 +1,4 @@
-/* $Id: plugin_cfg.c,v 1.9 2004/06/20 10:09:56 reinelt Exp $
+/* $Id: plugin_cfg.c,v 1.10 2004/06/26 09:27:21 reinelt Exp $
*
* plugin for config file access
*
@@ -23,6 +23,12 @@
*
*
* $Log: plugin_cfg.c,v $
+ * Revision 1.10 2004/06/26 09:27:21 reinelt
+ *
+ * added '-W' to CFLAGS
+ * changed all C++ comments to C ones ('//' => '/* */')
+ * cleaned up a lot of signed/unsigned mistakes
+ *
* Revision 1.9 2004/06/20 10:09:56 reinelt
*
* 'const'ified the whole source
@@ -137,29 +143,29 @@ static void my_cfg (RESULT *result, const int argc, RESULT *argv[])
char *value;
char *buffer;
- // calculate key length
+ /* calculate key length */
len=0;
for (i=0; i<argc; i++) {
len+=strlen(R2S(argv[i]))+1;
}
- // allocate key buffer
+ /* allocate key buffer */
buffer=malloc(len+1);
- // prepare key buffer
+ /* prepare key buffer */
*buffer='\0';
for (i=0; i<argc; i++) {
strcat (buffer, ".");
strcat (buffer, R2S(argv[i]));
}
- // buffer starts with '.', so cut off first char
+ /* buffer starts with '.', so cut off first char */
value=cfg_get("", buffer+1, "");
- // store result
+ /* store result */
SetResult(&result, R_STRING, value);
- // free buffer again
+ /* free buffer again */
free (buffer);
free(value);
@@ -168,10 +174,10 @@ static void my_cfg (RESULT *result, const int argc, RESULT *argv[])
int plugin_init_cfg (void)
{
- // load "Variables" section from cfg
+ /* load "Variables" section from cfg */
load_variables();
- // register plugin
+ /* register plugin */
AddFunction ("cfg", -1, my_cfg);
return 0;
@@ -179,5 +185,5 @@ int plugin_init_cfg (void)
void plugin_exit_cfg(void)
{
-
+ /* empty */
}