summaryrefslogtreecommitdiff
path: root/usr/src/lib/libast/amd64/include/ast/ftwalk.h
blob: 673b1c2824c2a7c361372e13d5f0a96fbadf7633 (plain)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135

/* : : generated by proto : : */
/***********************************************************************
*                                                                      *
*               This software is part of the ast package               *
*          Copyright (c) 1985-2010 AT&T Intellectual Property          *
*                      and is licensed under the                       *
*                  Common Public License, Version 1.0                  *
*                    by AT&T Intellectual Property                     *
*                                                                      *
*                A copy of the License is available at                 *
*            http://www.opensource.org/licenses/cpl1.0.txt             *
*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
*                                                                      *
*              Information and Software Systems Research               *
*                            AT&T Research                             *
*                           Florham Park NJ                            *
*                                                                      *
*                 Glenn Fowler <gsf@research.att.com>                  *
*                  David Korn <dgk@research.att.com>                   *
*                   Phong Vo <kpv@research.att.com>                    *
*                                                                      *
***********************************************************************/
                  
/*
 * Phong Vo
 * Glenn Fowler
 * AT&T Research
 *
 * ast ftwalk interface definitions
 * ftwalk was the initial improvement on ftw and nftw
 * which formed the basis for the POSIX fts proposal
 *
 * NOTE: this file is in cahoots with the fts implementation
 */

#ifndef _FTWALK_H
#if !defined(__PROTO__)
#include <prototyped.h>
#endif
#if !defined(__LINKAGE__)
#define __LINKAGE__		/* 2004-08-11 transition */
#endif

#define _FTWALK_H

#define fts_info	info
#define fts_level	level
#define fts_link	link
#define fts_name	name
#define fts_namelen	namelen
#define fts_parent	parent
#define fts_path	path
#define fts_pathlen	pathlen
#define _fts_status	status
#define _fts_statb	statb

#define FTSENT		Ftw_t			/* <fts.h> internal	*/
#define Ftsent		FTW			/* <fts.h> internal	*/

#define _FTSENT_LOCAL_PRIVATE_			/* <fts.h> internal	*/ \
	union								   \
	{								   \
	long		number;			/* local numeric value	*/ \
	__V_*		pointer;		/* local pointer value	*/ \
	}		local;

#include <fts.h>

/*
 * ftwalk() argument flags
 */

#define FTW_CANON	FTS_CANON
#define FTW_CHILDREN	(FTS_USER<<0)
#define FTW_DELAY	FTS_NOSTAT
#define FTW_DOT		FTS_NOCHDIR
#define FTW_META	FTS_META
#define FTW_MOUNT	FTS_XDEV
#define FTW_MULTIPLE	FTS_ONEPATH
#define FTW_NOSEEDOTDIR	FTS_NOSEEDOTDIR
#define FTW_PHYSICAL	FTS_PHYSICAL
#define FTW_POST	(FTS_USER<<1)
#define FTW_SEEDOTDIR	FTS_SEEDOTDIR
#define FTW_TOP		FTS_TOP
#define FTW_TWICE	(FTS_USER<<2)
#define FTW_USER	(FTS_USER<<3)

/*
 * Ftw_t.info type bits
 */

#define FTW_C		FTS_C
#define FTW_D		FTS_D
#define FTW_DC		FTS_DC
#define FTW_DNR		FTS_DNR
#define FTW_DNX		FTS_DNX
#define FTW_DP		FTS_DP
#define FTW_F		FTS_F
#define FTW_NR		FTS_NR
#define FTW_NS		FTS_NS
#define FTW_NSOK	FTS_NSOK
#define FTW_NX		FTS_NX
#define FTW_P		FTS_P
#define FTW_SL		FTS_SL

/*
 * Ftw_t.status entry values
 */

#define FTW_NAME	FTS_DOT		/* access by Ftw_t.name		*/
#define FTW_PATH	FTS_NOCHDIR	/* access by Ftw_t.path		*/

/*
 * Ftw_t.status return values
 */

#define FTW_AGAIN	FTS_AGAIN
#define FTW_FOLLOW	FTS_FOLLOW
#define FTW_NOPOST	FTS_NOPOSTORDER
#define FTW_SKIP	FTS_SKIP
#define FTW_STAT	FTS_STAT

#if _BLD_ast && defined(__EXPORT__)
#undef __MANGLE__
#define __MANGLE__ __LINKAGE__		__EXPORT__
#endif

extern __MANGLE__ int	ftwalk __PROTO__((const char*, int(*)(Ftw_t*), int, int(*)(Ftw_t*, Ftw_t*)));
extern __MANGLE__ int	ftwflags __PROTO__((void));

#undef __MANGLE__
#define __MANGLE__ __LINKAGE__

#endif