return s ? strdup(s) : NULL;
}
+static inline bool
+isempty(const char *s)
+{
+ return s == NULL || s[0] == '\0';
+}
+
/* Compiler Attributes */
#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__CYGWIN__)
#include "rules.h"
#include "parseutils.h"
-#define ISEMPTY(str) (!(str) || (strlen(str) == 0))
-
static XkbFile *
keymap_file_from_names(struct xkb_context *ctx,
const struct xkb_rule_names *rmlvo)
struct xkb_rule_names rmlvo = *rmlvo_in;
XkbFile *file;
- if (ISEMPTY(rmlvo.rules))
+ if (isempty(rmlvo.rules))
rmlvo.rules = DEFAULT_XKB_RULES;
- if (ISEMPTY(rmlvo.model))
+ if (isempty(rmlvo.model))
rmlvo.model = DEFAULT_XKB_MODEL;
- if (ISEMPTY(rmlvo.layout))
+ if (isempty(rmlvo.layout))
rmlvo.layout = DEFAULT_XKB_LAYOUT;
file = keymap_file_from_names(ctx, &rmlvo);