--- /dev/null
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __LABWC_GET_BOOL_H
+#define __LABWC_GET_BOOL_H
+#include <stdbool.h>
+
+/**
+ * get_bool - interpret string and return boolean
+ * @s: string to interpret
+ *
+ * Note: This merely performs a case-insensitive check for 'yes' and 'true'.
+ * Returns false by default.
+ */
+bool get_bool(const char *s);
+
+#endif /* __LABWC_GET_BOOL_H */
--- /dev/null
+// SPDX-License-Identifier: GPL-2.0-only
+#include <string.h>
+#include <strings.h>
+#include "common/get-bool.h"
+
+bool
+get_bool(const char *s)
+{
+ if (!s) {
+ return false;
+ }
+ if (!strcasecmp(s, "yes")) {
+ return true;
+ }
+ if (!strcasecmp(s, "true")) {
+ return true;
+ }
+ return false;
+}
'dir.c',
'fd_util.c',
'font.c',
+ 'get-bool.c',
'grab-file.c',
'graphic-helpers.c',
'mem.c',
#include <wlr/util/box.h>
#include <wlr/util/log.h>
#include "action.h"
+#include "common/get-bool.h"
#include "common/list.h"
#include "common/mem.h"
#include "common/nodename.h"
}
}
-static bool
-get_bool(const char *s)
-{
- if (!s) {
- return false;
- }
- if (!strcasecmp(s, "yes")) {
- return true;
- }
- if (!strcasecmp(s, "true")) {
- return true;
- }
- return false;
-}
-
static enum libinput_config_accel_profile
get_accel_profile(const char *s)
{