]> git.mdlowis.com Git - proto/labwc.git/commitdiff
include/: refactor header files
authorJohan Malm <jgm323@gmail.com>
Fri, 31 Jul 2020 20:31:03 +0000 (21:31 +0100)
committerJohan Malm <jgm323@gmail.com>
Fri, 31 Jul 2020 20:31:03 +0000 (21:31 +0100)
include/common/buf.h [moved from include/buf.h with 100% similarity]
include/common/bug-on.h [new file with mode: 0644]
include/rcxml.h
src/common/buf.c
src/config/rcxml.c
src/theme/xbm/parse.c
tools/rcxml/Makefile
tools/rcxml/rcxml-print-nodenames.c

similarity index 100%
rename from include/buf.h
rename to include/common/buf.h
diff --git a/include/common/bug-on.h b/include/common/bug-on.h
new file mode 100644 (file)
index 0000000..c9c3be5
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef __LABWC_BUG_ON_H
+#define __LABWC_BUG_ON_H
+
+#define BUG_ON(condition)                                             \
+       do {                                                          \
+               if ((condition) != 0) {                               \
+                       fprintf(stderr, "Badness in %s() at %s:%d\n", \
+                               __func__, __FILE__, __LINE__);        \
+               }                                                     \
+       } while (0)
+
+#endif /* __LABWC_BUT_ON_H */
+
index dcc496d6dd9c426fd7eaacafe009e9b34d6c707f..eda86a13de6fbaf0051ff5b0613c13ccdc056909 100644 (file)
@@ -7,15 +7,7 @@
 #include <wayland-server-core.h>
 #include <xkbcommon/xkbcommon.h>
 
-#include "buf.h"
-
-#define BUG_ON(condition)                                             \
-       do {                                                          \
-               if ((condition) != 0) {                               \
-                       fprintf(stderr, "Badness in %s() at %s:%d\n", \
-                               __func__, __FILE__, __LINE__);        \
-               }                                                     \
-       } while (0)
+#include "common/buf.h"
 
 struct keybind {
        uint32_t modifiers;
index 87c0d30fd7707aeca0a09b99f6cc65269bbc1ff1..9e79f30cbc1ac2fc5f01867233fafb295b3ebf7e 100644 (file)
@@ -1,4 +1,4 @@
-#include "buf.h"
+#include "common/buf.h"
 
 void buf_init(struct buf *s)
 {
index 653d62c6a14e40c4db690279473ef0628b8c0e3f..dbdf9f841ba1929b2afa0df511120a2b8bac2436 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "rcxml.h"
 #include "config/config-dir.h"
+#include "common/bug-on.h"
 
 static bool in_keybind = false;
 static bool is_attribute = false;
index 7cc257846da1081cfcab260b80aadc8d1ff15fb2..89bbbcf04338ee4901c42e2923ffcb6888eef1d0 100644 (file)
@@ -11,7 +11,7 @@
 #include <stdint.h>
 #include <stdbool.h>
 
-#include "buf.h"
+#include "common/buf.h"
 #include "theme/xbm/parse.h"
 
 /* TODO: should be window.active.button.unpressed.image.color */
index 507db21bfc7fc27c2a91eb3bb82f299fc83fae2e..9973985ec4fb2884a60254ca71bf3abb91cff82f 100644 (file)
@@ -9,11 +9,18 @@ LDFLAGS   += `xml2-config --libs`
 LDFLAGS   += `pkg-config --cflags --libs glib-2.0 wayland-server xkbcommon`
 
 PROGS = rcxml-print-nodenames
+SRC = \
+       rcxml-print-nodenames.c \
+       ../../src/config/rcxml.c \
+       ../../src/config/config-dir.c \
+       ../../src/common/buf.c \
+       ../../src/config/keybind.c
+
 
 all: $(PROGS)
 
-rcxml-print-nodenames: rcxml-print-nodenames.c
-       $(CC) $(CFLAGS) -o $@ $^ ../../src/config/rcxml.c ../../src/common/buf.c ../../src/config/keybind.c $(LDFLAGS)
+rcxml-print-nodenames: $(SRC)
+       $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
 
 clean:
        rm -f $(PROGS)
index 3e51db88697267f8ec94524ca796ce388af661ed..d5df9f38bed9ca558c064357c7a3bf840c066eb3 100644 (file)
@@ -3,7 +3,7 @@
 #include <unistd.h>
 
 #include "rcxml.h"
-#include "buf.h"
+#include "common/buf.h"
 
 struct rcxml rc = { 0 };