Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/include compat code reorg



details:   https://anonhg.NetBSD.org/src/rev/60195ebbb042
branches:  trunk
changeset: 584314:60195ebbb042
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Sep 13 01:44:32 2005 +0000

description:
compat code reorg

diffstat:

 include/dirent.h |  24 ++--------------------
 include/errno.h  |   4 ++-
 include/fts.h    |  16 +++-----------
 include/glob.h   |  26 +++++++++---------------
 include/ndbm.h   |  14 +-----------
 include/regex.h  |   6 +----
 include/setjmp.h |  18 +++++-----------
 include/signal.h |  57 +++++++++++++++----------------------------------------
 include/stdlib.h |   7 +----
 include/time.h   |  14 ++----------
 include/unistd.h |   7 +----
 include/utmpx.h  |  10 ++------
 include/vis.h    |   7 +----
 13 files changed, 57 insertions(+), 153 deletions(-)

diffs (truncated from 514 to 300 lines):

diff -r febabecb48af -r 60195ebbb042 include/dirent.h
--- a/include/dirent.h  Tue Sep 13 01:44:08 2005 +0000
+++ b/include/dirent.h  Tue Sep 13 01:44:32 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dirent.h,v 1.23 2005/08/19 02:05:59 christos Exp $     */
+/*     $NetBSD: dirent.h,v 1.24 2005/09/13 01:44:32 christos Exp $     */
 
 /*-
  * Copyright (c) 1989, 1993
@@ -86,15 +86,7 @@
 __BEGIN_DECLS
 int closedir(DIR *);
 void rewinddir(DIR *);
-#ifdef __LIBC12_SOURCE__
-DIR *opendir(const char *);
-struct dirent12 *readdir(DIR *);
-int readdir_r(DIR *, struct dirent12 * __restrict,
-    struct dirent12 ** __restrict);
-struct dirent *__readdir30(DIR *);
-int __readdir_r30(DIR *, struct dirent * __restrict,
-    struct dirent ** __restrict);
-#else
+#ifndef __LIBC12_SOURCE__
 DIR *opendir(const char *) __RENAME(__opendir30);
 DIR *__opendir30(const char *) __RENAME(__opendir30);
 struct dirent *readdir(DIR *) __RENAME(__readdir30);
@@ -107,17 +99,7 @@
 #endif /* defined(_NETBSD_SOURCE) || defined(_XOPEN_SOURCE) */
 #if defined(_NETBSD_SOURCE)
 void __seekdir(DIR *, long);
-#ifdef __LIBC12_SOURCE__
-DIR *__opendir2(const char *, int);
-DIR *__opendir230(const char *, int);
-int scandir(const char *, struct dirent12 ***,
-    int (*)(const struct dirent12 *), int (*)(const void *, const void *));
-int __scandir30(const char *, struct dirent ***,
-    int (*)(const struct dirent *), int (*)(const void *, const void *));
-int getdents(int, char *, size_t);
-int getdirentries(int, char *, int, long *);
-int __getdents30(int, char *, size_t);
-#else
+#ifndef __LIBC12_SOURCE__
 DIR *__opendir2(const char *, int) __RENAME(__opendir230);
 int scandir(const char *, struct dirent ***,
     int (*)(const struct dirent *), int (*)(const void *, const void *))
diff -r febabecb48af -r 60195ebbb042 include/errno.h
--- a/include/errno.h   Tue Sep 13 01:44:08 2005 +0000
+++ b/include/errno.h   Tue Sep 13 01:44:32 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: errno.h,v 1.7 2005/02/03 04:39:32 perry Exp $  */
+/*     $NetBSD: errno.h,v 1.8 2005/09/13 01:44:32 christos Exp $       */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -50,9 +50,11 @@
 #endif
 
 #if defined(_NETBSD_SOURCE)
+#ifndef __LIBC12_SOURCE__
 extern __const int sys_nerr __RENAME(__sys_nerr14);
 extern __const char *__const *sys_errlist __RENAME(__sys_errlist14);
 #endif
+#endif
 __END_DECLS
 
 #endif /* !_ERRNO_H_ */
diff -r febabecb48af -r 60195ebbb042 include/fts.h
--- a/include/fts.h     Tue Sep 13 01:44:08 2005 +0000
+++ b/include/fts.h     Tue Sep 13 01:44:32 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fts.h,v 1.13 2005/08/19 02:05:59 christos Exp $        */
+/*     $NetBSD: fts.h,v 1.14 2005/09/13 01:44:32 christos Exp $        */
 
 /*
  * Copyright (c) 1989, 1993
@@ -126,21 +126,13 @@
 #include <sys/cdefs.h>
 
 __BEGIN_DECLS
-#ifdef __LIBC12_SOURCE__
-FTSENT *fts_children(FTS *, int);
-int     fts_close(FTS *);
-FTS    *fts_open(char * const *, int,
-           int (*)(const FTSENT **, const FTSENT **));
-FTSENT *fts_read(FTS *);
-int     fts_set(FTS *, FTSENT *, int);
-#else
+#ifndef __LIBC12_SOURCE__
 FTSENT *fts_children(FTS *, int)               __RENAME(__fts_children30);
 int     fts_close(FTS *)                       __RENAME(__fts_close30);
 FTS    *fts_open(char * const *, int,
-           int (*)(const FTSENT **, const FTSENT **))
-                                               __RENAME(__fts_open30);
+    int (*)(const FTSENT **, const FTSENT **)) __RENAME(__fts_open30);
 FTSENT *fts_read(FTS *)                        __RENAME(__fts_read30);
-int     fts_set(FTS *, FTSENT *, int)  __RENAME(__fts_set30);
+int     fts_set(FTS *, FTSENT *, int)          __RENAME(__fts_set30);
 #endif
 __END_DECLS
 
diff -r febabecb48af -r 60195ebbb042 include/glob.h
--- a/include/glob.h    Tue Sep 13 01:44:08 2005 +0000
+++ b/include/glob.h    Tue Sep 13 01:44:32 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: glob.h,v 1.19 2005/02/03 04:39:32 perry Exp $  */
+/*     $NetBSD: glob.h,v 1.20 2005/09/13 01:44:32 christos Exp $       */
 
 /*
  * Copyright (c) 1989, 1993
@@ -42,6 +42,10 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
+#ifndef __gl_stat_t
+#define __gl_stat_t    struct stat
+#endif
+
 typedef struct {
        int gl_pathc;           /* Count of total paths so far. */
        int gl_matchc;          /* Count of paths matching pattern. */
@@ -59,13 +63,8 @@
        void (*gl_closedir)(void *);
        struct dirent *(*gl_readdir)(void *);   
        void *(*gl_opendir)(const char *);
-#ifdef __LIBC12_SOURCE__
-       int (*gl_lstat)(const char *, struct stat12 *);
-       int (*gl_stat)(const char *, struct stat12 *);
-#else
-       int (*gl_lstat)(const char *, struct stat *);
-       int (*gl_stat)(const char *, struct stat *);
-#endif
+       int (*gl_lstat)(const char *, __gl_stat_t *);
+       int (*gl_stat)(const char *, __gl_stat_t *);
 } glob_t;
 
 #define        GLOB_APPEND     0x0001  /* Append to output from previous call. */
@@ -94,15 +93,10 @@
 #endif
 
 __BEGIN_DECLS
-#ifdef __LIBC12_SOURCE__
+#ifndef __LIBC12_SOURCE__
 int    glob(const char * __restrict, int,
-           int (*)(const char *, int), glob_t * __restrict);
-void   globfree(glob_t *);
-#else
-int    glob(const char * __restrict, int,
-           int (*)(const char *, int), glob_t * __restrict)
-       __RENAME(__glob13);
-void   globfree(glob_t *) __RENAME(__globfree13);
+    int (*)(const char *, int), glob_t * __restrict)    __RENAME(__glob13);
+void   globfree(glob_t *)                               __RENAME(__globfree13);
 #endif
 __END_DECLS
 
diff -r febabecb48af -r 60195ebbb042 include/ndbm.h
--- a/include/ndbm.h    Tue Sep 13 01:44:08 2005 +0000
+++ b/include/ndbm.h    Tue Sep 13 01:44:32 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ndbm.h,v 1.13 2004/04/28 00:10:52 kleink Exp $ */
+/*     $NetBSD: ndbm.h,v 1.14 2005/09/13 01:44:32 christos Exp $       */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -60,11 +60,7 @@
 
 typedef struct {
        void    *dptr;
-#if defined(__LIBC12_SOURCE__)
-       int      dsize;         /* XXX */
-#else
        size_t   dsize;         /* XPG4.2 */
-#endif
 } datum;
 
 typedef DB DBM;
@@ -80,13 +76,7 @@
 #if defined(_NETBSD_SOURCE)
 int     dbm_dirfno(DBM *);
 #endif
-#if defined(__LIBC12_SOURCE__)
-int     dbm_delete(DBM *, datum);
-datum   dbm_fetch(DBM *, datum);
-datum   dbm_firstkey(DBM *);
-datum   dbm_nextkey(DBM *);
-int     dbm_store(DBM *, datum, datum, int);
-#else
+#ifndef __LIBC12_SOURCE__
 int     dbm_delete(DBM *, datum)               __RENAME(__dbm_delete13);
 datum   dbm_fetch(DBM *, datum)                __RENAME(__dbm_fetch13);
 datum   dbm_firstkey(DBM *)                    __RENAME(__dbm_firstkey13);
diff -r febabecb48af -r 60195ebbb042 include/regex.h
--- a/include/regex.h   Tue Sep 13 01:44:08 2005 +0000
+++ b/include/regex.h   Tue Sep 13 01:44:32 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: regex.h,v 1.12 2005/02/03 04:39:32 perry Exp $ */
+/*     $NetBSD: regex.h,v 1.13 2005/09/13 01:44:32 christos Exp $      */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -78,11 +78,7 @@
 #include <sys/types.h>
 
 /* types */
-#if 1  /* __LIBC12_SOURCE__ - should go away */
 typedef off_t regoff_t;
-#else
-typedef size_t regoff_t;
-#endif
 
 typedef struct {
        int re_magic;
diff -r febabecb48af -r 60195ebbb042 include/setjmp.h
--- a/include/setjmp.h  Tue Sep 13 01:44:08 2005 +0000
+++ b/include/setjmp.h  Tue Sep 13 01:44:32 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: setjmp.h,v 1.22 2005/04/15 16:58:13 christos Exp $     */
+/*     $NetBSD: setjmp.h,v 1.23 2005/09/13 01:44:32 christos Exp $     */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -58,21 +58,15 @@
 #include <sys/cdefs.h>
 
 __BEGIN_DECLS
-#ifdef __LIBC12_SOURCE__
-int    __setjmp14(jmp_buf);
-void   __longjmp14(jmp_buf, int) __attribute__((__noreturn__));
-
-int    __sigsetjmp14(sigjmp_buf, int);
-void   __siglongjmp14(sigjmp_buf, int) __attribute__((__noreturn__));
-#else /* !__LIBC12_SOURCE__ */
-int    setjmp(jmp_buf) __RENAME(__setjmp14);
-void   longjmp(jmp_buf, int) __RENAME(__longjmp14)
+#ifndef __LIBC12_SOURCE__
+int    setjmp(jmp_buf)                  __RENAME(__setjmp14);
+void   longjmp(jmp_buf, int)            __RENAME(__longjmp14)
     __attribute__((__noreturn__));
 
 #if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
     defined(_NETBSD_SOURCE)
-int    sigsetjmp(sigjmp_buf, int) __RENAME(__sigsetjmp14);
-void   siglongjmp(sigjmp_buf, int) __RENAME(__siglongjmp14)
+int    sigsetjmp(sigjmp_buf, int)      __RENAME(__sigsetjmp14);
+void   siglongjmp(sigjmp_buf, int)      __RENAME(__siglongjmp14)
     __attribute__((__noreturn__));
 #endif /* not ANSI */
 #endif /* __LIBC12_SOURCE__ */
diff -r febabecb48af -r 60195ebbb042 include/signal.h
--- a/include/signal.h  Tue Sep 13 01:44:08 2005 +0000
+++ b/include/signal.h  Tue Sep 13 01:44:32 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: signal.h,v 1.43 2005/03/22 20:25:31 kleink Exp $       */
+/*     $NetBSD: signal.h,v 1.44 2005/09/13 01:44:32 christos Exp $     */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -72,32 +72,9 @@
 #endif /* __LIBPTHREAD_SOURCE__ */
 #endif
 
-#ifdef __LIBC12_SOURCE__
-int    sigaction(int, const struct sigaction13 * __restrict,
-           struct sigaction13 * __restrict);
-int    __sigaction14(int, const struct sigaction * __restrict,
-           struct sigaction * __restrict);
-int    sigaddset(sigset13_t *, int);
-int    __sigaddset14(sigset_t *, int);
-int    sigdelset(sigset13_t *, int);
-int    __sigdelset14(sigset_t *, int);
-int    sigemptyset(sigset13_t *);
-int    __sigemptyset14(sigset_t *);
-int    sigfillset(sigset13_t *);
-int    __sigfillset14(sigset_t *);
-int    sigismember(const sigset13_t *, int);
-int    __sigismember14(const sigset_t *, int);
-int    sigpending(sigset13_t *);
-int    __sigpending14(sigset_t *);
-int    sigprocmask(int, const sigset13_t * __restrict,
-           sigset13_t * __restrict);
-int    __sigprocmask14(int, const sigset_t * __restrict,
-           sigset_t * __restrict);
-int    sigsuspend(const sigset13_t *);
-int    __sigsuspend14(const sigset_t *);
-#else /* !__LIBC12_SOURCE__ */
+#ifndef __LIBC12_SOURCE__
 int    sigaction(int, const struct sigaction * __restrict,
-           struct sigaction * __restrict) __RENAME(__sigaction14);
+    struct sigaction * __restrict) __RENAME(__sigaction14);
 int    sigaddset(sigset_t *, int) __RENAME(__sigaddset14);
 int    sigdelset(sigset_t *, int) __RENAME(__sigdelset14);
 int    sigemptyset(sigset_t *) __RENAME(__sigemptyset14);
@@ -105,15 +82,18 @@
 int    sigismember(const sigset_t *, int) __RENAME(__sigismember14);
 int    sigpending(sigset_t *) __RENAME(__sigpending14);
 int    sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict)
-           __RENAME(__sigprocmask14);
+    __RENAME(__sigprocmask14);
 int    sigsuspend(const sigset_t *) __RENAME(__sigsuspend14);
 



Home | Main Index | Thread Index | Old Index