mash/rdconfig.c

changeset 143
54f9b5d39e4c
parent 103
99c47a8a61cb
--- a/mash/rdconfig.c	Mon Jul 28 21:41:03 2014 +0200
+++ b/mash/rdconfig.c	Tue Jul 29 20:11:23 2014 +0200
@@ -24,7 +24,7 @@
 #include "xutil.h"
 
 
-bool		debug = FALSE;
+int		debug = FALSE;
 static char	*mypath;
 static char	*k, *v;
 static int	linecnt = 0;
@@ -32,13 +32,9 @@
 
 
 
-//static int getstr(char **);
 static int getint(char **);
 static int getw1(char **);
-//static int getuch(char **);
-//static int getfloat(char **);
-//static int getbyt(char **);
-//static int gethex(char **);
+
 
 #define XSTR(x) #x
 #define STR(x) XSTR(x)
@@ -223,17 +219,6 @@
 }
 
 
-/*
-static int getstr(char **dest)
-{
-    if (debug)
-	syslog(LOG_NOTICE, "rdconfig: getstr: %s(%d): %s %s", mypath, linecnt, MBSE_SS(k), MBSE_SS(v));
-
-    *dest = xstrcpy(v);
-    return 0;
-}
-*/
-
 
 static int getint(char **dest)
 {
@@ -299,70 +284,3 @@
 }
 
 
-/*
-static int getuch(char **dest)
-{
-    if (debug)
-	syslog(LOG_NOTICE, "rdconfig: getuch: %s(%d): %s %s", mypath, linecnt, MBSE_SS(k), MBSE_SS(v));
-
-    if (isalnum(v[0])) {
-	*((unsigned char*)dest) = v[0];
-    } else {
-	syslog(LOG_NOTICE, "rdconfig: %s(%d): %s %s - bad character", mypath, linecnt, MBSE_SS(k), MBSE_SS(v));
-    }
-    return 0;
-}
-
-
-
-static int getfloat(char **dest)
-{
-    float	val = 0.0;
-    int		rc;
-
-    if (debug)
-	syslog(LOG_NOTICE, "rdconfig: getfloat: %s(%d): %s %s", mypath, linecnt, MBSE_SS(k), MBSE_SS(v));
-
-    rc = sscanf(v, "%f", &val);
-    if (rc != 1) {
-	syslog(LOG_NOTICE, "rdconfig: %s(%d): %s %s - bad float value", mypath, linecnt, MBSE_SS(k), MBSE_SS(v));
-	return 1;
-    }
-    *((float*)dest) = val;
-
-    return 0;
-}
-*/
-
-/*
-static int getbyt(char **dest)
-{
-    Log_Msg("[rdconfig] getbyt: %s(%d): %s %s", mypath, linecnt, k, v);
-    if (strspn(v,"0123456789") != strlen(v))
-	Log_Msg("[rdconfig] %s(%d): %s %s - bad numeric", mypath, linecnt, S(k), S(v));
-    else
-	*((Uint8*)dest)=atoi(v);
-    return 0;
-}
-*/
-
-
-/*
-static int gethex(char **dest)
-{
-    unsigned int    val = 0;
-    int		    rc;
-
-    Log_Msg("[rdconfig] gethex: %s(%d): %s %s", mypath, linecnt, k, v);
-    rc = sscanf(v, "%08x", &val);
-    if (rc != 1) {
-	Log_Msg("[rdconfig] %s(%d): %s %s - bad hex value", mypath, linecnt, S(k), S(v));
-	return 1;
-    }
-    *((int*)dest) = val;
-
-    return 0;
-}
-*/
-
-

mercurial