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

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.14    ! frystyk     6: **     @(#) $Id: HTBInit.c,v 2.13 1998/12/03 15:05:45 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("ai",   "application/postscript",       NULL,           "8bit",         NULL,   0.5);   /* Adobe Illustrator    */
                     38:     HTBind_add("aif",  "audio/x-aiff",                 NULL,           "binary",       NULL,   1.0);
                     39:     HTBind_add("aifc", "audio/x-aiff",                 NULL,           "binary",       NULL,   1.0);
                     40:     HTBind_add("aiff", "audio/x-aiff",                 NULL,           "binary",       NULL,   1.0);
                     41:     HTBind_add("au",   "audio/basic",                  NULL,           "binary",       NULL,   1.0);
2.10      frystyk    42:     HTBind_add("asf",  "video/x-ms-asf",               NULL,           "binary",       NULL,   1.0);   /* MS Active Streaming  */
2.6       frystyk    43:     HTBind_add("avi",  "video/x-msvideo",              NULL,           "binary",       NULL,   1.0);   /* MS Video for Windows */
2.9       frystyk    44:     HTBind_add("bat",  "application/octet-stream",     NULL,           "binary",       NULL,   1.0);   /* Uninterpreted binary */
2.6       frystyk    45:     HTBind_add("bcpio",        "application/x-bcpio",          NULL,           "binary",       NULL,   1.0);   /* Old binary CPIO      */
                     46:     HTBind_add("bin",  "application/octet-stream",     NULL,           "binary",       NULL,   1.0);   /* Uninterpreted binary */
2.9       frystyk    47:     HTBind_add("bmp",  "image/bmp",                    NULL,           "binary",       NULL,   1.0);   /* MS Windows bitmap    */
2.6       frystyk    48:     HTBind_add("c",    "text/plain",                   NULL,           "7bit",         NULL,   0.5);   /* C source             */
                     49:     HTBind_add("cc",   "text/plain",                   NULL,           "7bit",         NULL,   0.5);   /* C++ source           */
2.10      frystyk    50:     HTBind_add("cpp",  "text/plain",                   NULL,           "7bit",         NULL,   0.5);   /* C++ source           */
2.6       frystyk    51:     HTBind_add("cdf",  "application/x-netcdf",         NULL,           "binary",       NULL,   1.0);
                     52:     HTBind_add("cgm",  "image/cgm",                    NULL,           "binary",       NULL,   1.0);
                     53:     HTBind_add("conf", "application/x-www-rules",      NULL,           "8bit",         NULL,   1.0);   /* CONFIGURATION FILE   */
                     54:     HTBind_add("cpio", "application/x-cpio",           NULL,           "binary",       NULL,   1.0);   /* POSIX CPIO           */
                     55:     HTBind_add("csh",  "application/x-csh",            NULL,           "7bit",         NULL,   0.5);   /* C-shell script       */
2.9       frystyk    56:     HTBind_add("css",  "text/css",                     NULL,           "8bit",         NULL,   1.0);   /* CSS Stylesheet       */
                     57:     HTBind_add("dll",  "application/octet-stream",     NULL,           "binary",       NULL,   1.0);   /* Uninterpreted binary */
                     58:     HTBind_add("doc",  "application/msword",           NULL,           "binary",       NULL,   0.5);   /* MS Word format       */
                     59:     HTBind_add("dot",  "application/msword",           NULL,           "binary",       NULL,   0.5);   /* MS Word format       */
2.6       frystyk    60:     HTBind_add("dvi",  "application/x-dvi",            NULL,           "binary",       NULL,   1.0);   /* TeX DVI              */
                     61:     HTBind_add("eps",  "application/postscript",       NULL,           "8bit",         NULL,   0.8);
                     62:     HTBind_add("etx",  "text/x-setext",                NULL,           "7bit",         NULL,   0.9);   /* Struct Enchanced Txt */
2.9       frystyk    63:     HTBind_add("exe",  "application/octet-stream",     NULL,           "binary",       NULL,   1.0);   /* Uninterpreted binary */
2.6       frystyk    64:     HTBind_add("f90",  "text/plain",                   NULL,           "7bit",         NULL,   0.5);   /* Fortran 90 source    */
                     65:     HTBind_add("gif",  "image/gif",                    NULL,           "binary",       NULL,   1.0);   /* GIF                  */
                     66:     HTBind_add("h",    "text/plain",                   NULL,           "7bit",         NULL,   0.5);   /* C headers            */
                     67:     HTBind_add("hdf",  "application/x-hdf",            NULL,           "binary",       NULL,   1.0);   /* NCSA HDF data file   */
                     68:     HTBind_add("hh",   "text/plain",                   NULL,           "7bit",         NULL,   0.5);   /* C++ headers          */
2.8       frystyk    69:     HTBind_add("htm",  "text/html",                    NULL,           "8bit",         NULL,   1.0);   /* HTML                 */
2.6       frystyk    70:     HTBind_add("html", "text/html",                    NULL,           "8bit",         NULL,   1.0);   /* HTML                 */
                     71:     HTBind_add("ief",  "image/ief",                    NULL,           "binary",       NULL,   1.0);   /* Image Exchange fmt   */
                     72:     HTBind_add("jpe",  "image/jpeg",                   NULL,           "binary",       NULL,   1.0);
                     73:     HTBind_add("jpeg", "image/jpeg",                   NULL,           "binary",       NULL,   1.0);
                     74:     HTBind_add("jpg",  "image/jpeg",                   NULL,           "binary",       NULL,   1.0);   /* JPEG                 */
                     75:     HTBind_add("latex",        "text/latex",                   NULL,           "8bit",         NULL,   1.0);   /* LaTeX source         */
                     76:     HTBind_add("m",    "text/plain",                   NULL,           "7bit",         NULL,   0.5);   /* Objective-C source   */
                     77:     HTBind_add("man",  "application/x-troff-man",      NULL,           "7bit",         NULL,   0.5);   /* Troff with man macros*/
                     78:     HTBind_add("me",   "application/x-troff-me",       NULL,           "7bit",         NULL,   0.5);   /* Troff with me macros */
2.9       frystyk    79:     HTBind_add("mht",  "message/rfc822",               NULL,           "8bit",         NULL,   1.0);   /* MHTML format */
                     80:     HTBind_add("mhtml",        "message/rfc822",               NULL,           "8bit",         NULL,   1.0);   /* MHTML format */
2.6       frystyk    81:     HTBind_add("mime", "message/rfc822",               NULL,           "8bit",         NULL,   1.0);
                     82:     HTBind_add("mov",  "video/quicktime",              NULL,           "binary",       NULL,   1.0);
                     83:     HTBind_add("movie",        "video/x-sgi-movie",            NULL,           "binary",       NULL,   1.0);   /* SGI "moviepalyer"    */
                     84:     HTBind_add("mpe",  "video/mpeg",                   NULL,           "binary",       NULL,   1.0);
                     85:     HTBind_add("mpeg", "video/mpeg",                   NULL,           "binary",       NULL,   1.0);
                     86:     HTBind_add("mpg",  "video/mpeg",                   NULL,           "binary",       NULL,   1.0);
                     87:     HTBind_add("ms",   "application/x-troff-ms",       NULL,           "7bit",         NULL,   0.5);   /* Troff with ms macros */
                     88:     HTBind_add("nc",   "application/x-netcdf",         NULL,           "binary",       NULL,   1.0);   /* Unidata netCDF data  */
                     89:     HTBind_add("oda",  "application/oda",              NULL,           "binary",       NULL,   1.0);
                     90:     HTBind_add("pbm",  "image/x-portable-bitmap",      NULL,           "binary",       NULL,   1.0);   /* PBM Bitmap format    */
                     91:     HTBind_add("pcu",  "application/x-pics-user",      NULL,           "8bit",         NULL,   1.0);   /* PICS User */
                     92:     HTBind_add("pdf",  "application/pdf",              NULL,           "binary",       NULL,   1.0);
                     93:     HTBind_add("pgm",  "image/x-portable-graymap",     NULL,           "binary",       NULL,   1.0);   /* PBM Graymap format   */
2.11      frystyk    94:     HTBind_add("pgp",          "application/pgp-encrypted",    NULL,           "binary",       NULL,   1.0);   /* PGP encrypted        */
2.6       frystyk    95:     HTBind_add("png",  "image/png",                    NULL,           "binary",       NULL,   1.0);   /* PNG                  */
                     96:     HTBind_add("pnm",  "image/x-portable-anymap",      NULL,           "binary",       NULL,   1.0);   /* PBM Anymap format    */
2.9       frystyk    97:     HTBind_add("ppt",  "application/vnd.ms-powerpoint",NULL,           "binary",       NULL,   0.5);   /* MS Powerpoint        */
2.6       frystyk    98:     HTBind_add("ps",   "application/postscript",       NULL,           "8bit",         NULL,   0.8);
                     99:     HTBind_add("qt",   "video/quicktime",              NULL,           "binary",       NULL,   1.0);   /* QuickTime            */
                    100:     HTBind_add("ras",  "image/cmu-raster",             NULL,           "binary",       NULL,   1.0);
                    101:     HTBind_add("rgb",  "image/x-rgb",                  NULL,           "binary",       NULL,   1.0);
                    102:     HTBind_add("roff", "application/x-troff",          NULL,           "7bit",         NULL,   0.5);
                    103:     HTBind_add("rtf",  "text/rtf",                     NULL,           "7bit",         NULL,   1.0);   /* RTF                  */
                    104:     HTBind_add("rtx",  "text/richtext",                NULL,           "7bit",         NULL,   1.0);   /* MIME Richtext format */
                    105:     HTBind_add("sh",   "application/x-sh",             NULL,           "7bit",         NULL,   0.5);   /* Shell-script         */
2.11      frystyk   106:     HTBind_add("sig",  "application/pgp-signature",    NULL,           "binary",       NULL,   1.0);   /* PGP signature        */
2.6       frystyk   107:     HTBind_add("shar", "application/x-shar",           NULL,           "8bit",         NULL,   1.0);   /* Shell archive        */
                    108:     HTBind_add("snd",  "audio/basic",                  NULL,           "binary",       NULL,   1.0);   /* Audio                */
                    109:     HTBind_add("src",  "application/x-wais-source",    NULL,           "7bit",         NULL,   1.0);   /* WAIS source          */
                    110:     HTBind_add("sv4cpio","application/x-sv4cpio",      NULL,           "binary",       NULL,   1.0);   /* SVR4 CPIO            */
                    111:     HTBind_add("sv4crc","application/x-sv4crc",                NULL,           "binary",       NULL,   1.0);   /* SVR4 CPIO with CRC   */
                    112:     HTBind_add("t",    "application/x-troff",          NULL,           "7bit",         NULL,   0.5);   /* Troff                */
                    113:     HTBind_add("tar",  "application/tar",              NULL,           "binary",       NULL,   1.0);   /* 4.3BSD tar           */
2.12      frystyk   114:     HTBind_add("tar",  "application/x-tar",            NULL,           "binary",       NULL,   1.0);   /* 4.3BSD tar           */
2.6       frystyk   115:     HTBind_add("tcl",  "application/x-tcl",            NULL,           "7bit",         NULL,   0.5);   /* TCL-script           */
                    116:     HTBind_add("tex",  "text/tex",                     NULL,           "8bit",         NULL,   1.0);   /* TeX source           */
                    117:     HTBind_add("texi", "application/x-texinfo",        NULL,           "7bit",         NULL,   1.0);   /* Texinfo              */
                    118:     HTBind_add("tif",  "image/tiff",                   NULL,           "binary",       NULL,   1.0);   /* TIFF                 */
                    119:     HTBind_add("tiff", "image/tiff",                   NULL,           "binary",       NULL,   1.0);
                    120:     HTBind_add("tr",   "application/x-troff",          NULL,           "7bit",         NULL,   0.5);
                    121:     HTBind_add("tsv",  "text/tab-separated-values",    NULL,           "7bit",         NULL,   1.0);   /* Tab-separated values */
                    122:     HTBind_add("txt",  "text/plain",                   NULL,           "7bit",         NULL,   0.5);   /* Plain text           */
                    123:     HTBind_add("ustar",        "application/x-ustar",          NULL,           "binary",       NULL,   1.0);   /* POSIX tar            */
                    124:     HTBind_add("wav",  "audio/x-wav",                  NULL,           "binary",       NULL,   1.0);   /* Windows+ WAVE format */
                    125:     HTBind_add("xbm",  "image/x-xbitmap",              NULL,           "binary",       NULL,   1.0);   /* X bitmap             */
2.9       frystyk   126:     HTBind_add("xls",  "application/vnd.ms-excel",     NULL,           "binary",       NULL,   0.5);   /* MS Excel             */
2.13      frystyk   127:     HTBind_add("xml",  "application/xml",              NULL,           "binary",       NULL,   1.0);   /* xml                  */
2.6       frystyk   128:     HTBind_add("xpm",  "image/x-xpixmap",              NULL,           "binary",       NULL,   1.0);   /* X pixmap format      */
                    129:     HTBind_add("xwd",  "image/x-xwindowdump",          NULL,           "binary",       NULL,   1.0);   /* X window dump (xwd)  */
                    130: 
                    131:     HTBind_add("zip",  "application/zip",              NULL,           "binary",       NULL,   1.0);   /* PKZIP                */
                    132:     HTBind_add("Z",     NULL,                          "compress",     "binary",       NULL,   1.0);   /* Compressed data      */
                    133:     HTBind_add("gz",    NULL,                          "gzip",         "binary",       NULL,   1.0);   /* Gnu Compressed data  */
2.1       frystyk   134: 
2.6       frystyk   135:     HTBind_add("*.*",  "www/unknown",                  NULL,           "binary",       NULL,   0.1);   /* Unknown suffix */
                    136:     HTBind_add("*",    "www/unknown",                  NULL,           "7bit",         NULL,   0.5);   /* No suffix */
2.1       frystyk   137: }
                    138: 

Webmaster