// File: http_support.h // Author: Karl Abrahamson /************************************************ * MAX_DATA_LENGTH is the longest that a data * * string can be. If longer than this, the * * data string will be cut off. * ************************************************/ #define MAX_DATA_LENGTH 500 /************************************************ * getBinding * ************************************************ * Suppose that data is the form of string that * * is passed to a program by an HTTP server via * * the Common Gateway Interface. It has the * * form * * name=val&name=val&... * * telling what was typed into boxes in a form. * * For example, if the form has two boxes * * called FLAVOR and COLOR, and somebody * * typed mango into the FLAVOR box and orange * * into the COLOR box, then data the string * * will be * * FLAVOR=mango&COLOR=orange * * * * getBinding(name, data) returns the string * * that was typed into the box called name. * * For example, * * getBinding("COLOR", * * "FLAVOR=mango&COLOR=orange"); * * returns "orange". * * * * The returned string is stored in memory that * * is allocated using 'new'. * ************************************************/ char* getBinding(const char* name, const char* data); void WriteHttpHeading();