19%define api.prefix {html}
47 for (
size_t i = 0; i <
item.nitems; i++) {
67 struct XML_ParserStruct *parser;
104 for (
size_t r = 0; r < rows_size(
rows); ++r) {
106 for (
size_t c = 0; c < cells_size(&rp->
rp); ++c) {
166 if (c !=
' ')
return true;
202%type <cell>
cell cells
204%type <tbl>
table fonttable
298 $2->u.
p.rows = (rows_t){0};
363 .font = *sfont_back(&html_state->
fontstack)};
364 textspans_append(&html_state->
fitemList, ti);
371 textspans_t *ilist = &html_state->
fitemList;
373 size_t cnt = textspans_size(ilist);
379 for (
size_t i = 0; i < textspans_size(ilist); ++i) {
393 textspans_clear(ilist);
395 htextspans_append(&html_state->
fspanList, lp);
401 htextspans_t *ispan = &html_state->
fspanList;
404 if (!textspans_is_empty(&html_state->
fitemList))
407 size_t cnt = htextspans_size(ispan);
411 for (
size_t i = 0; i < htextspans_size(ispan); ++i) {
418 htextspans_clear(ispan);
434 rows_append(&tbl->
u.
p.
rows, sp);
440 cells_t *
row = &rp->
rp;
441 cells_append(
row, cp);
461 if (html_state->
lbl) {
472 htextspans_clear(&html_state->
fspanList);
486 if ((f.
size < 0.0) && (curfont->
size >= 0.0))
495 sfont_push_back(&html_state->
fontstack, ft);
501 (void)sfont_pop_back(&html_state->
fontstack);
528 textspans_free(&
scanner.parser.fitemList);
529 htextspans_free(&
scanner.parser.fspanList);
531 sfont_free(&
scanner.parser.fontstack);
static void agxbfree(agxbuf *xb)
free any malloced resources
static WUR char * agxbuse(agxbuf *xb)
static char * agxbdisown(agxbuf *xb)
Memory allocation wrappers that exit on failure.
static char * gv_strdup(const char *original)
static void * gv_calloc(size_t nmemb, size_t size)
static void * gv_alloc(size_t size)
static void cleanup(void)
static int cnt(Dict_t *d, Dtlink_t **set)
int clearHTMLlexer(htmlscan_t *scanner)
int initHTMLlexer(htmlscan_t *scanner, char *src, agxbuf *xb, htmlenv_t *env)
void htmlerror(htmlscan_t *scanner, const char *msg)
int htmlparse(htmlscan_t *scanner)
static void cleanTbl(htmltbl_t *tp)
Clean up table if error in parsing.
static void free_ti(textspan_t item)
static void cleanCell(htmlcell_t *cp)
Clean up cell if error in parsing.
static void free_hi(htextspan_t item)
static htmllabel_t * mkLabel(void *obj, label_type_t kind)
Create label, given body and type.
static bool nonSpace(const char *s)
Return 1 if s contains a non-space character.
static void appendFItemList(htmlparserstate_t *html_state, agxbuf *ag)
font text n_font italic text n_italic underline text n_underline overline text n_overline bold text n_bold sup text n_sup sub text n_sub strike text n_strike
static void popFont(htmlparserstate_t *html_state)
static void addRow(htmlparserstate_t *html_state)
underline table n_underline
static void appendFLineList(htmlparserstate_t *html_state, int v)
htmllabel_t * parseHTML(char *txt, int *warn, htmlenv_t *env)
static row_t * lastRow(htmlparserstate_t *html_state)
overline table n_overline
rows T_end_table opt_space
static htmltxt_t * mkText(htmlparserstate_t *html_state)
static void setCell(htmlparserstate_t *html_state, htmlcell_t *cp, void *obj, label_type_t kind)
textitem scanner parser str
static void pushFont(htmlparserstate_t *html_state, textfont_t *fp)
void free_html_text(htmltxt_t *t)
void free_html_label(htmllabel_t *lp, int root)
void free_html_data(htmldata_t *dp)
#define DEFINE_LIST_WITH_DTOR(name, type, dtor)
#define DEFINE_LIST(name, type)
static int table[NTYPES][NTYPES]
result of partitioning available space, part of maze
bool vruled
vertically ruled?
bool hruled
horizontally ruled?
struct htmltbl_t::@73::@75 p
bool hrule
horizontal rule
a non-owning string reference
Non-owning string references.
textspan_t, textfont_t, PostscriptAlias
static tok_t tok(const char *input, const char *separators)
begin tokenization of a new string