/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2014 Garrett D'Amore <garrett@damore.org>
*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
#ifndef _DIRENT_H
#define _DIRENT_H
#include <sys/feature_tests.h>
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
#endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) */
#if !defined(__XOPEN_OR_POSIX)
typedef struct {
#else
typedef struct {
#endif /* !defined(__XOPEN_OR_POSIX) */
/* large file compilation environment setup */
#ifdef __PRAGMA_REDEFINE_EXTNAME
#else
#endif
#endif /* _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
#else
#endif
#endif /* _LP64 && _LARGEFILE64_SOURCE */
#if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
defined(_ATFILE_SOURCE)
#endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) ... */
#if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
int (*)(const struct dirent *),
int (*)(const struct dirent **,
const struct dirent **));
const struct dirent **);
#endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) */
#if defined(__EXTENSIONS__) || !defined(_POSIX_C_SOURCE) || \
defined(_XOPEN_SOURCE)
#endif /* defined(__EXTENSIONS__) || !defined(_POSIX_C_SOURCE) ... */
/* transitional large file interface */
!defined(__PRAGMA_REDEFINE_EXTNAME))
#if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
int (*)(const struct dirent64 *),
int (*)(const struct dirent64 **,
const struct dirent64 **));
#endif /* defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) */
#endif
#if defined(__EXTENSIONS__) || !defined(_POSIX_C_SOURCE) || \
defined(_XOPEN_SOURCE)
#endif
/*
* readdir_r() prototype is defined here.
*
* There are several variations, depending on whether compatibility with old
* POSIX draft specifications or the final specification is desired and on
* whether the large file compilation environment is active. To combat a
* combinatorial explosion, enabling large files implies using the final
* specification (since the definition of the large file environment
* considerably postdates that of the final readdir_r specification).
*
* In the LP64 compilation environment, all APIs are already large file,
* and since there are no 64-bit applications that can have seen the
* draft implementation, again, we use the final POSIX specification.
*/
#if defined(__EXTENSIONS__) || defined(_REENTRANT) || \
defined(_POSIX_PTHREAD_SEMANTICS)
#ifdef __PRAGMA_REDEFINE_EXTNAME
struct dirent **_RESTRICT_KYWD);
#else /* __PRAGMA_REDEFINE_EXTNAME */
#ifdef __lint
#else /* !__lint */
static int
}
#endif /* !__lint */
#endif /* __PRAGMA_REDEFINE_EXTNAME */
#else /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
#endif /* (_POSIX_C_SOURCE - 0 >= 199506L) || ... */
#else /* !_LP64 && _FILE_OFFSET_BITS == 32 */
#if defined(_LP64)
#ifdef __PRAGMA_REDEFINE_EXTNAME
#else
#endif
#else /* _LP64 */
#ifdef __PRAGMA_REDEFINE_EXTNAME
#else
#endif
#endif /* _LP64 */
struct dirent **_RESTRICT_KYWD);
#endif /* !_LP64 && _FILE_OFFSET_BITS == 32 */
!defined(__PRAGMA_REDEFINE_EXTNAME))
/* transitional large file interface */
struct dirent64 **_RESTRICT_KYWD);
#endif
#endif /* defined(__EXTENSIONS__) || defined(_REENTRANT)... */
#ifdef __cplusplus
}
#endif
#endif /* _DIRENT_H */