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