ftw.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
#ifndef _FTW_H
#define _FTW_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/feature_tests.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Codes for the third argument to the user-supplied function
* which is passed as the second argument to ftwalk
*/
#define FTW_F 0 /* file */
/*
* Codes for the fourth argument to ftwalk. You can specify the
* union of these flags.
*/
struct FTW
{
#if defined(_XPG4_2)
int __quit;
#else
int quit;
#endif
int base;
int level;
};
#endif /* defined(__EXTENSIONS__) || !defined(_XOPEN_SOURCE) ... */
/*
* legal values for quit
*/
#define FTW_SKD 1
#define FTW_FOLLOW 2
#define FTW_PRUNE 4
/* large file compilation environment setup */
#ifdef __PRAGMA_REDEFINE_EXTNAME
#if !defined(_XOPEN_SOURCE) || defined(_XPG5)
#endif
#else /* __PRAGMA_REDEFINE_EXTNAME */
#if !defined(_XOPEN_SOURCE) || defined(_XPG5)
#endif
#endif /* __PRAGMA_REDEFINE_EXTNAME */
#endif /* !_LP64 && _FILE_OFFSET_BITS == 64 */
/* In the LP64 compilation environment, all APIs are already large file */
#if defined(_LP64) && defined(_LARGEFILE64_SOURCE)
#ifdef __PRAGMA_REDEFINE_EXTNAME
#if !defined(_XOPEN_SOURCE) || defined(_XPG5)
#endif
#else /* __PRAGMA_REDEFINE_EXTNAME */
#if !defined(_XOPEN_SOURCE) || defined(_XPG5)
#endif
#endif /* __PRAGMA_REDEFINE_EXTNAME */
#endif /* _LP64 && _LARGEFILE64_SOURCE */
#if defined(__STDC__)
extern int ftw(const char *,
int (*)(const char *, const struct stat *, int), int);
extern int _xftw(int, const char *,
int (*)(const char *, const struct stat *, int), int);
extern int nftw(const char *,
int, int);
#endif /* defined(__EXTENSIONS__) || !defined(_XOPEN_SOURCE) ... */
/*
* transitional large file interface versions
*/
!defined(__PRAGMA_REDEFINE_EXTNAME))
extern int ftw64(const char *,
int (*)(const char *, const struct stat64 *, int), int);
extern int _xftw64(int, const char *,
int (*)(const char *, const struct stat64 *, int), int);
#if !defined(_XOPEN_SOURCE)
extern int nftw64(const char *,
int, int);
#endif /* !defined(_XOPEN_SOURCE) */
#endif /* _LARGEFILE64_SOURCE .. */
#else /* __STDC__ */
extern int nftw();
#endif /* defined(__EXTENSIONS__) || !defined(_XOPEN_SOURCE) ... */
/* transitional large file interface versions */
!defined(__PRAGMA_REDEFINE_EXTNAME))
extern int ftw64();
extern int _xftw64();
#if !defined(_XOPEN_SOURCE)
extern int nftw64();
#endif /* !defined(_XOPEN_SOURCE) */
#endif /* _LARGEFILE64_SOURCE .. */
#endif /* __STDC__ */
!defined(__PRAGMA_REDEFINE_EXTNAME))
#endif
#ifdef __cplusplus
}
#endif
#endif /* _FTW_H */