Apply slweb renaming to libweb

This commit is contained in:
Xavier Del Campo Romero 2023-10-10 23:43:47 +02:00
parent e3177b549d
commit 28ae865e5e
Signed by: xavi
GPG Key ID: 84FF3612A9BF43F2
11 changed files with 28 additions and 28 deletions

6
.gitmodules vendored
View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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).

2
auth.c
View File

@ -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>

2
auth.h
View File

@ -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);

1
libweb Submodule

@ -0,0 +1 @@
Subproject commit 0222b75e8554796548e079aa3393c512ae30ac24

6
main.c
View File

@ -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>

4
page.c
View File

@ -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>

2
page.h
View File

@ -1,7 +1,7 @@
#ifndef PAGE_H
#define PAGE_H
#include <slweb/http.h>
#include <libweb/http.h>
#include <stdbool.h>
#include <stddef.h>

1
slweb

@ -1 +0,0 @@
Subproject commit b43adf9a005f93550167c36a33c183ebedd1362d