| 1 | /*- |
| 2 | * Copyright (c) 1990 The Regents of the University of California. |
| 3 | * All rights reserved. |
| 4 | * |
| 5 | * %sccs.include.redist.c% |
| 6 | * |
| 7 | * @(#)mtree.h 5.7 (Berkeley) %G% |
| 8 | */ |
| 9 | |
| 10 | #include <string.h> |
| 11 | #include <stdlib.h> |
| 12 | |
| 13 | typedef struct _node { |
| 14 | struct _node *parent, *child; /* up, down */ |
| 15 | struct _node *prev, *next; /* left, right */ |
| 16 | off_t st_size; /* size */ |
| 17 | time_t st_mtime; /* last modification time */ |
| 18 | u_long cksum; /* check sum */ |
| 19 | char *slink; /* symbolic link reference */ |
| 20 | uid_t st_uid; /* owner */ |
| 21 | gid_t st_gid; /* group */ |
| 22 | #define MBITS (S_ISUID|S_ISGID|S_ISTXT|S_IRWXU|S_IRWXG|S_IRWXO) |
| 23 | mode_t st_mode; /* mode */ |
| 24 | nlink_t st_nlink; /* link count */ |
| 25 | |
| 26 | #define F_BLOCK 0x001 /* block special */ |
| 27 | #define F_CHAR 0x002 /* char special */ |
| 28 | #define F_DIR 0x004 /* directory */ |
| 29 | #define F_FIFO 0x008 /* fifo */ |
| 30 | #define F_FILE 0x010 /* regular file */ |
| 31 | #define F_LINK 0x020 /* symbolic link */ |
| 32 | #define F_SOCK 0x040 /* socket */ |
| 33 | u_short type; /* file type */ |
| 34 | |
| 35 | #define F_CKSUM 0x0001 /* check sum */ |
| 36 | #define F_DONE 0x0002 /* directory done */ |
| 37 | #define F_GROUP 0x0004 /* group */ |
| 38 | #define F_IGN 0x0008 /* ignore */ |
| 39 | #define F_MAGIC 0x0010 /* name has magic chars */ |
| 40 | #define F_MODE 0x0020 /* mode */ |
| 41 | #define F_NLINK 0x0040 /* number of links */ |
| 42 | #define F_OWNER 0x0080 /* owner */ |
| 43 | #define F_SIZE 0x0100 /* size */ |
| 44 | #define F_SLINK 0x0200 /* link count */ |
| 45 | #define F_TIME 0x0400 /* modification time */ |
| 46 | #define F_TYPE 0x0800 /* file type */ |
| 47 | #define F_VISIT 0x1000 /* file visited */ |
| 48 | u_short flags; /* items set */ |
| 49 | |
| 50 | char name[1]; /* file name (must be last) */ |
| 51 | } NODE; |
| 52 | |
| 53 | #define RP(p) (p->fts_path + 2) |