From 28ae865e5ecad9b398ac21fa148fc4b93c987226 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Tue, 10 Oct 2023 23:43:47 +0200 Subject: Apply slweb renaming to libweb --- .gitmodules | 6 +++--- CMakeLists.txt | 4 ++-- Makefile | 22 +++++++++++----------- README.md | 6 +++--- auth.c | 2 +- auth.h | 2 +- libweb | 1 + main.c | 6 +++--- page.c | 4 ++-- page.h | 2 +- slweb | 1 - 11 files changed, 28 insertions(+), 28 deletions(-) create mode 160000 libweb delete mode 160000 slweb 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 +#include #include #include #include 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 +#include #include struct auth *auth_alloc(const char *dir); diff --git a/libweb b/libweb new file mode 160000 index 0000000..0222b75 --- /dev/null +++ b/libweb @@ -0,0 +1 @@ +Subproject commit 0222b75e8554796548e079aa3393c512ae30ac24 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 -#include -#include +#include +#include +#include #include #include #include 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 -#include +#include +#include #include #include #include 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 +#include #include #include diff --git a/slweb b/slweb deleted file mode 160000 index b43adf9..0000000 --- a/slweb +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b43adf9a005f93550167c36a33c183ebedd1362d -- cgit v1.2.3