machinatrix
A very silly Matrix bot written in C
|
HTML utility functions. More...
#include <stdbool.h>
#include <stdio.h>
#include "common.h"
#include <tidy.h>
Go to the source code of this file.
Functions | |
bool | list_has_class (const char *s, const char *cls) |
Checks if space-separated list l contains the class c . | |
bool | node_has_class (TidyNode node, const char *cls) |
Checks whether cls is one of the classes of p node. | |
TidyNode | find_node_by_name (TidyNode node, const char *name) |
Searches a list for a given name. | |
TidyNode | find_node_by_name_prefix (TidyNode node, const char *name) |
Searches a list for a given name prefix. | |
TidyNode | find_node_by_class (TidyNode node, const char *cls, bool rec) |
Searches a list or tree for an element with a given lcass. | |
TidyNode | find_node_by_id (TidyNode node, const char *id, bool rec) |
Searches a list or tree for a given ID. | |
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). | |
TidyAttr | find_attr (TidyNode node, const char *name) |
Finds a node attribute by name. | |
void | trim_tag (const unsigned char **b, const unsigned char **e) |
Moves both pointers to remove an HTML tag from the beginning/end. | |
void | print_unescaped (FILE *f, const unsigned char *s) |
Writes the HTML string without tags. | |
HTML utility functions.
TidyAttr find_attr | ( | TidyNode | node, |
const char * | name ) |
Finds a node attribute by name.
TidyNode find_node_by_class | ( | TidyNode | node, |
const char * | cls, | ||
bool | rec ) |
Searches a list or tree for an element with a given lcass.
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).
TidyNode find_node_by_id | ( | TidyNode | node, |
const char * | id, | ||
bool | rec ) |
Searches a list or tree for a given ID.
TidyNode find_node_by_name | ( | TidyNode | node, |
const char * | name ) |
Searches a list for a given name.
TidyNode find_node_by_name_prefix | ( | TidyNode | node, |
const char * | name ) |
Searches a list for a given name prefix.
bool list_has_class | ( | const char * | s, |
const char * | cls ) |
Checks if space-separated list l
contains the class c
.
bool node_has_class | ( | TidyNode | node, |
const char * | cls ) |
Checks whether cls
is one of the classes of p node.
void print_unescaped | ( | FILE * | f, |
const unsigned char * | s ) |
Writes the HTML string without tags.
void trim_tag | ( | const unsigned char ** | b, |
const unsigned char ** | e ) |
Moves both pointers to remove an HTML tag from the beginning/end.