Lines Matching refs:np
82 struct node *np;
84 np = calloc(1, sizeof *np);
85 np->cont = sbuf_new_auto();
86 sbuf_clear(np->cont);
87 np->key = sbuf_new_auto();
88 sbuf_clear(np->key);
89 LIST_INIT(&np->children);
90 return (np);
104 struct node *np;
114 np = new_node();
117 np->id = strdup(attr[i+1]);
119 np->ref = strdup(attr[i+1]);
121 np->name = strdup(name);
122 sbuf_cat(np->key, name);
123 sbuf_cat(np->key, "::");
124 np->parent = mt->cur;
125 LIST_INSERT_HEAD(&mt->cur->children, np, siblings);
126 mt->cur = np;
133 struct node *np;
141 LIST_FOREACH(np, &mt->cur->children, siblings) {
142 if (strcmp(np->name, "name"))
144 sbuf_cat(mt->cur->key, sbuf_data(np->cont));
210 print_node(struct node *np)
212 printf("\"%s\" -- \"%s\" -- \"%s\"", np->name, sbuf_data(np->cont), sbuf_data(np->key));
213 if (np->id)
214 printf(" id=\"%s\"", np->id);
215 if (np->ref)
216 printf(" ref=\"%s\"", np->ref);
221 print_tree(struct node *np, int n)
225 indent(n); printf("%s id=%s ref=%s\n", np->name, np->id, np->ref);
226 LIST_FOREACH(np1, &np->children, siblings)
231 sort_node(struct node *np)
236 LIST_FOREACH(np1, &np->children, siblings)
239 np1 = LIST_FIRST(&np->children);