aboutsummaryrefslogtreecommitdiffstats
path: root/cgi_gemini.c
diff options
context:
space:
mode:
authorla-ninpre <leobrekalini@gmail.com>2021-06-02 17:00:39 +0000
committerla-ninpre <leobrekalini@gmail.com>2021-06-02 17:00:39 +0000
commite7e4e22b69a0c9965c2d4f96903ae647165e99d3 (patch)
tree206e0ffd324751e51850184dc21929382a3af4e4 /cgi_gemini.c
parent44c234cfdf8588e5c53a9534cc2ee1c627682f7c (diff)
downloadnimisewi_c-e7e4e22b69a0c9965c2d4f96903ae647165e99d3.tar.gz
nimisewi_c-e7e4e22b69a0c9965c2d4f96903ae647165e99d3.zip
major refactoringv0.0.3
added options to compile cgi for http and gemini FossilOrigin-Name: 393d793150423ffe6680f109ef6b0524fd8e2e3501766a6761aa63276e90d90e
Diffstat (limited to 'cgi_gemini.c')
-rw-r--r--cgi_gemini.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/cgi_gemini.c b/cgi_gemini.c
new file mode 100644
index 0000000..b839146
--- /dev/null
+++ b/cgi_gemini.c
@@ -0,0 +1,29 @@
+#include <stdio.h>
+#include <err.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "nimisewi.h"
+
+int
+main(void)
+{
+#ifdef __OpenBSD__
+ if (pledge("stdio", NULL) == -1) {
+ err(EXIT_FAILURE, "pledge failed");
+ }
+#endif
+
+ char *ns;
+
+ ns = nimi_sewi();
+ if (ns == NULL) {
+ err(EXIT_FAILURE, "memory allocation failed");
+ }
+
+ printf("20 text/gemini\r\n");
+ printf("sina o lukin e nimi sewi:\n\n");
+ printf("# %s\n", ns);
+
+ return EXIT_SUCCESS;
+}