aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjustanothercatgirl <sotov@twistea.su>2025-03-24 08:30:16 +0300
committerjustanothercatgirl <sotov@twistea.su>2025-03-24 08:30:16 +0300
commit8542ec17d3df989f3df9fd03af7a447bf730dc13 (patch)
tree796f070ef2d22d0d8d75fd25f3ce6613a0ce15ab
parent787ef64ce61302a159ad48974272533b6fdf6c9e (diff)
added json dependency
-rw-r--r--.gitmodules3
-rw-r--r--Makefile6
m---------c_headers0
-rw-r--r--compile_flags.txt1
-rw-r--r--endpoints.c4
5 files changed, 12 insertions, 2 deletions
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..1d6a137
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "c_headers"]
+ path = c_headers
+ url = git:repos/c_headers
diff --git a/Makefile b/Makefile
index 44869e6..e7e7b3d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,13 @@
# Makefile
+CFLAGS += -Ic_headers/include
+
all: main endpoints.so
.PHONY: all clean
endpoints.o: endpoints.c
- $(CC) -c $< -o $@
+ $(CC) -c $< $(CFLAGS) -o $@
rename.ld: endpoints.o
# Looks terrible
@@ -18,7 +20,7 @@ endpoints.so: endpoints.o rename.ld
$(CC) -shared -Wl,rename.ld $< -fPIE -o $@
main: main.c
- $(CC) $< -ldl -lmicrohttpd -o $@
+ $(CC) $< $(CFLAGS) -ldl -lmicrohttpd -o $@
clean:
$(RM) main endpoints.o endpoints.so rename.ld
diff --git a/c_headers b/c_headers
new file mode 160000
+Subproject 1c857416928744d359bc3fc63cd765219bf0cb1
diff --git a/compile_flags.txt b/compile_flags.txt
new file mode 100644
index 0000000..64a88c8
--- /dev/null
+++ b/compile_flags.txt
@@ -0,0 +1 @@
+-Ic_headers/include
diff --git a/endpoints.c b/endpoints.c
index 9a02098..789f48a 100644
--- a/endpoints.c
+++ b/endpoints.c
@@ -3,6 +3,10 @@
#include "microhttpd.h"
+#define CONTAINER_IMPLEMENTATION
+#define JACSON_IMPLEMENTATION
+#include <jacson.h>
+
// not accessible in browser because ALL URLs start with / (or with _ in dylib)
char* duplicate(const char* x) {
size_t len = strlen(x);