}
else {
struct xkb_rule_names rmlvo = {
- .rules = isempty(rules) ? NULL : rules,
- .model = isempty(model) ? NULL : model,
- .layout = isempty(layout) ? NULL : layout,
- .variant = isempty(variant) ? NULL : variant,
- .options = isempty(options) ? NULL : options
+ .rules = (rules == NULL || rules[0] == '\0') ? NULL : rules,
+ .model = (model == NULL || model[0] == '\0') ? NULL : model,
+ .layout = (layout == NULL || layout[0] == '\0') ? NULL : layout,
+ .variant = (variant == NULL || variant[0] == '\0') ? NULL : variant,
+ .options = (options == NULL || options[0] == '\0') ? NULL : options
};
if (!rules && !model && !layout && !variant && !options)
#include <errno.h>
#include <fcntl.h>
#include <locale.h>
+#include <stdbool.h>
#include <stdint.h>
-#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
#include <sys/mman.h>
+#include <unistd.h>
#include "xkbcommon/xkbcommon.h"
#include "tools-common.h"
#include "xdg-shell-client-protocol.h"
#include <wayland-util.h>
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+
struct interactive_dpy {
struct wl_display *dpy;
struct wl_compositor *compositor;
#include "config.h"
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
-#include "utils.h"
#include "xkbcommon/xkbcommon.h"
int
goto out;
}
- if (streq(keymap_path, "-")) {
+ if (strcmp(keymap_path, "-") == 0) {
FILE *tmp;
tmp = tmpfile();
#define _XKBCOMMON_COMPAT_H
#include "xkbcommon/xkbcommon.h"
#include "xkbcommon/xkbcommon-compose.h"
-#include "utils.h"
void
tools_print_keycode_state(struct xkb_state *state,