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

2.1       frystyk     1: /*                                                                HTBInit.c
                      2: **     STANDARD BINDINGS BETWEEN FILE SUFFIXES AND MEDIA TYPES
                      3: **
                      4: **     (c) COPYRIGHT MIT 1995.
                      5: **     Please first read the full copyright statement in the file COPYRIGH.
2.8     ! frystyk     6: **     @(#) $Id: HTBInit.c,v 2.7 1998/05/04 19:36:15 frystyk Exp $
2.1       frystyk     7: **
                      8: **     Define a basic set of suffixes and presentations
                      9: */
                     10: 
                     11: /* Library include files */
2.7       frystyk    12: #include "wwwsys.h"
2.1       frystyk    13: #include "HTUtils.h"
                     14: #include "HTFormat.h"
                     15: #include "HTBind.h"
                     16: #include "HTBInit.h"                                    /* Implemented here */
                     17: 
                     18: /* ------------------------------------------------------------------------- */
                     19: 
                     20: /*     BINDINGS BETWEEN FILE EXTENSIONS AND MEDIA TYPES
                     21: **     ------------------------------------------------
                     22: **     Not done automaticly - may be done by application!
                     23: **     The LAST suffix for a type is that used for temporary files of that
                     24: **     type. The quality is an apriori bias as to whether the file should be
                     25: **     used.  Not that different suffixes can be used to represent files
                     26: **     which are of the same format but are originals or regenerated,
                     27: **     with different values.
2.3       frystyk    28: **
                     29: **             C-T     Content type
                     30: **             C-T-E   Content Transfer encoding
                     31: **             C-E     Content encoding
2.1       frystyk    32: */
                     33: PUBLIC void HTFileInit (void)
                     34: {
2.6       frystyk    35:     /*         Suffix  C-T                             C-E             C-T-E           Lang    Quality */
2.1       frystyk    36: 
2.6       frystyk    37:     HTBind_add("C",    "text/plain",                   NULL,           "7bit",         NULL,   0.5);   /* C++ source           */
                     38:     HTBind_add("JPE",  "image/jpeg",                   NULL,           "binary",       NULL,   1.0);
                     39:     HTBind_add("JPEG", "image/jpeg",                   NULL,           "binary",       NULL,   1.0);
                     40:     HTBind_add("JPG",  "image/jpeg",                   NULL,           "binary",       NULL,   1.0);
                     41:     HTBind_add("MPE",  "video/mpeg",                   NULL,           "binary",       NULL,   1.0);
                     42:     HTBind_add("MPEG", "video/mpeg",                   NULL,           "binary",       NULL,   1.0);
                     43:     HTBind_add("MPG",  "video/mpeg",                   NULL,           "binary",       NULL,   1.0);   /* MPEG                 */
                     44:     HTBind_add("ai",   "application/postscript",       NULL,           "8bit",         NULL,   0.5);   /* Adobe Illustrator    */
                     45:     HTBind_add("aif",  "audio/x-aiff",                 NULL,           "binary",       NULL,   1.0);
                     46:     HTBind_add("aifc", "audio/x-aiff",                 NULL,           "binary",       NULL,   1.0);
                     47:     HTBind_add("aiff", "audio/x-aiff",                 NULL,           "binary",       NULL,   1.0);
                     48:     HTBind_add("au",   "audio/basic",                  NULL,           "binary",       NULL,   1.0);
                     49:     HTBind_add("avi",  "video/x-msvideo",              NULL,           "binary",       NULL,   1.0);   /* MS Video for Windows */
                     50:     HTBind_add("bcpio",        "application/x-bcpio",          NULL,           "binary",       NULL,   1.0);   /* Old binary CPIO      */
                     51:     HTBind_add("bin",  "application/octet-stream",     NULL,           "binary",       NULL,   1.0);   /* Uninterpreted binary */
                     52:     HTBind_add("c",    "text/plain",                   NULL,           "7bit",         NULL,   0.5);   /* C source             */
                     53:     HTBind_add("cc",   "text/plain",                   NULL,           "7bit",         NULL,   0.5);   /* C++ source           */
                     54:     HTBind_add("cdf",  "application/x-netcdf",         NULL,           "binary",       NULL,   1.0);
                     55:     HTBind_add("cgm",  "image/cgm",                    NULL,           "binary",       NULL,   1.0);
                     56:     HTBind_add("conf", "application/x-www-rules",      NULL,           "8bit",         NULL,   1.0);   /* CONFIGURATION FILE   */
                     57:     HTBind_add("cpio", "application/x-cpio",           NULL,           "binary",       NULL,   1.0);   /* POSIX CPIO           */
                     58:     HTBind_add("csh",  "application/x-csh",            NULL,           "7bit",         NULL,   0.5);   /* C-shell script       */
                     59:     HTBind_add("dvi",  "application/x-dvi",            NULL,           "binary",       NULL,   1.0);   /* TeX DVI              */
                     60:     HTBind_add("eps",  "application/postscript",       NULL,           "8bit",         NULL,   0.8);
                     61:     HTBind_add("etx",  "text/x-setext",                NULL,           "7bit",         NULL,   0.9);   /* Struct Enchanced Txt */
                     62:     HTBind_add("f90",  "text/plain",                   NULL,           "7bit",         NULL,   0.5);   /* Fortran 90 source    */
                     63:     HTBind_add("gif",  "image/gif",                    NULL,           "binary",       NULL,   1.0);   /* GIF                  */
                     64:     HTBind_add("h",    "text/plain",                   NULL,           "7bit",         NULL,   0.5);   /* C headers            */
                     65:     HTBind_add("hdf",  "application/x-hdf",            NULL,           "binary",       NULL,   1.0);   /* NCSA HDF data file   */
                     66:     HTBind_add("hh",   "text/plain",                   NULL,           "7bit",         NULL,   0.5);   /* C++ headers          */
2.8     ! frystyk    67:     HTBind_add("htm",  "text/html",                    NULL,           "8bit",         NULL,   1.0);   /* HTML                 */
2.6       frystyk    68:     HTBind_add("html", "text/html",                    NULL,           "8bit",         NULL,   1.0);   /* HTML                 */
                     69:     HTBind_add("ief",  "image/ief",                    NULL,           "binary",       NULL,   1.0);   /* Image Exchange fmt   */
                     70:     HTBind_add("jpe",  "image/jpeg",                   NULL,           "binary",       NULL,   1.0);
                     71:     HTBind_add("jpeg", "image/jpeg",                   NULL,           "binary",       NULL,   1.0);
                     72:     HTBind_add("jpg",  "image/jpeg",                   NULL,           "binary",       NULL,   1.0);   /* JPEG                 */
                     73:     HTBind_add("latex",        "text/latex",                   NULL,           "8bit",         NULL,   1.0);   /* LaTeX source         */
                     74:     HTBind_add("m",    "text/plain",                   NULL,           "7bit",         NULL,   0.5);   /* Objective-C source   */
                     75:     HTBind_add("man",  "application/x-troff-man",      NULL,           "7bit",         NULL,   0.5);   /* Troff with man macros*/
                     76:     HTBind_add("me",   "application/x-troff-me",       NULL,           "7bit",         NULL,   0.5);   /* Troff with me macros */
                     77:     HTBind_add("mime", "message/rfc822",               NULL,           "8bit",         NULL,   1.0);
                     78:     HTBind_add("mov",  "video/quicktime",              NULL,           "binary",       NULL,   1.0);
                     79:     HTBind_add("movie",        "video/x-sgi-movie",            NULL,           "binary",       NULL,   1.0);   /* SGI "moviepalyer"    */
                     80:     HTBind_add("mpe",  "video/mpeg",                   NULL,           "binary",       NULL,   1.0);
                     81:     HTBind_add("mpeg", "video/mpeg",                   NULL,           "binary",       NULL,   1.0);
                     82:     HTBind_add("mpg",  "video/mpeg",                   NULL,           "binary",       NULL,   1.0);
                     83:     HTBind_add("ms",   "application/x-troff-ms",       NULL,           "7bit",         NULL,   0.5);   /* Troff with ms macros */
                     84:     HTBind_add("nc",   "application/x-netcdf",         NULL,           "binary",       NULL,   1.0);   /* Unidata netCDF data  */
                     85:     HTBind_add("oda",  "application/oda",              NULL,           "binary",       NULL,   1.0);
                     86:     HTBind_add("pbm",  "image/x-portable-bitmap",      NULL,           "binary",       NULL,   1.0);   /* PBM Bitmap format    */
                     87:     HTBind_add("pcu",  "application/x-pics-user",      NULL,           "8bit",         NULL,   1.0);   /* PICS User */
                     88:     HTBind_add("pdf",  "application/pdf",              NULL,           "binary",       NULL,   1.0);
                     89:     HTBind_add("pgm",  "image/x-portable-graymap",     NULL,           "binary",       NULL,   1.0);   /* PBM Graymap format   */
                     90:     HTBind_add("png",  "image/png",                    NULL,           "binary",       NULL,   1.0);   /* PNG                  */
                     91:     HTBind_add("pnm",  "image/x-portable-anymap",      NULL,           "binary",       NULL,   1.0);   /* PBM Anymap format    */
                     92:     HTBind_add("ppm",  "image/x-portable-pixmap",      NULL,           "binary",       NULL,   1.0);   /* PBM Pixmap format    */
                     93:     HTBind_add("ps",   "application/postscript",       NULL,           "8bit",         NULL,   0.8);
                     94:     HTBind_add("qt",   "video/quicktime",              NULL,           "binary",       NULL,   1.0);   /* QuickTime            */
                     95:     HTBind_add("ras",  "image/cmu-raster",             NULL,           "binary",       NULL,   1.0);
                     96:     HTBind_add("rgb",  "image/x-rgb",                  NULL,           "binary",       NULL,   1.0);
                     97:     HTBind_add("roff", "application/x-troff",          NULL,           "7bit",         NULL,   0.5);
                     98:     HTBind_add("rtf",  "text/rtf",                     NULL,           "7bit",         NULL,   1.0);   /* RTF                  */
                     99:     HTBind_add("rtx",  "text/richtext",                NULL,           "7bit",         NULL,   1.0);   /* MIME Richtext format */
                    100:     HTBind_add("sh",   "application/x-sh",             NULL,           "7bit",         NULL,   0.5);   /* Shell-script         */
                    101:     HTBind_add("shar", "application/x-shar",           NULL,           "8bit",         NULL,   1.0);   /* Shell archive        */
                    102:     HTBind_add("snd",  "audio/basic",                  NULL,           "binary",       NULL,   1.0);   /* Audio                */
                    103:     HTBind_add("src",  "application/x-wais-source",    NULL,           "7bit",         NULL,   1.0);   /* WAIS source          */
                    104:     HTBind_add("sv4cpio","application/x-sv4cpio",      NULL,           "binary",       NULL,   1.0);   /* SVR4 CPIO            */
                    105:     HTBind_add("sv4crc","application/x-sv4crc",                NULL,           "binary",       NULL,   1.0);   /* SVR4 CPIO with CRC   */
                    106:     HTBind_add("t",    "application/x-troff",          NULL,           "7bit",         NULL,   0.5);   /* Troff                */
                    107:     HTBind_add("tar",  "application/tar",              NULL,           "binary",       NULL,   1.0);   /* 4.3BSD tar           */
                    108:     HTBind_add("tcl",  "application/x-tcl",            NULL,           "7bit",         NULL,   0.5);   /* TCL-script           */
                    109:     HTBind_add("tex",  "text/tex",                     NULL,           "8bit",         NULL,   1.0);   /* TeX source           */
                    110:     HTBind_add("texi", "application/x-texinfo",        NULL,           "7bit",         NULL,   1.0);   /* Texinfo              */
                    111:     HTBind_add("tif",  "image/tiff",                   NULL,           "binary",       NULL,   1.0);   /* TIFF                 */
                    112:     HTBind_add("tiff", "image/tiff",                   NULL,           "binary",       NULL,   1.0);
                    113:     HTBind_add("tr",   "application/x-troff",          NULL,           "7bit",         NULL,   0.5);
                    114:     HTBind_add("tsv",  "text/tab-separated-values",    NULL,           "7bit",         NULL,   1.0);   /* Tab-separated values */
                    115:     HTBind_add("txt",  "text/plain",                   NULL,           "7bit",         NULL,   0.5);   /* Plain text           */
                    116:     HTBind_add("ustar",        "application/x-ustar",          NULL,           "binary",       NULL,   1.0);   /* POSIX tar            */
                    117:     HTBind_add("wav",  "audio/x-wav",                  NULL,           "binary",       NULL,   1.0);   /* Windows+ WAVE format */
                    118:     HTBind_add("xbm",  "image/x-xbitmap",              NULL,           "binary",       NULL,   1.0);   /* X bitmap             */
                    119:     HTBind_add("xpm",  "image/x-xpixmap",              NULL,           "binary",       NULL,   1.0);   /* X pixmap format      */
                    120:     HTBind_add("xwd",  "image/x-xwindowdump",          NULL,           "binary",       NULL,   1.0);   /* X window dump (xwd)  */
                    121: 
                    122:     HTBind_add("zip",  "application/zip",              NULL,           "binary",       NULL,   1.0);   /* PKZIP                */
                    123:     HTBind_add("Z",     NULL,                          "compress",     "binary",       NULL,   1.0);   /* Compressed data      */
                    124:     HTBind_add("gz",    NULL,                          "gzip",         "binary",       NULL,   1.0);   /* Gnu Compressed data  */
2.1       frystyk   125: 
2.6       frystyk   126:     HTBind_add("*.*",  "www/unknown",                  NULL,           "binary",       NULL,   0.1);   /* Unknown suffix */
                    127:     HTBind_add("*",    "www/unknown",                  NULL,           "7bit",         NULL,   0.5);   /* No suffix */
2.1       frystyk   128: }
                    129: 

Webmaster