commit 31115dc786d9c7d6e4f7ddac7f71c7c2bea4de4f from: Aleksey Ryndin date: Tue Aug 08 10:53:57 2023 UTC Add vostokd commit - 4453827665a9ddf783c5d45bddaae37218ba41c6 commit + 31115dc786d9c7d6e4f7ddac7f71c7c2bea4de4f blob - 4b3029e48dac95ce76bfa2d3d522cc072157807d blob + f2c180f6c8193bbc475196c8068efdb5b1b7bced --- .gitignore +++ .gitignore @@ -1,2 +1,2 @@ syntax: glob -vostokd +vostokd/vostokd blob - /dev/null blob + eb49959b0f02422280bfccb7162b89bdb7cffce3 (mode 644) --- /dev/null +++ Makefile @@ -0,0 +1,7 @@ +.PHONY: clean + +clean: + rm -rf vostokd/vostokd + +server: + ${MAKE} -C vostokd blob - /dev/null blob + 08402b8b9e4b3b27cdcb8bf9ae0ee79028b2fd20 (mode 644) --- /dev/null +++ shared/transport.cc @@ -0,0 +1,20 @@ +/** Wrap libtls for gemini protocol */ + +#include +#include + + +namespace vostok +{ +namespace tls +{ + + +bool init() +{ + return tls_init() != -1; +} + + +} // namespace tls +} // namespace vostok blob - /dev/null blob + 13e80fedbd96e3db9c53a209857df238e68df2c1 (mode 644) --- /dev/null +++ shared/transport.h @@ -0,0 +1,17 @@ +/** Wrap libtls for gemini protocol */ + +#pragma once + + +namespace vostok +{ +namespace tls +{ + + +/** Per-process initialization */ +bool init(); + + +} // namespace tls +} // namespace vostok blob - /dev/null blob + 42d0c810ae05a9ce11476bd3c6202c1a3bbf26e4 (mode 644) --- /dev/null +++ vostokd/Makefile @@ -0,0 +1,11 @@ +CXXFLAGS = -Wall -Wextra -std=c++11 +CXXFLAGS += -I${.CURDIR}/../shared -I${.CURDIR}/../3party +CXXFLAGS += -ltls +CXXFILES = vostokd.cc +HXXFILES = + +CXXFILES += ${.PATH}../shared/transport.cc +HXXFILES += ${.PATH}../shared/transport.h + +vostokd: ${CXXFILES} ${HXXFILES} + ${CXX} ${CXXFLAGS} ${CXXFILES} -o vostokd blob - /dev/null blob + f91bfa178c03316d32c9f17acadb3596aac89367 (mode 644) --- /dev/null +++ vostokd/vostokd.cc @@ -0,0 +1,31 @@ +/* Gemini server */ + +#include + +namespace vostok +{ +namespace +{ +} // namespace + + +bool +main() +{ + if (!tls::init()) + return false; + + return true; +} + +} // namespace vostok + + +extern "C" +int +main(int argc, char *argv[]) +{ + (void)argc; + (void)argv; + return vostok::main() ? 0 : 1; +}