summaryrefslogtreecommitdiffstats
path: root/hc.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2013-10-05 11:26:38 -0700
committerKaz Kylheku <kaz@kylheku.com>2013-10-05 11:26:38 -0700
commite022ebd1f2b414837b60f434e6db26e2c999207a (patch)
tree69f4b0da06f9b44642bac62906cddcd1005e8924 /hc.c
parent33c2ad9765e7dc34b9c645b304cfd51524056d9e (diff)
downloadhc-e022ebd1f2b414837b60f434e6db26e2c999207a.tar.gz
hc-e022ebd1f2b414837b60f434e6db26e2c999207a.tar.bz2
hc-e022ebd1f2b414837b60f434e6db26e2c999207a.zip
Ground work for supporting attribute filtering.
Diffstat (limited to 'hc.c')
-rw-r--r--hc.c100
1 files changed, 4 insertions, 96 deletions
diff --git a/hc.c b/hc.c
index 4c14e04..3efb28a 100644
--- a/hc.c
+++ b/hc.c
@@ -2,102 +2,10 @@
#include <stdlib.h>
#include <string.h>
#include "hc.h"
+#include "wl.h"
-static int allowed_el_spec[] = {
- tok_el_a,
- tok_el_abbr,
- tok_el_acronym,
- tok_el_address,
- /* tok_el_applet, */
- /* tok_el_area, */
- tok_el_b,
- /* tok_el_base, */
- tok_el_basefont,
- tok_el_bdo,
- tok_el_big,
- tok_el_blockquote,
- /* tok_el_body, */
- tok_el_br,
- /* tok_el_button, */
- tok_el_caption,
- tok_el_center,
- tok_el_cite,
- tok_el_code,
- tok_el_col,
- tok_el_colgroup,
- tok_el_dd,
- tok_el_del,
- tok_el_dfn,
- tok_el_dir,
- tok_el_div,
- tok_el_dl,
- tok_el_dt,
- tok_el_em,
- /* tok_el_fieldset, */
- tok_el_font,
- tok_el_form,
- /* tok_el_frame, */
- /* tok_el_frameset, */
- tok_el_h1,
- tok_el_h2,
- tok_el_h3,
- tok_el_h4,
- tok_el_h5,
- tok_el_h6,
- /* tok_el_head, */
- tok_el_hr,
- /* tok_el_html, */
- tok_el_i,
- /* tok_el_iframe, */
- tok_el_img,
- /* tok_el_input, */
- tok_el_ins,
- tok_el_kbd,
- /* tok_el_label, */
- /* tok_el_legend, */
- tok_el_li,
- /* tok_el_link, */
- /* tok_el_map, */
- /* tok_el_menu, */
- /* tok_el_meta, */
- /* tok_el_noframes, */
- /* tok_el_noscript, */
- /* tok_el_object, */
- tok_el_ol,
- tok_el_optgroup,
- /* tok_el_option, */
- tok_el_p,
- /* tok_el_param, */
- tok_el_pre,
- tok_el_q,
- tok_el_samp,
- /* tok_el_script,*/
- /* tok_el_select, */
- tok_el_small,
- tok_el_span,
- tok_el_strike,
- tok_el_strong,
- tok_el_style,
- tok_el_sub,
- tok_el_sup,
- tok_el_table,
- tok_el_tbody,
- tok_el_td,
- /* tok_el_textarea, */
- tok_el_tfoot,
- tok_el_th,
- tok_el_thead,
- /* tok_el_title, */
- tok_el_tr,
- tok_el_tt,
- tok_el_u,
- tok_el_ul,
- /* tok_el_var, */
- tok_eof,
-};
-
-static int allowed_el[tok_max];
+static allowed_el_t *allowed_el[tok_max];
static const token_t blank;
static token_t pushback;
@@ -253,8 +161,8 @@ static void init(void)
{
int i;
- for (i = 0; allowed_el_spec[i] != tok_eof; i++)
- allowed_el[allowed_el_spec[i]] = 1;
+ for (i = 0; allowed_el_spec[i].type != tok_eof; i++)
+ allowed_el[allowed_el_spec[i].type] = &allowed_el_spec[i];
}
int main(void)