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

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

Webmaster