From 0222b75e8554796548e079aa3393c512ae30ac24 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Tue, 10 Oct 2023 23:21:35 +0200 Subject: Rename project from slweb to libweb It was found out there was another project of the same name around (https://git.sr.ht/~strahinja/slweb/), also related to website generation. In order to avoid confusion, a new name has been chosen for this project. Surprisingly, libweb was not in use by any distributions (according to https://repology.org and AUR index), and it should reflect well the intention behind this project i.e., being a library to build web-related stuff. --- examples/hello/CMakeLists.txt | 2 +- examples/hello/Makefile | 10 +++++----- examples/hello/README.md | 4 ++-- examples/hello/main.c | 8 ++++---- examples/html/CMakeLists.txt | 2 +- examples/html/Makefile | 10 +++++----- examples/html/README.md | 2 +- examples/html/main.c | 4 ++-- 8 files changed, 21 insertions(+), 21 deletions(-) (limited to 'examples') diff --git a/examples/hello/CMakeLists.txt b/examples/hello/CMakeLists.txt index c22ab33..7d14ac6 100644 --- a/examples/hello/CMakeLists.txt +++ b/examples/hello/CMakeLists.txt @@ -1,4 +1,4 @@ cmake_minimum_required(VERSION 3.13) project(hello C) add_executable(hello main.c) -target_link_libraries(${PROJECT_NAME} PRIVATE slweb dynstr) +target_link_libraries(${PROJECT_NAME} PRIVATE web dynstr) diff --git a/examples/hello/Makefile b/examples/hello/Makefile index 217bccb..275fa5a 100644 --- a/examples/hello/Makefile +++ b/examples/hello/Makefile @@ -3,10 +3,10 @@ PROJECT = hello DEPS = \ main.o -SLWEB = ../../libslweb.a +LIBWEB = ../../libweb.a DYNSTR = ../../dynstr/libdynstr.a CFLAGS = -I ../../include -I ../../dynstr/include -SLWEB_FLAGS = -L ../../ -l slweb +LIBWEB_FLAGS = -L ../../ -l libweb DYNSTR_FLAGS = -L ../../dynstr -l dynstr all: $(PROJECT) @@ -16,10 +16,10 @@ clean: FORCE: -$(PROJECT): $(DEPS) $(SLWEB) $(DYNSTR) - $(CC) $(LDFLAGS) $(DEPS) $(SLWEB_FLAGS) $(DYNSTR_FLAGS) -o $@ +$(PROJECT): $(DEPS) $(LIBWEB) $(DYNSTR) + $(CC) $(LDFLAGS) $(DEPS) $(LIBWEB_FLAGS) $(DYNSTR_FLAGS) -o $@ -$(SLWEB): FORCE +$(LIBWEB): FORCE +cd ../../ && $(MAKE) $(DYNSTR): FORCE diff --git a/examples/hello/README.md b/examples/hello/README.md index 7c7cf74..24b747b 100644 --- a/examples/hello/README.md +++ b/examples/hello/README.md @@ -1,8 +1,8 @@ # "Hello world" example -This example shows a minimal setup for an application using `slweb`. When +This example shows a minimal setup for an application using `libweb`. When executed, it starts a HTTP/1.1 server on port `8080` and returns an example -website reading "Hello from slweb!" when either `/` or `/index.html` are +website reading "Hello from libweb!" when either `/` or `/index.html` are accessed by clients. ## How to build diff --git a/examples/hello/main.c b/examples/hello/main.c index d1a3206..59643ec 100644 --- a/examples/hello/main.c +++ b/examples/hello/main.c @@ -1,7 +1,7 @@ #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -30,7 +30,7 @@ static int hello(const struct http_payload *const pl, fprintf(stderr, "%s: html_node_add_child p failed\n", __func__); goto end; } - else if (html_node_set_value(p, "Hello from slweb!")) + else if (html_node_set_value(p, "Hello from libweb!")) { fprintf(stderr, "%s: html_node_set_value p failed\n", __func__); goto end; diff --git a/examples/html/CMakeLists.txt b/examples/html/CMakeLists.txt index bc4202d..410663b 100644 --- a/examples/html/CMakeLists.txt +++ b/examples/html/CMakeLists.txt @@ -1,4 +1,4 @@ cmake_minimum_required(VERSION 3.13) project(html C) add_executable(html main.c) -target_link_libraries(${PROJECT_NAME} PRIVATE slweb dynstr) +target_link_libraries(${PROJECT_NAME} PRIVATE web dynstr) diff --git a/examples/html/Makefile b/examples/html/Makefile index 77d94f8..87d27aa 100644 --- a/examples/html/Makefile +++ b/examples/html/Makefile @@ -3,10 +3,10 @@ PROJECT = html DEPS = \ main.o -SLWEB = ../../libslweb.a +LIBWEB = ../../libweb.a DYNSTR = ../../dynstr/libdynstr.a CFLAGS = -I ../../include -I ../../dynstr/include -SLWEB_FLAGS = -L ../../ -l slweb +LIBWEB_FLAGS = -L ../../ -l libweb DYNSTR_FLAGS = -L ../../dynstr -l dynstr all: $(PROJECT) @@ -16,10 +16,10 @@ clean: FORCE: -$(PROJECT): $(DEPS) $(SLWEB) $(DYNSTR) - $(CC) $(LDFLAGS) $(DEPS) $(SLWEB_FLAGS) $(DYNSTR_FLAGS) -o $@ +$(PROJECT): $(DEPS) $(LIBWEB) $(DYNSTR) + $(CC) $(LDFLAGS) $(DEPS) $(LIBWEB_FLAGS) $(DYNSTR_FLAGS) -o $@ -$(SLWEB): FORCE +$(LIBWEB): FORCE +cd ../../ && $(MAKE) $(DYNSTR): FORCE diff --git a/examples/html/README.md b/examples/html/README.md index ac89287..4d7544f 100644 --- a/examples/html/README.md +++ b/examples/html/README.md @@ -20,6 +20,6 @@ should be written to the standard output: - testing slweb + testing libweb ``` diff --git a/examples/html/main.c b/examples/html/main.c index c29e360..858aff7 100644 --- a/examples/html/main.c +++ b/examples/html/main.c @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -9,7 +9,7 @@ int main() struct dynstr d; struct html_node *const html = html_node_alloc("html"), *head, *meta, *body; - static const char text[] = "testing slweb"; + static const char text[] = "testing libweb"; dynstr_init(&d); -- cgit v1.2.3