xref: /titanic_41/usr/src/lib/libbc/inc/include/dirent.h (revision 1ae0874509b6811fdde1dfd46f0d93fd09867a3f)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1989 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*      Copyright (c) 1984 AT&T */
28 /*        All Rights Reserved   */
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 /*
33  * Filesystem-independent directory information.
34  */
35 
36 #ifndef	__dirent_h
37 #define	__dirent_h
38 
39 #include <sys/types.h>
40 
41 #ifndef	_POSIX_SOURCE
42 #define	d_ino	d_fileno	/* compatability */
43 #ifndef	NULL
44 #define	NULL	0
45 #endif
46 #endif	/* !_POSIX_SOURCE */
47 
48 /*
49  * Definitions for library routines operating on directories.
50  */
51 typedef	struct __dirdesc {
52 	int	dd_fd;		/* file descriptor */
53 	long	dd_loc;		/* buf offset of entry from last readddir() */
54 	long	dd_size;	/* amount of valid data in buffer */
55 	long	dd_bsize;	/* amount of entries read at a time */
56 	long	dd_off;		/* Current offset in dir (for telldir) */
57 	char	*dd_buf;	/* directory data buffer */
58 } DIR;
59 
60 extern	DIR *opendir(/* char *dirname */);
61 extern	struct dirent *readdir(/* DIR *dirp */);
62 extern	int closedir(/* DIR *dirp */);
63 #ifndef	_POSIX_SOURCE
64 extern	void seekdir(/* DIR *dirp, int loc */);
65 extern	long telldir(/* DIR *dirp */);
66 #endif	/* POSIX_SOURCE */
67 extern	void rewinddir(/* DIR *dirp */);
68 
69 #ifndef	lint
70 #define	rewinddir(dirp)	seekdir((dirp), (long)0)
71 #endif
72 
73 #include <sys/dirent.h>
74 
75 #endif	/* !__dirent_h */
76