diff --git a/http/Makefile b/http/Makefile
new file mode 100644
index 0000000..a4db491
--- /dev/null
+++ b/http/Makefile
@@ -0,0 +1,78 @@
+## kc3
+## Copyright 2022-2024 kmx.io <contact@kmx.io>
+##
+## Permission is hereby granted to use this software granted the above
+## copyright notice and this permission paragraph are included in all
+## copies and substantial portions of this software.
+##
+## THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
+## PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
+## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
+## THIS SOFTWARE.
+
+CLEANFILES = *.a *.gcno *.la .libs *.lo *.o
+
+CLEANFILES_COV = *.css *.gcda *.html .libs/*.gcda
+
+CLEANFILES += ${CLEANFILES_COV}
+
+DISTCLEANFILES = .build ${CLEANFILES} config.h config.mk
+
+all:
+ ${MAKE} build
+ ${MAKE} debug
+ if ${HAVE_ASAN}; then ${MAKE} asan; fi
+ if ${HAVE_GCOV}; then ${MAKE} cov; fi
+
+asan:
+ ${MAKE} ${LIB_ASAN}
+
+build:
+ ${MAKE} ${LIB}
+
+clean:
+ rm -rf ${CLEANFILES}
+
+clean_cov:
+ rm -rf ${CLEANFILES_COV}
+
+cov:
+ ${MAKE} ${LIB_COV}
+
+debug:
+ ${MAKE} ${LIB_DEBUG}
+
+distclean:
+ rm -rf ${DISTCLEANFILES}
+
+gcovr:
+ gcovr --gcov-executable ${GCOV} --html-details libkc3_web.html
+
+install:
+ ${INSTALL} -o ${OWNER} -g ${GROUP} -m 0755 -d ${prefix}/include/libkc3/ekc3
+ ${LIBTOOL} --tag=CC --mode=install ${INSTALL} -o ${OWNER} -g ${GROUP} -m 0644 ${HEADERS} ${prefix}/include/libkc3/ekc3
+ ${INSTALL} -o ${OWNER} -g ${GROUP} -m 0755 -d ${prefix}/lib
+ ${LIBTOOL} --tag=CC --mode=install ${INSTALL} -o ${OWNER} -g ${GROUP} -m 0644 ${LIB} ${prefix}/lib
+ ${LIBTOOL} --tag=CC --mode=install ${INSTALL} -o ${OWNER} -g ${GROUP} -m 0644 ${LIB_DEBUG} ${prefix}/lib
+ ${LIBTOOL} --finish ${prefix}/lib
+
+test:
+
+update_sources:
+ ./update_sources
+
+.PHONY: \
+ all \
+ asan \
+ build \
+ clean \
+ cov \
+ debug \
+ distclean \
+ gen \
+ install \
+ test \
+ update_sources \
+
+include config.mk
+include sources.mk
diff --git a/http/configure b/http/configure
new file mode 100755
index 0000000..a4c02b1
--- /dev/null
+++ b/http/configure
@@ -0,0 +1,113 @@
+#!/bin/sh
+## kc3
+## Copyright 2022-2024 kmx.io <contact@kmx.io>
+##
+## Permission is hereby granted to use this software granted the above
+## copyright notice and this permission paragraph are included in all
+## copies and substantial portions of this software.
+##
+## THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
+## PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
+## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
+## THIS SOFTWARE.
+
+set -e
+
+echo "$PWD/configure"
+
+export SRC_TOP="$(dirname "$PWD")"
+
+CONFIG_H_PREFIX=KC3_HTTP_
+
+. ../config.subr
+
+LIB=libkc3_http.la
+LIB_ASAN=libkc3_http_asan.la
+LIB_COV=libkc3_http_cov.la
+LIB_DEBUG=libkc3_http_debug.la
+
+echo "LIB = $LIB" >> ${CONFIG_MK}
+echo "LIB_ASAN = $LIB_ASAN" >> ${CONFIG_MK}
+echo "LIB_COV = $LIB_COV" >> ${CONFIG_MK}
+echo "LIB_DEBUG = $LIB_DEBUG" >> ${CONFIG_MK}
+
+. ./sources.sh
+
+OBJECTS="$(c2ext .main.lo "$SOURCES")"
+echo "OBJECTS = $OBJECTS" >> ${CONFIG_MK}
+OBJECTS_ASAN="$(c2ext .asan.lo "$SOURCES")"
+OBJECTS_COV="$(c2ext .cov.lo "$SOURCES")"
+OBJECTS_DEBUG="$(c2ext .debug.lo "$SOURCES")"
+
+# Common config for all targets
+CPPFLAGS="-I.. $CPPFLAGS"
+CFLAGS="$CFLAGS -W -Wall -Werror -std=c11 -pedantic -pipe"
+CFLAGS="$CFLAGS -msse2 -mfpmath=sse"
+LDFLAGS="-export-dynamic $LDFLAGS -rdynamic"
+config_asan
+config_gnu
+pkg_config libbsd-overlay
+pkg_config libffi
+config_define PREFIX "\"${PREFIX}\""
+update_config_h
+LIBS="$LIBS -lm -rpath ${PREFIX}/lib"
+
+# Address Sanitizer config
+CPPFLAGS_ASAN="$CPPFLAGS"
+CFLAGS_ASAN="$CFLAGS -DDEBUG -O1 -g"
+CFLAGS_ASAN="$CFLAGS_ASAN -fsanitize=address -fno-omit-frame-pointer"
+LDFLAGS_ASAN="$LDFLAGS"
+LIBS_ASAN="$LIBS"
+
+# Coverage config
+CPPFLAGS_COV="$CPPFLAGS"
+CFLAGS_COV="$CFLAGS -fprofile-arcs -ftest-coverage"
+LDFLAGS_COV="$LDFLAGS --coverage"
+LIBS_COV="$LIBS -lgcov"
+
+# Debug config
+CPPFLAGS_DEBUG="$CPPFLAGS"
+CFLAGS_DEBUG="$CFLAGS -DDEBUG -O0 -g"
+LDFLAGS_DEBUG="$LDFLAGS"
+LIBS_DEBUG="$LIBS"
+
+# Main config
+DEFAULT_CFLAGS="-O2 -fPIC"
+if [ "x$ENV_CFLAGS" = "x" ]; then
+ CFLAGS="$CFLAGS $DEFAULT_CFLAGS"
+fi
+CFLAGS="$CFLAGS -DNDEBUG"
+LIBS="$LIBS"
+
+echo "LIB = $LIB" >> ${CONFIG_MK}
+echo "HAVE_ASAN = $HAVE_ASAN" >> ${CONFIG_MK}
+echo "CPPFLAGS = $CPPFLAGS" >> ${CONFIG_MK}
+echo "CFLAGS = $CFLAGS" >> ${CONFIG_MK}
+echo "LDFLAGS = $LDFLAGS" >> ${CONFIG_MK}
+echo "LIBS = $LIBS" >> ${CONFIG_MK}
+echo >> ${CONFIG_MK}
+echo "LIB_ASAN = $LIB_ASAN" >> ${CONFIG_MK}
+echo "CPPFLAGS_ASAN = $CPPFLAGS_ASAN" >> ${CONFIG_MK}
+echo "CFLAGS_ASAN = $CFLAGS_ASAN" >> ${CONFIG_MK}
+echo "LDFLAGS_ASAN = $LDFLAGS_ASAN" >> ${CONFIG_MK}
+echo "LIBS_ASAN = $LIBS_ASAN" >> ${CONFIG_MK}
+echo >> ${CONFIG_MK}
+echo "LIB_COV = $LIB_COV" >> ${CONFIG_MK}
+echo "CPPFLAGS_COV = $CPPFLAGS_COV" >> ${CONFIG_MK}
+echo "CFLAGS_COV = $CFLAGS_COV" >> ${CONFIG_MK}
+echo "LDFLAGS_COV = $LDFLAGS_COV" >> ${CONFIG_MK}
+echo "LIBS_COV = $LIBS_COV" >> ${CONFIG_MK}
+echo >> ${CONFIG_MK}
+echo "LIB_DEBUG = $LIB_DEBUG" >> ${CONFIG_MK}
+echo "CPPFLAGS_DEBUG = $CPPFLAGS_DEBUG" >> ${CONFIG_MK}
+echo "CFLAGS_DEBUG = $CFLAGS_DEBUG" >> ${CONFIG_MK}
+echo "LDFLAGS_DEBUG = $LDFLAGS_DEBUG" >> ${CONFIG_MK}
+echo "LIBS_DEBUG = $LIBS_DEBUG" >> ${CONFIG_MK}
+
+update_build
+update_build_lib
+
+build_lo
+build_lib
+
+update_config_mk
diff --git a/http/http.c b/http/http.c
new file mode 100644
index 0000000..645a439
--- /dev/null
+++ b/http/http.c
@@ -0,0 +1,16 @@
+/* kc3
+ * Copyright 2022,2023,2024 kmx.io <contact@kmx.io>
+ *
+ * Permission is hereby granted to use this software granted the above
+ * copyright notice and this permission paragraph are included in all
+ * copies and substantial portions of this software.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
+ * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
+ * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+#include <libkc3/kc3.h>
+#include "http.h"
+#include "socket.h"
+
diff --git a/http/http.h b/http/http.h
new file mode 100644
index 0000000..24e7b41
--- /dev/null
+++ b/http/http.h
@@ -0,0 +1,20 @@
+/* kc3
+ * Copyright 2022,2023,2024 kmx.io <contact@kmx.io>
+ *
+ * Permission is hereby granted to use this software granted the above
+ * copyright notice and this permission paragraph are included in all
+ * copies and substantial portions of this software.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
+ * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
+ * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+#ifndef HTTP_H
+#define HTTP_H
+
+#include "types.h"
+
+
+
+#endif /* HTTP_H */
diff --git a/http/socket.c b/http/socket.c
new file mode 100644
index 0000000..271c7ce
--- /dev/null
+++ b/http/socket.c
@@ -0,0 +1,118 @@
+/* kc3
+ * Copyright 2022,2023,2024 kmx.io <contact@kmx.io>
+ *
+ * Permission is hereby granted to use this software granted the above
+ * copyright notice and this permission paragraph are included in all
+ * copies and substantial portions of this software.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
+ * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
+ * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+#include <errno.h>
+#include <netdb.h>
+#include <netinet/in.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <unistd.h>
+#include <libkc3/kc3.h>
+#include "socket.h"
+
+void socket_close (p_socket s)
+{
+ assert(s);
+ close(*s);
+ *s = 0;
+}
+
+p_socket socket_init_accept (p_socket s, p_socket listening)
+{
+ struct sockaddr *addr;
+ struct sockaddr_storage addr_storage = {0};
+ socklen_t addr_len;
+ sw e;
+ t_socket tmp;
+ assert(s);
+ assert(listening);
+ addr = (struct sockaddr *) &addr_storage;
+ addr_len = sizeof(addr_storage);
+ tmp = accept(*listening, addr, &addr_len);
+ if (tmp < 0) {
+ e = errno;
+ err_write_1("socket_init_accept: accept: ");
+ err_puts(strerror(e));
+ assert(! "socket_init_accept: accept");
+ return NULL;
+ }
+ *s = tmp;
+ return s;
+}
+
+p_socket socket_init_listen (p_socket s, const s_str *host, u16 port)
+{
+ struct sockaddr *addr;
+ struct sockaddr_in *addr_inet;
+ struct sockaddr_in6 *addr_inet6;
+ socklen_t addr_len;
+ struct sockaddr_storage addr_storage;
+ sw e;
+ struct hostent *hostent;
+ t_socket tmp;
+ assert(s);
+ assert(host);
+ hostent = gethostbyname2(host->ptr.pchar, AF_INET);
+ if (! hostent)
+ hostent = gethostbyname2(host->ptr.pchar, AF_INET6);
+ if (! hostent) {
+ e = errno;
+ err_write_1("socket_init_listen: gethostbyname2: ");
+ err_puts(strerror(e));
+ assert(! "socket_init_listen: gethostbyname2");
+ return NULL;
+ }
+ addr = (struct sockaddr *) &addr_storage;
+ addr_len = hostent->h_length;
+ memcpy(addr, hostent->h_addr_list[0], addr_len);
+ switch (addr->sa_family) {
+ case AF_INET:
+ addr_inet = (struct sockaddr_in *) addr;
+ addr_inet->sin_port = htons(port);
+ break;
+ case AF_INET6:
+ addr_inet6 = (struct sockaddr_in6 *) addr;
+ addr_inet6->sin6_port = htons(port);
+ break;
+ default:
+ err_puts("socket_init_listen: unknown address family");
+ assert(! "socket_init_listen: unknown address family");
+ return NULL;
+ }
+ tmp = socket(addr->sa_family, SOCK_STREAM, 0);
+ if (tmp < 0) {
+ e = errno;
+ err_write_1("socket_init_listen: socket: ");
+ err_puts(strerror(e));
+ assert(! "socket_init_listen: socket");
+ return NULL;
+ }
+ if (bind(tmp, addr, addr_len) < 0) {
+ e = errno;
+ err_write_1("socket_init_listen: bind: ");
+ err_puts(strerror(e));
+ assert(! "socket_init_listen: bind");
+ socket_clean(&tmp);
+ return NULL;
+ }
+ if (listen(tmp, SOMAXCONN) < 0) {
+ e = errno;
+ err_write_1("socket_init_listen: listen: ");
+ err_puts(strerror(e));
+ assert(! "socket_init_listen: listen");
+ socket_clean(&tmp);
+ free(addr);
+ return NULL;
+ }
+ *s = tmp;
+ return s;
+}
diff --git a/http/socket.h b/http/socket.h
new file mode 100644
index 0000000..26a03fc
--- /dev/null
+++ b/http/socket.h
@@ -0,0 +1,25 @@
+/* kc3
+ * Copyright 2022,2023,2024 kmx.io <contact@kmx.io>
+ *
+ * Permission is hereby granted to use this software granted the above
+ * copyright notice and this permission paragraph are included in all
+ * copies and substantial portions of this software.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
+ * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
+ * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+#ifndef SOCKET_H
+#define SOCKET_H
+
+#include "types.h"
+
+/* Stack-allocation compatible functions. */
+p_socket socket_init_accept (p_socket s, p_socket listening);
+p_socket socket_init_listen (p_socket s, const s_str *host, u16 port);
+
+/* Operators. */
+void socket_close (p_socket s);
+
+#endif /* SOCKET_H */
diff --git a/http/sources.mk b/http/sources.mk
new file mode 100644
index 0000000..6d2e05e
--- /dev/null
+++ b/http/sources.mk
@@ -0,0 +1,10 @@
+# sources.mk generated by update_sources
+HEADERS = \
+ "http.h" \
+ "socket.h" \
+ "types.h" \
+
+SOURCES = \
+ "http.c" \
+ "socket.c" \
+
diff --git a/http/sources.sh b/http/sources.sh
new file mode 100644
index 0000000..ba1e699
--- /dev/null
+++ b/http/sources.sh
@@ -0,0 +1,3 @@
+# sources.sh generated by update_sources
+HEADERS='http.h socket.h types.h '
+SOURCES='http.c socket.c '
diff --git a/http/types.h b/http/types.h
new file mode 100644
index 0000000..ff12d73
--- /dev/null
+++ b/http/types.h
@@ -0,0 +1,24 @@
+/* kc3
+ * Copyright 2022,2023,2024 kmx.io <contact@kmx.io>
+ *
+ * Permission is hereby granted to use this software granted the above
+ * copyright notice and this permission paragraph are included in all
+ * copies and substantial portions of this software.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
+ * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
+ * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
+ * THIS SOFTWARE.
+ */
+#ifndef HTTP_TYPES_H
+#define HTTP_TYPES_H
+
+#include <libkc3/types.h>
+
+/* 1 */
+typedef int t_socket;
+
+/* 2 */
+typedef t_socket *p_socket;
+
+#endif /* HTTP_TYPES_H */
diff --git a/http/update_sources b/http/update_sources
new file mode 100755
index 0000000..a4101fe
--- /dev/null
+++ b/http/update_sources
@@ -0,0 +1,28 @@
+#!/bin/sh
+## kc3
+## Copyright 2022-2024 kmx.io <contact@kmx.io>
+##
+## Permission is hereby granted to use this software granted the above
+## copyright notice and this permission paragraph are included in all
+## copies and substantial portions of this software.
+##
+## THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
+## PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
+## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
+## THIS SOFTWARE.
+
+. ../config.subr
+
+echo "$PWD/update_sources"
+
+echo "# sources.mk generated by update_sources" > ${SOURCES_MK}
+echo "# sources.sh generated by update_sources" > ${SOURCES_SH}
+
+HEADERS="$(ls *.h | grep -v '^config.h$')"
+sources HEADERS "$HEADERS"
+
+SOURCES="$(ls *.c)"
+sources SOURCES "$SOURCES"
+
+update_sources_mk
+update_sources_sh
diff --git a/kc3_http/Makefile b/kc3_http/Makefile
deleted file mode 100644
index a4db491..0000000
--- a/kc3_http/Makefile
+++ /dev/null
@@ -1,78 +0,0 @@
-## kc3
-## Copyright 2022-2024 kmx.io <contact@kmx.io>
-##
-## Permission is hereby granted to use this software granted the above
-## copyright notice and this permission paragraph are included in all
-## copies and substantial portions of this software.
-##
-## THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
-## PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
-## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
-## THIS SOFTWARE.
-
-CLEANFILES = *.a *.gcno *.la .libs *.lo *.o
-
-CLEANFILES_COV = *.css *.gcda *.html .libs/*.gcda
-
-CLEANFILES += ${CLEANFILES_COV}
-
-DISTCLEANFILES = .build ${CLEANFILES} config.h config.mk
-
-all:
- ${MAKE} build
- ${MAKE} debug
- if ${HAVE_ASAN}; then ${MAKE} asan; fi
- if ${HAVE_GCOV}; then ${MAKE} cov; fi
-
-asan:
- ${MAKE} ${LIB_ASAN}
-
-build:
- ${MAKE} ${LIB}
-
-clean:
- rm -rf ${CLEANFILES}
-
-clean_cov:
- rm -rf ${CLEANFILES_COV}
-
-cov:
- ${MAKE} ${LIB_COV}
-
-debug:
- ${MAKE} ${LIB_DEBUG}
-
-distclean:
- rm -rf ${DISTCLEANFILES}
-
-gcovr:
- gcovr --gcov-executable ${GCOV} --html-details libkc3_web.html
-
-install:
- ${INSTALL} -o ${OWNER} -g ${GROUP} -m 0755 -d ${prefix}/include/libkc3/ekc3
- ${LIBTOOL} --tag=CC --mode=install ${INSTALL} -o ${OWNER} -g ${GROUP} -m 0644 ${HEADERS} ${prefix}/include/libkc3/ekc3
- ${INSTALL} -o ${OWNER} -g ${GROUP} -m 0755 -d ${prefix}/lib
- ${LIBTOOL} --tag=CC --mode=install ${INSTALL} -o ${OWNER} -g ${GROUP} -m 0644 ${LIB} ${prefix}/lib
- ${LIBTOOL} --tag=CC --mode=install ${INSTALL} -o ${OWNER} -g ${GROUP} -m 0644 ${LIB_DEBUG} ${prefix}/lib
- ${LIBTOOL} --finish ${prefix}/lib
-
-test:
-
-update_sources:
- ./update_sources
-
-.PHONY: \
- all \
- asan \
- build \
- clean \
- cov \
- debug \
- distclean \
- gen \
- install \
- test \
- update_sources \
-
-include config.mk
-include sources.mk
diff --git a/kc3_http/configure b/kc3_http/configure
deleted file mode 100755
index a4c02b1..0000000
--- a/kc3_http/configure
+++ /dev/null
@@ -1,113 +0,0 @@
-#!/bin/sh
-## kc3
-## Copyright 2022-2024 kmx.io <contact@kmx.io>
-##
-## Permission is hereby granted to use this software granted the above
-## copyright notice and this permission paragraph are included in all
-## copies and substantial portions of this software.
-##
-## THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
-## PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
-## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
-## THIS SOFTWARE.
-
-set -e
-
-echo "$PWD/configure"
-
-export SRC_TOP="$(dirname "$PWD")"
-
-CONFIG_H_PREFIX=KC3_HTTP_
-
-. ../config.subr
-
-LIB=libkc3_http.la
-LIB_ASAN=libkc3_http_asan.la
-LIB_COV=libkc3_http_cov.la
-LIB_DEBUG=libkc3_http_debug.la
-
-echo "LIB = $LIB" >> ${CONFIG_MK}
-echo "LIB_ASAN = $LIB_ASAN" >> ${CONFIG_MK}
-echo "LIB_COV = $LIB_COV" >> ${CONFIG_MK}
-echo "LIB_DEBUG = $LIB_DEBUG" >> ${CONFIG_MK}
-
-. ./sources.sh
-
-OBJECTS="$(c2ext .main.lo "$SOURCES")"
-echo "OBJECTS = $OBJECTS" >> ${CONFIG_MK}
-OBJECTS_ASAN="$(c2ext .asan.lo "$SOURCES")"
-OBJECTS_COV="$(c2ext .cov.lo "$SOURCES")"
-OBJECTS_DEBUG="$(c2ext .debug.lo "$SOURCES")"
-
-# Common config for all targets
-CPPFLAGS="-I.. $CPPFLAGS"
-CFLAGS="$CFLAGS -W -Wall -Werror -std=c11 -pedantic -pipe"
-CFLAGS="$CFLAGS -msse2 -mfpmath=sse"
-LDFLAGS="-export-dynamic $LDFLAGS -rdynamic"
-config_asan
-config_gnu
-pkg_config libbsd-overlay
-pkg_config libffi
-config_define PREFIX "\"${PREFIX}\""
-update_config_h
-LIBS="$LIBS -lm -rpath ${PREFIX}/lib"
-
-# Address Sanitizer config
-CPPFLAGS_ASAN="$CPPFLAGS"
-CFLAGS_ASAN="$CFLAGS -DDEBUG -O1 -g"
-CFLAGS_ASAN="$CFLAGS_ASAN -fsanitize=address -fno-omit-frame-pointer"
-LDFLAGS_ASAN="$LDFLAGS"
-LIBS_ASAN="$LIBS"
-
-# Coverage config
-CPPFLAGS_COV="$CPPFLAGS"
-CFLAGS_COV="$CFLAGS -fprofile-arcs -ftest-coverage"
-LDFLAGS_COV="$LDFLAGS --coverage"
-LIBS_COV="$LIBS -lgcov"
-
-# Debug config
-CPPFLAGS_DEBUG="$CPPFLAGS"
-CFLAGS_DEBUG="$CFLAGS -DDEBUG -O0 -g"
-LDFLAGS_DEBUG="$LDFLAGS"
-LIBS_DEBUG="$LIBS"
-
-# Main config
-DEFAULT_CFLAGS="-O2 -fPIC"
-if [ "x$ENV_CFLAGS" = "x" ]; then
- CFLAGS="$CFLAGS $DEFAULT_CFLAGS"
-fi
-CFLAGS="$CFLAGS -DNDEBUG"
-LIBS="$LIBS"
-
-echo "LIB = $LIB" >> ${CONFIG_MK}
-echo "HAVE_ASAN = $HAVE_ASAN" >> ${CONFIG_MK}
-echo "CPPFLAGS = $CPPFLAGS" >> ${CONFIG_MK}
-echo "CFLAGS = $CFLAGS" >> ${CONFIG_MK}
-echo "LDFLAGS = $LDFLAGS" >> ${CONFIG_MK}
-echo "LIBS = $LIBS" >> ${CONFIG_MK}
-echo >> ${CONFIG_MK}
-echo "LIB_ASAN = $LIB_ASAN" >> ${CONFIG_MK}
-echo "CPPFLAGS_ASAN = $CPPFLAGS_ASAN" >> ${CONFIG_MK}
-echo "CFLAGS_ASAN = $CFLAGS_ASAN" >> ${CONFIG_MK}
-echo "LDFLAGS_ASAN = $LDFLAGS_ASAN" >> ${CONFIG_MK}
-echo "LIBS_ASAN = $LIBS_ASAN" >> ${CONFIG_MK}
-echo >> ${CONFIG_MK}
-echo "LIB_COV = $LIB_COV" >> ${CONFIG_MK}
-echo "CPPFLAGS_COV = $CPPFLAGS_COV" >> ${CONFIG_MK}
-echo "CFLAGS_COV = $CFLAGS_COV" >> ${CONFIG_MK}
-echo "LDFLAGS_COV = $LDFLAGS_COV" >> ${CONFIG_MK}
-echo "LIBS_COV = $LIBS_COV" >> ${CONFIG_MK}
-echo >> ${CONFIG_MK}
-echo "LIB_DEBUG = $LIB_DEBUG" >> ${CONFIG_MK}
-echo "CPPFLAGS_DEBUG = $CPPFLAGS_DEBUG" >> ${CONFIG_MK}
-echo "CFLAGS_DEBUG = $CFLAGS_DEBUG" >> ${CONFIG_MK}
-echo "LDFLAGS_DEBUG = $LDFLAGS_DEBUG" >> ${CONFIG_MK}
-echo "LIBS_DEBUG = $LIBS_DEBUG" >> ${CONFIG_MK}
-
-update_build
-update_build_lib
-
-build_lo
-build_lib
-
-update_config_mk
diff --git a/kc3_http/http.c b/kc3_http/http.c
deleted file mode 100644
index 645a439..0000000
--- a/kc3_http/http.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/* kc3
- * Copyright 2022,2023,2024 kmx.io <contact@kmx.io>
- *
- * Permission is hereby granted to use this software granted the above
- * copyright notice and this permission paragraph are included in all
- * copies and substantial portions of this software.
- *
- * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
- * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
- * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
- * THIS SOFTWARE.
- */
-#include <libkc3/kc3.h>
-#include "http.h"
-#include "socket.h"
-
diff --git a/kc3_http/http.h b/kc3_http/http.h
deleted file mode 100644
index 24e7b41..0000000
--- a/kc3_http/http.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/* kc3
- * Copyright 2022,2023,2024 kmx.io <contact@kmx.io>
- *
- * Permission is hereby granted to use this software granted the above
- * copyright notice and this permission paragraph are included in all
- * copies and substantial portions of this software.
- *
- * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
- * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
- * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
- * THIS SOFTWARE.
- */
-#ifndef HTTP_H
-#define HTTP_H
-
-#include "types.h"
-
-
-
-#endif /* HTTP_H */
diff --git a/kc3_http/socket.c b/kc3_http/socket.c
deleted file mode 100644
index 271c7ce..0000000
--- a/kc3_http/socket.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/* kc3
- * Copyright 2022,2023,2024 kmx.io <contact@kmx.io>
- *
- * Permission is hereby granted to use this software granted the above
- * copyright notice and this permission paragraph are included in all
- * copies and substantial portions of this software.
- *
- * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
- * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
- * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
- * THIS SOFTWARE.
- */
-#include <errno.h>
-#include <netdb.h>
-#include <netinet/in.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <unistd.h>
-#include <libkc3/kc3.h>
-#include "socket.h"
-
-void socket_close (p_socket s)
-{
- assert(s);
- close(*s);
- *s = 0;
-}
-
-p_socket socket_init_accept (p_socket s, p_socket listening)
-{
- struct sockaddr *addr;
- struct sockaddr_storage addr_storage = {0};
- socklen_t addr_len;
- sw e;
- t_socket tmp;
- assert(s);
- assert(listening);
- addr = (struct sockaddr *) &addr_storage;
- addr_len = sizeof(addr_storage);
- tmp = accept(*listening, addr, &addr_len);
- if (tmp < 0) {
- e = errno;
- err_write_1("socket_init_accept: accept: ");
- err_puts(strerror(e));
- assert(! "socket_init_accept: accept");
- return NULL;
- }
- *s = tmp;
- return s;
-}
-
-p_socket socket_init_listen (p_socket s, const s_str *host, u16 port)
-{
- struct sockaddr *addr;
- struct sockaddr_in *addr_inet;
- struct sockaddr_in6 *addr_inet6;
- socklen_t addr_len;
- struct sockaddr_storage addr_storage;
- sw e;
- struct hostent *hostent;
- t_socket tmp;
- assert(s);
- assert(host);
- hostent = gethostbyname2(host->ptr.pchar, AF_INET);
- if (! hostent)
- hostent = gethostbyname2(host->ptr.pchar, AF_INET6);
- if (! hostent) {
- e = errno;
- err_write_1("socket_init_listen: gethostbyname2: ");
- err_puts(strerror(e));
- assert(! "socket_init_listen: gethostbyname2");
- return NULL;
- }
- addr = (struct sockaddr *) &addr_storage;
- addr_len = hostent->h_length;
- memcpy(addr, hostent->h_addr_list[0], addr_len);
- switch (addr->sa_family) {
- case AF_INET:
- addr_inet = (struct sockaddr_in *) addr;
- addr_inet->sin_port = htons(port);
- break;
- case AF_INET6:
- addr_inet6 = (struct sockaddr_in6 *) addr;
- addr_inet6->sin6_port = htons(port);
- break;
- default:
- err_puts("socket_init_listen: unknown address family");
- assert(! "socket_init_listen: unknown address family");
- return NULL;
- }
- tmp = socket(addr->sa_family, SOCK_STREAM, 0);
- if (tmp < 0) {
- e = errno;
- err_write_1("socket_init_listen: socket: ");
- err_puts(strerror(e));
- assert(! "socket_init_listen: socket");
- return NULL;
- }
- if (bind(tmp, addr, addr_len) < 0) {
- e = errno;
- err_write_1("socket_init_listen: bind: ");
- err_puts(strerror(e));
- assert(! "socket_init_listen: bind");
- socket_clean(&tmp);
- return NULL;
- }
- if (listen(tmp, SOMAXCONN) < 0) {
- e = errno;
- err_write_1("socket_init_listen: listen: ");
- err_puts(strerror(e));
- assert(! "socket_init_listen: listen");
- socket_clean(&tmp);
- free(addr);
- return NULL;
- }
- *s = tmp;
- return s;
-}
diff --git a/kc3_http/socket.h b/kc3_http/socket.h
deleted file mode 100644
index 26a03fc..0000000
--- a/kc3_http/socket.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* kc3
- * Copyright 2022,2023,2024 kmx.io <contact@kmx.io>
- *
- * Permission is hereby granted to use this software granted the above
- * copyright notice and this permission paragraph are included in all
- * copies and substantial portions of this software.
- *
- * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
- * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
- * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
- * THIS SOFTWARE.
- */
-#ifndef SOCKET_H
-#define SOCKET_H
-
-#include "types.h"
-
-/* Stack-allocation compatible functions. */
-p_socket socket_init_accept (p_socket s, p_socket listening);
-p_socket socket_init_listen (p_socket s, const s_str *host, u16 port);
-
-/* Operators. */
-void socket_close (p_socket s);
-
-#endif /* SOCKET_H */
diff --git a/kc3_http/sources.mk b/kc3_http/sources.mk
deleted file mode 100644
index 6d2e05e..0000000
--- a/kc3_http/sources.mk
+++ /dev/null
@@ -1,10 +0,0 @@
-# sources.mk generated by update_sources
-HEADERS = \
- "http.h" \
- "socket.h" \
- "types.h" \
-
-SOURCES = \
- "http.c" \
- "socket.c" \
-
diff --git a/kc3_http/sources.sh b/kc3_http/sources.sh
deleted file mode 100644
index ba1e699..0000000
--- a/kc3_http/sources.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-# sources.sh generated by update_sources
-HEADERS='http.h socket.h types.h '
-SOURCES='http.c socket.c '
diff --git a/kc3_http/types.h b/kc3_http/types.h
deleted file mode 100644
index ff12d73..0000000
--- a/kc3_http/types.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* kc3
- * Copyright 2022,2023,2024 kmx.io <contact@kmx.io>
- *
- * Permission is hereby granted to use this software granted the above
- * copyright notice and this permission paragraph are included in all
- * copies and substantial portions of this software.
- *
- * THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
- * PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
- * AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
- * THIS SOFTWARE.
- */
-#ifndef HTTP_TYPES_H
-#define HTTP_TYPES_H
-
-#include <libkc3/types.h>
-
-/* 1 */
-typedef int t_socket;
-
-/* 2 */
-typedef t_socket *p_socket;
-
-#endif /* HTTP_TYPES_H */
diff --git a/kc3_http/update_sources b/kc3_http/update_sources
deleted file mode 100755
index a4101fe..0000000
--- a/kc3_http/update_sources
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-## kc3
-## Copyright 2022-2024 kmx.io <contact@kmx.io>
-##
-## Permission is hereby granted to use this software granted the above
-## copyright notice and this permission paragraph are included in all
-## copies and substantial portions of this software.
-##
-## THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
-## PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
-## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
-## THIS SOFTWARE.
-
-. ../config.subr
-
-echo "$PWD/update_sources"
-
-echo "# sources.mk generated by update_sources" > ${SOURCES_MK}
-echo "# sources.sh generated by update_sources" > ${SOURCES_SH}
-
-HEADERS="$(ls *.h | grep -v '^config.h$')"
-sources HEADERS "$HEADERS"
-
-SOURCES="$(ls *.c)"
-sources SOURCES "$SOURCES"
-
-update_sources_mk
-update_sources_sh