Revision 12350,
1.1 KB
checked in by ghudson, 26 years ago
(diff) |
Some RCS ID cleanup: delete $Log$ and replace other RCS keywords with $Id$.
|
Line | |
---|
1 | /* |
---|
2 | * $Id: StrToBool.c,v 1.2 1999-01-22 23:16:58 ghudson Exp $ |
---|
3 | * |
---|
4 | * Copyright 1990, 1991 by the Massachusetts Institute of Technology. |
---|
5 | * |
---|
6 | * For copying and distribution information, please see the file |
---|
7 | * <mit-copyright.h>. |
---|
8 | * |
---|
9 | */ |
---|
10 | |
---|
11 | #if (!defined(lint)) && (!defined(SABER)) |
---|
12 | static char *rcsid = |
---|
13 | "$Id: StrToBool.c,v 1.2 1999-01-22 23:16:58 ghudson Exp $"; |
---|
14 | #endif |
---|
15 | |
---|
16 | #include "mit-copyright.h" |
---|
17 | #include "Jets.h" |
---|
18 | |
---|
19 | /* |
---|
20 | * String to Boolean conversion |
---|
21 | */ |
---|
22 | int StrToBoolean(display, window, where, resource, type, address) |
---|
23 | Display *display; |
---|
24 | Window window; |
---|
25 | caddr_t where; |
---|
26 | XjResource *resource; |
---|
27 | char *type; |
---|
28 | caddr_t address; |
---|
29 | { |
---|
30 | if (strcasecmp(address, "true") == 0 || |
---|
31 | strcasecmp(address, "yes") == 0 || |
---|
32 | strcasecmp(address, "on") == 0) |
---|
33 | { |
---|
34 | *((int *)((char *)where + resource->resource_offset)) = True; |
---|
35 | return 0; |
---|
36 | } |
---|
37 | |
---|
38 | if (strcasecmp(address, "false") == 0 || |
---|
39 | strcasecmp(address, "no") == 0 || |
---|
40 | strcasecmp(address, "off") == 0) |
---|
41 | { |
---|
42 | *((int *)((char *)where + resource->resource_offset)) = False; |
---|
43 | return 0; |
---|
44 | } |
---|
45 | |
---|
46 | *((int *)((char *)where + resource->resource_offset)) = atoi(address); |
---|
47 | return 0; |
---|
48 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.