ELinks 0.18.0
select.c File Reference
#include "elinks.h"
#include "dom/css/scanner.h"
#include "dom/code.h"
#include "dom/node.h"
#include "dom/scanner.h"
#include "dom/select.h"
#include "dom/stack.h"
#include "dom/string.h"
#include "util/memory.h"
Include dependency graph for select.c:

Data Structures

struct  dom_select_data
struct  dom_select_state

Macros

#define INIT_DOM_SELECT_PSEUDO_STRING(str, type)
#define get_element_relation(sel)
#define has_attribute_match(selector, name)
#define get_dom_select_state(stack, state)
#define has_element_match(selector, name)
#define get_dom_select_data(stack)

Functions

static unsigned int get_dom_select_pseudo (struct dom_scanner_token *token)
static enum dom_code parse_dom_select_attribute (struct dom_select_node *sel, struct dom_scanner *scanner)
static size_t get_scanner_token_number (struct dom_scanner_token *token)
static enum dom_code parse_dom_select_nth_arg (struct dom_select_nth_match *nth, struct dom_scanner *scanner)
static enum dom_code parse_dom_select_pseudo (struct dom_select *select, struct dom_select_node *sel, struct dom_scanner *scanner)
static enum dom_code parse_dom_select (struct dom_select *select, struct dom_stack *stack, struct dom_string *string)
struct dom_selectinit_dom_select (enum dom_select_syntax syntax, struct dom_string *string)
void done_dom_select (struct dom_select *select)
static struct dom_select_nodeget_child_dom_select_node (struct dom_select_node *selector, enum dom_node_type type)
static int match_attribute_value (struct dom_select_node *selector, struct dom_node *node)
static int match_attribute_selectors (struct dom_select_node *base, struct dom_node *node)
static int match_element_relation (struct dom_select_node *selector, struct dom_node *node, struct dom_stack *stack)
static int match_element_selector (struct dom_select_node *selector, struct dom_node *node, struct dom_stack *stack)
enum dom_code dom_select_push_element (struct dom_stack *stack, struct dom_node *node, void *data)
enum dom_code dom_select_pop_element (struct dom_stack *stack, struct dom_node *node, void *data)
enum dom_code dom_select_push_text (struct dom_stack *stack, struct dom_node *node, void *data)
struct dom_node_listselect_dom_nodes (struct dom_select *select, struct dom_node *root)

Variables

static struct dom_stack_context_info dom_select_context_info
static struct dom_stack_context_info dom_select_data_context_info

Macro Definition Documentation

◆ get_dom_select_data

#define get_dom_select_data ( stack)
Value:
((stack)->current->data)

◆ get_dom_select_state

#define get_dom_select_state ( stack,
state )
Value:
((struct dom_select_state *) get_dom_stack_state_data((stack)->contexts[0], state))
static void * get_dom_stack_state_data(struct dom_stack_context *context, struct dom_stack_state *state)
Access context specific state data.
Definition stack.h:195
Definition select.c:584

◆ get_element_relation

#define get_element_relation ( sel)
Value:
((sel)->match.element & DOM_SELECT_RELATION_FLAGS)
@ DOM_SELECT_RELATION_FLAGS
Definition select.h:28

◆ has_attribute_match

#define has_attribute_match ( selector,
name )
Value:
((selector)->match.attribute & (name))

◆ has_element_match

#define has_element_match ( selector,
name )
Value:
((selector)->match.element & (name))

◆ INIT_DOM_SELECT_PSEUDO_STRING

#define INIT_DOM_SELECT_PSEUDO_STRING ( str,
type )
Value:
{ STATIC_DOM_STRING(str), DOM_SELECT_PSEUDO_##type }
#define STATIC_DOM_STRING(strvalue)
Definition string.h:25
const char * type
Definition download.c:1899

Function Documentation

◆ dom_select_pop_element()

enum dom_code dom_select_pop_element ( struct dom_stack * stack,
struct dom_node * node,
void * data )

◆ dom_select_push_element()

enum dom_code dom_select_push_element ( struct dom_stack * stack,
struct dom_node * node,
void * data )

◆ dom_select_push_text()

enum dom_code dom_select_push_text ( struct dom_stack * stack,
struct dom_node * node,
void * data )

◆ done_dom_select()

void done_dom_select ( struct dom_select * select)

◆ get_child_dom_select_node()

struct dom_select_node * get_child_dom_select_node ( struct dom_select_node * selector,
enum dom_node_type type )
static

◆ get_dom_select_pseudo()

unsigned int get_dom_select_pseudo ( struct dom_scanner_token * token)
static

◆ get_scanner_token_number()

size_t get_scanner_token_number ( struct dom_scanner_token * token)
static

◆ init_dom_select()

struct dom_select * init_dom_select ( enum dom_select_syntax syntax,
struct dom_string * string )

◆ match_attribute_selectors()

int match_attribute_selectors ( struct dom_select_node * base,
struct dom_node * node )
static

◆ match_attribute_value()

int match_attribute_value ( struct dom_select_node * selector,
struct dom_node * node )
static

◆ match_element_relation()

int match_element_relation ( struct dom_select_node * selector,
struct dom_node * node,
struct dom_stack * stack )
static

◆ match_element_selector()

int match_element_selector ( struct dom_select_node * selector,
struct dom_node * node,
struct dom_stack * stack )
static

◆ parse_dom_select()

enum dom_code parse_dom_select ( struct dom_select * select,
struct dom_stack * stack,
struct dom_string * string )
static

◆ parse_dom_select_attribute()

enum dom_code parse_dom_select_attribute ( struct dom_select_node * sel,
struct dom_scanner * scanner )
static

◆ parse_dom_select_nth_arg()

enum dom_code parse_dom_select_nth_arg ( struct dom_select_nth_match * nth,
struct dom_scanner * scanner )
static

◆ parse_dom_select_pseudo()

enum dom_code parse_dom_select_pseudo ( struct dom_select * select,
struct dom_select_node * sel,
struct dom_scanner * scanner )
static

◆ select_dom_nodes()

struct dom_node_list * select_dom_nodes ( struct dom_select * select,
struct dom_node * root )

Variable Documentation

◆ dom_select_context_info

struct dom_stack_context_info dom_select_context_info
static

◆ dom_select_data_context_info

struct dom_stack_context_info dom_select_data_context_info
static