Annotation of libwww/Library/src/HTInit.c, revision 2.87

2.20      frystyk     1: /*                                                                    HTInit.c
                      2: **     CONFIGURATION-SPECIFIC INITIALIALIZATION
                      3: **
2.25      frystyk     4: **     (c) COPYRIGHT MIT 1995.
2.20      frystyk     5: **     Please first read the full copyright statement in the file COPYRIGH.
2.87    ! frystyk     6: **     @(#) $Id: HTInit.c,v 2.86 1998/03/09 15:31:56 frystyk Exp $
2.9       duns        7: **
2.20      frystyk     8: **     Define a basic set of suffixes and presentations
2.1       timbl       9: */
                     10: 
2.22      frystyk    11: /* Library include files */
2.52      frystyk    12: #include "sysdep.h"
2.59      frystyk    13: #include "WWWUtil.h"
                     14: #include "WWWCore.h"
2.83      frystyk    15: 
                     16: #ifdef HT_MUX
2.75      frystyk    17: #include "WWWMux.h"
2.83      frystyk    18: #endif
2.75      frystyk    19: 
2.22      frystyk    20: #include "HTInit.h"                                     /* Implemented here */
2.1       timbl      21: 
2.65      frystyk    22: #ifndef W3C_ICONS
2.87    ! frystyk    23: #define W3C_ICONS      "w3c-icons"
2.65      frystyk    24: #endif
                     25: 
2.87    ! frystyk    26: #define ICON_LOCATION  "/icons/"
2.65      frystyk    27: 
2.29      frystyk    28: /* ------------------------------------------------------------------------- */
                     29: 
2.23      frystyk    30: /*     BINDINGS BETWEEN A SOURCE MEDIA TYPE AND A DEST MEDIA TYPE (CONVERSION)
                     31: **     ----------------------------------------------------------------------
2.47      frystyk    32: **     Not done automaticly - may be done by application!
2.23      frystyk    33: */
2.38      frystyk    34: PUBLIC void HTConverterInit (HTList * c)
2.23      frystyk    35: {
2.31      frystyk    36:     /*
2.49      frystyk    37:     ** You can get debug information out through the debug stream if you set
                     38:     ** the debug format appropriately
                     39:     */
                     40:     HTConversion_add(c,"*/*",                  "www/debug",    HTBlackHoleConverter,   1.0, 0.0, 0.0);
                     41: 
                     42:     /*
2.31      frystyk    43:     ** These are converters that converts to something other than www/present,
                     44:     ** that is not directly outputting someting to the user on the screen
                     45:     */
2.43      frystyk    46:     HTConversion_add(c,"message/rfc822",       "*/*",          HTMIMEConvert,  1.0, 0.0, 0.0);
2.55      frystyk    47:     HTConversion_add(c,"message/x-rfc822-foot",        "*/*",          HTMIMEFooter,   1.0, 0.0, 0.0);
2.72      frystyk    48:     HTConversion_add(c,"message/x-rfc822-head",        "*/*",          HTMIMEHeader,   1.0, 0.0, 0.0);
2.80      frystyk    49:     HTConversion_add(c,"message/x-rfc822-cont",        "*/*",          HTMIMEContinue, 1.0, 0.0, 0.0);
                     50:     HTConversion_add(c,"message/x-rfc822-partial","*/*",       HTMIMEPartial,  1.0, 0.0, 0.0);
2.43      frystyk    51:     HTConversion_add(c,"multipart/*",          "*/*",          HTBoundary,     1.0, 0.0, 0.0);
2.38      frystyk    52:     HTConversion_add(c,"text/plain",           "text/html",    HTPlainToHTML,  1.0, 0.0, 0.0);
2.39      frystyk    53: 
                     54:     /*
                     55:     ** The following conversions are converting ASCII output from various
                     56:     ** protocols to HTML objects.
                     57:     */
2.51      frystyk    58:     HTConversion_add(c,"text/x-http",          "*/*",          HTTPStatus_new, 1.0, 0.0, 0.0);
2.68      frystyk    59: 
2.42      frystyk    60: #if 0
                     61:     HTConversion_add(c,"text/x-gopher",                "www/present",  HTGopherMenu,   1.0, 0.0, 0.0);
                     62:     HTConversion_add(c,"text/x-cso",           "www/present",  HTGopherCSO,    1.0, 0.0, 0.0);
2.68      frystyk    63:     HTConversion_add(c,"text/x-wais-source",   "*/*",          HTWSRCConvert,  1.0, 0.0, 0.0);
                     64: #endif
                     65: 
2.48      frystyk    66:     HTConversion_add(c,"text/x-nntp-list",     "*/*",          HTNewsList,     1.0, 0.0, 0.0);
                     67:     HTConversion_add(c,"text/x-nntp-over",     "*/*",          HTNewsGroup,    1.0, 0.0, 0.0);
2.43      frystyk    68: 
2.31      frystyk    69:     /*
2.45      frystyk    70:     ** We also register a special content type guess stream that can figure out
                     71:     ** the content type by reading the first bytes of the stream
                     72:     */
                     73:     HTConversion_add(c,"www/unknown",          "*/*",          HTGuess_new,    1.0, 0.0, 0.0);
2.46      frystyk    74: 
                     75:     /*
2.72      frystyk    76:     ** Register a persistent cache stream which can save an object to local
                     77:     ** file
                     78:     */
                     79:     HTConversion_add(c,"www/cache",            "*/*",          HTCacheWriter,  1.0, 0.0, 0.0);
2.73      frystyk    80:     HTConversion_add(c,"www/cache-append",     "*/*",          HTCacheAppend,  1.0, 0.0, 0.0);
2.72      frystyk    81: 
                     82:     /*
2.46      frystyk    83:     ** Handling Rule files is handled just like any other stream
                     84:     ** This converter reads a rule file and generates the rules
                     85:     */
2.48      frystyk    86:     HTConversion_add(c,"application/x-www-rules","*/*",                HTRules,        1.0, 0.0, 0.0);
2.46      frystyk    87: 
2.45      frystyk    88:     /*
2.34      frystyk    89:     ** This dumps all other formats to local disk without any further
2.31      frystyk    90:     ** action taken
                     91:     */
2.85      frystyk    92:     HTConversion_add(c,"*/*",                  "www/present",  HTSaveConverter, 0.3, 0.0, 0.0);
2.23      frystyk    93: }
                     94: 
                     95: /*     BINDINGS BETWEEN MEDIA TYPES AND EXTERNAL VIEWERS/PRESENTERS
                     96: **     ------------------------------------------------------------
2.47      frystyk    97: **     Not done automaticly - may be done by application!
2.23      frystyk    98: **     The data objects are stored in temporary files before the external
                     99: **     program is called
                    100: */
2.38      frystyk   101: PUBLIC void HTPresenterInit (HTList * c)
2.1       timbl     102: {
                    103: #ifdef NeXT
2.38      frystyk   104:     HTPresentation_add(c,"application/postscript", "open %s",  NULL, 1.0, 2.0, 0.0);
2.10      luotonen  105:     /* The following needs the GIF previewer -- you might not have it. */
2.19      howcome   106: 
2.38      frystyk   107:     HTPresentation_add(c,"image/gif",          "open %s",      NULL, 0.3, 2.0, 0.0);
2.44      frystyk   108:     HTPresentation_add(c,"image/tiff",         "open %s",      NULL, 1.0, 2.0, 0.0);
2.41      frystyk   109:     HTPresentation_add(c,"audio/basic",        "open %s",      NULL, 1.0, 2.0, 0.0);
                    110:     HTPresentation_add(c,"*/*",                "open %s",      NULL, 0.05, 0.0, 0.0); 
2.1       timbl     111: #else
2.10      luotonen  112:     if (getenv("DISPLAY")) {   /* Must have X11 */
2.38      frystyk   113:        HTPresentation_add(c,"application/postscript", "ghostview %s",  NULL, 1.0, 3.0, 0.0);
2.41      frystyk   114:        HTPresentation_add(c,"image/gif",       "xv %s",        NULL, 1.0, 3.0, 0.0);
2.44      frystyk   115:        HTPresentation_add(c,"image/tiff",      "xv %s",        NULL, 1.0, 3.0, 0.0);
2.38      frystyk   116:        HTPresentation_add(c,"image/jpeg",      "xv %s",        NULL, 1.0, 3.0, 0.0);
2.44      frystyk   117:        HTPresentation_add(c,"image/png",       "xv %s",        NULL, 1.0, 3.0, 0.0);
2.10      luotonen  118:     }
2.1       timbl     119: #endif
2.15      frystyk   120: }
                    121: 
                    122: 
2.23      frystyk   123: /*     PRESENTERS AND CONVERTERS AT THE SAME TIME
                    124: **     ------------------------------------------
2.47      frystyk   125: **     Not done automaticly - may be done by application!
2.23      frystyk   126: **     This function is only defined in order to preserve backward
                    127: **     compatibility.
                    128: */
2.38      frystyk   129: PUBLIC void HTFormatInit (HTList * c)
2.15      frystyk   130: {
2.23      frystyk   131:     HTConverterInit(c);
                    132:     HTPresenterInit(c);
                    133: 
2.1       timbl     134: }
                    135: 
2.78      frystyk   136: /*     BINDINGS BETWEEN A TRANSFER ENCODING AND CODERS / DECODERS
                    137: **     ----------------------------------------------------------
2.55      frystyk   138: **     Not done automaticly - may be done by application!
                    139: */
2.78      frystyk   140: PUBLIC void HTTransferEncoderInit (HTList * c)
2.55      frystyk   141: {
2.63      frystyk   142:     HTCoding_add(c, "chunked", HTChunkedEncoder, HTChunkedDecoder, 1.0);
2.55      frystyk   143: }
2.47      frystyk   144: 
2.78      frystyk   145: /*     BINDINGS BETWEEN A CONTENT ENCODING AND CODERS / DECODERS
                    146: **     ---------------------------------------------------------
                    147: **     Not done automaticly - may be done by application!
                    148: */
                    149: PUBLIC void HTContentEncoderInit (HTList * c)
                    150: {
2.79      frystyk   151: #ifdef HT_ZLIB
2.78      frystyk   152:     HTCoding_add(c, "deflate", NULL, HTZLib_inflate, 1.0);
2.79      frystyk   153: #endif /* HT_ZLIB */
2.78      frystyk   154: }
                    155: 
2.64      frystyk   156: /*     REGISTER BEFORE FILTERS
                    157: **     -----------------------
                    158: **     The BEFORE filters handle proxies, caches, rule files etc.
                    159: **     The filters are called in the order by which the are registered
                    160: **     Not done automaticly - may be done by application!
                    161: */
                    162: PUBLIC void HTBeforeInit (void)
                    163: {
2.86      frystyk   164: #if 0
                    165:     /* Often handled better by the application */
2.74      frystyk   166:     HTNet_addBefore(HTMemoryCacheFilter,       NULL,           NULL, HT_FILTER_MIDDLE);
2.86      frystyk   167: #endif
2.74      frystyk   168:     HTNet_addBefore(HTCacheFilter,             "http://*",     NULL, HT_FILTER_MIDDLE);
                    169:     HTNet_addBefore(HTCredentialsFilter,       "http://*",     NULL, HT_FILTER_LATE);
                    170:     HTNet_addBefore(HTPEP_beforeFilter,        "http://*",     NULL, HT_FILTER_LATE);
                    171:     HTNet_addBefore(HTRuleFilter,              NULL,           NULL, HT_FILTER_LATE);
                    172:     HTNet_addBefore(HTProxyFilter,             NULL,           NULL, HT_FILTER_LATE);
2.64      frystyk   173: }
                    174: 
                    175: /*     REGISTER AFTER FILTERS
                    176: **     ----------------------
                    177: **     The AFTER filters handle error messages, logging, redirection,
                    178: **     authentication etc.
                    179: **     The filters are called in the order by which the are registered
                    180: **     Not done automaticly - may be done by application!
                    181: */
                    182: PUBLIC void HTAfterInit (void)
                    183: {
2.74      frystyk   184:     HTNet_addAfter(HTAuthFilter,       "http://*",     NULL, HT_NO_ACCESS,     HT_FILTER_MIDDLE);
2.81      frystyk   185:     HTNet_addAfter(HTAuthFilter,       "http://*",     NULL, HT_REAUTH,        HT_FILTER_MIDDLE);
2.74      frystyk   186:     HTNet_addAfter(HTPEP_afterFilter,  "http://*",     NULL, HT_ALL,           HT_FILTER_MIDDLE);
2.81      frystyk   187:     HTNet_addAfter(HTRedirectFilter,   "http://*",     NULL, HT_PERM_REDIRECT, HT_FILTER_MIDDLE);
                    188:     HTNet_addAfter(HTRedirectFilter,   "http://*",     NULL, HT_FOUND,         HT_FILTER_MIDDLE);
                    189:     HTNet_addAfter(HTRedirectFilter,   "http://*",     NULL, HT_SEE_OTHER,     HT_FILTER_MIDDLE);
2.74      frystyk   190:     HTNet_addAfter(HTRedirectFilter,   "http://*",     NULL, HT_TEMP_REDIRECT, HT_FILTER_MIDDLE);
                    191:     HTNet_addAfter(HTUseProxyFilter,   "http://*",     NULL, HT_USE_PROXY,     HT_FILTER_MIDDLE);
                    192:     HTNet_addAfter(HTCacheUpdateFilter, "http://*",    NULL, HT_NOT_MODIFIED,  HT_FILTER_MIDDLE);
                    193:     HTNet_addAfter(HTInfoFilter,       NULL,           NULL, HT_ALL,           HT_FILTER_LATE);
2.64      frystyk   194: }
                    195: 
                    196: /*     REGISTER DEFAULT AUTHENTICATION SCHEMES
                    197: **     ---------------------------------------
                    198: **     This function registers the BASIC access authentication
                    199: */
                    200: PUBLIC void HTAAInit (void)
                    201: {
                    202:     HTAA_newModule ("basic", HTBasic_generate, HTBasic_parse, HTBasic_delete);
                    203: }
                    204: 
                    205: /*     REGISTER BEFORE AND AFTER FILTERS
                    206: **     ---------------------------------
                    207: **     We register a commonly used set of BEFORE and AFTER filters.
2.47      frystyk   208: **     Not done automaticly - may be done by application!
                    209: */
                    210: PUBLIC void HTNetInit (void)
                    211: {
2.64      frystyk   212:     HTBeforeInit();
                    213:     HTAfterInit();
2.47      frystyk   214: }
                    215: 
                    216: 
                    217: /*     REGISTER CALLBACKS FOR THE ALERT MANAGER
                    218: **     ----------------------------------------
                    219: **     We register a set of alert messages
                    220: **     Not done automaticly - may be done by application!
                    221: */
                    222: PUBLIC void HTAlertInit (void)
                    223: {
                    224:     HTAlert_add(HTProgress, HT_A_PROGRESS);
                    225:     HTAlert_add(HTError_print, HT_A_MESSAGE);
                    226:     HTAlert_add(HTConfirm, HT_A_CONFIRM);
                    227:     HTAlert_add(HTPrompt, HT_A_PROMPT);
                    228:     HTAlert_add(HTPromptPassword, HT_A_SECRET);
                    229:     HTAlert_add(HTPromptUsernameAndPassword, HT_A_USER_PW);
                    230: }
                    231: 
2.53      frystyk   232: /*     REGISTER ALL KNOWN TRANSPORTS IN THE LIBRARY
                    233: **     --------------------------------------------
                    234: **     Not done automaticly - may be done by application!
                    235: */
                    236: PUBLIC void HTTransportInit (void)
                    237: {
2.69      frystyk   238:     HTTransport_add("tcp", HT_TP_SINGLE, HTReader_new, HTWriter_new);
                    239:     HTTransport_add("buffered_tcp", HT_TP_SINGLE, HTReader_new, HTBufferWriter_new);
2.75      frystyk   240: #ifdef HT_MUX
2.76      frystyk   241:     HTTransport_add("mux", HT_TP_INTERLEAVE, HTReader_new, HTBufferWriter_new);
2.75      frystyk   242: #endif /* HT_MUX */
2.54      frystyk   243: #ifndef NO_UNIX_IO
2.69      frystyk   244:     HTTransport_add("local", HT_TP_SINGLE, HTReader_new, HTWriter_new);
2.54      frystyk   245: #else
2.69      frystyk   246:     HTTransport_add("local", HT_TP_SINGLE, HTANSIReader_new, HTANSIWriter_new);
2.54      frystyk   247: #endif
2.53      frystyk   248: }
2.47      frystyk   249: 
2.24      frystyk   250: /*     REGISTER ALL KNOWN PROTOCOLS IN THE LIBRARY
                    251: **     -------------------------------------------
2.47      frystyk   252: **     Not done automaticly - may be done by application!
2.24      frystyk   253: */
2.63      frystyk   254: PUBLIC void HTProtocolInit (void)
2.24      frystyk   255: {
                    256: #ifndef DECNET
2.75      frystyk   257:     HTProtocol_add("ftp",      "tcp",  FTP_PORT,       NO,     HTLoadFTP,      NULL);
                    258:     HTProtocol_add("nntp",     "tcp",  NEWS_PORT,      NO,     HTLoadNews,     NULL);
                    259:     HTProtocol_add("news",     "tcp",  NEWS_PORT,      NO,     HTLoadNews,     NULL);
                    260:     HTProtocol_add("gopher",   "tcp",  GOPHER_PORT,    NO,     HTLoadGopher,   NULL);
2.24      frystyk   261: #ifdef HT_DIRECT_WAIS
2.75      frystyk   262:     HTProtocol_add("wais",     "",     WAIS_PORT,      YES,    HTLoadWAIS,     NULL);
2.24      frystyk   263: #endif
                    264: #endif /* DECNET */
2.75      frystyk   265: #ifdef HT_MUX
                    266:     HTProtocol_add("http",     "mux",  HTTP_PORT,      NO,     HTLoadHTTP,     NULL);
                    267: #else
                    268:     HTProtocol_add("http",     "buffered_tcp", HTTP_PORT,      NO,     HTLoadHTTP,     NULL);
                    269: #endif /* !HT_MUX */
2.84      frystyk   270: #ifndef NO_UNIX_IO
                    271:     HTProtocol_add("file",     "local",        0,      NO,     HTLoadFile,     NULL);
                    272:     HTProtocol_add("cache",    "local",        0,      NO,     HTLoadCache,    NULL);
                    273: #else
                    274:     HTProtocol_add("file",     "local",        0,      YES,    HTLoadFile,     NULL);
                    275:     HTProtocol_add("cache",    "local",        0,      YES,    HTLoadCache,    NULL);
                    276: #endif
2.75      frystyk   277:     HTProtocol_add("telnet",   "",             0,      YES,    HTLoadTelnet,   NULL);
                    278:     HTProtocol_add("tn3270",   "",             0,      YES,    HTLoadTelnet,   NULL);
                    279:     HTProtocol_add("rlogin",   "",             0,      YES,    HTLoadTelnet,   NULL);
2.24      frystyk   280: }
2.1       timbl     281: 
2.65      frystyk   282: /*     REGISTER ALL KNOWN PROTOCOLS IN THE LIBRARY PREEMPTIVELY
                    283: **     --------------------------------------------------------
                    284: **     Not done automaticly - may be done by application!
                    285: */
                    286: PUBLIC void HTProtocolPreemptiveInit (void)
                    287: {
                    288: #ifndef DECNET
2.75      frystyk   289:     HTProtocol_add("ftp", "tcp", FTP_PORT, YES, HTLoadFTP, NULL);
                    290:     HTProtocol_add("nntp", "tcp", NEWS_PORT, YES, HTLoadNews, NULL);
                    291:     HTProtocol_add("news", "tcp", NEWS_PORT, YES, HTLoadNews, NULL);
                    292:     HTProtocol_add("gopher", "tcp", GOPHER_PORT, YES, HTLoadGopher, NULL);
2.65      frystyk   293: #ifdef HT_DIRECT_WAIS
2.75      frystyk   294:     HTProtocol_add("wais", "", WAIS_PORT, YES, HTLoadWAIS, NULL);
2.65      frystyk   295: #endif
                    296: #endif /* DECNET */
                    297: 
2.75      frystyk   298:     HTProtocol_add("http", "buffered_tcp", HTTP_PORT, YES, HTLoadHTTP, NULL);
                    299:     HTProtocol_add("file", "local", 0, YES, HTLoadFile, NULL);
                    300:     HTProtocol_add("telnet", "", 0, YES, HTLoadTelnet, NULL);
                    301:     HTProtocol_add("tn3270", "", 0, YES, HTLoadTelnet, NULL);
                    302:     HTProtocol_add("rlogin", "", 0, YES, HTLoadTelnet, NULL);
                    303:     HTProtocol_add("cache","local",0,YES,HTLoadCache,  NULL);
2.61      frystyk   304: }
                    305: 
2.48      frystyk   306: /*     BINDINGS BETWEEN ICONS AND MEDIA TYPES
                    307: **     --------------------------------------
                    308: **     Not done automaticly - may be done by application!
                    309: **     For directory listings etc. you can bind a set of icons to a set of
                    310: **     media types and special icons for directories and other objects that
                    311: **     do not have a media type.
                    312: */
2.61      frystyk   313: PUBLIC void HTIconInit (const char * url_prefix)
2.58      eric      314: {
2.65      frystyk   315:     const char * prefix = url_prefix ? url_prefix : ICON_LOCATION;
2.58      eric      316: 
2.61      frystyk   317:     HTIcon_addBlank("blank.xbm",       prefix, NULL);
                    318:     HTIcon_addDir("directory.xbm",     prefix, "DIR");
                    319:     HTIcon_addParent("back.xbm",       prefix, "UP");
                    320:     HTIcon_addUnknown("unknown.xbm",   prefix, NULL);
                    321: 
                    322:     HTIcon_add("unknown.xbm",  prefix, NULL,   "*/*");
                    323:     HTIcon_add("binary.xbm",   prefix, "BIN",  "binary");
                    324:     HTIcon_add("unknown.xbm",  prefix, NULL,   "www/unknown");
                    325:     HTIcon_add("text.xbm",     prefix, "TXT",  "text/*");
                    326:     HTIcon_add("image.xbm",    prefix, "IMG",  "image/*");
                    327:     HTIcon_add("movie.xbm",    prefix, "MOV",  "video/*");
                    328:     HTIcon_add("sound.xbm",    prefix, "AU",   "audio/*");
                    329:     HTIcon_add("tar.xbm",      prefix, "TAR",  "multipart/x-tar");
                    330:     HTIcon_add("tar.xbm",      prefix, "TAR",  "multipart/x-gtar");
                    331:     HTIcon_add("compressed.xbm",prefix,        "CMP",  "x-compress");
                    332:     HTIcon_add("compressed.xbm",prefix,        "GZP",  "x-gzip");
                    333:     HTIcon_add("index.xbm",    prefix, "IDX",  "application/x-gopher-index");
                    334:     HTIcon_add("index2.xbm",   prefix, "CSO",  "application/x-gopher-cso");
                    335:     HTIcon_add("telnet.xbm",   prefix, "TEL",  "application/x-gopher-telnet");
                    336:     HTIcon_add("unknown.xbm",  prefix, "DUP",  "application/x-gopher-duplicate");
                    337:     HTIcon_add("unknown.xbm",  prefix, "TN",   "application/x-gopher-tn3270");
2.65      frystyk   338: 
                    339:     /* Add global  mapping to where to find the internal icons */
2.87    ! frystyk   340:     {
        !           341:        char * curdir = HTGetCurrentDirectoryURL();
        !           342:        char * virtual = HTParse(ICON_LOCATION, curdir,
        !           343:                                 PARSE_ACCESS|PARSE_HOST|PARSE_PATH|PARSE_PUNCTUATION);
        !           344:        char * physical = NULL;
        !           345:        StrAllocCat(virtual, "*");
        !           346: 
        !           347:        {
        !           348:            char * str = NULL;
        !           349:            if ((str = (char *) HT_MALLOC(strlen(W3C_ICONS) + 4)) == NULL)
        !           350:                HT_OUTOFMEM("HTIconInit");
        !           351:            strcpy(str, W3C_ICONS);
        !           352:            if (*(str + strlen(str) - 1) != '/') strcat(str, "/");
        !           353:            strcat(str, "*");
        !           354:            physical = HTParse(str, curdir,
        !           355:                               PARSE_ACCESS|PARSE_HOST|PARSE_PATH|PARSE_PUNCTUATION);
        !           356:            HT_FREE(str);
        !           357:        }
        !           358:        HTRule_addGlobal(HT_Pass, virtual, physical);
        !           359:        HT_FREE(virtual);
        !           360:        HT_FREE(physical);
        !           361:        HT_FREE(curdir);
        !           362:     }
2.58      eric      363: }
                    364: 
2.57      eric      365: /*     REGISTER ALL HTTP/1.1 MIME HEADERS
                    366: **     --------------------------------------------
                    367: **     Not done automaticly - may be done by application!
                    368: */
2.64      frystyk   369: PUBLIC void HTMIMEInit (void)
2.57      eric      370: {
                    371:     struct {
                    372:         char * string;
                    373:        HTParserCallback * pHandler;
                    374:     } fixedHandlers[] = {
2.61      frystyk   375:        {"accept", &HTMIME_accept}, 
                    376:        {"accept-charset", &HTMIME_acceptCharset}, 
                    377:        {"accept-encoding", &HTMIME_acceptEncoding}, 
                    378:        {"accept-language", &HTMIME_acceptLanguage}, 
                    379:        {"accept-ranges", &HTMIME_acceptRanges}, 
                    380:        {"authorization", NULL},
2.72      frystyk   381:        {"cache-control", &HTMIME_cacheControl},
2.61      frystyk   382:        {"connection", &HTMIME_connection}, 
                    383:        {"content-encoding", &HTMIME_contentEncoding}, 
                    384:        {"content-length", &HTMIME_contentLength}, 
                    385:        {"content-range", &HTMIME_contentRange},
                    386:        {"content-transfer-encoding", &HTMIME_contentTransferEncoding}, 
                    387:        {"content-type", &HTMIME_contentType},
                    388:        {"digest-MessageDigest", &HTMIME_messageDigest}, 
2.77      eric      389:        {"keep-alive", &HTMIME_keepAlive}, 
2.61      frystyk   390:        {"link", &HTMIME_link},
                    391:        {"location", &HTMIME_location},
                    392:        {"max-forwards", &HTMIME_maxForwards}, 
2.57      eric      393:        {"mime-version", NULL}, 
2.61      frystyk   394:        {"pragma", &HTMIME_pragma},
2.73      frystyk   395:         {"protocol", &HTMIME_protocol},
                    396:         {"protocol-info", &HTMIME_protocolInfo},
                    397:         {"protocol-request", &HTMIME_protocolRequest},
2.66      frystyk   398:        {"proxy-authenticate", &HTMIME_authenticate},
2.61      frystyk   399:        {"proxy-authorization", &HTMIME_proxyAuthorization},
                    400:        {"public", &HTMIME_public},
                    401:        {"range", &HTMIME_range},
                    402:        {"referer", &HTMIME_referer},
                    403:        {"retry-after", &HTMIME_retryAfter}, 
2.62      frystyk   404:        {"server", &HTMIME_server}, 
2.81      frystyk   405:        {"trailer", &HTMIME_trailer},
2.85      frystyk   406:        {"transfer-encoding", &HTMIME_transferEncoding}, 
2.61      frystyk   407:        {"upgrade", &HTMIME_upgrade},
                    408:        {"user-agent", &HTMIME_userAgent},
                    409:        {"vary", &HTMIME_vary},
                    410:        {"via", &HTMIME_via},
                    411:        {"warning", &HTMIME_warning},
                    412:        {"www-authenticate", &HTMIME_authenticate}, 
2.57      eric      413:     };
                    414:     int i;
                    415: 
                    416:     for (i = 0; i < sizeof(fixedHandlers)/sizeof(fixedHandlers[0]); i++)
                    417:         HTHeader_addParser(fixedHandlers[i].string, NO, 
                    418:                           fixedHandlers[i].pHandler);
                    419: }
                    420: 

Webmaster