cgi_gemini.c (view raw)
1#include <stdio.h>
2#include <err.h>
3#include <stdlib.h>
4#include <unistd.h>
5
6#include "nimisewi.h"
7
8int
9main(void)
10{
11#ifdef __OpenBSD__
12 if (pledge("stdio", NULL) == -1) {
13 err(EXIT_FAILURE, "pledge failed");
14 }
15#endif
16
17 char *ns;
18
19 ns = nimi_sewi();
20 if (ns == NULL) {
21 err(EXIT_FAILURE, "memory allocation failed");
22 }
23
24 printf("20 text/gemini\r\n");
25 printf("sina o lukin e nimi sewi:\n\n");
26 printf("# %s\n", ns);
27
28 return EXIT_SUCCESS;
29}