home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * This file describes the interface for a
- * library of functions to read CGI input.
- * The library depends on two ADTs, Array and
- * Dicitonary.
- *
- * To use the library, declare a string and Dictionary.
- * Call read data, passing in the un-allocated string.
- * The library will allocate space if needed.
- * Then call parse data, to convert the encoded
- * string into a dictionary of data.
- *
- * Dictionary dataDict;
- * char *data;
- *
- * dataDict = dict_alloc();
- *
- * readData(&data);
- *
- * if(data) parseData(data,dataDict);
- *
- * You can also use the convience function readParse():
- *
- * Dictionary dataDict;
- * dataDict = readParse();
- */
-
- #ifndef CGILIB_H
- #define CGILIB_H
-
- #include "dict.h"
- #include "array.h"
- #include "string.h"
-
- /* Calls readData and parseData, then returns the dictionary */
-
- Dictionary readParse();
-
- /* Calls readGetData or readPostData appropriately */
-
- void readData(char **aString);
-
- /* readGetData() reads get data and puts it into aString */
- void readGetData(char **aString);
-
- /* readPostData() reads POST data and puts it into aString */
- void readPostData(char **aString);
-
- /* decodeData() decodes a string of CGI encoded data */
-
- void decodeData(char *queryString);
-
- /* encodeData() encodes a string for CGI */
- void encodeData(String aString);
-
- /*
- * encodeDictionary() encodes a dictionary in the form
- * of CGI data and returns a String ADT.
- */
- String encodeDictionary(Dictionary dataDict);
-
- /*
- * parseData() breaks a CGI encoded string into
- * a Dictionary.
- */
- int parseData(char *queryString, Dictionary dataDict);
-
- #endif
-