New functions gw_res_int and gw_res_bool.
[egate.git] / res+log / gw-res-bool.c
1 /*
2  * Implementation of resource management.
3  *
4  * Europagate, 1994-1995.
5  *
6  * $Log: gw-res-bool.c,v $
7  * Revision 1.1  1995/05/03 07:38:18  adam
8  * New functions gw_res_int and gw_res_bool.
9  *
10  */
11 #include <assert.h>
12 #include <stdio.h>
13 #include <stdlib.h>
14 #include <string.h>
15
16 #include <gw-log.h>
17 #include <gw-res.h>
18
19 int gw_res_bool (GwRes res, const char *name, int def_val)
20 {
21     const char *cp;
22
23     cp = gw_res_get (res, name, NULL);
24     if (!cp)
25         return def_val;
26     if (strchr ("1TYty", *cp))
27         return 1;
28     return 0;
29 }
30