summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0b6de87)
raw | patch | inline | side by side (parent: 0b6de87)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 18 Jan 2009 20:07:36 +0000 (21:07 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 18 Jan 2009 20:07:36 +0000 (21:07 +0100) |
They should be used to check if a string is "true|yes|on" or
"false|no|off" from now on.
"false|no|off" from now on.
src/common.h | patch | blob | history |
diff --git a/src/common.h b/src/common.h
index aefc2cc602589a7128616ecd0b2a5787cd4bdaea..d372872a30d135dd6743f6365b2b76f1f26b8013 100644 (file)
--- a/src/common.h
+++ b/src/common.h
#define STATIC_ARRAY_SIZE(a) (sizeof (a) / sizeof (*(a)))
+#define IS_TRUE(s) ((strcasecmp ("true", (s)) == 0) \
+ || (strcasecmp ("yes", (s)) == 0) \
+ || (strcasecmp ("on", (s)) == 0))
+#define IS_FALSE(s) ((strcasecmp ("false", (s)) == 0) \
+ || (strcasecmp ("no", (s)) == 0) \
+ || (strcasecmp ("off", (s)) == 0))
+
char *sstrncpy (char *dest, const char *src, size_t n);
int ssnprintf (char *dest, size_t n, const char *format, ...);
char *sstrdup(const char *s);