xref: /netbsd-src/lib/libc/compat/include/dirent.h (revision f1582e88f73129514e9d0a2b931778e4d7122709)
1*f1582e88Smrg /*	$NetBSD: dirent.h,v 1.8 2016/12/16 04:45:04 mrg Exp $	*/
25b84b398Schristos 
35b84b398Schristos /*-
45b84b398Schristos  * Copyright (c) 1989, 1993
55b84b398Schristos  *	The Regents of the University of California.  All rights reserved.
65b84b398Schristos  *
75b84b398Schristos  * Redistribution and use in source and binary forms, with or without
85b84b398Schristos  * modification, are permitted provided that the following conditions
95b84b398Schristos  * are met:
105b84b398Schristos  * 1. Redistributions of source code must retain the above copyright
115b84b398Schristos  *    notice, this list of conditions and the following disclaimer.
125b84b398Schristos  * 2. Redistributions in binary form must reproduce the above copyright
135b84b398Schristos  *    notice, this list of conditions and the following disclaimer in the
145b84b398Schristos  *    documentation and/or other materials provided with the distribution.
155b84b398Schristos  * 3. Neither the name of the University nor the names of its contributors
165b84b398Schristos  *    may be used to endorse or promote products derived from this software
175b84b398Schristos  *    without specific prior written permission.
185b84b398Schristos  *
195b84b398Schristos  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
205b84b398Schristos  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
215b84b398Schristos  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
225b84b398Schristos  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
235b84b398Schristos  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
245b84b398Schristos  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
255b84b398Schristos  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
265b84b398Schristos  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
275b84b398Schristos  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
285b84b398Schristos  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
295b84b398Schristos  * SUCH DAMAGE.
305b84b398Schristos  *
315b84b398Schristos  *	@(#)dirent.h	8.2 (Berkeley) 7/28/94
325b84b398Schristos  */
335b84b398Schristos 
345b84b398Schristos #ifndef _COMPAT_DIRENT_H_
355b84b398Schristos #define _COMPAT_DIRENT_H_
365b84b398Schristos 
375b84b398Schristos #include <compat/sys/dirent.h>
385b84b398Schristos 
395b84b398Schristos __BEGIN_DECLS
409d2cc4eaSchristos 
415b84b398Schristos DIR *opendir(const char *);
429d2cc4eaSchristos DIR *__opendir30(const char *);
439d2cc4eaSchristos 
445b84b398Schristos int readdir_r(DIR *, struct dirent12 * __restrict,
455b84b398Schristos     struct dirent12 ** __restrict);
46fb11ba2dSchristos int __readdir_r30(DIR * __restrict, struct dirent * __restrict,
475b84b398Schristos     struct dirent ** __restrict);
489d2cc4eaSchristos 
499d2cc4eaSchristos struct dirent12 *readdir(DIR *);
509d2cc4eaSchristos struct dirent *__readdir30(DIR *);
519d2cc4eaSchristos 
525b84b398Schristos #if defined(_NETBSD_SOURCE)
539d2cc4eaSchristos 
5434f7daa8Stonnerre struct dirent12 *_readdir_unlocked(DIR *, int);
5534f7daa8Stonnerre struct dirent *___readdir_unlocked50(DIR *, int);
56b72acd51Schristos struct dirent *___readdir_unlocked30(DIR *);
5796dd93adSchristos 
585b84b398Schristos DIR *__opendir2(const char *, int);
595b84b398Schristos DIR *__opendir230(const char *, int);
609d2cc4eaSchristos 
615b84b398Schristos int scandir(const char *, struct dirent12 ***,
625b84b398Schristos     int (*)(const struct dirent12 *), int (*)(const void *, const void *));
635b84b398Schristos int __scandir30(const char *, struct dirent ***,
64*f1582e88Smrg     int (*)(const struct dirent *),
65*f1582e88Smrg     int (*)(const struct dirent **, const struct dirent **));
669d2cc4eaSchristos 
675b84b398Schristos int getdents(int, char *, size_t);
685b84b398Schristos int __getdents30(int, char *, size_t);
699d2cc4eaSchristos 
702c266c8aSchristos int alphasort(const void *, const void *);
71*f1582e88Smrg int __alphasort30(const struct dirent **, const struct dirent **);
722c266c8aSchristos 
739d2cc4eaSchristos int getdirentries(int, char *, int, long *);
749d2cc4eaSchristos 
755b84b398Schristos #endif /* defined(_NETBSD_SOURCE) */
769d2cc4eaSchristos 
775b84b398Schristos __END_DECLS
785b84b398Schristos 
795b84b398Schristos #endif /* !_COMPAT_DIRENT_H_ */
80