if ((fp = fopen(personal_type_map,"r")) != NULL) { fclose(fp);
if (LYCanReadFile(personal_type_map)) {
PUBLIC void HTFormatInit NOARGS{ FILE *fp = NULL;#ifdef NeXT  HTSetPresentation("application/postscript",   "open %s", 1.0, 2.0, 0.0, 0);  HTSetPresentation("image/x-tiff",             "open %s", 2.0, 2.0, 0.0, 0);  HTSetPresentation("image/tiff",               "open %s", 1.0, 2.0, 0.0, 0);  HTSetPresentation("audio/basic",              "open %s", 1.0, 2.0, 0.0, 0);  HTSetPresentation("*",                        "open %s", 1.0, 0.0, 0.0, 0);#else if (LYgetXDisplay() != 0) {	/* Must have X11 */  HTSetPresentation("application/postscript", "ghostview %s&",  							    1.0, 3.0, 0.0, 0);  HTSetPresentation("image/gif",        XLoadImageCommand,  1.0, 3.0, 0.0, 0);  HTSetPresentation("image/x-xbm",      XLoadImageCommand,  1.0, 3.0, 0.0, 0);  HTSetPresentation("image/x-xbitmap",  XLoadImageCommand,  1.0, 3.0, 0.0, 0);  HTSetPresentation("image/x-png",      XLoadImageCommand,  2.0, 3.0, 0.0, 0);  HTSetPresentation("image/png",	XLoadImageCommand,  1.0, 3.0, 0.0, 0);  HTSetPresentation("image/x-rgb",      XLoadImageCommand,  1.0, 3.0, 0.0, 0);  HTSetPresentation("image/x-tiff",     XLoadImageCommand,  2.0, 3.0, 0.0, 0);  HTSetPresentation("image/tiff",	XLoadImageCommand,  1.0, 3.0, 0.0, 0);  HTSetPresentation("image/jpeg",       XLoadImageCommand,  1.0, 3.0, 0.0, 0);  HTSetPresentation("video/mpeg",       "mpeg_play %s &",   1.0, 3.0, 0.0, 0); }#endif#ifdef EXEC_SCRIPTS /* set quality to 999.0 for protected exec applications */#ifndef VMS HTSetPresentation("application/x-csh",	"csh %s", 999.0, 3.0, 0.0, 0); HTSetPresentation("application/x-sh",	"sh %s",  999.0, 3.0, 0.0, 0); HTSetPresentation("application/x-ksh",	"ksh %s", 999.0, 3.0, 0.0, 0);#else HTSetPresentation("application/x-VMS_script",	"@%s", 999.0, 3.0, 0.0, 0);#endif /* not VMS */#endif /* EXEC_SCRIPTS *//* *  Add our header handlers. */ HTSetConversion("www/mime",  "www/present",  HTMIMEConvert, 1.0, 0.0, 0.0, 0); HTSetConversion("www/mime",  "www/download", HTMIMEConvert, 1.0, 0.0, 0.0, 0); HTSetConversion("www/mime",  "www/source",   HTMIMEConvert, 1.0, 0.0, 0.0, 0); HTSetConversion("www/mime",  "www/dump",     HTMIMEConvert, 1.0, 0.0, 0.0, 0);/* *  Add our compressed file handlers. */ HTSetConversion("www/compressed", "www/present", 					      HTCompressed,   1.0, 0.0, 0.0, 0); HTSetConversion("www/compressed", "www/download", 					      HTCompressed,   1.0, 0.0, 0.0, 0); HTSetConversion("www/compressed", "www/present", 					      HTCompressed,   1.0, 0.0, 0.0, 0); HTSetConversion("www/compressed", "www/source", 					      HTCompressed,   1.0, 0.0, 0.0, 0); HTSetConversion("www/compressed", "www/dump", 					      HTCompressed,   1.0, 0.0, 0.0, 0); /*  * Added the following to support some content types beginning to surface.  */ HTSetConversion("application/html", "text/x-c", 					HTMLToC,	0.5, 0.0, 0.0, 0); HTSetConversion("application/html", "text/plain", 					HTMLToPlain,	0.5, 0.0, 0.0, 0); HTSetConversion("application/html", "www/present", 					HTMLPresent,	2.0, 0.0, 0.0, 0); HTSetConversion("application/html", "www/source", 					HTPlainPresent,	1.0, 0.0, 0.0, 0); HTSetConversion("application/x-wais-source", "www/source",					HTPlainPresent,	1.0, 0.0, 0.0, 0); HTSetConversion("application/x-wais-source", "www/present",				        HTWSRCConvert,	2.0, 0.0, 0.0, 0); HTSetConversion("application/x-wais-source", "www/download",					HTWSRCConvert,	1.0, 0.0, 0.0, 0); HTSetConversion("application/x-wais-source", "www/dump",					HTWSRCConvert,	1.0, 0.0, 0.0, 0); /*  *  Save all unknown mime types to disk.  */ HTSetConversion("www/source",  "www/present", 					HTSaveToFile,	1.0, 3.0, 0.0, 0); HTSetConversion("www/source",  "www/source", 					HTSaveToFile,	1.0, 3.0, 0.0, 0); HTSetConversion("www/source",  "www/download", 					HTSaveToFile,	1.0, 3.0, 0.0, 0); HTSetConversion("www/source",  "*",	HTSaveToFile,	1.0, 3.0, 0.0, 0); /*  *  Output all www/dump presentations to stdout.  */ HTSetConversion("www/source",  "www/dump", 					HTDumpToStdout,	1.0, 3.0, 0.0, 0);/* *  Now add our basic conversions. */ HTSetConversion("text/x-sgml", 			      "www/source",  HTPlainPresent, 1.0, 0.0, 0.0, 0); HTSetConversion("text/x-sgml", 			      "www/present", HTMLPresent,    2.0, 0.0, 0.0, 0); HTSetConversion("text/sgml", "www/source",  HTPlainPresent, 1.0, 0.0, 0.0, 0); HTSetConversion("text/sgml", "www/present", HTMLPresent,    1.0, 0.0, 0.0, 0); HTSetConversion("text/plain","www/present", HTPlainPresent, 1.0, 0.0, 0.0, 0); HTSetConversion("text/plain","www/source",  HTPlainPresent, 1.0, 0.0, 0.0, 0); HTSetConversion("text/html", "www/source",  HTPlainPresent, 1.0, 0.0, 0.0, 0); HTSetConversion("text/html", "text/x-c",    HTMLToC, 	     0.5, 0.0, 0.0, 0); HTSetConversion("text/html", "text/plain",  HTMLToPlain,    0.5, 0.0, 0.0, 0); HTSetConversion("text/html", "www/present", HTMLPresent,    1.0, 0.0, 0.0, 0); /*  *  These should override the default types as necessary.  */ HTLoadTypesConfigFile(global_type_map); /*  *  Load the local maps.  */ if ((fp = fopen(personal_type_map,"r")) != NULL) {     fclose(fp);     /* These should override everything else. */     HTLoadTypesConfigFile(personal_type_map); } else {     char buffer[LY_MAXPATH];     LYAddPathToHome(buffer, sizeof(buffer), personal_type_map);     HTLoadTypesConfigFile(buffer); } /*  *  Put text/html and text/plain at beginning of list. - kw  */ HTReorderPresentation(WWW_PLAINTEXT, WWW_PRESENT); HTReorderPresentation(WWW_HTML, WWW_PRESENT);}