php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
state.h File Reference

Go to the source code of this file.

Macros

#define lxb_html_tokenizer_state_begin_set(tkz, v_data)
 
#define lxb_html_tokenizer_state_append_data_m(tkz, v_data)
 
#define lxb_html_tokenizer_state_append_m(tkz, v_data, size)
 
#define lxb_html_tokenizer_state_append_replace_m(tkz)
 
#define lxb_html_tokenizer_state_set_tag_m(tkz, _start, _end)
 
#define lxb_html_tokenizer_state_set_name_m(tkz)
 
#define lxb_html_tokenizer_state_set_value_m(tkz)
 
#define lxb_html_tokenizer_state_token_set_begin(tkz, v_begin)
 
#define lxb_html_tokenizer_state_token_set_end(tkz, v_end)
 
#define lxb_html_tokenizer_state_token_set_end_down(tkz, v_end, offset)
 
#define lxb_html_tokenizer_state_token_set_end_oef(tkz)
 
#define lxb_html_tokenizer_state_token_attr_add_m(tkz, attr, v_return)
 
#define lxb_html_tokenizer_state_token_attr_set_name_begin(tkz, v_begin)
 
#define lxb_html_tokenizer_state_token_attr_set_name_end(tkz, v_end)
 
#define lxb_html_tokenizer_state_token_attr_set_name_end_oef(tkz)
 
#define lxb_html_tokenizer_state_token_attr_set_value_begin(tkz, v_begin)
 
#define lxb_html_tokenizer_state_token_attr_set_value_end(tkz, v_end)
 
#define lxb_html_tokenizer_state_token_attr_set_value_end_oef(tkz)
 
#define _lxb_html_tokenizer_state_token_done_m(tkz, v_end)
 
#define lxb_html_tokenizer_state_token_done_m(tkz, v_end)
 
#define lxb_html_tokenizer_state_token_done_wo_check_m(tkz, v_end)
 
#define lxb_html_tokenizer_state_set_text(tkz)
 
#define lxb_html_tokenizer_state_token_emit_text_not_empty_m(tkz, v_end)
 

Functions

LXB_API const lxb_char_tlxb_html_tokenizer_state_data_before (lxb_html_tokenizer_t *tkz, const lxb_char_t *data, const lxb_char_t *end)
 
LXB_API const lxb_char_tlxb_html_tokenizer_state_plaintext_before (lxb_html_tokenizer_t *tkz, const lxb_char_t *data, const lxb_char_t *end)
 
LXB_API const lxb_char_tlxb_html_tokenizer_state_before_attribute_name (lxb_html_tokenizer_t *tkz, const lxb_char_t *data, const lxb_char_t *end)
 
LXB_API const lxb_char_tlxb_html_tokenizer_state_self_closing_start_tag (lxb_html_tokenizer_t *tkz, const lxb_char_t *data, const lxb_char_t *end)
 
LXB_API const lxb_char_tlxb_html_tokenizer_state_cr (lxb_html_tokenizer_t *tkz, const lxb_char_t *data, const lxb_char_t *end)
 
LXB_API const lxb_char_tlxb_html_tokenizer_state_char_ref (lxb_html_tokenizer_t *tkz, const lxb_char_t *data, const lxb_char_t *end)
 

Macro Definition Documentation

◆ _lxb_html_tokenizer_state_token_done_m

#define _lxb_html_tokenizer_state_token_done_m ( tkz,
v_end )
Value:
tkz->token = tkz->callback_token_done(tkz, tkz->token, \
tkz->callback_token_ctx); \
if (tkz->token == NULL) { \
if (tkz->status == LXB_STATUS_OK) { \
tkz->status = LXB_STATUS_ERROR; \
} \
return v_end; \
}
@ LXB_STATUS_OK
Definition base.h:49
@ LXB_STATUS_ERROR
Definition base.h:50
#define NULL
Definition gdcache.h:45

Definition at line 147 of file state.h.

◆ lxb_html_tokenizer_state_append_data_m

#define lxb_html_tokenizer_state_append_data_m ( tkz,
v_data )
Value:
do { \
return end; \
} \
} \
while (0)
lxb_inline lxb_status_t lxb_html_tokenizer_temp_append_data(lxb_html_tokenizer_t *tkz, const lxb_char_t *data)
Definition tokenizer.h:272
unsigned const char * end
Definition php_ffi.h:51

Definition at line 19 of file state.h.

◆ lxb_html_tokenizer_state_append_m

#define lxb_html_tokenizer_state_append_m ( tkz,
v_data,
size )
Value:
do { \
if (lxb_html_tokenizer_temp_append(tkz, (const lxb_char_t *) (v_data), \
(size))) \
{ \
return end; \
} \
} \
while (0)
new_type size
Definition ffi.c:4365
lxb_inline lxb_status_t lxb_html_tokenizer_temp_append(lxb_html_tokenizer_t *tkz, const lxb_char_t *data, size_t size)
Definition tokenizer.h:289
unsigned char lxb_char_t
Definition types.h:27

Definition at line 27 of file state.h.

◆ lxb_html_tokenizer_state_append_replace_m

#define lxb_html_tokenizer_state_append_replace_m ( tkz)
Value:
do { \
lexbor_str_res_ansi_replacement_character, \
sizeof(lexbor_str_res_ansi_replacement_character) - 1))\
{ \
return end; \
} \
} \
while (0)

Definition at line 37 of file state.h.

◆ lxb_html_tokenizer_state_begin_set

#define lxb_html_tokenizer_state_begin_set ( tkz,
v_data )
Value:
(tkz->begin = v_data)

Definition at line 16 of file state.h.

◆ lxb_html_tokenizer_state_set_name_m

#define lxb_html_tokenizer_state_set_name_m ( tkz)
Value:
do { \
data = lxb_dom_attr_local_name_append(tkz->attrs, tkz->start, \
tkz->pos - tkz->start); \
if (data == NULL) { \
return end; \
} \
tkz->token->attr_last->name = data; \
} \
while (0)
@ LXB_STATUS_ERROR_MEMORY_ALLOCATION
Definition base.h:51
LXB_API lxb_dom_attr_data_t * lxb_dom_attr_local_name_append(lexbor_hash_t *hash, const lxb_char_t *name, size_t length)
Definition attr.c:358
zend_constant * data

Definition at line 60 of file state.h.

◆ lxb_html_tokenizer_state_set_tag_m

#define lxb_html_tokenizer_state_set_tag_m ( tkz,
_start,
_end )
Value:
do { \
const lxb_tag_data_t *tag; \
tag = lxb_tag_append_lower(tkz->tags, (_start), (_end) - (_start)); \
if (tag == NULL) { \
return end; \
} \
tkz->token->tag_id = tag->tag_id; \
} \
while (0)
const lxb_tag_data_t * lxb_tag_append_lower(lexbor_hash_t *hash, const lxb_char_t *name, size_t length)
Definition tag.c:41
lxb_tag_id_t tag_id
Definition tag.h:24

Definition at line 48 of file state.h.

◆ lxb_html_tokenizer_state_set_text

#define lxb_html_tokenizer_state_set_text ( tkz)
Value:
do { \
tkz->token->text_start = tkz->start; \
tkz->token->text_end = tkz->pos; \
} \
while (0)

Definition at line 174 of file state.h.

◆ lxb_html_tokenizer_state_set_value_m

#define lxb_html_tokenizer_state_set_value_m ( tkz)
Value:
do { \
lxb_html_token_attr_t *attr = tkz->token->attr_last; \
\
attr->value_size = (size_t) (tkz->pos - tkz->start); \
\
attr->value = lexbor_mraw_alloc(tkz->attrs_mraw, attr->value_size + 1);\
if (attr->value == NULL) { \
return end; \
} \
memcpy(attr->value, tkz->start, attr->value_size); \
attr->value[attr->value_size] = 0x00; \
} \
while (0)
new_type attr
Definition ffi.c:4364
void * lexbor_mraw_alloc(lexbor_mraw_t *mraw, size_t size)
Definition mraw.c:180
struct lxb_html_token_attr lxb_html_token_attr_t
Definition token_attr.h:22

Definition at line 73 of file state.h.

◆ lxb_html_tokenizer_state_token_attr_add_m

#define lxb_html_tokenizer_state_token_attr_add_m ( tkz,
attr,
v_return )
Value:
do { \
attr = lxb_html_token_attr_append(tkz->token, tkz->dobj_token_attr); \
if (attr == NULL) { \
return v_return; \
} \
} \
while (0)
lxb_html_token_attr_t * lxb_html_token_attr_append(lxb_html_token_t *token, lexbor_dobject_t *dobj)
Definition token.c:37

Definition at line 111 of file state.h.

◆ lxb_html_tokenizer_state_token_attr_set_name_begin

#define lxb_html_tokenizer_state_token_attr_set_name_begin ( tkz,
v_begin )
Value:
do { \
tkz->pos = tkz->start; \
tkz->token->attr_last->name_begin = v_begin; \
} \
while (0)

Definition at line 121 of file state.h.

◆ lxb_html_tokenizer_state_token_attr_set_name_end

#define lxb_html_tokenizer_state_token_attr_set_name_end ( tkz,
v_end )
Value:
(tkz->token->attr_last->name_end = v_end)

Definition at line 128 of file state.h.

◆ lxb_html_tokenizer_state_token_attr_set_name_end_oef

#define lxb_html_tokenizer_state_token_attr_set_name_end_oef ( tkz)
Value:
(tkz->token->attr_last->name_end = tkz->last)

Definition at line 131 of file state.h.

◆ lxb_html_tokenizer_state_token_attr_set_value_begin

#define lxb_html_tokenizer_state_token_attr_set_value_begin ( tkz,
v_begin )
Value:
do { \
tkz->pos = tkz->start; \
tkz->token->attr_last->value_begin = v_begin; \
} \
while (0)

Definition at line 134 of file state.h.

◆ lxb_html_tokenizer_state_token_attr_set_value_end

#define lxb_html_tokenizer_state_token_attr_set_value_end ( tkz,
v_end )
Value:
(tkz->token->attr_last->value_end = v_end)

Definition at line 141 of file state.h.

◆ lxb_html_tokenizer_state_token_attr_set_value_end_oef

#define lxb_html_tokenizer_state_token_attr_set_value_end_oef ( tkz)
Value:
(tkz->token->attr_last->value_end = tkz->last)

Definition at line 144 of file state.h.

◆ lxb_html_tokenizer_state_token_done_m

#define lxb_html_tokenizer_state_token_done_m ( tkz,
v_end )
Value:
do { \
if (tkz->token->begin != tkz->token->end) { \
_lxb_html_tokenizer_state_token_done_m(tkz, v_end) \
} \
lxb_html_token_clean(tkz->token); \
tkz->pos = tkz->start; \
} \
while (0)

Definition at line 157 of file state.h.

◆ lxb_html_tokenizer_state_token_done_wo_check_m

#define lxb_html_tokenizer_state_token_done_wo_check_m ( tkz,
v_end )
Value:
do { \
_lxb_html_tokenizer_state_token_done_m(tkz, v_end) \
lxb_html_token_clean(tkz->token); \
} \
while (0)

Definition at line 167 of file state.h.

◆ lxb_html_tokenizer_state_token_emit_text_not_empty_m

#define lxb_html_tokenizer_state_token_emit_text_not_empty_m ( tkz,
v_end )
Value:
do { \
if (tkz->token->begin != tkz->token->end) { \
tkz->token->tag_id = LXB_TAG__TEXT; \
\
lxb_html_tokenizer_state_set_text(tkz); \
_lxb_html_tokenizer_state_token_done_m(tkz, v_end) \
lxb_html_token_clean(tkz->token); \
} \
} \
while (0)
@ LXB_TAG__TEXT
Definition const.h:26

Definition at line 181 of file state.h.

◆ lxb_html_tokenizer_state_token_set_begin

#define lxb_html_tokenizer_state_token_set_begin ( tkz,
v_begin )
Value:
do { \
tkz->pos = tkz->start; \
tkz->token->begin = v_begin; \
tkz->token->line = tkz->current_line; \
tkz->token->column = tkz->current_column; \
} \
while (0)

Definition at line 89 of file state.h.

◆ lxb_html_tokenizer_state_token_set_end

#define lxb_html_tokenizer_state_token_set_end ( tkz,
v_end )
Value:
(tkz->token->end = v_end)

Definition at line 98 of file state.h.

◆ lxb_html_tokenizer_state_token_set_end_down

#define lxb_html_tokenizer_state_token_set_end_down ( tkz,
v_end,
offset )
Value:
do { \
tkz->token->end = lexbor_in_node_pos_down(tkz->incoming_node, NULL, \
v_end, offset); \
} \
while (0)
zend_long offset
const lxb_char_t * lexbor_in_node_pos_down(lexbor_in_node_t *node, lexbor_in_node_t **return_node, const lxb_char_t *pos, size_t offset)
Definition in.c:192

Definition at line 101 of file state.h.

◆ lxb_html_tokenizer_state_token_set_end_oef

#define lxb_html_tokenizer_state_token_set_end_oef ( tkz)
Value:
(tkz->token->end = tkz->last)

Definition at line 108 of file state.h.

Function Documentation

◆ lxb_html_tokenizer_state_before_attribute_name()

LXB_API const lxb_char_t * lxb_html_tokenizer_state_before_attribute_name ( lxb_html_tokenizer_t * tkz,
const lxb_char_t * data,
const lxb_char_t * end )

Definition at line 617 of file state.c.

◆ lxb_html_tokenizer_state_char_ref()

LXB_API const lxb_char_t * lxb_html_tokenizer_state_char_ref ( lxb_html_tokenizer_t * tkz,
const lxb_char_t * data,
const lxb_char_t * end )

Definition at line 1745 of file state.c.

◆ lxb_html_tokenizer_state_cr()

LXB_API const lxb_char_t * lxb_html_tokenizer_state_cr ( lxb_html_tokenizer_t * tkz,
const lxb_char_t * data,
const lxb_char_t * end )

Definition at line 1257 of file state.c.

◆ lxb_html_tokenizer_state_data_before()

LXB_API const lxb_char_t * lxb_html_tokenizer_state_data_before ( lxb_html_tokenizer_t * tkz,
const lxb_char_t * data,
const lxb_char_t * end )

Definition at line 204 of file state.c.

◆ lxb_html_tokenizer_state_plaintext_before()

LXB_API const lxb_char_t * lxb_html_tokenizer_state_plaintext_before ( lxb_html_tokenizer_t * tkz,
const lxb_char_t * data,
const lxb_char_t * end )

Definition at line 321 of file state.c.

◆ lxb_html_tokenizer_state_self_closing_start_tag()

LXB_API const lxb_char_t * lxb_html_tokenizer_state_self_closing_start_tag ( lxb_html_tokenizer_t * tkz,
const lxb_char_t * data,
const lxb_char_t * end )

Definition at line 1275 of file state.c.