/* Library structures ******************************************************************************/ struct { int contentLength; char *contentType; char *requestMethod; char *httpReferer; char *httpUserAgent; char *remoteAddr; char *remoteHost; } cgiEnv; /* Library functions ******************************************************************************/ /* --- form query functions --- */ char *cgiFormGetVal(char *var); /* --- html header functions --- */ void cgiHeaderContent(char *mimeType); void cgiHeaderLocation(char *redirectUrl); int cgiHeaderStatus(int statusCode, char *statusReason, char *statusMesg); /* --- html body functions --- */ void cgiHtmlHead(char *title); void cgiHtmlTail(); /* --- misc utility functions --- */ void cgiPrintf(char *fmt, ...); /* Externally defined functions ******************************************************************************/ extern void cgiMain();