aboutsummaryrefslogtreecommitdiffstats
path: root/cgi_gemini.c
diff options
context:
space:
mode:
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;
+}