File: namelist.h

package info (click to toggle)
fdclone 3.01b-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 4,772 kB
  • ctags: 8,674
  • sloc: ansic: 100,552; makefile: 4,497; sh: 1,480; sed: 224
file content (61 lines) | stat: -rw-r--r-- 1,663 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
 *	namelist.h
 *
 *	definitions for listing files
 */

#ifndef	__NAMELIST_H_
#define	__NAMELIST_H_

#include "depend.h"

typedef struct _namelist {
	char *name;
	u_short ent;
	u_short st_mode;
	short st_nlink;
#ifndef	NOUID
	u_id_t st_uid;
	g_id_t st_gid;
#endif
#if	!defined (NOSYMLINK) && defined (DEP_LSPARSE)
	char *linkname;
#endif
#ifdef	HAVEFLAGS
	u_long st_flags;
#endif
	off_t st_size;
	time_t st_mtim;
	u_char flags;
	u_char tmpflags;
} namelist;

#define	F_ISEXE			0001
#define	F_ISWRI			0002
#define	F_ISRED			0004
#define	F_ISDIR			0010
#define	F_ISLNK			0020
#define	F_ISDEV			0040
#define	F_ISMRK			0001
#define	F_WSMRK			0002
#define	F_ISARG			0004
#define	F_STAT			0010
#define	isdir(file)		((file) -> flags & F_ISDIR)
#define	islink(file)		((file) -> flags & F_ISLNK)
#define	isdev(file)		((file) -> flags & F_ISDEV)
#define	isfile(file)		(!((file) -> flags & (F_ISDIR | F_ISDEV)))
#define	isread(file)		((file) -> flags & F_ISRED)
#define	iswrite(file)		((file) -> flags & F_ISWRI)
#define	isexec(file)		((file) -> flags & F_ISEXE)
#define	ismark(file)		((file) -> tmpflags & F_ISMRK)
#define	wasmark(file)		((file) -> tmpflags & F_WSMRK)
#define	isarg(file)		((file) -> tmpflags & F_ISARG)
#define	havestat(file)		((file) -> tmpflags & F_STAT)
#define	s_isdir(s)		((((s) -> st_mode) & S_IFMT) == S_IFDIR)
#define	s_isreg(s)		((((s) -> st_mode) & S_IFMT) == S_IFREG)
#define	s_islnk(s)		((((s) -> st_mode) & S_IFMT) == S_IFLNK)
#define	s_isfifo(s)		((((s) -> st_mode) & S_IFMT) == S_IFIFO)
#define	s_ischr(s)		((((s) -> st_mode) & S_IFMT) == S_IFCHR)
#define	s_isblk(s)		((((s) -> st_mode) & S_IFMT) == S_IFBLK)

#endif	/* !__NAMELIST_H_ */