Lines Matching defs:cur

74 	fsnode		*first, *cur, *prev, *last;
95 first = cur = join;
96 while (cur->next != NULL)
97 cur = cur->next;
98 prev = cur;
135 cur = join->next;
137 if (cur == NULL || strcmp(cur->name, name) == 0)
139 if (cur == last) {
140 cur = NULL;
143 cur = cur->next;
145 if (cur != NULL) {
146 if (S_ISDIR(cur->type) &&
150 path, cur->child);
151 cur->child = walk_dir(root, rp, cur,
152 cur->child);
157 inode_type(cur->type));
161 cur = create_fsnode(root, dir, name, &stbuf);
162 cur->parent = parent;
165 cur->next = first;
166 first = cur;
168 prev = cur;
169 cur->first = first;
172 prev->next = cur;
173 prev = cur;
175 first = cur;
176 cur->first = first;
177 if (S_ISDIR(cur->type)) {
178 cur->child = walk_dir(root, rp, cur, NULL);
185 curino = link_check(cur->inode);
187 free(cur->inode);
188 cur->inode = curino;
189 cur->inode->nlink++;
196 if (S_ISLNK(cur->type)) {
204 cur->symlink = estrdup(slink);
209 for (cur = first->next; cur != NULL; cur = cur->next)
210 cur->first = first;
220 fsnode *cur;
222 cur = ecalloc(1, sizeof(*cur));
223 cur->path = estrdup(path);
224 cur->name = estrdup(name);
225 cur->inode = ecalloc(1, sizeof(*cur->inode));
226 cur->root = root;
227 cur->type = stbuf->st_mode & S_IFMT;
228 cur->inode->nlink = 1;
229 cur->inode->st = *stbuf;
231 cur->inode->st.st_atime = stampst.st_atime;
232 cur->inode->st.st_mtime = stampst.st_mtime;
233 cur->inode->st.st_ctime = stampst.st_ctime;
235 cur->inode->st.st_atimensec = stampst.st_atimensec;
236 cur->inode->st.st_mtimensec = stampst.st_mtimensec;
237 cur->inode->st.st_ctimensec = stampst.st_ctimensec;
240 cur->inode->st.st_birthtime = stampst.st_birthtime;
241 cur->inode->st.st_birthtimensec = stampst.st_birthtimensec;
244 return (cur);
255 fsnode *cur, *next;
270 for (cur = node->first; cur->next; cur = cur->next) {
271 if (cur->next == node) {
272 cur->next = node->next;
279 for (cur = node; cur != NULL; cur = next) {
280 next = cur->next;
281 if (cur->child) {
282 cur->child->parent = NULL;
283 free_fsnodes(cur->child);
285 if (cur->inode->nlink-- == 1)
286 free(cur->inode);
287 if (cur->symlink)
288 free(cur->symlink);
289 free(cur->path);
290 free(cur->name);
291 free(cur);
555 * dump the fsnodes from `cur'
560 fsnode *cur;
564 for (cur = root; cur != NULL; cur = cur->next) {
565 if (snprintf(path, sizeof(path), "%s/%s", cur->path,
566 cur->name) >= (int)sizeof(path))
570 printf("cur=%8p parent=%8p first=%8p ",
571 cur, cur->parent, cur->first);
572 printf("%7s: %s", inode_type(cur->type), path);
573 if (S_ISLNK(cur->type)) {
574 assert(cur->symlink != NULL);
575 printf(" -> %s", cur->symlink);
577 assert (cur->symlink == NULL);
579 if (cur->inode->nlink > 1)
580 printf(", nlinks=%d", cur->inode->nlink);
583 if (cur->child) {
584 assert (cur->type == S_IFDIR);
585 dump_fsnodes(cur->child);