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>2011-06-06 10:46:18 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2011-06-06 10:46:18 -0400
commit928b460051be016d0035c90bb94f4168db68386b (patch)
treee3040eca769ed0e09c08bc543dc3ba10ce5cb3fc /src/LYStyle.c
parent080f88a781524b40f3e5de4b10c8f22b0e7b87e4 (diff)
downloadlynx-snapshots-928b460051be016d0035c90bb94f4168db68386b.tar.gz
snapshot of project "lynx", label v2-8-8dev_8k
Diffstat (limited to 'src/LYStyle.c')
-rw-r--r--src/LYStyle.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/src/LYStyle.c b/src/LYStyle.c
index 61dc30d4..0b891869 100644
--- a/src/LYStyle.c
+++ b/src/LYStyle.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYStyle.c,v 1.69 2010/09/24 22:07:20 tom Exp $
+ * $LynxId: LYStyle.c,v 1.70 2011/06/06 09:28:29 tom Exp $
  *
  * character level styles for Lynx
  * (c) 1996 Rob Partington -- donated to the Lyncei (if they want it :-)
@@ -51,16 +51,6 @@ int last_styles[MAX_LAST_STYLES + 1] =
 int last_colorattr_ptr = 0;
 
 bucket hashStyles[CSHASHSIZE];
-bucket special_bucket =
-{
-    "<special>",		/* in order something to be in trace. */
-    0, 0, 0, 0, NULL
-};
-bucket nostyle_bucket =
-{
-    "<NOSTYLE>",		/* in order something to be in trace. */
-    0, 0, 0, 0, NULL
-};
 
 int cached_tag_styles[HTML_ELEMENTS];
 int current_tag_style;
@@ -119,6 +109,28 @@ static unsigned char our_pairs[2]
 [MAX_COLOR + 1]
 [MAX_COLOR + 1];
 
+static bucket *new_bucket(const char *name)
+{
+    bucket *result = typecalloc(bucket);
+
+    if (!result)
+	outofmem(__FILE__, "new_bucket");
+    StrAllocCopy(result->name, name);
+    return result;
+}
+
+#if OMIT_SCN_KEEPING
+bucket *special_bucket(void)
+{
+    return new_bucket("<special>");
+}
+#endif
+
+bucket *nostyle_bucket(void)
+{
+    return new_bucket("<NOSTYLE>");
+}
+
 static char *TrimLowercase(char *buffer)
 {
     LYRemoveBlanks(buffer);