Lines Matching defs:ep

85 	struct entry *ep;
89 for (ep = entry[inum % entrytblsize]; ep != NULL; ep = ep->e_next)
90 if (ep->e_ino == inum)
91 return (ep);
144 struct entry *ep;
149 for (ep = lookupino(ROOTINO); ep != NULL; ep = ep->e_entries) {
156 for ( ; ep != NULL; ep = ep->e_sibling)
157 if (strcmp(ep->e_name, buf) == 0)
159 if (ep == NULL)
162 return (ep);
173 struct entry *ep;
180 ep = lookupname(name);
182 if (ep == NULL)
184 if (ep->e_type != NODE)
186 return (ep);
193 myname(struct entry *ep)
198 for (cp = &namebuf[MAXPATHLEN - 2]; cp > &namebuf[ep->e_namlen]; ) {
199 cp -= ep->e_namlen;
200 memmove(cp, ep->e_name, (long)ep->e_namlen);
201 if (ep == lookupino(ROOTINO))
204 ep = ep->e_parent;
222 struct entry *np, *ep;
234 ep = lookupparent(name);
235 if (ep == NULL) {
246 np->e_parent = ep;
247 np->e_sibling = ep->e_entries;
248 ep->e_entries = np;
250 ep = lookupino(inum);
251 if (ep == NULL)
254 np->e_links = ep->e_links;
255 ep->e_links = np;
268 freeentry(struct entry *ep)
273 if (ep->e_flags != REMOVED)
274 badentry(ep, "not marked REMOVED");
275 if (ep->e_type == NODE) {
276 if (ep->e_links != NULL)
277 badentry(ep, "freeing referenced directory");
278 if (ep->e_entries != NULL)
279 badentry(ep, "freeing non-empty directory");
281 if (ep->e_ino != 0) {
282 np = lookupino(ep->e_ino);
284 badentry(ep, "lookupino failed");
285 if (np == ep) {
286 inum = ep->e_ino;
288 if (ep->e_links != NULL)
289 addino(inum, ep->e_links);
292 if (np->e_links == ep) {
293 np->e_links = ep->e_links;
298 badentry(ep, "link not found");
301 removeentry(ep);
302 freename(ep->e_name);
303 ep->e_next = freelist;
304 freelist = ep;
311 moveentry(struct entry *ep, char *newname)
318 badentry(ep, "cannot move ROOT");
319 if (np != ep->e_parent) {
320 removeentry(ep);
321 ep->e_parent = np;
322 ep->e_sibling = np->e_entries;
323 np->e_entries = ep;
326 freename(ep->e_name);
327 ep->e_name = savename(cp);
328 ep->e_namlen = strlen(cp);
329 if (strcmp(gentempname(ep), ep->e_name) == 0)
330 ep->e_flags |= TMPNAME;
332 ep->e_flags &= ~TMPNAME;
339 removeentry(struct entry *ep)
343 np = ep->e_parent;
344 if (np->e_entries == ep) {
345 np->e_entries = ep->e_sibling;
348 if (np->e_sibling == ep) {
349 np->e_sibling = ep->e_sibling;
354 badentry(ep, "cannot find entry in parent list");
440 struct entry *ep, *tep;
462 for (ep = lookupino(i); ep != NULL; ep = ep->e_links) {
463 ep->e_index = mynum++;
464 (void) fwrite(ep->e_name, sizeof(char),
465 (int)allocsize(ep->e_namlen), fd);
474 for (ep = lookupino(i); ep != NULL; ep = ep->e_links) {
475 memmove(tep, ep, (long)sizeof(struct entry));
477 stroff += allocsize(ep->e_namlen);
478 tep->e_parent = (struct entry *)ep->e_parent->e_index;
479 if (ep->e_links != NULL)
481 (struct entry *)ep->e_links->e_index;
482 if (ep->e_sibling != NULL)
484 (struct entry *)ep->e_sibling->e_index;
485 if (ep->e_entries != NULL)
487 (struct entry *)ep->e_entries->e_index;
488 if (ep->e_next != NULL)
490 (struct entry *)ep->e_next->e_index;
528 struct entry *ep;
542 ep = addentry(".", ROOTINO, NODE);
543 ep->e_flags |= NEW;
603 for (ep = &baseep[1]; ep < lep; ep++) {
604 ep->e_name = base + (long)ep->e_name;
605 ep->e_parent = &baseep[(long)ep->e_parent];
606 if (ep->e_sibling != NULL)
607 ep->e_sibling = &baseep[(long)ep->e_sibling];
608 if (ep->e_links != NULL)
609 ep->e_links = &baseep[(long)ep->e_links];
610 if (ep->e_entries != NULL)
611 ep->e_entries = &baseep[(long)ep->e_entries];
612 if (ep->e_next != NULL)
613 ep->e_next = &baseep[(long)ep->e_next];