aboutsummaryrefslogtreecommitdiffstats
path: root/system.c
diff options
context:
space:
mode:
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2003-02-22 07:53:10 +0000
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2003-02-22 07:53:10 +0000
commited1760b6b3194d68cdf6edbae01079e9efbc2e09 (patch)
tree9a0596fed56b4985e15b7d677c43c0bda80fbabb /system.c
parentd302e66cd7b633e557bcb1504149ff3a7b39198c (diff)
downloadlcd4linux-ed1760b6b3194d68cdf6edbae01079e9efbc2e09.tar.gz
[lcd4linux @ 2003-02-22 07:53:09 by reinelt]
cfg_get(key,defval) git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@183 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
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) {