aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-10-10 23:43:47 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-10-11 00:08:40 +0200
commit28ae865e5ecad9b398ac21fa148fc4b93c987226 (patch)
tree1f045b4c55d9556557758f5cfa9457d07e988aa9
parente3177b549d5fb9c065d336cbb95301f48e29863a (diff)
downloadslcl-28ae865e5ecad9b398ac21fa148fc4b93c987226.tar.gz
Apply slweb renaming to libweb
-rw-r--r--.gitmodules6
-rw-r--r--CMakeLists.txt4
-rw-r--r--Makefile22
-rw-r--r--README.md6
-rw-r--r--auth.c2
-rw-r--r--auth.h2
m---------libweb0
-rw-r--r--main.c6
-rw-r--r--page.c4
-rw-r--r--page.h2
m---------slweb0
11 files changed, 27 insertions, 27 deletions
diff --git a/.gitmodules b/.gitmodules
index 7dc08da..805a102 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,3 @@
-[submodule "slweb"]
- path = slweb
- url = https://gitea.privatedns.org/xavi/slweb
+[submodule "libweb"]
+ path = libweb
+ url = https://gitea.privatedns.org/xavi/libweb
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a9dde62..91d4673 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,10 +12,10 @@ add_executable(${PROJECT_NAME}
)
target_compile_options(${PROJECT_NAME} PRIVATE -Wall)
target_compile_definitions(${PROJECT_NAME} PRIVATE _FILE_OFFSET_BITS=64)
-add_subdirectory(slweb)
+add_subdirectory(libweb)
find_package(cJSON 1.0 REQUIRED)
find_package(OpenSSL 2.0 REQUIRED)
-target_link_libraries(${PROJECT_NAME} PRIVATE slweb dynstr cjson OpenSSL::SSL)
+target_link_libraries(${PROJECT_NAME} PRIVATE libweb dynstr cjson OpenSSL::SSL)
install(TARGETS ${PROJECT_NAME})
install(FILES usergen
TYPE BIN
diff --git a/Makefile b/Makefile
index 7a87332..68e56b6 100644
--- a/Makefile
+++ b/Makefile
@@ -5,14 +5,14 @@ DST = $(PREFIX)/bin
PROJECT = slcl
O = -Og
CDEFS = -D_FILE_OFFSET_BITS=64 # Required for large file support on 32-bit.
-CFLAGS = $(O) $(CDEFS) -g -Wall -Islweb/include -Islweb/dynstr/include \
+CFLAGS = $(O) $(CDEFS) -g -Wall -Ilibweb/include -Ilibweb/dynstr/include \
-MD -MF $(@:.o=.d)
LIBS = -lcjson -lssl -lm -lcrypto
DEPS = $(OBJECTS:.o=.d)
-DYNSTR = slweb/dynstr/libdynstr.a
-DYNSTR_FLAGS = -Lslweb/dynstr -ldynstr
-SLWEB = slweb/libslweb.a
-SLWEB_FLAGS = -Lslweb -lslweb
+DYNSTR = libweb/dynstr/libdynstr.a
+DYNSTR_FLAGS = -Llibweb/dynstr -ldynstr
+LIBWEB = libweb/libslweb.a
+SLWEB_FLAGS = -Llibweb -lweb
OBJECTS = \
auth.o \
base64.o \
@@ -34,18 +34,18 @@ install: all usergen
clean:
rm -f $(OBJECTS) $(DEPS)
- +cd slweb && $(MAKE) clean
- +cd slweb/dynstr && $(MAKE) clean
+ +cd libweb && $(MAKE) clean
+ +cd libweb/dynstr && $(MAKE) clean
FORCE:
-$(PROJECT): $(OBJECTS) $(DYNSTR) $(SLWEB)
+$(PROJECT): $(OBJECTS) $(DYNSTR) $(LIBWEB)
$(CC) $(OBJECTS) $(LDFLAGS) $(LIBS) $(SLWEB_FLAGS) $(DYNSTR_FLAGS) -o $@
$(DYNSTR): FORCE
- +cd slweb/dynstr && $(MAKE)
+ +cd libweb/dynstr && $(MAKE)
-$(SLWEB): FORCE
- +cd slweb && $(MAKE)
+$(LIBWEB): FORCE
+ +cd libweb && $(MAKE)
-include $(DEPS)
diff --git a/README.md b/README.md
index 7c0d2b4..134ec6f 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,7 @@ portability, minimalism, simplicity and efficiency.
- Private access directory with file uploading, with configurable quota.
- Read-only public file sharing.
-- Uses [`slweb`](https://gitea.privatedns.org/xavi/slweb), a tiny web framework.
+- Uses [`libweb`](https://gitea.privatedns.org/xavi/libweb), a tiny web framework.
- A simple JSON file as the credentials database.
- No JavaScript.
@@ -48,8 +48,8 @@ to `slcl`. If required, encryption should be done before uploading e.g.: using
- OpenSSL >= 2.0.
- cJSON >= 1.7.15.
- [`dynstr`](https://gitea.privatedns.org/xavi/dynstr)
-(provided as a `git` submodule by `slweb`).
-- [`slweb`](https://gitea.privatedns.org/xavi/slweb)
+(provided as a `git` submodule by `libweb`).
+- [`libweb`](https://gitea.privatedns.org/xavi/libweb)
(provided as a `git` submodule).
- `jq` (for [`usergen`](usergen) only).
- CMake (optional).
diff --git a/auth.c b/auth.c
index 0cfb6e2..774e16a 100644
--- a/auth.c
+++ b/auth.c
@@ -1,7 +1,7 @@
#include "auth.h"
#include "hex.h"
#include "jwt.h"
-#include <slweb/http.h>
+#include <libweb/http.h>
#include <cjson/cJSON.h>
#include <dynstr.h>
#include <openssl/sha.h>
diff --git a/auth.h b/auth.h
index 0fcf396..56daa2e 100644
--- a/auth.h
+++ b/auth.h
@@ -1,7 +1,7 @@
#ifndef AUTH_H
#define AUTH_H
-#include <slweb/http.h>
+#include <libweb/http.h>
#include <stdbool.h>
struct auth *auth_alloc(const char *dir);
diff --git a/libweb b/libweb
new file mode 160000
+Subproject 0222b75e8554796548e079aa3393c512ae30ac2
diff --git a/main.c b/main.c
index ffdac98..8a15e06 100644
--- a/main.c
+++ b/main.c
@@ -5,9 +5,9 @@
#include "hex.h"
#include "page.h"
#include "style.h"
-#include <slweb/handler.h>
-#include <slweb/http.h>
-#include <slweb/wildcard_cmp.h>
+#include <libweb/handler.h>
+#include <libweb/http.h>
+#include <libweb/wildcard_cmp.h>
#include <openssl/err.h>
#include <openssl/rand.h>
#include <dynstr.h>
diff --git a/page.c b/page.c
index 8c525d4..27dc158 100644
--- a/page.c
+++ b/page.c
@@ -1,8 +1,8 @@
#define _POSIX_C_SOURCE 200809L
#include "page.h"
-#include <slweb/html.h>
-#include <slweb/http.h>
+#include <libweb/html.h>
+#include <libweb/http.h>
#include <dynstr.h>
#include <dirent.h>
#include <fcntl.h>
diff --git a/page.h b/page.h
index 7160f4b..01e7a0a 100644
--- a/page.h
+++ b/page.h
@@ -1,7 +1,7 @@
#ifndef PAGE_H
#define PAGE_H
-#include <slweb/http.h>
+#include <libweb/http.h>
#include <stdbool.h>
#include <stddef.h>
diff --git a/slweb b/slweb
deleted file mode 160000
-Subproject b43adf9a005f93550167c36a33c183ebedd1362