StrAllocCopy(MapTitle, new->title);
LYformTitle(&MapTitle, new->title);
PRIVATE int LYLoadIMGmap ARGS4 (	CONST char *,		arg,	HTParentAnchor *,	anAnchor,	HTFormat,		format_out,	HTStream*,		sink){    HTFormat format_in = WWW_HTML;    HTStream *target = NULL;    char *buf = NULL;    LYMapElement *new = NULL;    LYImageMap *theMap = NULL;    char *MapTitle = NULL;    char *MapAddress = NULL;    HTList *theList;    HTList *cur = NULL;    char *address = NULL;    char *cp = NULL;    DocAddress WWWDoc;    HTParentAnchor * underlying;    BOOL old_cache_setting = LYforce_no_cache;    BOOL old_reloading = reloading;    HTFormat old_format_out = HTOutputFormat;    if (!strncasecomp(arg, "LYNXIMGMAP:", 11)) {	address = (char * )(arg + 11);    }    if (!(address && strchr(address, ':'))) {	HTAlert(MISDIRECTED_MAP_REQUEST);	return(HT_NOT_LOADED);    }    theList = get_the_list(&WWWDoc, address, anAnchor, &underlying);    if (WWWDoc.safe)	anAnchor->safe = TRUE;    if (!theList) {	if (anAnchor->post_data && !WWWDoc.safe &&	    ((underlying && underlying->document && !LYforce_no_cache) ||	     HTConfirm(CONFIRM_POST_RESUBMISSION) != TRUE)) {	    HTAlert(FAILED_MAP_POST_REQUEST);	    return(HT_NOT_LOADED);	}	LYforce_no_cache = TRUE;	reloading = TRUE;	HTOutputFormat = WWW_PRESENT;	LYMapsOnly = TRUE;	if (!HTLoadAbsolute(&WWWDoc)) {	    LYforce_no_cache = old_cache_setting;	    reloading = old_reloading;	    HTOutputFormat = old_format_out;	    LYMapsOnly = FALSE;	    HTAlert(MAP_NOT_ACCESSIBLE);	    return(HT_NOT_LOADED);	}	LYforce_no_cache = old_cache_setting;	reloading = old_reloading;	HTOutputFormat = old_format_out;	LYMapsOnly = FALSE;	theList = get_the_list(&WWWDoc, address, anAnchor, &underlying);    }    if (!theList) {	HTAlert(MAPS_NOT_AVAILABLE);	return(HT_NOT_LOADED);    }    cur = theList;    while (NULL != (theMap = (LYImageMap *)HTList_nextObject(cur))) {	if (!strcmp(theMap->address, address)) {	    break;	}    }    if (!(theMap && theMap->elements)) {	if (anAnchor->post_data && !WWWDoc.safe &&	    ((underlying && underlying->document && !LYforce_no_cache) ||	    HTConfirm(CONFIRM_POST_RESUBMISSION) != TRUE)) {	    HTAlert(FAILED_MAP_POST_REQUEST);	    return(HT_NOT_LOADED);	}	LYforce_no_cache = TRUE;	reloading = TRUE;	HTOutputFormat = WWW_PRESENT;	LYMapsOnly = TRUE;	if (!HTLoadAbsolute(&WWWDoc)) {	    LYforce_no_cache = old_cache_setting;	    reloading = old_reloading;	    HTOutputFormat = old_format_out;	    LYMapsOnly = FALSE;	    HTAlert(MAP_NOT_ACCESSIBLE);	    return(HT_NOT_LOADED);	}	LYforce_no_cache = old_cache_setting;	reloading = old_reloading;	HTOutputFormat = old_format_out;	LYMapsOnly = FALSE;	cur = get_the_list(&WWWDoc, address, anAnchor, &underlying);	while (NULL != (theMap = (LYImageMap *)HTList_nextObject(cur))) {	    if (!strcmp(theMap->address, address)) {		break;	    }	}	if (!(theMap && theMap->elements)) {	    HTAlert(MAP_NOT_AVAILABLE);	    return(HT_NOT_LOADED);	}    }#ifdef DONT_TRACK_INTERNAL_LINKS    anAnchor->no_cache = TRUE;#endif    target = HTStreamStack(format_in,			   format_out,			   sink, anAnchor);    if (!target || target == NULL) {	HTSprintf(&buf, CANNOT_CONVERT_I_TO_O,		HTAtom_name(format_in), HTAtom_name(format_out));	HTAlert(buf);	FREE(buf);	return(HT_NOT_LOADED);    }    if (theMap->title && *theMap->title) {	StrAllocCopy(MapTitle, theMap->title);    } else if (anAnchor->title && *anAnchor->title) {	StrAllocCopy(MapTitle, anAnchor->title);    } else if (LYRequestTitle && *LYRequestTitle &&	       strcasecomp(LYRequestTitle, "[USEMAP]")) {	StrAllocCopy(MapTitle, LYRequestTitle);    } else if ((cp=strrchr(address, '#')) != NULL) {	StrAllocCopy(MapTitle, (cp+1));    }    if (!(MapTitle && *MapTitle)) {	StrAllocCopy(MapTitle, "[USEMAP]");    } else {	LYEntify(&MapTitle, TRUE);    }#define PUTS(buf)    (*target->isa->put_block)(target, buf, strlen(buf))    HTSprintf0(&buf, "<html>\n<head>\n");    PUTS(buf);    HTSprintf0(&buf, "<META %s content=\"text/html;charset=%s\">\n",		"http-equiv=\"content-type\"",		LYCharSet_UC[current_char_set].MIMEname);    PUTS(buf);	/*	 *  This page is a list of titles and anchors for them.	 *  Since titles already passed SGML/HTML stage	 *  they converted to current_char_set.	 *  That is why we insist on META charset for this page.	 */    HTSprintf0(&buf, "<title>%s</title>\n", MapTitle);    PUTS(buf);    HTSprintf0(&buf, "</head>\n<body>\n");    PUTS(buf);    HTSprintf0(&buf,"<h1><em>%s</em></h1>\n", MapTitle);    PUTS(buf);    StrAllocCopy(MapAddress, address);    LYEntify(&MapAddress, FALSE);    HTSprintf0(&buf,"<h2><em>MAP:</em>&nbsp;%s</h2>\n", MapAddress);    PUTS(buf);    HTSprintf0(&buf, "<%s compact>\n", ((keypad_mode == NUMBERS_AS_ARROWS) ?				    "ol" : "ul"));    PUTS(buf);    cur = theMap->elements;    while (NULL != (new=(LYMapElement *)HTList_nextObject(cur))) {	StrAllocCopy(MapAddress, new->address);	LYEntify(&MapAddress, FALSE);	PUTS("<li><a href=\"");	PUTS(MapAddress);	PUTS("\"");#ifndef DONT_TRACK_INTERNAL_LINKS	if (new->intern_flag)	    PUTS(" TYPE=\"internal link\"");#endif	PUTS("\n>");	StrAllocCopy(MapTitle, new->title);	LYEntify(&MapTitle, TRUE);	PUTS(MapTitle);	PUTS("</a>\n");    }    HTSprintf0(&buf, "</%s>\n</body>\n</html>\n",		    ((keypad_mode == NUMBERS_AS_ARROWS)		    ? "ol"		    : "ul"));    PUTS(buf);    (*target->isa->_free)(target);    FREE(MapAddress);    FREE(MapTitle);    FREE(buf);    return(HT_LOADED);}