PL_strcpy(buffer, "<A TARGET=Internal_URL_Info HREF=about:"); PL_strcat(buffer, address); PL_strcat(buffer, ">");
PL_strcpy(buffer, "<A TARGET=Internal_URL_Info HREF=\"about:"); escaped = NET_EscapeDoubleQuote(address); PL_strcat(buffer, escaped); PR_Free(escaped); PL_strcat(buffer, "\">");
IL_DisplayMemCacheInfoAsHTML(FO_Present_Types format_out, URL_Struct *urls,                             OPAQUE_CONTEXT *cx){	char buffer[2048];    char *output = NULL;    char *img_info;	char *address;	char *escaped;   	NET_StreamClass *stream;	Bool long_form = FALSE;	int status;	if(PL_strcasestr(urls->address, "?long"))		long_form = TRUE;#ifndef M12N                    /* XXXM12N Cache trace: cleanup/eliminate. */	else if(PL_strcasestr(urls->address, "?traceon"))		il_cache_trace = TRUE;	else if(PL_strcasestr(urls->address, "?traceoff"))		il_cache_trace = FALSE;#endif /* M12N */	StrAllocCopy(urls->content_type, TEXT_HTML);	format_out = CLEAR_CACHE_BIT(format_out);	stream = NET_StreamBuilder(format_out, urls, (MWContext *)cx);	if (!stream)		return 0;	/*     * Define a macro to push a string up the stream	 * and handle errors	 */#define PUT_PART(part)														\{                                                                           \    status = (*stream->put_block)(stream,						\                                  part ? part : "Unknown",					\                                  part ? PL_strlen(part) : 7);				\    if (status < 0)															\        goto END;                                                           \}    /* Send something to the screen immediately.  This will force all     * the images on the page to enter the cache now. Otherwise,     * layout will be causing cache state to be modified even as we're     * trying to display it.     */    PL_strcpy(buffer,              "<TITLE>Information about the Netscape image cache</TITLE>\n");    PUT_PART(buffer);                                   	XP_SPRINTF(buffer, 			   "<h2>Image Cache statistics</h2>\n"			   "<TABLE CELLSPACING=0 CELLPADDING=1>\n"			   "<TR>\n"			   "<TD ALIGN=RIGHT><b>Maximum size:</b></TD>\n"			   "<TD>%ld</TD>\n"			   "</TR>\n"			   "<TR>\n"			   "<TD ALIGN=RIGHT><b>Current size:</b></TD>\n"			   "<TD>%ld</TD>\n"			   "</TR>\n"			   "<TR>\n"			   "<TD ALIGN=RIGHT><b>Number of images in cache:</b></TD>\n"			   "<TD>%d</TD>\n"			   "</TR>\n"			   "<TR>\n"			   "<TD ALIGN=RIGHT><b>Average cached image size:</b></TD>\n"			   "<TD>%ld</TD>\n"			   "</TR>\n"			   "</TABLE>\n"			   "<HR>",			   (long)il_cache.max_bytes,			   (long)il_cache.bytes,			   il_cache.items,			   (il_cache.bytes ?                (long)il_cache.bytes / il_cache.items : 0L));	PUT_PART(buffer);    {        il_container *ic, *l = NULL;        for (ic=il_cache.head; ic; ic=ic->next) {                        /* Sanity check */            if (l)                PR_ASSERT(ic->prev == l);            l = ic;            /* Don't display uninteresting images */            if ((ic->state != IC_COMPLETE) &&                (ic->state != IC_SIZED)    &&                (ic->state != IC_MULTI))                continue;                        StrAllocCat(output, "<TABLE>\n");            /* Emit DocInfo link to URL */            address = ic->url_address;            PL_strcpy(buffer, "<A TARGET=Internal_URL_Info HREF=about:");            PL_strcat(buffer, address);            PL_strcat(buffer, ">");            escaped = NET_EscapeHTML(address);            PL_strcat(buffer, escaped);            PR_FREEIF(escaped);            PL_strcat(buffer, "</A>");            ADD_CELL("URL:", buffer);                        /* Rest of image info (size, colors, depth, etc.) */            img_info = il_HTML_image_info(ic, long_form, FALSE);            if (img_info) {                StrAllocCat(output, img_info);                PR_FREEIF(img_info);            }                        StrAllocCat(output, "</TABLE><P>\n");        }        if (output)            PUT_PART(output);    }          END:         PR_FREEIF(output);     	if(status < 0)		(*stream->abort)(stream, status);	else		(*stream->complete)((NET_StreamClass *)stream);	return 1;}