1 /* 2 * Copyright (c) 1989 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms are permitted 6 * provided that the above copyright notice and this paragraph are 7 * duplicated in all such forms and that any documentation, 8 * advertising materials, and other materials related to such 9 * distribution and use acknowledge that the software was developed 10 * by the University of California, Berkeley. The name of the 11 * University may not be used to endorse or promote products derived 12 * from this software without specific prior written permission. 13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16 * 17 * @(#)mtree.h 5.1 (Berkeley) 09/04/89 18 */ 19 20 typedef struct _id { 21 struct _id *next; 22 u_int id; 23 u_long cnt; 24 } ID; 25 26 typedef struct _info { 27 #define F_CKSUM 0x001 /* check sum */ 28 #define F_DMODE 0x002 /* directory mode */ 29 #define F_FMODE 0x004 /* directory mode */ 30 #define F_GROUP 0x008 /* group */ 31 #define F_MODE 0x010 /* directory mode */ 32 #define F_NLINK 0x020 /* number of links */ 33 #define F_OWNER 0x040 /* owner */ 34 #define F_SIZE 0x080 /* size */ 35 #define F_SLINK 0x100 /* link count */ 36 #define F_TYPE 0x200 /* file type */ 37 u_int flags; /* items set */ 38 39 #define F_BLOCK 0x001 /* block special */ 40 #define F_CHAR 0x002 /* char special */ 41 #define F_DIR 0x004 /* directory */ 42 #define F_FILE 0x008 /* regular file */ 43 #define F_LINK 0x010 /* symbolic link */ 44 #define F_SOCK 0x020 /* socket */ 45 u_int type; /* file type */ 46 47 uid_t st_uid; 48 gid_t st_gid; 49 off_t st_size; 50 mode_t st_mode; 51 nlink_t st_nlink; 52 u_long cksum; /* check sum */ 53 char *slink; /* symbolic link reference */ 54 } INFO; 55 56 typedef struct _entry { 57 struct _entry *next, *child, *parent; /* tree links */ 58 INFO info; /* node info structure */ 59 #define F_DONE 0x01 /* directory done */ 60 #define F_IGN 0x02 /* ignore this node on down */ 61 #define F_VISIT 0x04 /* visited this node */ 62 u_int flags; /* flags */ 63 char *name; /* node name */ 64 int nlen; /* name length */ 65 } ENTRY; 66