machinatrix
A very silly Matrix bot written in C
Loading...
Searching...
No Matches
html.h
Go to the documentation of this file.
1
5#include <stdbool.h>
6#include <stdio.h>
7
8#include "common.h"
9
10#include <tidy.h>
11
13bool list_has_class(const char *s, const char *cls);
14
16bool node_has_class(TidyNode node, const char *cls);
17
19TidyNode find_node_by_name(TidyNode node, const char *name);
20
22TidyNode find_node_by_name_prefix(TidyNode node, const char *name);
23
25TidyNode find_node_by_class(TidyNode node, const char *cls, bool rec);
26
28TidyNode find_node_by_id(TidyNode node, const char *id, bool rec);
29
32 TidyDoc doc, TidyNode node, const char *s, TidyBuffer *b, bool rec);
33
35TidyAttr find_attr(TidyNode node, const char *name);
36
38void trim_tag(const unsigned char **b, const unsigned char **e);
39
41void print_unescaped(FILE *f, const unsigned char *s);
TidyNode find_node_by_class(TidyNode node, const char *cls, bool rec)
Searches a list or tree for an element with a given lcass.
Definition html.c:43
bool node_has_class(TidyNode node, const char *cls)
Checks whether cls is one of the classes of p node.
Definition html.c:18
TidyNode find_node_by_name(TidyNode node, const char *name)
Searches a list for a given name.
Definition html.c:24
TidyNode find_node_by_id(TidyNode node, const char *id, bool rec)
Searches a list or tree for a given ID.
Definition html.c:56
void trim_tag(const unsigned char **b, const unsigned char **e)
Moves both pointers to remove an HTML tag from the beginning/end.
Definition html.c:112
bool list_has_class(const char *s, const char *cls)
Checks if space-separated list l contains the class c.
Definition html.c:7
TidyAttr find_attr(TidyNode node, const char *name)
Finds a node attribute by name.
Definition html.c:97
void print_unescaped(FILE *f, const unsigned char *s)
Writes the HTML string without tags.
Definition html.c:133
TidyNode find_node_by_content(TidyDoc doc, TidyNode node, const char *s, TidyBuffer *b, bool rec)
Searches a list or tree for an element containing a text (substring).
Definition html.c:76
TidyNode find_node_by_name_prefix(TidyNode node, const char *name)
Searches a list for a given name prefix.
Definition html.c:33