Classes | Defines | Typedefs | Enumerations | Functions | Variables

cgic.cpp File Reference

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <unistd.h>
#include "cgic.h"
#include "utilit.h"
Include dependency graph for cgic.cpp:

Classes

Defines

Typedefs

Enumerations

Functions

Variables


Define Documentation

#define CGICDEBUGSTART
#define CGICDEBUGEND
#define cgiStrEq (   a,
  b 
)    (!strcmp((a), (b)))

Typedef Documentation


Enumeration Type Documentation

Enumerator:
cgiParseSuccess 
cgiParseMemory 
cgiParseIO 
cgiParseSuccess 
cgiParseMemory 
cgiParseIO 
Enumerator:
cgiEscapeRest 
cgiEscapeFirst 
cgiEscapeSecond 
cgiEscapeRest 
cgiEscapeFirst 
cgiEscapeSecond 
Enumerator:
cgiUnescapeSuccess 
cgiUnescapeMemory 
cgiUnescapeSuccess 
cgiUnescapeMemory 

Function Documentation

static void cgiGetenv ( char **  s,
const char *  var 
) [static]

Referenced by main().

Here is the caller graph for this function:

static cgiParseResultType cgiParseGetFormInput (  )  [static]

References cgiContentLength, cgiParseFormInput(), and cgiQueryString.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static cgiParseResultType cgiParsePostFormInput (  )  [static]

References cgiContentLength, cgiIn, and cgiParseFormInput().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

static cgiParseResultType cgiParseFormInput ( char *  data,
int  length 
) [static]

References cgiFormEntryStruct::attr, cgiUnescapeChars(), cgiUnescapeSuccess, cgiFormEntryStruct::next, and cgiFormEntryStruct::value.

Referenced by cgiParseGetFormInput(), and cgiParsePostFormInput().

Here is the call graph for this function:

Here is the caller graph for this function:

static void cgiSetupConstants (  )  [static]

References cgiHexValue.

Referenced by main().

Here is the caller graph for this function:

static void cgiFreeResources (  )  [static]
static int cgiStrEqNc ( const char *  s1,
const char *  s2 
) [static]

Referenced by main().

Here is the caller graph for this function:

int main ( int  argc,
char *  argv[] 
)
cgiUnescapeResultType cgiUnescapeChars ( char **  sp,
char *  cp,
int  len 
) [static]

References cgiEscapeFirst, cgiEscapeRest, cgiEscapeSecond, and cgiHexValue.

Referenced by cgiParseFormInput().

Here is the caller graph for this function:

static cgiFormResultType cgiFormEntryString ( cgiFormEntry e,
char *  result,
int  max,
int  newlines 
) [static]

References cgiFormEntryStruct::value.

Referenced by cgiFormString(), cgiFormStringMultiple(), and cgiFormStringNoNewlines().

Here is the caller graph for this function:

static cgiFormEntry * cgiFormEntryFindFirst ( const char *  name  )  [static]
static cgiFormEntry * cgiFormEntryFindNext (  )  [static]

References cgiFormEntryStruct::attr, cgiFindTarget, and cgiFormEntryStruct::next.

Referenced by cgiFormEntryFindFirst(), cgiFormSelectMultiple(), and cgiFormStringMultiple().

Here is the caller graph for this function:

cgiFormResultType cgiFormString ( const char *  name,
char *  result,
int  max 
)

References cgiFormEntryFindFirst(), and cgiFormEntryString().

Here is the call graph for this function:

cgiFormResultType cgiFormStringNoNewlines ( const char *  name,
char *  result,
int  max 
)

References cgiFormEntryFindFirst(), and cgiFormEntryString().

Here is the call graph for this function:

cgiFormResultType cgiFormStringMultiple ( const char *  name,
char ***  result 
)
cgiFormResultType cgiFormStringSpaceNeeded ( const char *  name,
int *  result 
)

References cgiFormEntryFindFirst(), and cgiFormEntryStruct::value.

Here is the call graph for this function:

static int cgiFirstNonspaceChar ( char *  s  )  [static]

Referenced by cgiFormDouble(), and cgiFormInteger().

Here is the caller graph for this function:

cgiFormResultType cgiFormInteger ( const char *  name,
int *  result,
int  defaultV 
)

References cgiFirstNonspaceChar(), cgiFormEntryFindFirst(), and cgiFormEntryStruct::value.

Here is the call graph for this function:

cgiFormResultType cgiFormIntegerBounded ( const char *  name,
int *  result,
int  min,
int  max,
int  defaultV 
)

References cgiFormInteger(), and cgiFormSuccess.

Here is the call graph for this function:

cgiFormResultType cgiFormDouble ( const char *  name,
double *  result,
double  defaultV 
)

References cgiFirstNonspaceChar(), cgiFormEntryFindFirst(), and cgiFormEntryStruct::value.

Here is the call graph for this function:

cgiFormResultType cgiFormDoubleBounded ( const char *  name,
double *  result,
double  min,
double  max,
double  defaultV 
)

References cgiFormDouble(), and cgiFormSuccess.

Here is the call graph for this function:

cgiFormResultType cgiFormSelectSingle ( const char *  name,
char **  choicesText,
int  choicesTotal,
int *  result,
int  defaultV 
)

References CGICDEBUGEND, CGICDEBUGSTART, cgiFormEntryFindFirst(), and cgiStrEq.

Here is the call graph for this function:

cgiFormResultType cgiFormSelectMultiple ( const char *  name,
char **  choicesText,
int  choicesTotal,
int *  result,
int *  invalid 
)

References cgiFormEntryFindFirst(), cgiFormEntryFindNext(), cgiStrEq, and cgiFormEntryStruct::value.

Here is the call graph for this function:

cgiFormResultType cgiFormCheckboxSingle ( const char *  name  ) 

References cgiFormEntryFindFirst().

Here is the call graph for this function:

cgiFormResultType cgiFormCheckboxMultiple ( const char *  name,
char **  valuesText,
int  valuesTotal,
int *  result,
int *  invalid 
)

References cgiFormSelectMultiple().

Here is the call graph for this function:

cgiFormResultType cgiFormRadio ( const char *  name,
char **  valuesText,
int  valuesTotal,
int *  result,
int  defaultV 
)

References cgiFormSelectSingle().

Here is the call graph for this function:

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().

Here is the call graph for this function:

Here is the caller graph for this function:

static int cgiWriteInt ( FILE *  out,
int  i 
) [static]

Referenced by cgiWriteEnvironment(), and cgiWriteString().

Here is the caller graph for this function:

cgiEnvironmentResultType cgiWriteEnvironment ( char *  filename  ) 
static int cgiReadString ( FILE *  out,
char **  s 
) [static]

References cgiReadInt().

Referenced by cgiReadEnvironment().

Here is the call graph for this function:

Here is the caller graph for this function:

static int cgiReadInt ( FILE *  out,
int *  i 
) [static]

Referenced by cgiReadEnvironment(), and cgiReadString().

Here is the caller graph for this function:

cgiEnvironmentResultType cgiReadEnvironment ( char *  filename  ) 
void cgiStringArrayFree ( char **  stringArray  ) 

Variable Documentation

char* cgiPathInfo
char* cgiAuthType
char* cgiAccept
char* cgiUserAgent
char* cgiReferrer
FILE* cgiIn
FILE* cgiOut
int cgiRestored = 0 [static]
int cgiHexValue[256] [static]
const char* cgiFindTarget = 0 [static]
cgiFormEntry* cgiFindPos = 0 [static]