HTBInit.c
上传用户:zlh9724
上传日期:2007-01-04
资源大小:1991k
文件大小:8k
源码类别:

浏览器

开发平台:

Unix_Linux

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