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

2.1     ! timbl       1: /*             Configuration-specific Initialialization        HTInit.c
        !             2: **             ----------------------------------------
        !             3: */
        !             4: 
        !             5: /*     Define a basic set of suffixes and presentations
        !             6: **     ------------------------------------------------
        !             7: */
        !             8: 
        !             9: /* Implements:
        !            10: */
        !            11: #include "HTInit.h"
        !            12: 
        !            13: #include "HTML.h"
        !            14: #include "HTPlain.h"
        !            15: #include "HTMLGen.h"
        !            16: #include "HTFile.h"
        !            17: #include "HTFormat.h"
        !            18: #include "HTMIME.h"
        !            19: 
        !            20: PUBLIC void HTFormatInit NOARGS
        !            21: {
        !            22: #ifdef NeXT
        !            23:   HTSetPresentation("application/postscript", "open %s",       1.0, 2.0, 0.0);
        !            24:   HTSetPresentation("image/gif",               "open %s",      1.0, 2.0, 0.0);
        !            25:   HTSetPresentation("audio/basic",             "open %s",      1.0, 2.0, 0.0);
        !            26:   HTSetPresentation("*",                       "open %s",      1.0, 0.0, 0.0);
        !            27: #else
        !            28:  if (getenv("DISPLAY")) {      /* Must have X11 */
        !            29:   HTSetPresentation("application/postscript", "ghostview %s",  1.0, 3.0, 0.0);
        !            30:   HTSetPresentation("image/gif",               "xv %s",        1.0, 3.0, 0.0);
        !            31:   HTSetPresentation("image/jpeg",              "xv %s",        1.0, 3.0, 0.0);
        !            32:  }
        !            33: #endif
        !            34:  HTSetConversion("www/mime",  "*",          HTMIMEConvert,     1.0, 0.0, 0.0);
        !            35:  HTSetConversion("text/html", "text/x-c",    HTMLToC,          0.5, 0.0, 0.0);
        !            36:  HTSetConversion("text/html", "text/plain",  HTMLToPlain,      0.5, 0.0, 0.0);
        !            37:  HTSetConversion("text/html", "www/present", HTMLPresent,      1.0, 0.0, 0.0);
        !            38:  HTSetConversion("text/plain", "text/html",  HTPlainToHTML,    1.0, 0.0, 0.0);
        !            39:  HTSetConversion("text/plain", "www/present", HTPlainPresent,  1.0, 0.0, 0.0);
        !            40: }
        !            41: 
        !            42: 
        !            43: 
        !            44: /*     Define a basic set of suffixes
        !            45: **     ------------------------------
        !            46: **
        !            47: **     The LAST suffix for a type is that used for temporary files
        !            48: **     of that type.
        !            49: **     The quality is an apriori bias as to whether the file should be
        !            50: **     used.  Not that different suffixes can be used to represent files
        !            51: **     which are of the same format but are originals or regenerated,
        !            52: **     with different values.
        !            53: */
        !            54: 
        !            55: #ifndef NO_INIT
        !            56: PUBLIC void HTFileInit NOARGS
        !            57: {
        !            58:     HTSetSuffix(".mime","www/mime", 1.0);      /* Internal -- MIME is not recursive */
        !            59:     
        !            60:     HTSetSuffix(".PS", "application/postscript", 0.8);
        !            61:     HTSetSuffix(".eps",        "application/postscript", 0.8);
        !            62:     HTSetSuffix(".ai", "application/postscript", 0.5); /* Adobe illustator */
        !            63:     HTSetSuffix(".ps", "application/postscript", 0.8);
        !            64:     
        !            65:     HTSetSuffix(".html","text/html", 1.0);             /* Jumping the gun a little */
        !            66: 
        !            67:     HTSetSuffix(".c",  "text/plain", 0.5);
        !            68:     HTSetSuffix(".h",  "text/plain", 0.5);             /* html better */
        !            69:     HTSetSuffix(".m",  "text/plain", 0.5);             /* Objective-C code */
        !            70:     HTSetSuffix(".txt", "text/plain", 0.5);
        !            71: 
        !            72:     HTSetSuffix(".rtf",        "application/x-rtf", 1.0);
        !            73:     
        !            74:     HTSetSuffix(".snd", "audio/basic", 1.0);
        !            75:     
        !            76:     HTSetSuffix(".bin",        "application/octet-stream", 1.0);       /* @@@@@@@@@@@@@@@@ */
        !            77: 
        !            78:     HTSetSuffix(".Z",  "application/x-compressed", 1.0);       /* @@@@@@@@@@@@@@@@ */
        !            79:     
        !            80:     HTSetSuffix(".gif", "image/gif", 1.0);
        !            81: 
        !            82:     HTSetSuffix(".tiff","image/x-tiff", 1.0);
        !            83:     
        !            84:     HTSetSuffix(".jpg", "image/jpeg", 1.0);
        !            85:     HTSetSuffix(".JPG", "image/jpeg", 1.0);
        !            86:     HTSetSuffix(".JPEG","image/jpeg", 1.0);
        !            87:     HTSetSuffix(".jpeg","image/jpeg", 1.0);
        !            88:     
        !            89:     HTSetSuffix(".MPEG","video/mpeg", 1.0);
        !            90:     HTSetSuffix(".mpg","video/mpeg", 1.0);
        !            91:     HTSetSuffix(".MPG","video/mpeg", 1.0);
        !            92:     HTSetSuffix(".mpeg","video/mpeg", 1.0);
        !            93: 
        !            94: }
        !            95: #endif /* NO_INIT */
        !            96: 

Webmaster