aboutsummaryrefslogtreecommitdiff
path: root/src/libhtml/runetab.c
diff options
context:
space:
mode:
authorwkj <devnull@localhost>2004-04-06 19:06:52 +0000
committerwkj <devnull@localhost>2004-04-06 19:06:52 +0000
commit7cf289ca89a7416999ae02330236042b0d37e3db (patch)
tree796d1363a7a53c72c28b199758ee674f1326a510 /src/libhtml/runetab.c
parent3e3817f7c86658f60715dd93768eaf8285807985 (diff)
downloadplan9port-7cf289ca89a7416999ae02330236042b0d37e3db.tar.gz
plan9port-7cf289ca89a7416999ae02330236042b0d37e3db.tar.bz2
plan9port-7cf289ca89a7416999ae02330236042b0d37e3db.zip
Import version of libhtml that might actually work with ANSI C.
Diffstat (limited to 'src/libhtml/runetab.c')
-rw-r--r--src/libhtml/runetab.c83
1 files changed, 83 insertions, 0 deletions
diff --git a/src/libhtml/runetab.c b/src/libhtml/runetab.c
new file mode 100644
index 00000000..abd0a50f
--- /dev/null
+++ b/src/libhtml/runetab.c
@@ -0,0 +1,83 @@
+#include <u.h>
+#include <libc.h>
+#include <draw.h>
+#include <html.h>
+#include "impl.h"
+
+Rune **runeconsttab;
+char *_runeconsttab[] = {
+ " ",
+ " ",
+ "",
+ "#",
+ "+",
+ ", ",
+ "-",
+ "-->",
+ "1",
+ "<",
+ ">",
+ "?",
+ "Index search terms:",
+ "Reset",
+ "Submit",
+ "^0-9",
+ "_ISINDEX_",
+ "_blank",
+ "_fr",
+ "_no_name_submit_",
+ "_parent",
+ "_self",
+ "_top",
+ "application/x-www-form-urlencoded",
+ "circle",
+ "cm",
+ "content-script-type",
+ "disc",
+ "em",
+ "in",
+ "javascript",
+ "jscript",
+ "jscript1.1",
+ "mm",
+ "none",
+ "pi",
+ "pt",
+ "refresh",
+ "select",
+ "square",
+ "textarea",
+};
+
+Rune**
+cvtstringtab(char **tab, int n)
+{
+ int i;
+ Rune **rtab;
+
+ rtab = emalloc(n*sizeof(rtab[0]));
+ for(i=0; i<n; i++)
+ rtab[i] = toStr(tab[i], strlen(tab[i]), US_Ascii);
+ return rtab;
+}
+
+StringInt*
+cvtstringinttab(AsciiInt *tab, int n)
+{
+ int i;
+ StringInt *stab;
+
+ stab = emalloc(n*sizeof(stab[0]));
+ for(i=0; i<n; i++){
+ stab[i].key = toStr(tab[i].key, strlen(tab[i].key), US_Ascii);
+ stab[i].val = tab[i].val;
+ }
+ return stab;
+}
+
+void
+runetabinit(void)
+{
+ runeconsttab = cvtstringtab(_runeconsttab, nelem(_runeconsttab));
+ return;
+}