Annotation of libwww/Library/src/HTInit.c, revision 2.15
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"
2.11 timbl 15: #include "HTList.h"
2.1 timbl 16: #include "HTPlain.h"
17: #include "HTMLGen.h"
18: #include "HTFile.h"
19: #include "HTFormat.h"
20: #include "HTMIME.h"
2.2 timbl 21: #include "HTWSRC.h"
2.7 timbl 22: #include "HTFWriter.h"
2.1 timbl 23:
2.14 frystyk 24: PUBLIC void HTFormatInit ARGS1(HTList *, c) /* Note: Wildcard is no longer * (see further dovn) */
2.1 timbl 25: {
26: #ifdef NeXT
2.11 timbl 27: HTSetPresentation(c,"application/postscript", "open %s", 1.0, 2.0, 0.0);
2.10 luotonen 28: /* The following needs the GIF previewer -- you might not have it. */
2.11 timbl 29: HTSetPresentation(c,"image/gif", "open %s", 0.3, 2.0, 0.0);
30: HTSetPresentation(c,"image/x-tiff", "open %s", 1.0, 2.0, 0.0);
31: HTSetPresentation(c,"audio/basic", "open %s", 1.0, 2.0, 0.0);
2.14 frystyk 32: HTSetPresentation(c,"*/*", "open %s", 0.05, 0.0, 0.0);
2.1 timbl 33: #else
2.10 luotonen 34: if (getenv("DISPLAY")) { /* Must have X11 */
2.11 timbl 35: HTSetPresentation(c,"application/postscript", "ghostview %s", 1.0, 3.0, 0.0);
36: HTSetPresentation(c,"image/gif", "xv %s", 1.0, 3.0, 0.0);
37: HTSetPresentation(c,"image/x-tiff", "xv %s", 1.0, 3.0, 0.0);
38: HTSetPresentation(c,"image/jpeg", "xv %s", 1.0, 3.0, 0.0);
2.10 luotonen 39: }
2.1 timbl 40: #endif
2.13 frystyk 41: HTSetConversion(c,"www/mime", "*/*", HTMIMEConvert, 1.0, 0.0, 0.0);
42: HTSetConversion(c,"application/x-wais-source","*/*", HTWSRCConvert, 1.0, 0.0, 0.0);
2.11 timbl 43: HTSetConversion(c,"text/html", "text/x-c", HTMLToC, 0.5, 0.0, 0.0);
44: HTSetConversion(c,"text/html", "text/plain", HTMLToPlain, 0.5, 0.0, 0.0);
45: HTSetConversion(c,"text/html", "www/present", HTMLPresent, 1.0, 0.0, 0.0);
46: HTSetConversion(c,"text/plain", "text/html", HTPlainToHTML, 1.0, 0.0, 0.0);
47: HTSetConversion(c,"text/plain", "www/present", HTPlainPresent, 1.0, 0.0, 0.0);
48: HTSetConversion(c,"application/octet-stream", "www/present", HTSaveLocally, 0.1, 0.0, 0.0);
2.15 ! frystyk 49: HTSetConversion(c,"*/*", "www/present", HTSaveLocally, 0.3, 0.0, 0.0);
! 50: /* www/source is replaced by star/star */
! 51: }
! 52:
! 53:
! 54: /* -----------------
! 55: This function is for init of non-interactive mode, where no extern 'pop-up
! 56: programs' are wanted during execution. Nor should functions be used that
! 57: redirects the output stream to a temp file, e.g., HTSaveLocally()
! 58: Henrik 01/03-94
! 59: ----------------- */
! 60: PUBLIC void HTFormatInitNIM ARGS1(HTList *, c)
! 61: {
! 62: HTSetConversion(c,"www/mime", "*/*", HTMIMEConvert, 1.0, 0.0, 0.0);
! 63: HTSetConversion(c,"application/x-wais-source","*/*", HTWSRCConvert, 1.0, 0.0, 0.0);
! 64: HTSetConversion(c,"text/html", "text/x-c", HTMLToC, 0.5, 0.0, 0.0);
! 65: HTSetConversion(c,"text/html", "text/plain", HTMLToPlain, 0.5, 0.0, 0.0);
! 66: HTSetConversion(c,"text/html", "www/present", HTMLPresent, 1.0, 0.0, 0.0);
! 67: HTSetConversion(c,"text/plain", "text/html", HTPlainToHTML, 1.0, 0.0, 0.0);
! 68: HTSetConversion(c,"text/plain", "www/present", HTPlainPresent, 1.0, 0.0, 0.0);
! 69: HTSetConversion(c,"application/octet-stream","www/present", HTThroughLine, 0.1, 0.0, 0.0);
! 70: HTSetConversion(c,"*/*", "www/present", HTThroughLine, 0.3, 0.0, 0.0);
2.1 timbl 71: }
72:
73:
74:
75: /* Define a basic set of suffixes
76: ** ------------------------------
77: **
78: ** The LAST suffix for a type is that used for temporary files
79: ** of that type.
80: ** The quality is an apriori bias as to whether the file should be
81: ** used. Not that different suffixes can be used to represent files
82: ** which are of the same format but are originals or regenerated,
83: ** with different values.
84: */
85:
86: #ifndef NO_INIT
87: PUBLIC void HTFileInit NOARGS
2.10 luotonen 88: {
89: /* Suffix Contenet-Type Content-Encoding Quality */
2.2 timbl 90:
2.12 luotonen 91: HTAddType(".mime", "www/mime", "8bit", 1.0); /* Internal -- MIME is */
2.10 luotonen 92: /* not recursive */
2.12 luotonen 93: HTAddType(".bin", "application/octet-stream", "binary", 1.0); /* Uninterpreted binary */
94: HTAddType(".oda", "application/oda", "binary", 1.0);
95: HTAddType(".pdf", "application/pdf", "binary", 1.0);
96: HTAddType(".ai", "application/postscript", "8bit", 0.5); /* Adobe Illustrator */
97: HTAddType(".PS", "application/postscript", "8bit", 0.8); /* PostScript */
98: HTAddType(".eps", "application/postscript", "8bit", 0.8);
99: HTAddType(".ps", "application/postscript", "8bit", 0.8);
100: HTAddType(".rtf", "application/x-rtf", "7bit", 1.0); /* RTF */
101: HTAddType(".Z", "application/x-compressed", "binary", 1.0); /* Compressed data */
102: HTAddType(".csh", "application/x-csh", "7bit", 0.5); /* C-shell script */
103: HTAddType(".dvi", "application/x-dvi", "binary", 1.0); /* TeX DVI */
104: HTAddType(".hdf", "application/x-hdf", "binary", 1.0); /* NCSA HDF data file */
105: HTAddType(".latex", "application/x-latex", "8bit", 1.0); /* LaTeX source */
106: HTAddType(".nc", "application/x-netcdf", "binary", 1.0); /* Unidata netCDF data */
107: HTAddType(".cdf", "application/x-netcdf", "binary", 1.0);
108: HTAddType(".sh", "application/x-sh", "7bit", 0.5); /* Shell-script */
109: HTAddType(".tcl", "application/x-tcl", "7bit", 0.5); /* TCL-script */
110: HTAddType(".tex", "application/x-tex", "8bit", 1.0); /* TeX source */
111: HTAddType(".texi", "application/x-texinfo", "7bit", 1.0); /* Texinfo */
112: HTAddType(".texinfo","application/x-texinfo", "7bit", 1.0);
113: HTAddType(".t", "application/x-troff", "7bit", 0.5); /* Troff */
114: HTAddType(".roff", "application/x-troff", "7bit", 0.5);
115: HTAddType(".tr", "application/x-troff", "7bit", 0.5);
116: HTAddType(".man", "application/x-troff-man", "7bit", 0.5); /* Troff with man macros*/
117: HTAddType(".me", "application/x-troff-me", "7bit", 0.5); /* Troff with me macros */
118: HTAddType(".ms", "application/x-troff-ms", "7bit", 0.5); /* Troff with ms macros */
119: HTAddType(".src", "application/x-wais-source", "7bit", 1.0); /* WAIS source */
120: HTAddType(".zip", "application/zip", "binary", 1.0); /* PKZIP */
121: HTAddType(".bcpio", "application/x-bcpio", "binary", 1.0); /* Old binary CPIO */
122: HTAddType(".cpio", "application/x-cpio", "binary", 1.0); /* POSIX CPIO */
123: HTAddType(".gtar", "application/x-gtar", "binary", 1.0); /* Gnu tar */
124: HTAddType(".shar", "application/x-shar", "8bit", 1.0); /* Shell archive */
125: HTAddType(".sv4cpio","application/x-sv4cpio", "binary", 1.0); /* SVR4 CPIO */
126: HTAddType(".sv4crc", "application/x-sv4crc", "binary", 1.0); /* SVR4 CPIO with CRC */
127: HTAddType(".tar", "application/x-tar", "binary", 1.0); /* 4.3BSD tar */
128: HTAddType(".ustar", "application/x-ustar", "binary", 1.0); /* POSIX tar */
129: HTAddType(".snd", "audio/basic", "binary", 1.0); /* Audio */
130: HTAddType(".au", "audio/basic", "binary", 1.0);
131: HTAddType(".aiff", "audio/x-aiff", "binary", 1.0);
132: HTAddType(".aifc", "audio/x-aiff", "binary", 1.0);
133: HTAddType(".aif", "audio/x-aiff", "binary", 1.0);
134: HTAddType(".wav", "audio/x-wav", "binary", 1.0); /* Windows+ WAVE format */
135: HTAddType(".gif", "image/gif", "binary", 1.0); /* GIF */
136: HTAddType(".ief", "image/ief", "binary", 1.0); /* Image Exchange fmt */
137: HTAddType(".jpg", "image/jpeg", "binary", 1.0); /* JPEG */
138: HTAddType(".JPG", "image/jpeg", "binary", 1.0);
139: HTAddType(".JPE", "image/jpeg", "binary", 1.0);
140: HTAddType(".jpe", "image/jpeg", "binary", 1.0);
141: HTAddType(".JPEG", "image/jpeg", "binary", 1.0);
142: HTAddType(".jpeg", "image/jpeg", "binary", 1.0);
143: HTAddType(".tif", "image/tiff", "binary", 1.0); /* TIFF */
144: HTAddType(".tiff", "image/tiff", "binary", 1.0);
145: HTAddType(".ras", "image/cmu-raster", "binary", 1.0);
146: HTAddType(".pnm", "image/x-portable-anymap", "binary", 1.0); /* PBM Anymap format */
147: HTAddType(".pbm", "image/x-portable-bitmap", "binary", 1.0); /* PBM Bitmap format */
148: HTAddType(".pgm", "image/x-portable-graymap", "binary", 1.0); /* PBM Graymap format */
149: HTAddType(".ppm", "image/x-portable-pixmap", "binary", 1.0); /* PBM Pixmap format */
150: HTAddType(".rgb", "image/x-rgb", "binary", 1.0);
151: HTAddType(".xbm", "image/x-xbitmap", "binary", 1.0); /* X bitmap */
152: HTAddType(".xpm", "image/x-xpixmap", "binary", 1.0); /* X pixmap format */
153: HTAddType(".xwd", "image/x-xwindowdump", "binary", 1.0); /* X window dump (xwd) */
154: HTAddType(".html", "text/html", "8bit", 1.0); /* HTML */
155: HTAddType(".c", "text/plain", "7bit", 0.5); /* C source */
156: HTAddType(".h", "text/plain", "7bit", 0.5); /* C headers */
157: HTAddType(".C", "text/plain", "7bit", 0.5); /* C++ source */
158: HTAddType(".cc", "text/plain", "7bit", 0.5); /* C++ source */
159: HTAddType(".hh", "text/plain", "7bit", 0.5); /* C++ headers */
160: HTAddType(".m", "text/plain", "7bit", 0.5); /* Objective-C source */
161: HTAddType(".f90", "text/plain", "7bit", 0.5); /* Fortran 90 source */
162: HTAddType(".txt", "text/plain", "7bit", 0.5); /* Plain text */
163: HTAddType(".rtx", "text/richtext", "7bit", 1.0); /* MIME Richtext format */
164: HTAddType(".tsv", "text/tab-separated-values", "7bit", 1.0); /* Tab-separated values */
165: HTAddType(".etx", "text/x-setext", "7bit", 0.9); /* Struct Enchanced Txt */
166: HTAddType(".MPG", "video/mpeg", "binary", 1.0); /* MPEG */
167: HTAddType(".mpg", "video/mpeg", "binary", 1.0);
168: HTAddType(".MPE", "video/mpeg", "binary", 1.0);
169: HTAddType(".mpe", "video/mpeg", "binary", 1.0);
170: HTAddType(".MPEG", "video/mpeg", "binary", 1.0);
171: HTAddType(".mpeg", "video/mpeg", "binary", 1.0);
172: HTAddType(".qt", "video/quicktime", "binary", 1.0); /* QuickTime */
173: HTAddType(".mov", "video/quicktime", "binary", 1.0);
174: HTAddType(".avi", "video/x-msvideo", "binary", 1.0); /* MS Video for Windows */
175: HTAddType(".movie", "video/x-sgi-movie", "binary", 1.0); /* SGI "moviepalyer" */
176:
177: HTAddType("*.*", "application/octet-stream", "binary", 0.1);
178: HTAddType("*", "text/plain", "7bit", 0.5);
2.1 timbl 179:
180: }
2.12 luotonen 181: #endif /* !NO_INIT */
2.1 timbl 182:
Webmaster