New functions gw_res_int and gw_res_bool.
[egate.git] / res+log / gw-res-bool.c
diff --git a/res+log/gw-res-bool.c b/res+log/gw-res-bool.c
new file mode 100644 (file)
index 0000000..532985c
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Implementation of resource management.
+ *
+ * Europagate, 1994-1995.
+ *
+ * $Log: gw-res-bool.c,v $
+ * Revision 1.1  1995/05/03 07:38:18  adam
+ * New functions gw_res_int and gw_res_bool.
+ *
+ */
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <gw-log.h>
+#include <gw-res.h>
+
+int gw_res_bool (GwRes res, const char *name, int def_val)
+{
+    const char *cp;
+
+    cp = gw_res_get (res, name, NULL);
+    if (!cp)
+        return def_val;
+    if (strchr ("1TYty", *cp))
+        return 1;
+    return 0;
+}
+