-/* the did tree is now a red-black tree while the parent/child
- * tree is a circular doubly-linked list. how exciting. */
-struct dir {
- struct dir *d_left, *d_right, *d_back; /* for red-black tree */
- int d_color;
- struct dir *d_parent, *d_child; /* parent-child */
- struct dir *d_prev, *d_next; /* siblings */
- void *d_ofork; /* oforks using this directory. */
- u_int32_t d_did;
- int d_flags;
-
- time_t ctime; /* inode ctime */
- u_int32_t offcnt; /* offspring count */
-
- char *d_m_name; /* mac name */
- char *d_u_name; /* unix name */
-};
-
-struct path {
- int m_type; /* mac name type (long name, unicode */
- char *m_name; /* mac name */
- char *u_name; /* unix name */
- struct dir *dir; /* */
- int st_valid; /* does st_errno and st set */
- int st_errno;
- struct stat st;
-};
-
-#define path_isadir(o_path) \
- ((o_path)->dir != NULL)
-#if 0
- ((o_path)->m_name == '\0' || /* we are in a it */ \
- !(o_path)->st_valid || /* in cache but we can't chdir in it */ \
- (!(o_path)->st_errno && S_ISDIR((o_path)->st.st_mode)) /* not in cache an can't chdir */ \
- )
-#endif
-
-/* child addition/removal macros */
-#define dirchildadd(a, b) do { \
- if (!(a)->d_child) \
- (a)->d_child = (b); \
- else { \
- (b)->d_next = (a)->d_child; \
- (b)->d_prev = (b)->d_next->d_prev; \
- (b)->d_next->d_prev = (b); \
- (b)->d_prev->d_next = (b); \
- } \
-} while (0)
-
-#define dirchildremove(a,b) do { \
- if ((a)->d_child == (b)) \
- (a)->d_child = ((b) == (b)->d_next) ? NULL : (b)->d_next; \
- (b)->d_next->d_prev = (b)->d_prev; \
- (b)->d_prev->d_next = (b)->d_next; \
- (b)->d_next = (b)->d_prev = (b); \
-} while (0)
-