home *** CD-ROM | disk | FTP | other *** search
- /*
- ** SmartWIN
- **
- ** © 1996 by Timo C. Nentwig
- ** All Rights Reserved !
- **
- ** Tcn@oxygen.in-berlin.de
- **
- */
-
- /// #include
-
- #include "GST.h"
- #include "Protos.h"
-
- ///
- /// proto
-
- proto BOOL atob (const STRPTR Key);
-
- ///
-
- /// atob ()
-
- /*
- * FUNCTION Convert a string to boolean.
- *
- * NOTE
- *
- * EXAMPLE atob ("on");
- *
- */
-
- BOOL
- atob (const STRPTR Key)
- {
-
- const struct { STRPTR Key; BOOL Value; } Table [] =
- {
-
- "yes", TRUE,
- "true", TRUE,
- "on", TRUE,
- "1", TRUE,
- "no", FALSE,
- "false", FALSE,
- "off", FALSE,
- "0", FALSE,
-
- NULL, -1
-
- };
-
-
- LONG i;
-
- for (i = 0; i < NumElements (Table); i++)
- {
-
- if (stricmp (Table [i] . Key, Key) == 0)
- {
-
- return (Table [i] . Value);
-
- }
-
- }
-
- }
-
- ///
-