• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/contrib/mtree/

Lines Matching refs: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 ||
228 centry->type != F_DIR)
231 last = root = centry;
237 centry->parent = pathparent;
238 addchild(pathparent, centry);
239 last = centry;
240 } else if (strcmp(centry->name, ".") == 0) {
244 replacenode(root, centry);
250 centry->parent = last;
251 addchild(last, centry);
252 last = centry;
259 centry->parent = last->parent;
260 addchild(last->parent, centry);
261 last = centry;
714 * Add the centry node as a child of the pathparent node. If
715 * centry is a duplicate, call replacenode(). If centry is not
720 addchild(NODE *pathparent, NODE *centry)
722 NODE *samename; /* node with the same name as centry */
723 NODE *replacepos; /* if non-NULL, centry should replace this node */
724 NODE *insertpos; /* if non-NULL, centry should be inserted
736 /* centry is pathparent's first and only child node so far */
737 pathparent->child = centry;
743 * centry node to the list.
751 if (strcmp(centry->name, cur->name) == 0) {
755 cmp = nodecmp(centry, cur);
778 * free the information in the centry node.
780 replacenode(samename, centry);
799 * Make centry point to the just-replaced node. Unlink
803 centry = samename;
804 if (centry->prev)
805 centry->prev->next = centry->next;
807 /* centry->next is the new head of the list */
808 pathparent->child = centry->next;
809 assert(centry->next != NULL);
811 if (centry->next)
812 centry->next->prev = centry->prev;
813 centry->prev = NULL;
814 centry->next = NULL;
818 /* insert centry at the beginning of the list */
819 pathparent->child->prev = centry;
820 centry->next = pathparent->child;
821 centry->prev = NULL;
822 pathparent->child = centry;
824 /* insert centry into the list just after insertpos */
825 centry->next = insertpos->next;
826 insertpos->next = centry;
827 centry->prev = insertpos;
828 if (centry->next)
829 centry->next->prev = centry;