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

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

Webmaster