about summary refs log tree commit diff stats
path: root/src/GridText.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>1998-04-23 12:35:00 -0400
committerThomas E. Dickey <dickey@invisible-island.net>1998-04-23 12:35:00 -0400
commit2a94396ccd9cf5ade728c53e02cba28e06af4378 (patch)
tree0ee1558f3e81f97725d83250f944aafa4eb43d54 /src/GridText.c
parent84271e583d80f546251ea914a33f8c537fddbac7 (diff)
downloadlynx-snapshots-2a94396ccd9cf5ade728c53e02cba28e06af4378.tar.gz
snapshot of project "lynx", label v2-8-1dev_7
Diffstat (limited to 'src/GridText.c')
-rw-r--r--src/GridText.c240
1 files changed, 89 insertions, 151 deletions
diff --git a/src/GridText.c b/src/GridText.c
index fcbe065e..c2f70164 100644
--- a/src/GridText.c
+++ b/src/GridText.c
@@ -54,12 +54,12 @@ unsigned int cached_styles[CACHEH][CACHEW];
 #ifdef USE_COLOR_STYLE_UNUSED
 void LynxClearScreenCache NOARGS
 {
-	int i,j;
-if (TRACE)
-	fprintf(stderr, "flushing cached screen styles\n");
-	for (i=0;i<CACHEH;i++)
-		for (j=0;j<CACHEW;j++)
-			cached_styles[i][j]=s_a;
+    int i,j;
+
+    CTRACE(tfp, "flushing cached screen styles\n");
+    for (i=0;i<CACHEH;i++)
+	for (j=0;j<CACHEW;j++)
+	    cached_styles[i][j]=s_a;
 }
 #endif /* USE_COLOR_STYLE */
 
@@ -312,9 +312,8 @@ PRIVATE void * LY_check_calloc ARGS2(
 	HText * t = HTList_objectAt(loaded_texts, i);
 	if (t == HTMainText)
 	    t = NULL;		/* shouldn't happen */
-	if (TRACE) {
-	    fprintf(stderr,
-		    "\r *** Emergency freeing document %d/%d for '%s'%s!\n",
+	{
+	CTRACE(tfp, "\r *** Emergency freeing document %d/%d for '%s'%s!\n",
 		    i + 1, n,
 		    ((t && t->node_anchor &&
 		      t->node_anchor->address) ?
@@ -408,8 +407,7 @@ PUBLIC HText *	HText_new ARGS1(
 
 #if defined(VMS) && defined (VAXC) && !defined(__DECC)
     status = lib$stat_vm(&VMType, &VMTotal);
-    if (TRACE)
-	fprintf(stderr, "GridText: VMTotal = %d\n", VMTotal);
+    CTRACE(tfp, "GridText: VMTotal = %d\n", VMTotal);
 #endif /* VMS && VAXC && !__DECC */
 
     if (!loaded_texts)	{
@@ -425,12 +423,11 @@ PUBLIC HText *	HText_new ARGS1(
      *  and free it before reloading. - Dick Wesseling (ftu@fi.ruu.nl)
      */
     if (anchor->document) {
-       HTList_removeObject(loaded_texts, anchor->document);
-       if (TRACE)
-	   fprintf(stderr, "GridText: Auto-uncaching\n") ;
-       ((HText *)anchor->document)->node_anchor = NULL;
-       HText_free((HText *)anchor->document);
-       anchor->document = NULL;
+	HTList_removeObject(loaded_texts, anchor->document);
+	CTRACE(tfp, "GridText: Auto-uncaching\n") ;
+	((HText *)anchor->document)->node_anchor = NULL;
+	HText_free((HText *)anchor->document);
+	anchor->document = NULL;
     }
 
     HTList_addObject(loaded_texts, self);
@@ -440,13 +437,11 @@ PUBLIC HText *	HText_new ARGS1(
 #else
     if (HTList_count(loaded_texts) > HTCacheSize) {
 #endif /* VMS && VAXC && !__DECC */
-	if (TRACE)
-	    fprintf(stderr, "GridText: Freeing off cached doc.\n");
+	CTRACE(tfp, "GridText: Freeing off cached doc.\n");
 	HText_free((HText *)HTList_removeFirstObject(loaded_texts));
 #if defined(VMS) && defined (VAXC) && !defined(__DECC)
 	status = lib$stat_vm(&VMType, &VMTotal);
-	if (TRACE)
-	    fprintf(stderr, "GridText: VMTotal reduced to %d\n", VMTotal);
+	CTRACE(tfp, "GridText: VMTotal reduced to %d\n", VMTotal);
 #endif /* VMS && VAXC && !__DECC */
     }
 
@@ -1386,8 +1381,8 @@ PRIVATE void display_page ARGS3(
 			    link_dest_intl = HTAnchor_followTypedLink(
 				(HTAnchor *)Anchor_ptr->anchor, LINK_INTERNAL);
 			    if (link_dest_intl && link_dest_intl != link_dest) {
-				if (TRACE)
-				    fprintf(stderr,
+
+				CTRACE(tfp,
 				    "display_page: unexpected typed link to %s!\n",
 					    link_dest_intl->parent->address);
 				link_dest_intl = NULL;
@@ -1478,9 +1473,8 @@ PRIVATE void display_page ARGS3(
 		/*
 		 *  Not showing anchor.
 		 */
-		if (TRACE &&
-		    Anchor_ptr->hightext && *Anchor_ptr->hightext)
-		    fprintf(stderr,
+		if (Anchor_ptr->hightext && *Anchor_ptr->hightext)
+		    CTRACE(tfp,
 			    "\nGridText: Not showing link, hightext=%s\n",
 			    Anchor_ptr->hightext);
 	    }
@@ -1501,8 +1495,7 @@ PRIVATE void display_page ARGS3(
 		_statusline(MAXLINKS_REACHED);
 		sleep(AlertSecs);
 	    }
-	    if (TRACE)
-	        fprintf(stderr, "\ndisplay_page: MAXLINKS reached.\n");
+	    CTRACE(tfp, "\ndisplay_page: MAXLINKS reached.\n");
 	    break;
 	}
     }
@@ -1608,8 +1601,7 @@ PRIVATE void split_line ARGS2(
     ctrl_chars_on_this_line = 0; /*reset since we are going to a new line*/
     text->LastChar = ' ';
 
-    if (TRACE)
-	fprintf(stderr,"GridText: split_line called\n");
+    CTRACE(tfp,"GridText: split_line called\n");
 
     text->Lines++;
 
@@ -1696,8 +1688,8 @@ PRIVATE void split_line ARGS2(
 	}
     }
     if (previous->numstyles > 0 && previous->styles[LastStyle].direction) {
-	if (TRACE)
-	    fprintf(stderr, "%s\n%s%s\n",
+
+	CTRACE(tfp, "%s\n%s%s\n",
 		    "........... Too many character styles on line:",
 		    "........... ", previous->data);
     }
@@ -2005,8 +1997,8 @@ PUBLIC void HText_setStyle ARGS2(
 	return; 			/* Safety */
     after = text->style->spaceAfter;
     before = style->spaceBefore;
-    if (TRACE)
-	fprintf(stderr, "GridText: Change to style %s\n", style->name);
+
+    CTRACE(tfp, "GridText: Change to style %s\n", style->name);
 
     blank_lines (text, ((after > before) ? after : before));
 
@@ -2692,15 +2684,15 @@ PUBLIC void HText_endAnchor ARGS2(
 	    a = text->last_anchor;
 	}
     }
-    if (TRACE)
-	fprintf(stderr, "HText_endAnchor: number:%d link_type:%d\n",
+
+    CTRACE(tfp, "HText_endAnchor: number:%d link_type:%d\n",
 			a->number, a->link_type);
     if (a->link_type == INPUT_ANCHOR) {
 	/*
 	 *  Shouldn't happen, but put test here anyway to be safe. - LE
 	 */
-	if (TRACE)
-	    fprintf(stderr,
+
+	CTRACE(tfp,
 	   "HText_endAnchor: internal error: last anchor was input field!\n");
 	return;
     }
@@ -3139,8 +3131,8 @@ PUBLIC void HText_endAppend ARGS1(
 
     if (!text)
 	return;
-    if (TRACE)
-	fprintf(stderr,"Gridtext: Entering HText_endAppend\n");
+
+    CTRACE(tfp,"Gridtext: Entering HText_endAppend\n");
 
     /*
      *  Create a  blank line at the bottom.
@@ -3171,8 +3163,8 @@ PUBLIC void HText_endAppend ARGS1(
     while (text->last_line->data[0] == '\0' && text->Lines > 2) {
 	HTLine *next_to_the_last_line = text->last_line->prev;
 
-	if (TRACE)
-	    fprintf(stderr, "GridText: Removing bottom blank line: %s\n",
+
+	CTRACE(tfp, "GridText: Removing bottom blank line: %s\n",
 			    text->last_line->data);
 	/*
 	 *  line_ptr points to the first line.
@@ -3183,10 +3175,8 @@ PUBLIC void HText_endAppend ARGS1(
 	text->last_line = next_to_the_last_line;
 	text->Lines--;
 #ifdef NOTUSED_BAD_FOR_SCREEN
-	if (TRACE) {
-	    fprintf(stderr, "GridText: New bottom line: %s\n",
+	CTRACE(tfp, "GridText: New bottom line: %s\n",
 			    text->last_line->data);
-	}
 #endif
     }
 
@@ -3214,8 +3204,8 @@ re_parse:
 	}
 	if (anchor_ptr->line_pos < 0)
 	    anchor_ptr->line_pos = 0;
-	if (TRACE)
-	    fprintf(stderr, "Gridtext: Anchor found on line:%d col:%d\n",
+
+	CTRACE(tfp, "Gridtext: Anchor found on line:%d col:%d\n",
 			    cur_line, anchor_ptr->line_pos);
 
 	/*
@@ -3236,8 +3226,7 @@ re_parse:
 	    anchor_ptr->extent = 0;
 	}
 #ifdef NOTUSED_BAD_FOR_SCREEN
-	if (TRACE)
-	    fprintf(stderr, "anchor text: '%s'   pos: %d\n",
+	CTRACE(tfp, "anchor text: '%s'   pos: %d\n",
 			    line_ptr->data, anchor_ptr->line_pos);
 #endif
 	/*
@@ -3248,14 +3237,12 @@ re_parse:
 	    cur_line < text->Lines) {
 	    anchor_ptr->start += (cur_shift + 1);
 	    cur_shift = 0;
-	    if (TRACE)
-		fprintf(stderr, "found anchor at end of line\n");
+	    CTRACE(tfp, "found anchor at end of line\n");
 	    goto re_parse;
 	}
 	cur_shift = 0;
 #ifdef NOTUSED_BAD_FOR_SCREEN
-	if (TRACE)
-	    fprintf(stderr, "anchor text: '%s'   pos: %d\n",
+	CTRACE(tfp, "anchor text: '%s'   pos: %d\n",
 			    line_ptr->data, anchor_ptr->line_pos);
 #endif
 	/*
@@ -3334,9 +3321,8 @@ re_parse:
 	 */
 	anchor_ptr->line_pos += line_ptr->offset;
 	anchor_ptr->line_num  = cur_line;
-	if (TRACE)
-	    fprintf(stderr,
-		    "GridText: adding link on line %d in HText_endAppend\n",
+
+	CTRACE(tfp, "GridText: adding link on line %d in HText_endAppend\n",
 		    cur_line);
 
 	/*
@@ -3348,12 +3334,12 @@ re_parse:
 }
 
 
-/*	Dump diagnostics to stderr
+/*	Dump diagnostics to tfp
 */
 PUBLIC void HText_dump ARGS1(
 	HText *,	text GCC_UNUSED)
 {
-    fprintf(stderr, "HText: Dump called\n");
+    fprintf(tfp, "HText: Dump called\n");
 }
 
 
@@ -3608,9 +3594,8 @@ PUBLIC int HTGetLinkInfo ARGS6(
 			    link_dest_intl = HTAnchor_followTypedLink(
 				(HTAnchor *)a->anchor, LINK_INTERNAL);
 			    if (link_dest_intl && link_dest_intl != link_dest) {
-				if (TRACE)
-				    fprintf(stderr,
-					    "HTGetLinkInfo: unexpected typed link to %s!\n",
+
+				CTRACE(tfp, "HTGetLinkInfo: unexpected typed link to %s!\n",
 					    link_dest_intl->parent->address);
 				link_dest_intl = NULL;
 			    }
@@ -4197,10 +4182,10 @@ PUBLIC BOOL HTFindPoundSelector ARGS1(
 	if (a->anchor && a->anchor->tag)
 	    if (!strcmp(a->anchor->tag, selector)) {
 
-		 www_search_result = a->line_num+1;
-		 if (TRACE)
-		    fprintf(stderr,
-		"HText: Selecting anchor [%d] at character %d, line %d\n",
+		www_search_result = a->line_num+1;
+
+		CTRACE(tfp,
+		       "HText: Selecting anchor [%d] at character %d, line %d\n",
 				     a->number, a->start, www_search_result);
 		if (!strcmp(selector, LYToolbarName))
 		    --www_search_result;
@@ -4230,7 +4215,7 @@ PUBLIC BOOL HText_selectAnchor ARGS2(
 	if (a->anchor == anchor) break;
     }
     if (!a) {
-	if (TRACE) fprintf(stderr, "HText: No such anchor in this text!\n");
+	CTRACE(tfp, "HText: No such anchor in this text!\n");
 	return NO;
     }
 
@@ -4241,7 +4226,7 @@ PUBLIC BOOL HText_selectAnchor ARGS2(
 
     {
 	 int l = line_for_char(text, a->start);
-	if (TRACE) fprintf(stderr,
+	 CTRACE(tfp,
 	    "HText: Selecting anchor [%d] at character %d, line %d\n",
 	    a->number, a->start, l);
 
@@ -4614,8 +4599,7 @@ get_query:
 	StrAllocCopy(doc->address, cp_freeme);
 	FREE(cp_freeme);
 
-	if (TRACE)
-	    fprintf(stderr,"\ndo_www_search: newfile: %s\n",doc->address);
+	CTRACE(tfp,"\ndo_www_search: newfile: %s\n",doc->address);
 
 	/*
 	 *  Yah, the search succeeded.
@@ -5303,22 +5287,18 @@ PUBLIC void HTuncache_current_document NOARGS
 		FREE(htmain_anchor->UCStages);
 	    }
 	}
-	if (TRACE) {
-	    fprintf(stderr, "\rHTuncache.. freeing document for '%s'%s\n",
+	CTRACE(tfp, "\rHTuncache.. freeing document for '%s'%s\n",
 			    ((htmain_anchor &&
 			      htmain_anchor->address) ?
 			       htmain_anchor->address : "unknown anchor"),
 			    ((htmain_anchor &&
 			      htmain_anchor->post_data) ?
 				      " with POST data" : ""));
-	}
 	HTList_removeObject(loaded_texts, HTMainText);
 	HText_free(HTMainText);
 	HTMainText = NULL;
     } else {
-	if (TRACE) {
-	    fprintf(stderr, "HTuncache.. HTMainText already is NULL!\n");
-	}
+	CTRACE(tfp, "HTuncache.. HTMainText already is NULL!\n");
     }
 }
 
@@ -5779,9 +5759,7 @@ PUBLIC void HText_beginForm ARGS5(
     PerFormInfo_free(HTCurrentForm); /* shouldn't happen here - kw */
     HTCurrentForm = newform;
 
-    if (TRACE)
-	fprintf(stderr,
-		"BeginForm: action:%s Method:%d%s%s%s%s%s%s\n",
+    CTRACE(tfp, "BeginForm: action:%s Method:%d%s%s%s%s%s%s\n",
 		HTFormAction, HTFormMethod,
 		(HTFormTitle ? " Title:" : ""),
 		(HTFormTitle ? HTFormTitle : ""),
@@ -5846,8 +5824,7 @@ PUBLIC void HText_endForm ARGS1(
 	HTList_appendObject(text->forms, HTCurrentForm);
 	HTCurrentForm = NULL;
     } else {
-	if (TRACE)
-	    fprintf(stderr, "endForm:    HTCurrentForm is missing!\n");
+	CTRACE(tfp, "endForm:    HTCurrentForm is missing!\n");
     }
 
     FREE(HTCurSelectGroup);
@@ -5889,18 +5866,16 @@ PUBLIC void HText_beginSelect ARGS4(
      */
     StrAllocCopy(HTCurSelectGroupSize, size);
 
-    if (TRACE) {
-       fprintf(stderr,"HText_beginSelect: name=%s type=%d size=%s\n",
+    CTRACE(tfp,"HText_beginSelect: name=%s type=%d size=%s\n",
 	       ((HTCurSelectGroup == NULL) ?
 				  "<NULL>" : HTCurSelectGroup),
 		HTCurSelectGroupType,
 	       ((HTCurSelectGroupSize == NULL) ?
 				      "<NULL>" : HTCurSelectGroupSize));
-	fprintf(stderr,"HText_beginSelect: name_cs=%d \"%s\"\n",
+    CTRACE(tfp,"HText_beginSelect: name_cs=%d \"%s\"\n",
 		HTCurSelectGroupCharset,
 		(HTCurSelectGroupCharset >= 0 ?
 		 LYCharSet_UC[HTCurSelectGroupCharset].MIMEname : "<UNKNOWN>"));
-    }
 }
 
 /*
@@ -5925,8 +5900,7 @@ PUBLIC int HText_getOptionNum ARGS1(
 
     for (op = a->input_field->select_list; op; op = op->next)
 	n++;
-    if (TRACE)
-	fprintf(stderr, "HText_getOptionNum: Got number '%d'.\n", n);
+    CTRACE(tfp, "HText_getOptionNum: Got number '%d'.\n", n);
     return(n);
 }
 
@@ -6003,16 +5977,12 @@ PUBLIC char * HText_setLastOptionValue ARGS7(
 
     if (!(text && text->last_anchor &&
 	  text->last_anchor->link_type == INPUT_ANCHOR)) {
-	if (TRACE)
-	    fprintf(stderr,
-		    "HText_setLastOptionValue: invalid call!  value:%s!\n",
+	CTRACE(tfp, "HText_setLastOptionValue: invalid call!  value:%s!\n",
 		    (value ? value : "<NULL>"));
 	return NULL;
     }
 
-    if (TRACE)
-	fprintf(stderr,
-		"Entering HText_setLastOptionValue: value:%s, checked:%s\n",
+    CTRACE(tfp, "Entering HText_setLastOptionValue: value:%s, checked:%s\n",
 		value, (checked ? "on" : "off"));
 
     /*
@@ -6090,14 +6060,10 @@ PUBLIC char * HText_setLastOptionValue ARGS7(
 	     *  No option items yet.
 	     */
 	    if (text->last_anchor->input_field->type != F_OPTION_LIST_TYPE) {
-		if (TRACE) {
-		    fprintf(stderr,
-   "HText_setLastOptionValue: last input_field not F_OPTION_LIST_TYPE (%d)\n",
+		CTRACE(tfp, "HText_setLastOptionValue: last input_field not F_OPTION_LIST_TYPE (%d)\n",
 			    F_OPTION_LIST_TYPE);
-		    fprintf(stderr,
-   "                          but %d, ignoring!\n",
+		CTRACE(tfp, "                          but %d, ignoring!\n",
 			    text->last_anchor->input_field->type);
-		}
 		return NULL;
 	    }
 
@@ -6229,15 +6195,15 @@ PUBLIC char * HText_setLastOptionValue ARGS7(
     }
 
     if (TRACE) {
-	fprintf(stderr,"HText_setLastOptionValue:%s value=%s",
+	fprintf(tfp,"HText_setLastOptionValue:%s value=%s",
 		(order == LAST_ORDER) ? " LAST_ORDER" : "",
 		value);
-	fprintf(stderr,"            val_cs=%d \"%s\"",
+	fprintf(tfp,"            val_cs=%d \"%s\"",
 			val_cs,
 			(val_cs >= 0 ?
 			 LYCharSet_UC[val_cs].MIMEname : "<UNKNOWN>"));
 	if (submit_value) {
-	    fprintf(stderr, " (submit_val_cs %d \"%s\") submit_value%s=%s\n",
+	    fprintf(tfp, " (submit_val_cs %d \"%s\") submit_value%s=%s\n",
 		    submit_val_cs,
 		    (submit_val_cs >= 0 ?
 		     LYCharSet_UC[submit_val_cs].MIMEname : "<UNKNOWN>"),
@@ -6246,7 +6212,7 @@ PUBLIC char * HText_setLastOptionValue ARGS7(
 		    submit_value);
 	}
 	else {
-	    fprintf(stderr,"\n");
+	    fprintf(tfp,"\n");
 	}
     }
     return(ret_Value);
@@ -6270,8 +6236,7 @@ PUBLIC int HText_beginInput ARGS3(
     unsigned char *tmp = NULL;
     int i, j;
 
-    if (TRACE)
-	fprintf(stderr,"Entering HText_beginInput\n");
+    CTRACE(tfp,"Entering HText_beginInput\n");
 
     if (a == NULL || f == NULL)
 	outofmem(__FILE__, "HText_beginInput");
@@ -6489,8 +6454,7 @@ PUBLIC int HText_beginInput ARGS3(
 	    /*
 	     *  Error!  NAME must be present.
 	     */
-	    if (TRACE)
-		fprintf(stderr,
+	    CTRACE(tfp,
 		  "GridText: No name present in input field; not displaying\n");
 	    FREE(a);
 	    FREE(f);
@@ -6717,30 +6681,27 @@ PUBLIC int HText_beginInput ARGS3(
 	    text->forms = HTList_new();
 	}
     } else {
-	if (TRACE)
-	    fprintf(stderr, "beginInput: HTCurrentForm is missing!\n");
+	CTRACE(tfp, "beginInput: HTCurrentForm is missing!\n");
     }
 
-    if (TRACE) {
-	fprintf(stderr,"Input link: name=%s\nvalue=%s\nsize=%d\n",
+    CTRACE(tfp, "Input link: name=%s\nvalue=%s\nsize=%d\n",
 			f->name,
 			((f->value != NULL) ? f->value : ""),
 			f->size);
-	fprintf(stderr,"Input link: name_cs=%d \"%s\" (from %d \"%s\")\n",
+    CTRACE(tfp, "Input link: name_cs=%d \"%s\" (from %d \"%s\")\n",
 			f->name_cs,
 			(f->name_cs >= 0 ?
 			 LYCharSet_UC[f->name_cs].MIMEname : "<UNKNOWN>"),
 			I->name_cs,
 			(I->name_cs >= 0 ?
 			 LYCharSet_UC[I->name_cs].MIMEname : "<UNKNOWN>"));
-	fprintf(stderr,"            value_cs=%d \"%s\" (from %d \"%s\")\n",
+    CTRACE(tfp, "            value_cs=%d \"%s\" (from %d \"%s\")\n",
 			f->value_cs,
 			(f->value_cs >= 0 ?
 			 LYCharSet_UC[f->value_cs].MIMEname : "<UNKNOWN>"),
 			I->value_cs,
 			(I->value_cs >= 0 ?
 			 LYCharSet_UC[I->value_cs].MIMEname : "<UNKNOWN>"));
-    }
 
     /*
      *  Return the SIZE of the input field.
@@ -6888,14 +6849,10 @@ PUBLIC void HText_SubmitForm ARGS4(
     thisform = HTList_objectAt(HTMainText->forms, form_number - 1);
     /*  Sanity check */
     if (!thisform) {
-	if (TRACE)
-	    fprintf(stderr,
-		    "SubmitForm: form %d not in HTMainText's list!\n",
+	CTRACE(tfp, "SubmitForm: form %d not in HTMainText's list!\n",
 		    form_number);
     } else if (thisform->number != form_number) {
-	if (TRACE)
-	    fprintf(stderr,
-		    "SubmitForm: failed sanity check, %d!=%d !\n",
+	CTRACE(tfp, "SubmitForm: failed sanity check, %d!=%d !\n",
 		    thisform->number, form_number);
 	thisform = NULL;
     }
@@ -7220,25 +7177,22 @@ PUBLIC void HText_SubmitForm ARGS4(
 	        case F_IMAGE_SUBMIT_TYPE:
 		    if (!(form_ptr->name && *form_ptr->name != '\0' &&
 			  !strcmp(form_ptr->name, link_name))) {
-			if (TRACE) {
-			    fprintf(stderr,
+			CTRACE(tfp,
 				    "SubmitForm: skipping submit field with ");
-			    fprintf(stderr,
-				    "name \"%s\" for link_name \"%s\", %s.",
+			CTRACE(tfp, "name \"%s\" for link_name \"%s\", %s.",
 				    form_ptr->name ? form_ptr->name : "???",
 				    link_name ? link_name : "???",
 				    (form_ptr->name && *form_ptr->name) ?
 				    "not current link" : "no field name");
-			}
 			break;
 		    }
 		    if (!(form_ptr->type == F_TEXT_SUBMIT_TYPE ||
 			(form_ptr->value && *form_ptr->value != '\0' &&
 			 !strcmp(form_ptr->value, link_value)))) {
 			if (TRACE) {
-			    fprintf(stderr,
+			    fprintf(tfp,
 				    "SubmitForm: skipping submit field with ");
-			    fprintf(stderr,
+			    fprintf(tfp,
 				    "name \"%s\" for link_name \"%s\", %s!",
 				    form_ptr->name ? form_ptr->name : "???",
 				    link_name ? link_name : "???",
@@ -7288,9 +7242,7 @@ PUBLIC void HText_SubmitForm ARGS4(
 			success = LYUCTranslateBackFormData(&copied_val_used,
 							form_ptr->value_cs,
 							target_cs, PlainText);
-			if (TRACE) {
-			    fprintf(stderr,
-				    "SubmitForm: field \"%s\" %d %s -> %d %s %s\n",
+			CTRACE(tfp, "SubmitForm: field \"%s\" %d %s -> %d %s %s\n",
 				    form_ptr->name ? form_ptr->name : "",
 				    form_ptr->value_cs,
 				    form_ptr->value_cs >= 0 ?
@@ -7299,18 +7251,14 @@ PUBLIC void HText_SubmitForm ARGS4(
 				    target_cs,
 				    target_csname ? target_csname : "???",
 				    success ? "OK" : "FAILED");
-			}
 			if (success) {
 			    val_used = copied_val_used;
 			}
 		    } else {  /* We can use the value directly. */
-			if (TRACE) {
-			    fprintf(stderr,
-				    "SubmitForm: field \"%s\" %d %s OK\n",
+			CTRACE(tfp, "SubmitForm: field \"%s\" %d %s OK\n",
 				    form_ptr->name ? form_ptr->name : "",
 				    target_cs,
 				    target_csname ? target_csname : "???");
-			}
 			success = YES;
 		    }
 		    if (!success) {
@@ -7384,9 +7332,7 @@ PUBLIC void HText_SubmitForm ARGS4(
 			success = LYUCTranslateBackFormData(&copied_name_used,
 							form_ptr->name_cs,
 							target_cs, PlainText);
-			if (TRACE) {
-			    fprintf(stderr,
-				    "SubmitForm: name \"%s\" %d %s -> %d %s %s\n",
+			CTRACE(tfp, "SubmitForm: name \"%s\" %d %s -> %d %s %s\n",
 				    form_ptr->name ? form_ptr->name : "",
 				    form_ptr->name_cs,
 				    form_ptr->name_cs >= 0 ?
@@ -7395,7 +7341,6 @@ PUBLIC void HText_SubmitForm ARGS4(
 				    target_cs,
 				    target_csname ? target_csname : "???",
 				    success ? "OK" : "FAILED");
-			}
 			if (success) {
 			    name_used = copied_name_used;
 			}
@@ -7409,13 +7354,10 @@ PUBLIC void HText_SubmitForm ARGS4(
 			    }
 			}
 		    } else {  /* We can use the name directly. */
-			if (TRACE) {
-			    fprintf(stderr,
-				    "SubmitForm: name \"%s\" %d %s OK\n",
+			CTRACE(tfp, "SubmitForm: name \"%s\" %d %s OK\n",
 				    form_ptr->name ? form_ptr->name : "",
 				    target_cs,
 				    target_csname ? target_csname : "???");
-			}
 			success = YES;
 			if (Boundary) {
 			    StrAllocCopy(copied_name_used, name_used);
@@ -7449,8 +7391,7 @@ PUBLIC void HText_SubmitForm ARGS4(
 
 		    break;
 		default:
-		    if (TRACE)
-			fprintf(stderr, "SubmitForm: What type is %d?\n",
+		    CTRACE(tfp, "SubmitForm: What type is %d?\n",
 				form_ptr->type);
 		}
 
@@ -7804,17 +7745,15 @@ PUBLIC void HText_SubmitForm ARGS4(
 
     if (submit_item->submit_method == URL_MAIL_METHOD) {
 	_user_message("Submitting %s", submit_item->submit_action);
-	if (TRACE) {
-	    fprintf(stderr, "\nGridText - mailto_address: %s\n",
+	CTRACE(tfp, "\nGridText - mailto_address: %s\n",
 			    (submit_item->submit_action+7));
-	    fprintf(stderr, "GridText - mailto_subject: %s\n",
+	CTRACE(tfp, "GridText - mailto_subject: %s\n",
 			    ((submit_item->submit_title &&
 			      *submit_item->submit_title) ?
 			      (submit_item->submit_title) :
 					(HText_getTitle() ?
 				         HText_getTitle() : "")));
-	    fprintf(stderr,"GridText - mailto_content: %s\n",query);
-	}
+	CTRACE(tfp,"GridText - mailto_content: %s\n",query);
 	sleep(MessageSecs);
 	mailform((submit_item->submit_action+7),
 		 ((submit_item->submit_title &&
@@ -7833,8 +7772,7 @@ PUBLIC void HText_SubmitForm ARGS4(
 
     if (submit_item->submit_method == URL_POST_METHOD || Boundary) {
 	StrAllocCopy(doc->post_data, query);
-	if (TRACE)
-	    fprintf(stderr,"GridText - post_data: %s\n",doc->post_data);
+	CTRACE(tfp,"GridText - post_data: %s\n",doc->post_data);
 	StrAllocCopy(doc->address, submit_item->submit_action);
 	FREE(query);
 	return;
ot;, label v2-7-1ac_0-28' href='/ingrix/lynx-snapshots/commit/src/LYStyle.c?id=945e8eb6bb07f64aaca42207af3311220ff2e4ba'>945e8eb6 ^
b6c832d0 ^




d3f9d547 ^
945e8eb6 ^



d3f9d547 ^
945e8eb6 ^
6d7ee048 ^
945e8eb6 ^

b6c832d0 ^
4525eb4b ^
b6c832d0 ^


















945e8eb6 ^
b6c832d0 ^

945e8eb6 ^
b6c832d0 ^

95586cc2 ^
d3f9d547 ^
95586cc2 ^
b6c832d0 ^





9c512bba ^




b6c832d0 ^
945e8eb6 ^
b6c832d0 ^
86b4d41a ^
b6c832d0 ^
945e8eb6 ^

b6c832d0 ^
86b4d41a ^
b6c832d0 ^
945e8eb6 ^
b6c832d0 ^
86b4d41a ^
b6c832d0 ^
945e8eb6 ^
b6c832d0 ^
86b4d41a ^
b6c832d0 ^
945e8eb6 ^
b6c832d0 ^
86b4d41a ^
b6c832d0 ^
945e8eb6 ^
b6c832d0 ^
86b4d41a ^
b6c832d0 ^
b63d287c ^
79de4059 ^
b6c832d0 ^

86b4d41a ^
b6c832d0 ^
945e8eb6 ^
b6c832d0 ^
79de4059 ^





b6c832d0 ^




8f8c57cc ^
945e8eb6 ^
b6c832d0 ^
945e8eb6 ^
86b4d41a ^
b6c832d0 ^
95586cc2 ^
b6c832d0 ^
945e8eb6 ^
b6c832d0 ^
945e8eb6 ^

cbcc3a1e ^









945e8eb6 ^
b6c832d0 ^
945e8eb6 ^

327b7c16 ^
cbcc3a1e ^




327b7c16 ^
cbcc3a1e ^
945e8eb6 ^





3f6f7118 ^













945e8eb6 ^


3f6f7118 ^
945e8eb6 ^
3f6f7118 ^

b6c832d0 ^
3f6f7118 ^











b223937f ^
3f6f7118 ^
b223937f ^
3f6f7118 ^





fde43024 ^
3f6f7118 ^



fde43024 ^
945e8eb6 ^
b6c832d0 ^
945e8eb6 ^







3f6f7118 ^

945e8eb6 ^
3f6f7118 ^

945e8eb6 ^
3f6f7118 ^







945e8eb6 ^
3f6f7118 ^
945e8eb6 ^



3f6f7118 ^
945e8eb6 ^
3f6f7118 ^






945e8eb6 ^







b6c832d0 ^
945e8eb6 ^

9c512bba ^
945e8eb6 ^
b6c832d0 ^
a735f5ad ^
b6c832d0 ^

95586cc2 ^
b6c832d0 ^

a2a1ab1e ^
b6c832d0 ^


3f6f7118 ^
b6c832d0 ^

945e8eb6 ^
9c512bba ^
3f6f7118 ^

9c512bba ^
b6c832d0 ^
1a6a3318 ^
a735f5ad ^
b6c832d0 ^

9c512bba ^


b6c832d0 ^

b6c832d0 ^
1a6a3318 ^
9c512bba ^
b6c832d0 ^

945e8eb6 ^
79de4059 ^
9c512bba ^




79de4059 ^



























4525eb4b ^
79de4059 ^

aa7067e1 ^

b223937f ^








13278785 ^
b223937f ^


13278785 ^
b223937f ^
13278785 ^








b223937f ^
b223937f ^


















945e8eb6 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555