diff options
author | reinelt <> | 2003-02-22 07:53:10 +0000 |
---|---|---|
committer | reinelt <> | 2003-02-22 07:53:10 +0000 |
commit | 90be5ac59fddad620f66ebc9dc813802cd45a7e3 (patch) | |
tree | 9a0596fed56b4985e15b7d677c43c0bda80fbabb /Raster.c | |
parent | db2a64cd4d6e46a6563181f38da2a0a01f56a559 (diff) | |
download | lcd4linux-90be5ac59fddad620f66ebc9dc813802cd45a7e3.tar.gz |
[lcd4linux @ 2003-02-22 07:53:09 by reinelt]
cfg_get(key,defval)
Diffstat (limited to 'Raster.c')
-rw-r--r-- | Raster.c | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -1,4 +1,4 @@ -/* $Id: Raster.c,v 1.20 2002/08/19 04:41:20 reinelt Exp $ +/* $Id: Raster.c,v 1.21 2003/02/22 07:53:10 reinelt Exp $ * * driver for raster formats * @@ -20,6 +20,9 @@ * * * $Log: Raster.c,v $ + * Revision 1.21 2003/02/22 07:53:10 reinelt + * cfg_get(key,defval) + * * Revision 1.20 2002/08/19 04:41:20 reinelt * introduced bar.c, moved bar stuff from display.h to bar.h * @@ -338,39 +341,39 @@ int Raster_init (LCD *Self) return -1; } - if (sscanf(s=cfg_get("size")?:"20x4", "%dx%d", &cols, &rows)!=2 || rows<1 || cols<1) { + if (sscanf(s=cfg_get("size","20x4"), "%dx%d", &cols, &rows)!=2 || rows<1 || cols<1) { error ("Raster: bad size '%s'", s); return -1; } - if (sscanf(s=cfg_get("font")?:"5x8", "%dx%d", &xres, &yres)!=2 || xres<5 || yres<7) { + if (sscanf(s=cfg_get("font","5x8"), "%dx%d", &xres, &yres)!=2 || xres<5 || yres<7) { error ("Raster: bad font '%s'", s); return -1; } - if (sscanf(s=cfg_get("pixel")?:"4+1", "%d+%d", &pixel, &pgap)!=2 || pixel<1 || pgap<0) { + if (sscanf(s=cfg_get("pixel","4+1"), "%d+%d", &pixel, &pgap)!=2 || pixel<1 || pgap<0) { error ("Raster: bad pixel '%s'", s); return -1; } - if (sscanf(s=cfg_get("gap")?:"3x3", "%dx%d", &cgap, &rgap)!=2 || cgap<-1 || rgap<-1) { + if (sscanf(s=cfg_get("gap","3x3"), "%dx%d", &cgap, &rgap)!=2 || cgap<-1 || rgap<-1) { error ("Raster: bad gap '%s'", s); return -1; } if (rgap<0) rgap=pixel+pgap; if (cgap<0) cgap=pixel+pgap; - border=atoi(cfg_get("border")?:"0"); + border=atoi(cfg_get("border","0")); - if (sscanf(s=cfg_get("foreground")?:"#102000", "#%x", &foreground)!=1) { + if (sscanf(s=cfg_get("foreground","#102000"), "#%x", &foreground)!=1) { error ("Raster: bad foreground color '%s'", s); return -1; } - if (sscanf(s=cfg_get("halfground")?:"#70c000", "#%x", &halfground)!=1) { + if (sscanf(s=cfg_get("halfground","#70c000"), "#%x", &halfground)!=1) { error ("Raster: bad halfground color '%s'", s); return -1; } - if (sscanf(s=cfg_get("background")?:"#80d000", "#%x", &background)!=1) { + if (sscanf(s=cfg_get("background","#80d000"), "#%x", &background)!=1) { error ("Raster: bad background color '%s'", s); return -1; } |