aboutsummaryrefslogtreecommitdiffstats
path: root/system.c
diff options
context:
space:
mode:
authorreinelt <>2003-02-22 07:53:10 +0000
committerreinelt <>2003-02-22 07:53:10 +0000
commit90be5ac59fddad620f66ebc9dc813802cd45a7e3 (patch)
tree9a0596fed56b4985e15b7d677c43c0bda80fbabb /system.c
parentdb2a64cd4d6e46a6563181f38da2a0a01f56a559 (diff)
downloadlcd4linux-90be5ac59fddad620f66ebc9dc813802cd45a7e3.tar.gz
[lcd4linux @ 2003-02-22 07:53:09 by reinelt]
cfg_get(key,defval)
Diffstat (limited to 'system.c')
-rw-r--r--system.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/system.c b/system.c
index a7fc947..7d091e3 100644
--- a/system.c
+++ b/system.c
@@ -1,4 +1,4 @@
-/* $Id: system.c,v 1.25 2002/12/05 19:12:47 reinelt Exp $
+/* $Id: system.c,v 1.26 2003/02/22 07:53:10 reinelt Exp $
*
* system status retreivement
*
@@ -20,6 +20,9 @@
*
*
* $Log: system.c,v $
+ * Revision 1.26 2003/02/22 07:53:10 reinelt
+ * cfg_get(key,defval)
+ *
* Revision 1.25 2002/12/05 19:12:47 reinelt
* sensors factor and offset patch from Petri Damsten <petri.damsten@raketti.net>
*
@@ -763,7 +766,7 @@ int Sensor (int index, double *val, double *min, double *max)
if (fd[index]==-2) {
snprintf(buffer, 32, "Sensor%d", index);
- sensor[index]=cfg_get(buffer);
+ sensor[index]=cfg_get(buffer, NULL);
if (sensor[index]==NULL || *sensor[index]=='\0') {
error ("%s: no entry for '%s'", cfg_file(), buffer);
fd[index]=-1;
@@ -771,18 +774,18 @@ int Sensor (int index, double *val, double *min, double *max)
}
snprintf(buffer, 32, "Sensor%d_min", index);
- min_buf[index]=atof(cfg_get(buffer)?:"0");
+ min_buf[index]=atof(cfg_get(buffer,"0"));
*min=min_buf[index];
snprintf(buffer, 32, "Sensor%d_max", index);
- max_buf[index]=atof(cfg_get(buffer)?:"100");
+ max_buf[index]=atof(cfg_get(buffer,"100"));
*max=max_buf[index];
snprintf(buffer, 32, "Sensor%d_factor", index);
- factor_buf[index]=atof(cfg_get(buffer)?:"1");
+ factor_buf[index]=atof(cfg_get(buffer,"1"));
snprintf(buffer, 32, "Sensor%d_offset", index);
- offset_buf[index]=atof(cfg_get(buffer)?:"0");
+ offset_buf[index]=atof(cfg_get(buffer,"0"));
fd[index]=open(sensor[index], O_RDONLY);
if (fd[index]==-1) {