machinatrix
A very silly Matrix bot written in C
Loading...
Searching...
No Matches
html.h File Reference

HTML utility functions. More...

#include <stdbool.h>
#include <stdio.h>
#include "common.h"
#include <tidy.h>
Include dependency graph for html.h:
This graph shows which files directly or indirectly include this file:

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.
 

Detailed Description

HTML utility functions.

Function Documentation

◆ find_attr()

TidyAttr find_attr ( TidyNode node,
const char * name )

Finds a node attribute by name.

◆ find_node_by_class()

TidyNode find_node_by_class ( TidyNode node,
const char * cls,
bool rec )

Searches a list or tree for an element with a given lcass.

◆ find_node_by_content()

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).

◆ find_node_by_id()

TidyNode find_node_by_id ( TidyNode node,
const char * id,
bool rec )

Searches a list or tree for a given ID.

◆ find_node_by_name()

TidyNode find_node_by_name ( TidyNode node,
const char * name )

Searches a list for a given name.

◆ find_node_by_name_prefix()

TidyNode find_node_by_name_prefix ( TidyNode node,
const char * name )

Searches a list for a given name prefix.

◆ list_has_class()

bool list_has_class ( const char * s,
const char * cls )

Checks if space-separated list l contains the class c.

Here is the call graph for this function:

◆ node_has_class()

bool node_has_class ( TidyNode node,
const char * cls )

Checks whether cls is one of the classes of p node.

◆ print_unescaped()

void print_unescaped ( FILE * f,
const unsigned char * s )

Writes the HTML string without tags.

◆ trim_tag()

void trim_tag ( const unsigned char ** b,
const unsigned char ** e )

Moves both pointers to remove an HTML tag from the beginning/end.