fix silly indirect-through-zero bug
[unix-history] / usr / src / usr.sbin / mtree / mtree.h
CommitLineData
cbe4b98c
KB
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
9dedc618
KB
3 * All rights reserved.
4 *
cbe4b98c 5 * %sccs.include.redist.c%
9dedc618 6 *
0af6fb71 7 * @(#)mtree.h 5.7 (Berkeley) %G%
9dedc618
KB
8 */
9
cbe4b98c
KB
10#include <string.h>
11#include <stdlib.h>
12
6e4c29b1
KB
13typedef struct _node {
14 struct _node *parent, *child; /* up, down */
15 struct _node *prev, *next; /* left, right */
16 off_t st_size; /* size */
0af6fb71 17 time_t st_mtime; /* last modification time */
6e4c29b1
KB
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
9dedc618
KB
26#define F_BLOCK 0x001 /* block special */
27#define F_CHAR 0x002 /* char special */
28#define F_DIR 0x004 /* directory */
c85e0d87
KB
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 */
bff504a2
KB
33 u_short type; /* file type */
34
0af6fb71
KB
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 */
bff504a2 48 u_short flags; /* items set */
9dedc618 49
7e5e86d9 50 char name[1]; /* file name (must be last) */
6e4c29b1 51} NODE;
bff504a2
KB
52
53#define RP(p) (p->fts_path + 2)