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