socsvn commit: r222617 - in soc2011/gk/ino64-head: include
lib/libc/gen
gk at FreeBSD.org
gk at FreeBSD.org
Mon May 30 23:10:17 UTC 2011
Author: gk
Date: Mon May 30 23:10:15 2011
New Revision: 222617
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=222617
Log:
Hide DIR definition by making it opaque struct typedef
Added:
soc2011/gk/ino64-head/lib/libc/gen/dirent_private.h
- copied, changed from r222616, soc2011/gk/ino64-head/lib/libc/gen/rewinddir.c
Modified:
soc2011/gk/ino64-head/include/dirent.h
soc2011/gk/ino64-head/lib/libc/gen/closedir.c
soc2011/gk/ino64-head/lib/libc/gen/fts-compat.c
soc2011/gk/ino64-head/lib/libc/gen/fts.c
soc2011/gk/ino64-head/lib/libc/gen/getcwd.c
soc2011/gk/ino64-head/lib/libc/gen/opendir.c
soc2011/gk/ino64-head/lib/libc/gen/readdir.c
soc2011/gk/ino64-head/lib/libc/gen/rewinddir.c
soc2011/gk/ino64-head/lib/libc/gen/seekdir.c
soc2011/gk/ino64-head/lib/libc/gen/telldir.c
Modified: soc2011/gk/ino64-head/include/dirent.h
==============================================================================
--- soc2011/gk/ino64-head/include/dirent.h Mon May 30 23:09:56 2011 (r222616)
+++ soc2011/gk/ino64-head/include/dirent.h Mon May 30 23:10:15 2011 (r222617)
@@ -54,25 +54,8 @@
/* definitions for library routines operating on directories. */
#define DIRBLKSIZ 1024
-
-struct _telldir; /* see telldir.h */
-struct pthread_mutex;
-
/* structure describing an open directory. */
-typedef struct _dirdesc {
- int dd_fd; /* file descriptor associated with directory */
- long dd_loc; /* offset in current buffer */
- long dd_size; /* amount of data returned by getdirentries */
- char *dd_buf; /* data buffer */
- int dd_len; /* size of data buffer */
- long dd_seek; /* magic cookie returned by getdirentries */
- long dd_rewind; /* magic cookie for rewinding */
- int dd_flags; /* flags for readdir */
- struct pthread_mutex *dd_lock; /* lock */
- struct _telldir *dd_td; /* telldir position recording */
-} DIR;
-
-#define dirfd(dirp) ((dirp)->dd_fd)
+typedef struct _dirdesc DIR;
/* flags for opendir2 */
#define DTF_HIDEW 0x0001 /* hide whiteout entries */
Modified: soc2011/gk/ino64-head/lib/libc/gen/closedir.c
==============================================================================
--- soc2011/gk/ino64-head/lib/libc/gen/closedir.c Mon May 30 23:09:56 2011 (r222616)
+++ soc2011/gk/ino64-head/lib/libc/gen/closedir.c Mon May 30 23:10:15 2011 (r222617)
@@ -42,6 +42,7 @@
#include "un-namespace.h"
#include "libc_private.h"
+#include "dirent_private.h"
#include "telldir.h"
/*
Copied and modified: soc2011/gk/ino64-head/lib/libc/gen/dirent_private.h (from r222616, soc2011/gk/ino64-head/lib/libc/gen/rewinddir.c)
==============================================================================
--- soc2011/gk/ino64-head/lib/libc/gen/rewinddir.c Mon May 30 23:09:56 2011 (r222616, copy source)
+++ soc2011/gk/ino64-head/lib/libc/gen/dirent_private.h Mon May 30 23:10:15 2011 (r222617)
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1990, 1993
+ * Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,7 +10,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -25,24 +25,30 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ *
+ * $FreeBSD$
*/
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)rewinddir.c 8.1 (Berkeley) 6/8/93";
-#endif /* LIBC_SCCS and not lint */
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+#ifndef _DIRENT_PRIVATE_H_
+#define _DIRENT_PRIVATE_H_
-#include <sys/types.h>
-#include <dirent.h>
+struct _telldir; /* see telldir.h */
+struct pthread_mutex;
-#include "telldir.h"
+/* structure describing an open directory. */
+struct _dirdesc {
+ int dd_fd; /* file descriptor associated with directory */
+ long dd_loc; /* offset in current buffer */
+ long dd_size; /* amount of data returned by getdirentries */
+ char *dd_buf; /* data buffer */
+ int dd_len; /* size of data buffer */
+ long dd_seek; /* magic cookie returned by getdirentries */
+ long dd_rewind; /* magic cookie for rewinding */
+ int dd_flags; /* flags for readdir */
+ struct pthread_mutex *dd_lock; /* lock */
+ struct _telldir *dd_td; /* telldir position recording */
+};
-void
-rewinddir(dirp)
- DIR *dirp;
-{
+#define dirfd(dirp) ((dirp)->dd_fd)
- _seekdir(dirp, dirp->dd_rewind);
- dirp->dd_rewind = telldir(dirp);
-}
+#endif /* !_DIRENT_PRIVATE_H_ */
Modified: soc2011/gk/ino64-head/lib/libc/gen/fts-compat.c
==============================================================================
--- soc2011/gk/ino64-head/lib/libc/gen/fts-compat.c Mon May 30 23:09:56 2011 (r222616)
+++ soc2011/gk/ino64-head/lib/libc/gen/fts-compat.c Mon May 30 23:10:15 2011 (r222617)
@@ -52,6 +52,8 @@
#include "fts-compat.h"
#include "un-namespace.h"
+#include "dirent_private.h"
+
FTSENT *__fts_children_44bsd(FTS *, int);
int __fts_close_44bsd(FTS *);
void *__fts_get_clientptr_44bsd(FTS *);
Modified: soc2011/gk/ino64-head/lib/libc/gen/fts.c
==============================================================================
--- soc2011/gk/ino64-head/lib/libc/gen/fts.c Mon May 30 23:09:56 2011 (r222616)
+++ soc2011/gk/ino64-head/lib/libc/gen/fts.c Mon May 30 23:10:15 2011 (r222617)
@@ -52,6 +52,8 @@
#include <unistd.h>
#include "un-namespace.h"
+#include "dirent_private.h"
+
static FTSENT *fts_alloc(FTS *, char *, size_t);
static FTSENT *fts_build(FTS *, int);
static void fts_lfree(FTSENT *);
Modified: soc2011/gk/ino64-head/lib/libc/gen/getcwd.c
==============================================================================
--- soc2011/gk/ino64-head/lib/libc/gen/getcwd.c Mon May 30 23:09:56 2011 (r222616)
+++ soc2011/gk/ino64-head/lib/libc/gen/getcwd.c Mon May 30 23:10:15 2011 (r222617)
@@ -46,6 +46,8 @@
#include <unistd.h>
#include "un-namespace.h"
+#include "dirent_private.h"
+
#define ISDOT(dp) \
(dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \
(dp->d_name[1] == '.' && dp->d_name[2] == '\0')))
Modified: soc2011/gk/ino64-head/lib/libc/gen/opendir.c
==============================================================================
--- soc2011/gk/ino64-head/lib/libc/gen/opendir.c Mon May 30 23:09:56 2011 (r222616)
+++ soc2011/gk/ino64-head/lib/libc/gen/opendir.c Mon May 30 23:10:15 2011 (r222617)
@@ -46,6 +46,7 @@
#include <unistd.h>
#include "un-namespace.h"
+#include "dirent_private.h"
#include "telldir.h"
static DIR * __opendir_common(int, const char *, int);
Modified: soc2011/gk/ino64-head/lib/libc/gen/readdir.c
==============================================================================
--- soc2011/gk/ino64-head/lib/libc/gen/readdir.c Mon May 30 23:09:56 2011 (r222616)
+++ soc2011/gk/ino64-head/lib/libc/gen/readdir.c Mon May 30 23:10:15 2011 (r222617)
@@ -42,6 +42,7 @@
#include "un-namespace.h"
#include "libc_private.h"
+#include "dirent_private.h"
#include "telldir.h"
/*
Modified: soc2011/gk/ino64-head/lib/libc/gen/rewinddir.c
==============================================================================
--- soc2011/gk/ino64-head/lib/libc/gen/rewinddir.c Mon May 30 23:09:56 2011 (r222616)
+++ soc2011/gk/ino64-head/lib/libc/gen/rewinddir.c Mon May 30 23:10:15 2011 (r222617)
@@ -36,6 +36,7 @@
#include <sys/types.h>
#include <dirent.h>
+#include "dirent_private.h"
#include "telldir.h"
void
Modified: soc2011/gk/ino64-head/lib/libc/gen/seekdir.c
==============================================================================
--- soc2011/gk/ino64-head/lib/libc/gen/seekdir.c Mon May 30 23:09:56 2011 (r222616)
+++ soc2011/gk/ino64-head/lib/libc/gen/seekdir.c Mon May 30 23:10:15 2011 (r222617)
@@ -40,6 +40,7 @@
#include "un-namespace.h"
#include "libc_private.h"
+#include "dirent_private.h"
#include "telldir.h"
/*
Modified: soc2011/gk/ino64-head/lib/libc/gen/telldir.c
==============================================================================
--- soc2011/gk/ino64-head/lib/libc/gen/telldir.c Mon May 30 23:09:56 2011 (r222616)
+++ soc2011/gk/ino64-head/lib/libc/gen/telldir.c Mon May 30 23:10:15 2011 (r222617)
@@ -43,6 +43,7 @@
#include "un-namespace.h"
#include "libc_private.h"
+#include "dirent_private.h"
#include "telldir.h"
/*
More information about the svn-soc-all
mailing list