CtdlGetConfigInt() and CtdlGetConfigLong() converted from macros to functions because...
authorArt Cancro <ajc@uncensored.citadel.org>
Tue, 5 May 2015 17:34:00 +0000 (13:34 -0400)
committerArt Cancro <ajc@uncensored.citadel.org>
Tue, 5 May 2015 17:34:00 +0000 (13:34 -0400)
citadel/config.c
citadel/config.h

index ed7a06914918d3afbdda4699a508e955e3af2103..f41533c5b13b858f27bf70d4f929c38211a76319 100644 (file)
@@ -437,6 +437,26 @@ char *CtdlGetConfigStr(char *key)
 }
 
 
+/*
+ * Fetch a system config value - integer
+ */
+int CtdlGetConfigInt(char *key)
+{
+       char *s = CtdlGetConfigStr(key);
+       if (s) return atoi(s);
+       return 0;
+}
+
+
+/*
+ * Fetch a system config value - long integer
+ */
+long CtdlGetConfigLong(char *key)
+{
+       char *s = CtdlGetConfigStr(key);
+       if (s) return atol(s);
+       return 0;
+}
 
 
 
index 79f24427439249371bf2d8650b2787180bb77b7c..293593b817a89763489ca1f272892e2c561abea6 100644 (file)
 #include "serv_extensions.h"
 #include "citadel_dirs.h"
 
-#define CtdlGetConfigInt(x)    atoi(CtdlGetConfigStr(x))
-#define CtdlGetConfigLong(x)   atol(CtdlGetConfigStr(x))
-
-
 
 
 /*
@@ -112,6 +108,8 @@ void shutdown_config_system(void);
 void put_config(void);
 void CtdlSetConfigStr(char *, char *);
 char *CtdlGetConfigStr(char *);
+int CtdlGetConfigInt(char *);
+long CtdlGetConfigLong(char *);
 void CtdlSetConfigInt(char *key, int value);
 void CtdlSetConfigLong(char *key, long value);