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

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

Webmaster