8 const char *const envok
[]= {
14 "HTTP_ACCEPT_ENCODING",
15 "HTTP_ACCEPT_LANGUAGE",
40 const int nenvok
= sizeof(envok
)/sizeof(envok
[0]);
44 static void outerror(void) {
46 exit(debugmode ?
0 : -1);
49 void syserror(const char *m
) {
50 if (printf("Content-Type: text/plain\n\n"
51 "ucgi: system call error:\n"
53 m
,strerror(errno
))==EOF
|| fflush(stdout
)) outerror();
57 void error(const char *m
) {
58 if (printf("Content-Type: text/plain\n\n"
61 m
)==EOF
|| fflush(stdout
)) outerror();
65 void *xmalloc(size_t sz
) {
69 if (!r
) syserror("malloc failed");
73 void xsetenv(const char *en
, const char *ev
, int overwrite
) {
74 if (setenv(en
,ev
,overwrite
)) syserror("setenv");