version 1.23, 2019/04/21 14:48:11 |
version 1.27, 2019/05/01 11:34:20 |
|
|
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
|
|
|
#include "xmalloc.h" |
#include "node.h" |
#include "node.h" |
|
|
/* |
/* |
Line 31 struct nodeprop { |
|
Line 32 struct nodeprop { |
|
}; |
}; |
|
|
static const struct nodeprop properties[] = { |
static const struct nodeprop properties[] = { |
|
{ "abstract", CLASS_BLOCK }, |
{ "appendix", CLASS_BLOCK }, |
{ "appendix", CLASS_BLOCK }, |
{ "arg", CLASS_ENCL }, |
{ "arg", CLASS_ENCL }, |
{ "author", CLASS_LINE }, |
{ "author", CLASS_LINE }, |
Line 147 static const struct nodeprop properties[] = { |
|
Line 149 static const struct nodeprop properties[] = { |
|
{ "warning", CLASS_BLOCK }, |
{ "warning", CLASS_BLOCK }, |
{ "wordasword", CLASS_TRANS }, |
{ "wordasword", CLASS_TRANS }, |
{ "xref", CLASS_LINE }, |
{ "xref", CLASS_LINE }, |
|
{ "year", CLASS_TRANS }, |
{ "[UNKNOWN]", CLASS_VOID }, |
{ "[UNKNOWN]", CLASS_VOID }, |
{ "(t)", CLASS_TEXT }, |
{ "(t)", CLASS_TEXT }, |
{ "(e)", CLASS_TEXT } |
{ "(e)", CLASS_TEXT } |
Line 252 pnode_alloc(struct pnode *np) |
|
Line 255 pnode_alloc(struct pnode *np) |
|
{ |
{ |
struct pnode *n; |
struct pnode *n; |
|
|
if ((n = calloc(1, sizeof(*n))) != NULL) { |
n = xcalloc(1, sizeof(*n)); |
TAILQ_INIT(&n->childq); |
TAILQ_INIT(&n->childq); |
TAILQ_INIT(&n->attrq); |
TAILQ_INIT(&n->attrq); |
if ((n->parent = np) != NULL) |
if ((n->parent = np) != NULL) |
TAILQ_INSERT_TAIL(&np->childq, n, child); |
TAILQ_INSERT_TAIL(&np->childq, n, child); |
} |
return n; |
|
} |
|
|
|
struct pnode * |
|
pnode_alloc_text(struct pnode *np, const char *text) |
|
{ |
|
struct pnode *n; |
|
|
|
n = pnode_alloc(np); |
|
n->node = NODE_TEXT; |
|
n->b = xstrdup(text); |
return n; |
return n; |
} |
} |
|
|