1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

DOM: rename init_dom_node_ to init_dom_node_at and cleanup the declaration

Only use the __FILE__ and __LINE__ parameters when DEBUG_MEMLEAK is defined
so that they do not end up in the generated documentation.
This commit is contained in:
Jonas Fonseca 2006-12-11 21:21:30 +01:00
parent 1435211cf6
commit 47d27a4d39
2 changed files with 25 additions and 6 deletions

View File

@ -331,7 +331,10 @@ get_dom_node_child(struct dom_node *parent, enum dom_node_type type,
/* Nodes */
struct dom_node *
init_dom_node_(unsigned char *file, int line,
init_dom_node_at(
#ifdef DEBUG_MEMLEAK
unsigned char *file, int line,
#endif
struct dom_node *parent, enum dom_node_type type,
struct dom_string *string, int allocated)
{

View File

@ -318,18 +318,34 @@ get_dom_node_map_entry(struct dom_node_list *node_map,
/* Removes the node and all its children and free()s itself */
void done_dom_node(struct dom_node *node);
#ifndef DEBUG_MEMLEAK
/* The allocated argument is used as the value of node->allocated if >= 0.
* Use -1 to default node->allocated to the value of parent->allocated. */
struct dom_node *
init_dom_node_(unsigned char *file, int line,
struct dom_node *parent, enum dom_node_type type,
struct dom_string *string, int allocated);
init_dom_node_at(struct dom_node *parent, enum dom_node_type type,
struct dom_string *string, int allocated);
#define init_dom_node(type, string, allocated) \
init_dom_node_(__FILE__, __LINE__, NULL, type, string, allocated)
init_dom_node_at(NULL, type, string, allocated)
#define add_dom_node(parent, type, string) \
init_dom_node_(__FILE__, __LINE__, parent, type, string, -1)
init_dom_node_at(parent, type, string, -1)
#else
struct dom_node *
init_dom_node_at(unsigned char *file, int line,
struct dom_node *parent, enum dom_node_type type,
struct dom_string *string, int allocated);
#define init_dom_node(type, string, allocated) \
init_dom_node_at(__FILE__, __LINE__, NULL, type, string, allocated)
#define add_dom_node(parent, type, string) \
init_dom_node_at(__FILE__, __LINE__, parent, type, string, -1)
#endif /* DEBUG_MEMLEAK */
#define add_dom_element(parent, string) \
add_dom_node(parent, DOM_NODE_ELEMENT, string)