Lines Matching defs:centry
112 NODE *centry, *last, *pathparent, *cur;
119 centry = last = NULL;
207 if ((centry = calloc(1, sizeof(NODE) + strlen(p))) == NULL)
209 *centry = ginfo;
210 centry->lineno = mtree_lineno;
211 strcpy(centry->name, p);
214 centry->flags |= F_MAGIC;
215 set(next, centry);
225 if (strcmp(centry->name, ".") == 0 && centry->type == 0)
226 centry->type = F_DIR;
227 if (strcmp(centry->name, ".") != 0)
230 " found `%s'", centry->name);
231 if (centry->type != F_DIR)
234 F_DIR, centry->type);
235 last = root = centry;
241 centry->parent = pathparent;
242 addchild(pathparent, centry);
243 last = centry;
244 } else if (strcmp(centry->name, ".") == 0) {
248 replacenode(root, centry);
254 centry->parent = last;
255 addchild(last, centry);
256 last = centry;
263 centry->parent = last->parent;
264 addchild(last->parent, centry);
265 last = centry;
719 * Add the centry node as a child of the pathparent node. If
720 * centry is a duplicate, call replacenode(). If centry is not
725 addchild(NODE *pathparent, NODE *centry)
727 NODE *samename; /* node with the same name as centry */
728 NODE *replacepos; /* if non-NULL, centry should replace this node */
729 NODE *insertpos; /* if non-NULL, centry should be inserted
741 /* centry is pathparent's first and only child node so far */
742 pathparent->child = centry;
748 * centry node to the list.
756 if (strcmp(centry->name, cur->name) == 0) {
760 cmp = nodecmp(centry, cur);
783 * free the information in the centry node.
785 replacenode(samename, centry);
804 * Make centry point to the just-replaced node. Unlink
808 centry = samename;
809 if (centry->prev)
810 centry->prev->next = centry->next;
812 /* centry->next is the new head of the list */
813 pathparent->child = centry->next;
814 assert(centry->next != NULL);
816 if (centry->next)
817 centry->next->prev = centry->prev;
818 centry->prev = NULL;
819 centry->next = NULL;
823 /* insert centry at the beginning of the list */
824 pathparent->child->prev = centry;
825 centry->next = pathparent->child;
826 centry->prev = NULL;
827 pathparent->child = centry;
829 /* insert centry into the list just after insertpos */
830 centry->next = insertpos->next;
831 insertpos->next = centry;
832 centry->prev = insertpos;
833 if (centry->next)
834 centry->next->prev = centry;