#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
#include "cgic.h"
#include "utilit.h"
#define CGICDEBUGSTART |
Referenced by cgiFormSelectSingle(), cgiFormStringMultiple(), and main().
#define CGICDEBUGEND |
Referenced by cgiFormSelectSingle(), cgiFormStringMultiple(), and main().
#define cgiStrEq | ( | a, | ||
b | ||||
) | (!strcmp((a), (b))) |
Referenced by cgiFormSelectMultiple(), and cgiFormSelectSingle().
typedef struct cgiFormEntryStruct cgiFormEntry |
enum cgiParseResultType |
enum cgiEscapeState |
static void cgiGetenv | ( | char ** | s, | |
const char * | var | |||
) | [static] |
static cgiParseResultType cgiParseGetFormInput | ( | ) | [static] |
References cgiContentLength, cgiParseFormInput(), and cgiQueryString.
Referenced by main().
static cgiParseResultType cgiParsePostFormInput | ( | ) | [static] |
References cgiContentLength, cgiIn, and cgiParseFormInput().
Referenced by main().
static cgiParseResultType cgiParseFormInput | ( | char * | data, | |
int | length | |||
) | [static] |
References cgiFormEntryStruct::attr, cgiUnescapeChars(), cgiUnescapeSuccess, cgiFormEntryStruct::next, and cgiFormEntryStruct::value.
Referenced by cgiParseGetFormInput(), and cgiParsePostFormInput().
static void cgiSetupConstants | ( | ) | [static] |
static void cgiFreeResources | ( | ) | [static] |
References cgiFormEntryStruct::attr, cgiAccept, cgiAuthType, cgiContentType, cgiGatewayInterface, cgiPathInfo, cgiPathTranslated, cgiQueryString, cgiReferrer, cgiRemoteAddr, cgiRemoteHost, cgiRemoteIdent, cgiRemoteUser, cgiRequestMethod, cgiRestored, cgiScriptName, cgiServerName, cgiServerPort, cgiServerProtocol, cgiServerSoftware, cgiUserAgent, cgiFormEntryStruct::next, and cgiFormEntryStruct::value.
Referenced by cgiReadEnvironment(), and main().
static int cgiStrEqNc | ( | const char * | s1, | |
const char * | s2 | |||
) | [static] |
int main | ( | int | argc, | |
char * | argv[] | |||
) |
References cgiAccept, cgiAuthType, CGICDEBUGEND, CGICDEBUGSTART, cgiContentLength, cgiContentType, cgiFreeResources(), cgiGatewayInterface, cgiGetenv(), cgiIn, cgiMain(), cgiOut, cgiParseGetFormInput(), cgiParsePostFormInput(), cgiParseSuccess, cgiPathInfo, cgiPathTranslated, cgiQueryString, cgiReferrer, cgiRemoteAddr, cgiRemoteHost, cgiRemoteIdent, cgiRemoteUser, cgiRequestMethod, cgiRestored, cgiScriptName, cgiServerName, cgiServerPort, cgiServerProtocol, cgiServerSoftware, cgiSetupConstants(), cgiStrEqNc(), and cgiUserAgent.
cgiUnescapeResultType cgiUnescapeChars | ( | char ** | sp, | |
char * | cp, | |||
int | len | |||
) | [static] |
References cgiEscapeFirst, cgiEscapeRest, cgiEscapeSecond, and cgiHexValue.
Referenced by cgiParseFormInput().
static cgiFormResultType cgiFormEntryString | ( | cgiFormEntry * | e, | |
char * | result, | |||
int | max, | |||
int | newlines | |||
) | [static] |
References cgiFormEntryStruct::value.
Referenced by cgiFormString(), cgiFormStringMultiple(), and cgiFormStringNoNewlines().
static cgiFormEntry * cgiFormEntryFindFirst | ( | const char * | name | ) | [static] |
References cgiFindTarget, and cgiFormEntryFindNext().
Referenced by cgiFormCheckboxSingle(), cgiFormDouble(), cgiFormInteger(), cgiFormSelectMultiple(), cgiFormSelectSingle(), cgiFormString(), cgiFormStringMultiple(), cgiFormStringNoNewlines(), and cgiFormStringSpaceNeeded().
static cgiFormEntry * cgiFormEntryFindNext | ( | ) | [static] |
References cgiFormEntryStruct::attr, cgiFindTarget, and cgiFormEntryStruct::next.
Referenced by cgiFormEntryFindFirst(), cgiFormSelectMultiple(), and cgiFormStringMultiple().
cgiFormResultType cgiFormString | ( | const char * | name, | |
char * | result, | |||
int | max | |||
) |
References cgiFormEntryFindFirst(), and cgiFormEntryString().
cgiFormResultType cgiFormStringNoNewlines | ( | const char * | name, | |
char * | result, | |||
int | max | |||
) |
References cgiFormEntryFindFirst(), and cgiFormEntryString().
cgiFormResultType cgiFormStringMultiple | ( | const char * | name, | |
char *** | result | |||
) |
References CGICDEBUGEND, CGICDEBUGSTART, cgiFormEntryFindFirst(), cgiFormEntryFindNext(), cgiFormEntryString(), cgiStringArrayFree(), and cgiFormEntryStruct::value.
cgiFormResultType cgiFormStringSpaceNeeded | ( | const char * | name, | |
int * | result | |||
) |
References cgiFormEntryFindFirst(), and cgiFormEntryStruct::value.
static int cgiFirstNonspaceChar | ( | char * | s | ) | [static] |
cgiFormResultType cgiFormInteger | ( | const char * | name, | |
int * | result, | |||
int | defaultV | |||
) |
References cgiFirstNonspaceChar(), cgiFormEntryFindFirst(), and cgiFormEntryStruct::value.
cgiFormResultType cgiFormIntegerBounded | ( | const char * | name, | |
int * | result, | |||
int | min, | |||
int | max, | |||
int | defaultV | |||
) |
cgiFormResultType cgiFormDouble | ( | const char * | name, | |
double * | result, | |||
double | defaultV | |||
) |
References cgiFirstNonspaceChar(), cgiFormEntryFindFirst(), and cgiFormEntryStruct::value.
cgiFormResultType cgiFormDoubleBounded | ( | const char * | name, | |
double * | result, | |||
double | min, | |||
double | max, | |||
double | defaultV | |||
) |
cgiFormResultType cgiFormSelectSingle | ( | const char * | name, | |
char ** | choicesText, | |||
int | choicesTotal, | |||
int * | result, | |||
int | defaultV | |||
) |
References CGICDEBUGEND, CGICDEBUGSTART, cgiFormEntryFindFirst(), and cgiStrEq.
cgiFormResultType cgiFormSelectMultiple | ( | const char * | name, | |
char ** | choicesText, | |||
int | choicesTotal, | |||
int * | result, | |||
int * | invalid | |||
) |
References cgiFormEntryFindFirst(), cgiFormEntryFindNext(), cgiStrEq, and cgiFormEntryStruct::value.
cgiFormResultType cgiFormCheckboxSingle | ( | const char * | name | ) |
cgiFormResultType cgiFormCheckboxMultiple | ( | const char * | name, | |
char ** | valuesText, | |||
int | valuesTotal, | |||
int * | result, | |||
int * | invalid | |||
) |
cgiFormResultType cgiFormRadio | ( | const char * | name, | |
char ** | valuesText, | |||
int | valuesTotal, | |||
int * | result, | |||
int | defaultV | |||
) |
void cgiHeaderLocation | ( | const char * | redirectUrl | ) |
References cgiOut.
void cgiHeaderStatus | ( | int | status, | |
const char * | statusMessage | |||
) |
References cgiOut.
void cgiHeaderContentType | ( | const char * | mimeType | ) |
References cgiOut.
static int cgiWriteString | ( | FILE * | out, | |
char * | s | |||
) | [static] |
References cgiWriteInt().
Referenced by cgiWriteEnvironment().
static int cgiWriteInt | ( | FILE * | out, | |
int | i | |||
) | [static] |
Referenced by cgiWriteEnvironment(), and cgiWriteString().
cgiEnvironmentResultType cgiWriteEnvironment | ( | char * | filename | ) |
References cgiFormEntryStruct::attr, cgiAccept, cgiAuthType, cgiContentLength, cgiContentType, cgiCookie, cgiFormFileClose(), cgiFormFileOpen(), cgiFormFileRead(), cgiFormSuccess, cgiGatewayInterface, cgiPathInfo, cgiPathTranslated, cgiQueryString, cgiReferrer, cgiRemoteAddr, cgiRemoteHost, cgiRemoteIdent, cgiRemoteUser, cgiRequestMethod, cgiScriptName, cgiServerName, cgiServerPort, cgiServerProtocol, cgiServerSoftware, cgiUserAgent, cgiWriteInt(), cgiWriteString(), cgiFormEntryStruct::contentType, cgiFormEntryStruct::fileName, cgiFormEntryStruct::next, cgiFormEntryStruct::value, and cgiFormEntryStruct::valueLength.
static int cgiReadString | ( | FILE * | out, | |
char ** | s | |||
) | [static] |
References cgiReadInt().
Referenced by cgiReadEnvironment().
static int cgiReadInt | ( | FILE * | out, | |
int * | i | |||
) | [static] |
Referenced by cgiReadEnvironment(), and cgiReadString().
cgiEnvironmentResultType cgiReadEnvironment | ( | char * | filename | ) |
References cgiFormEntryStruct::attr, cgiAccept, cgiAuthType, CGIC_VERSION, cgiContentLength, cgiContentType, cgiCookie, cgiFreeResources(), cgiGatewayInterface, cgiParseSuccess, cgiPathInfo, cgiPathTranslated, cgiQueryString, cgiReadInt(), cgiReadString(), cgiReferrer, cgiRemoteAddr, cgiRemoteHost, cgiRemoteIdent, cgiRemoteUser, cgiRequestMethod, cgiRestored, cgiScriptName, cgiServerName, cgiServerPort, cgiServerProtocol, cgiServerSoftware, cgiUserAgent, cgiFormEntryStruct::contentType, cgiFormEntryStruct::fileName, getTempFileName(), cgiFormEntryStruct::next, cgiFormEntryStruct::tfileName, cgiFormEntryStruct::value, and cgiFormEntryStruct::valueLength.
void cgiStringArrayFree | ( | char ** | stringArray | ) |
char* cgiServerSoftware |
char* cgiServerName |
char* cgiGatewayInterface |
char* cgiServerProtocol |
char* cgiServerPort |
char* cgiRequestMethod |
char* cgiPathInfo |
char* cgiPathTranslated |
char* cgiScriptName |
char* cgiQueryString |
char* cgiRemoteHost |
char* cgiRemoteAddr |
char* cgiAuthType |
char* cgiRemoteUser |
char* cgiRemoteIdent |
char* cgiContentType |
int cgiContentLength |
char* cgiAccept |
char* cgiUserAgent |
char* cgiReferrer |
FILE* cgiIn |
FILE* cgiOut |
cgiFormEntry* cgiFormEntryFirst [static] |
int cgiRestored = 0 [static] |
Referenced by cgiFreeResources(), cgiReadEnvironment(), and main().
int cgiHexValue[256] [static] |
Referenced by cgiSetupConstants(), and cgiUnescapeChars().
const char* cgiFindTarget = 0 [static] |
Referenced by cgiFormEntryFindFirst(), and cgiFormEntryFindNext().
cgiFormEntry* cgiFindPos = 0 [static] |