about summary refs log tree commit diff stats
path: root/src/LYStyle.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/LYStyle.c
parent84271e583d80f546251ea914a33f8c537fddbac7 (diff)
downloadlynx-snapshots-2a94396ccd9cf5ade728c53e02cba28e06af4378.tar.gz
snapshot of project "lynx", label v2-8-1dev_7
Diffstat (limited to 'src/LYStyle.c')
-rw-r--r--src/LYStyle.c33
1 files changed, 11 insertions, 22 deletions
diff --git a/src/LYStyle.c b/src/LYStyle.c
index 3953621f..af21fdd3 100644
--- a/src/LYStyle.c
+++ b/src/LYStyle.c
@@ -1,6 +1,6 @@
 /* character level styles for Lynx
  * (c) 1996 Rob Partington -- donated to the Lyncei (if they want it :-)
- * @Id: LYStyle.c 1.17 Wed, 25 Mar 1998 06:58:54 -0700 dickey @
+ * @Id: LYStyle.c 1.18 Thu, 23 Apr 1998 06:35:21 -0600 dickey @
  */
 #include <HTUtils.h>
 #include <HTML.h>
@@ -60,8 +60,7 @@ PRIVATE void parse_attributes ARGS5(char*,mono,char*,fg,char*,bg,int,style,char*
     int mA = 0, fA = default_fg, bA = default_bg, cA = A_NORMAL;
     int newstyle = hash_code(element);
 
-    if (TRACE)
-	fprintf(stderr, "CSS(PA):style d=%d / h=%d, e=%s\n", style, newstyle,element);
+    CTRACE(tfp, "CSS(PA):style d=%d / h=%d, e=%s\n", style, newstyle,element);
 
     for (i = 0; i <7; i++)
     {
@@ -70,8 +69,7 @@ PRIVATE void parse_attributes ARGS5(char*,mono,char*,fg,char*,bg,int,style,char*
 	    mA = ncursesMono[i];
 	}
     }
-    if (TRACE)
-	fprintf(stderr, "CSS(CP):%d\n", colorPairs);
+    CTRACE(tfp, "CSS(CP):%d\n", colorPairs);
 
     fA = check_color(fg, default_fg);
     bA = check_color(bg, default_bg);
@@ -177,13 +175,9 @@ where OBJECT is one of EM,STRONG,B,I,U,BLINK etc.\n\n", buffer);
 	}
     }
 
-    if (TRACE)
-    {
-	int bkt = hash_code(element);
-	fprintf(stderr, "CSSPARSE:%s => %d %s\n",
-	    element, bkt,
-	    (hashStyles[bkt].name ? "used" : ""));
-    }
+    CTRACE(tfp, "CSSPARSE:%s => %d %s\n",
+		element, hash_code(element),
+		(hashStyles[hash_code(element)].name ? "used" : ""));
 
     strtolower(element);
 
@@ -235,8 +229,7 @@ where OBJECT is one of EM,STRONG,B,I,U,BLINK etc.\n\n", buffer);
 	{
 	    if (!strcasecomp (HTML_dtd.tags[i].name, element))
 	    {
-		if (TRACE)
-		    fprintf(stderr, "PARSECSS:applying style <%s,%s,%s> for HTML_%s\n",mono,fg,bg,HTML_dtd.tags[i].name);
+		CTRACE(tfp, "PARSECSS:applying style <%s,%s,%s> for HTML_%s\n",mono,fg,bg,HTML_dtd.tags[i].name);
 			parse_attributes(mono,fg,bg,i+STARTAT,element);
 		break;
 	    }
@@ -318,8 +311,7 @@ PUBLIC void parse_userstyles NOARGS
 
 	while ((name = HTList_nextObject(cur)) != NULL)
 	{
-		if (TRACE)
-			fprintf(stderr, "LSS:%s\n", name ? name : "!?! empty !?!");
+		CTRACE(tfp, "LSS:%s\n", name ? name : "!?! empty !?!");
 		if (name != NULL)
 		    parse_style(name);
 	}
@@ -334,8 +326,7 @@ PUBLIC void HStyle_addStyle ARGS1(char*,buffer)
 	if (lss_styles == NULL)
 		lss_styles = HTList_new();
 	strtolower(name);
-	if (TRACE)
-		fprintf(stderr, "READCSS:%s\n", name ? name : "!?! empty !?!");
+	CTRACE(tfp, "READCSS:%s\n", name ? name : "!?! empty !?!");
 	HTList_addObject (lss_styles, name);
 }
 
@@ -366,16 +357,14 @@ PUBLIC int style_readFromFile ARGS1(char*, file)
     char buffer[1024];
     int len;
 
-    if (TRACE)
-	fprintf(stderr, "CSS:Reading styles from file: %s\n", file ? file : "?!? empty ?!?");
+    CTRACE(tfp, "CSS:Reading styles from file: %s\n", file ? file : "?!? empty ?!?");
     if (file == NULL || *file == '\0')
 	return -1;
     fh = fopen(file, "r");
     if (!fh)
     {
 	/* this should probably be an alert or something */
-	if (TRACE)
-	    fprintf(stderr, "CSS:Can't open style file %s, using defaults\n", file);
+	CTRACE(tfp, "CSS:Can't open style file %s, using defaults\n", file);
 	return -1;
     }