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

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: {
2.6     ! timbl      62:     HTSetSuffix(".mime","www/mime", "8bit", 1.0); /* Internal -- MIME is not recursive? */
2.1       timbl      63:     
2.6     ! timbl      64:     HTSetSuffix(".PS", "application/postscript", "8bit", 0.8);
        !            65:     HTSetSuffix(".eps",        "application/postscript", "8bit", 0.8);
        !            66:     HTSetSuffix(".ai", "application/postscript", "8bit", 0.5); /* Adobe illustator */
        !            67:     HTSetSuffix(".ps", "application/postscript", "8bit", 0.8);
        !            68: 
        !            69:     HTSetSuffix(".execme.csh", "application/x-csh", "7bit", 0.5);
2.1       timbl      70:     
2.6     ! timbl      71:     HTSetSuffix(".html","text/html", "8bit", 1.0);     /* Jumping the gun a little */
2.1       timbl      72: 
2.6     ! timbl      73:     HTSetSuffix(".c",  "text/plain", "7bit", 0.5);
        !            74:     HTSetSuffix(".h",  "text/plain", "7bit", 0.5);             /* html better */
        !            75:     HTSetSuffix(".m",  "text/plain", "7bit", 0.5);             /* Objective-C code */
        !            76:     HTSetSuffix(".txt", "text/plain", "7bit", 0.5);
2.1       timbl      77: 
2.6     ! timbl      78:     HTSetSuffix(".rtf",        "application/x-rtf", "8bit", 1.0);
2.2       timbl      79: 
2.6     ! timbl      80:     HTSetSuffix(".src",        "application/x-wais-source", "7bit", 1.0);
2.1       timbl      81:     
2.6     ! timbl      82:     HTSetSuffix(".snd", "audio/basic", "binary", 1.0);
2.1       timbl      83:     
2.6     ! timbl      84:     HTSetSuffix(".bin",        "application/octet-stream", "binary", 1.0);     /* @@@@@@@@@@@@@@@@ */
2.1       timbl      85: 
2.6     ! timbl      86:     HTSetSuffix(".Z",  "application/x-compressed", "binary", 1.0);     /* @@@@@@@@@@@@@@@@ */
2.1       timbl      87:     
2.6     ! timbl      88:     HTSetSuffix(".gif", "image/gif", "binary", 1.0);
2.1       timbl      89: 
2.6     ! timbl      90:     HTSetSuffix(".tiff","image/x-tiff", "binary", 1.0);
2.1       timbl      91:     
2.6     ! timbl      92:     HTSetSuffix(".jpg", "image/jpeg", "binary", 1.0);
        !            93:     HTSetSuffix(".JPG", "image/jpeg", "binary", 1.0);
        !            94:     HTSetSuffix(".JPEG","image/jpeg", "binary", 1.0);
        !            95:     HTSetSuffix(".jpeg","image/jpeg", "binary", 1.0);
        !            96:     
        !            97:     HTSetSuffix(".MPEG","video/mpeg", "binary", 1.0);
        !            98:     HTSetSuffix(".mpg","video/mpeg", "binary", 1.0);
        !            99:     HTSetSuffix(".MPG","video/mpeg", "binary", 1.0);
        !           100:     HTSetSuffix(".mpeg","video/mpeg", "binary", 1.0);
2.1       timbl     101: 
                    102: }
                    103: #endif /* NO_INIT */
                    104: 

Webmaster