Import version of libhtml that might actually work with ANSI C.
This commit is contained in:
parent
3e3817f7c8
commit
7cf289ca89
13 changed files with 7206 additions and 0 deletions
83
src/libhtml/runetab.c
Normal file
83
src/libhtml/runetab.c
Normal file
|
|
@ -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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue