sl@0: /*- sl@0: * Copyright (c) 1989, 1993 sl@0: * The Regents of the University of California. All rights reserved. sl@0: * sl@0: * Redistribution and use in source and binary forms, with or without sl@0: * modification, are permitted provided that the following conditions sl@0: * are met: sl@0: * 1. Redistributions of source code must retain the above copyright sl@0: * notice, this list of conditions and the following disclaimer. sl@0: * 2. Redistributions in binary form must reproduce the above copyright sl@0: * notice, this list of conditions and the following disclaimer in the sl@0: * documentation and/or other materials provided with the distribution. sl@0: * 4. Neither the name of the University nor the names of its contributors sl@0: * may be used to endorse or promote products derived from this software sl@0: * without specific prior written permission. sl@0: * sl@0: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND sl@0: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE sl@0: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE sl@0: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE sl@0: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL sl@0: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS sl@0: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) sl@0: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT sl@0: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY sl@0: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF sl@0: * SUCH DAMAGE. sl@0: * sl@0: * @(#)dirent.h 8.2 (Berkeley) 7/28/94 sl@0: * $FreeBSD: src/include/dirent.h,v 1.14 2003/12/07 21:10:06 marcel Exp $ sl@0: */ sl@0: sl@0: #ifndef _DIRENT_H_ sl@0: #define _DIRENT_H_ sl@0: sl@0: /* sl@0: * The kernel defines the format of directory entries returned by sl@0: * the getdirentries(2) system call. sl@0: */ sl@0: #include sl@0: #include sl@0: sl@0: #if __BSD_VISIBLE || __XSI_VISIBLE sl@0: /* sl@0: * XXX this is probably illegal in the __XSI_VISIBLE case, but brings us closer sl@0: * to the specification. sl@0: */ sl@0: #define d_ino d_fileno /* backward and XSI compatibility */ sl@0: #endif sl@0: sl@0: #if __BSD_VISIBLE sl@0: sl@0: #include sl@0: sl@0: /* definitions for library routines operating on directories. */ sl@0: #define DIRBLKSIZ 1024 sl@0: sl@0: struct _telldir; /* see telldir.h */ sl@0: sl@0: /* structure describing an open directory. */ sl@0: typedef struct _dirdesc { sl@0: int dd_fd; /* file descriptor associated with directory */ sl@0: long dd_loc; /* offset in current buffer */ sl@0: long dd_size; /* amount of data returned by getdirentries */ sl@0: char *dd_buf; /* data buffer */ sl@0: int dd_len; /* size of data buffer */ sl@0: long dd_seek; /* magic cookie returned by getdirentries */ sl@0: long dd_rewind; /* magic cookie for rewinding */ sl@0: int dd_flags; /* flags for readdir */ sl@0: void *dd_lock; /* hack to avoid including */ sl@0: struct _telldir *dd_td; /* telldir position recording */ sl@0: } DIR; sl@0: sl@0: #define dirfd(dirp) ((dirp)->dd_fd) sl@0: sl@0: /* flags for opendir2 */ sl@0: #define DTF_HIDEW 0x0001 /* hide whiteout entries */ sl@0: #define DTF_NODUP 0x0002 /* don't return duplicate names */ sl@0: #define DTF_REWIND 0x0004 /* rewind after reading union stack */ sl@0: #define __DTF_READALL 0x0008 /* everything has been read */ sl@0: sl@0: #else /* !__BSD_VISIBLE */ sl@0: sl@0: typedef void * DIR; sl@0: sl@0: #endif /* __BSD_VISIBLE */ sl@0: sl@0: #ifndef _KERNEL sl@0: sl@0: __BEGIN_DECLS sl@0: #if __BSD_VISIBLE sl@0: IMPORT_C int alphasort(const void *, const void *); sl@0: /* #define getdirentries _getdirentries */ sl@0: IMPORT_C int getdirentries(int, char *, int, long *); sl@0: #endif sl@0: IMPORT_C DIR *opendir(const char *); sl@0: IMPORT_C struct dirent * sl@0: readdir(DIR *); sl@0: IMPORT_C void rewinddir(DIR *); sl@0: IMPORT_C int alphasort(const void *, const void *); sl@0: IMPORT_C int scandir(const char *, struct dirent ***, sl@0: int (*)(struct dirent *), int (*)(const void *, const void *)); sl@0: sl@0: #if defined(SYMBIAN_OE_LARGE_FILE_SUPPORT) && !defined(SYMBIAN_OE_NO_LFS) sl@0: #define readdir64 readdir sl@0: #define alphasort64 alphasort sl@0: #define scandir64 scandir sl@0: #endif /* SYMBIAN_OE_LARGE_FILE_SUPPORT && !SYMBIAN_OE_NO_LFS */ sl@0: sl@0: sl@0: #if __XSI_VISIBLE sl@0: IMPORT_C void seekdir(DIR *, long); sl@0: IMPORT_C long telldir(DIR *); sl@0: #endif sl@0: IMPORT_C int closedir(DIR *); sl@0: __END_DECLS sl@0: sl@0: #endif /* !_KERNEL */ sl@0: sl@0: #endif /* !_DIRENT_H_ */