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)    { STATIC_DOM_STRING(str), DOM_SELECT_PSEUDO_##type }
 
#define get_element_relation(sel)    ((sel)->match.element & DOM_SELECT_RELATION_FLAGS)
 
#define has_attribute_match(selector, name)    ((selector)->match.attribute & (name))
 
#define get_dom_select_state(stack, state)    ((struct dom_select_state *) get_dom_stack_state_data((stack)->contexts[0], state))
 
#define has_element_match(selector, name)    ((selector)->match.element & (name))
 
#define get_dom_select_data(stack)   ((stack)->current->data)
 

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)    ((stack)->current->data)

◆ get_dom_select_state

#define get_dom_select_state ( stack,
state )    ((struct dom_select_state *) get_dom_stack_state_data((stack)->contexts[0], state))

◆ get_element_relation

#define get_element_relation ( sel)     ((sel)->match.element & DOM_SELECT_RELATION_FLAGS)

◆ has_attribute_match

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

◆ has_element_match

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

◆ INIT_DOM_SELECT_PSEUDO_STRING

#define INIT_DOM_SELECT_PSEUDO_STRING ( str,
type )    { STATIC_DOM_STRING(str), DOM_SELECT_PSEUDO_##type }

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

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

◆ get_dom_select_pseudo()

static unsigned int get_dom_select_pseudo ( struct dom_scanner_token * token)
static

◆ get_scanner_token_number()

static 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()

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

◆ match_attribute_value()

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

◆ match_element_relation()

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

◆ match_element_selector()

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

◆ parse_dom_select()

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

◆ parse_dom_select_attribute()

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

◆ parse_dom_select_nth_arg()

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

◆ parse_dom_select_pseudo()

static 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