mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Reorder some struct and fix some comments
This commit is contained in:
parent
2a24ad9099
commit
edee14699e
@ -10,6 +10,26 @@ struct dom_stack;
|
||||
|
||||
typedef void (*dom_stack_callback_T)(struct dom_stack *, struct dom_node *, void *);
|
||||
|
||||
#define DOM_STACK_MAX_DEPTH 4096
|
||||
|
||||
struct dom_stack_state {
|
||||
struct dom_node *node;
|
||||
|
||||
/* Used for recording which node list are currently being 'decended'
|
||||
* into. E.g. whether we are iterating all child elements or attributes
|
||||
* of an element. */
|
||||
struct dom_node_list *list;
|
||||
/* The index (in the list above) which are currently being handled. */
|
||||
size_t index;
|
||||
|
||||
/* The depth of the state in the stack. This is amongst other things
|
||||
* used to get the state object data. */
|
||||
unsigned int depth;
|
||||
|
||||
/* Wether this stack state can be popped with pop_dom_*() family. */
|
||||
unsigned int immutable:1;
|
||||
};
|
||||
|
||||
struct dom_stack_context_info {
|
||||
/* The @object_size member tells whether the stack should allocate
|
||||
* objects for each state to be assigned to the state's @data member.
|
||||
@ -33,26 +53,6 @@ struct dom_stack_context {
|
||||
struct dom_stack_context_info *info;
|
||||
};
|
||||
|
||||
#define DOM_STACK_MAX_DEPTH 4096
|
||||
|
||||
struct dom_stack_state {
|
||||
struct dom_node *node;
|
||||
|
||||
/* Used for recording which node list are currently being 'decended'
|
||||
* into. E.g. whether we are iterating all child elements or attributes
|
||||
* of an element. */
|
||||
struct dom_node_list *list;
|
||||
/* The index (in the list above) which are currently being handled. */
|
||||
size_t index;
|
||||
|
||||
/* The depth of the state in the stack. This is amongst other things
|
||||
* used to get the state object data. */
|
||||
unsigned int depth;
|
||||
|
||||
/* Wether this stack state can be popped with pop_dom_*() family. */
|
||||
unsigned int immutable:1;
|
||||
};
|
||||
|
||||
enum dom_stack_flag {
|
||||
/* Keep nodes when popping them or call done_dom_node() on them. */
|
||||
DOM_STACK_KEEP_NODES = 1,
|
||||
@ -68,9 +68,12 @@ struct dom_stack {
|
||||
|
||||
enum dom_stack_flag flags;
|
||||
|
||||
/* Callbacks which should be called for the pushed and popped nodes. */
|
||||
/* Contexts for the pushed and popped nodes. */
|
||||
struct dom_stack_context *contexts;
|
||||
size_t contexts_size;
|
||||
|
||||
/* The current context. XXX: Only meaningful within
|
||||
* dom_stack_callback_T functions. */
|
||||
struct dom_stack_context *current;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user