Update.
authorUlrich Drepper <drepper@redhat.com>
Sat, 1 Apr 2000 22:30:22 +0000 (22:30 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 1 Apr 2000 22:30:22 +0000 (22:30 +0000)
* include/netdb.h: Change type of first parameter of __getnetbyaddr_r.
* inet/getnetbyad.c: Likewise.
* inet/getnetbyad_r.c: Likewise.
* nis/nss_nis/nis-network.c: Likewise.
* nis/nssplus_nis/nisplus-network.c: Likewise.
* nss/nss_files/files-network.c: Likewise.
* resolv/netdb.h: Define uint32_t if not already happened.
Include bits/netdb.h.  Remove definition of struct netent.
Change type of first parameter of getnetbyaddr_r and getnetbyaddr.
* sysdeps/generic/stdint.h: Allow definition of uint32_t elsewhere.
* sysdeps/generic/bits/netdb.h: New file.
* sysdeps/unix/sysv/linux/alpha/bits/netdb.h: New file.

12 files changed:
ChangeLog
bits/netdb.h [new file with mode: 0644]
include/netdb.h
inet/getnetbyad.c
inet/getnetbyad_r.c
nis/nss_nis/nis-network.c
nis/nss_nisplus/nisplus-network.c
nss/nss_files/files-network.c
resolv/netdb.h
sysdeps/generic/bits/netdb.h [new file with mode: 0644]
sysdeps/generic/stdint.h
sysdeps/unix/sysv/linux/alpha/bits/netdb.h [new file with mode: 0644]

index 315d8b9..80b2564 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2000-04-01  Ulrich Drepper  <drepper@redhat.com>
 
+       * include/netdb.h: Change type of first parameter of __getnetbyaddr_r.
+       * inet/getnetbyad.c: Likewise.
+       * inet/getnetbyad_r.c: Likewise.
+       * nis/nss_nis/nis-network.c: Likewise.
+       * nis/nssplus_nis/nisplus-network.c: Likewise.
+       * nss/nss_files/files-network.c: Likewise.
+       * resolv/netdb.h: Define uint32_t if not already happened.
+       Include bits/netdb.h.  Remove definition of struct netent.
+       Change type of first parameter of getnetbyaddr_r and getnetbyaddr.
+       * sysdeps/generic/stdint.h: Allow definition of uint32_t elsewhere.
+       * sysdeps/generic/bits/netdb.h: New file.
+       * sysdeps/unix/sysv/linux/alpha/bits/netdb.h: New file.
+
        * dlfcn/Makefile (distribute): Add glreflib1.c and glreflib2.c.
        (tests): Add glrefmain.
        Add rules to build modules and run tests.  Ignore result of glrefmain
diff --git a/bits/netdb.h b/bits/netdb.h
new file mode 100644 (file)
index 0000000..f687a3e
--- /dev/null
@@ -0,0 +1,33 @@
+/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it
+   and/or modify it under the terms of the GNU Library General Public
+   License as published by the Free Software Foundation; either
+   version 2 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be
+   useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If
+   not, write to the Free Software Foundation, Inc., 59 Temple Place -
+   Suite 330, Boston, MA 02111-1307, USA.  */
+
+#ifndef _NETDB_H
+# error "Never include <bits/netdb.h> directly; use <netdb.h> instead."
+#endif
+
+
+/* Description of data base entry for a single network.  NOTE: here a
+   poor assumption is made.  The network number is expected to fit
+   into an unsigned long int variable.  */
+struct netent
+{
+  char *n_name;                        /* Official name of network.  */
+  char **n_aliases;            /* Alias list.  */
+  int n_addrtype;              /* Net address type.  */
+  uint32_t n_net;              /* Network number.  */
+};
index 48fdddd..eeede8d 100644 (file)
@@ -31,7 +31,7 @@ extern int __getnetent_r (struct netent *__restrict __result_buf,
                          struct netent **__restrict __result,
                          int *__restrict __h_errnop);
 
-extern int __getnetbyaddr_r (unsigned long int __net, int __type,
+extern int __getnetbyaddr_r (uint32_t __net, int __type,
                             struct netent *__restrict __result_buf,
                             char *__restrict __buf, size_t __buflen,
                             struct netent **__restrict __result,
index 7d9006d..0f6c7b3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
    Boston, MA 02111-1307, USA.  */
 
 #include <netdb.h>
+#include <stdint.h>
 
 
 #define LOOKUP_TYPE    struct netent
 #define FUNCTION_NAME  getnetbyaddr
 #define DATABASE_NAME  networks
-#define ADD_PARAMS     unsigned long int net, int type
+#define ADD_PARAMS     uint32_t net, int type
 #define ADD_VARIABLES  net, type
 #define BUFLEN         1024
 #define NEED_H_ERRNO   1
index c27fa88..4bcec16 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
    Boston, MA 02111-1307, USA.  */
 
 #include <netdb.h>
+#include <stdint.h>
 
 
 #define LOOKUP_TYPE    struct netent
 #define FUNCTION_NAME  getnetbyaddr
 #define DATABASE_NAME  networks
-#define ADD_PARAMS     unsigned long int net, int type
+#define ADD_PARAMS     uint32_t net, int type
 #define ADD_VARIABLES  net, type
 #define NEED__RES      1
 #define NEED_H_ERRNO   1
index 4e8c94f..cae0b77 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996.
 
@@ -21,6 +21,7 @@
 #include <netdb.h>
 #include <ctype.h>
 #include <errno.h>
+#include <stdint.h>
 #include <string.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
@@ -247,7 +248,7 @@ _nss_nis_getnetbyname_r (const char *name, struct netent *net, char *buffer,
 }
 
 enum nss_status
-_nss_nis_getnetbyaddr_r (unsigned long addr, int type, struct netent *net,
+_nss_nis_getnetbyaddr_r (uint32_t addr, int type, struct netent *net,
                         char *buffer, size_t buflen, int *errnop,
                         int *herrnop)
 {
index f152c49..4b2339b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
 
@@ -21,6 +21,7 @@
 #include <netdb.h>
 #include <errno.h>
 #include <ctype.h>
+#include <stdint.h>
 #include <string.h>
 #include <arpa/inet.h>
 #include <bits/libc-lock.h>
@@ -365,7 +366,7 @@ _nss_nisplus_getnetbyname_r (const char *name, struct netent *network,
 
 /* XXX type is ignored, SUN's NIS+ table doesn't support it */
 enum nss_status
-_nss_nisplus_getnetbyaddr_r (const unsigned long addr, const int type,
+_nss_nisplus_getnetbyaddr_r (uint32_t addr, const int type,
                             struct netent *network, char *buffer,
                             size_t buflen, int *errnop, int *herrnop)
 {
index 8bf9c04..3b1fec9 100644 (file)
@@ -1,5 +1,5 @@
 /* Networks file parser in nss_files module.
-   Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -53,4 +53,4 @@ DB_LOOKUP (netbyaddr, ,,
             if (result->n_addrtype == type && result->n_net == net)
               /* Bingo!  */
               break;
-          }, unsigned long int net, int type)
+          }, uint32_t net, int type)
index 508e7c4..50420c3 100644 (file)
 #define __need_size_t
 #include <stddef.h>
 
+#ifndef __uint32_t_defined
+typedef unsigned int           uint32_t;
+# define __uint32_t_defined
+#endif
+
+#include <bits/netdb.h>
+
 /* Absolute file name for network data base files.  */
 #define        _PATH_HEQUIV            "/etc/hosts.equiv"
 #define        _PATH_HOSTS             "/etc/hosts"
@@ -184,17 +191,6 @@ extern int gethostbyname2_r (__const char *__restrict __name, int __af,
 #endif /* misc */
 
 
-/* Description of data base entry for a single network.  NOTE: here a
-   poor assumption is made.  The network number is expected to fit
-   into an unsigned long int variable.  */
-struct netent
-{
-  char *n_name;                        /* Official name of network.  */
-  char **n_aliases;            /* Alias list.  */
-  int n_addrtype;              /* Net address type.  */
-  unsigned long        int n_net;      /* Network number.  */
-};
-
 /* Open network data base files and mark them as staying open even
    after a later search if STAY_OPEN is non-zero.  */
 extern void setnetent (int __stay_open) __THROW;
@@ -208,7 +204,7 @@ extern struct netent *getnetent (void) __THROW;
 
 /* Return entry from network data base which address match NET and
    type TYPE.  */
-extern struct netent *getnetbyaddr (unsigned long int __net, int __type)
+extern struct netent *getnetbyaddr (uint32_t __net, int __type)
      __THROW;
 
 /* Return entry from network data base for network with NAME.  */
@@ -225,7 +221,7 @@ extern int getnetent_r (struct netent *__restrict __result_buf,
                        struct netent **__restrict __result,
                        int *__restrict __h_errnop) __THROW;
 
-extern int getnetbyaddr_r (unsigned long int __net, int __type,
+extern int getnetbyaddr_r (uint32_t __net, int __type,
                           struct netent *__restrict __result_buf,
                           char *__restrict __buf, size_t __buflen,
                           struct netent **__restrict __result,
diff --git a/sysdeps/generic/bits/netdb.h b/sysdeps/generic/bits/netdb.h
new file mode 100644 (file)
index 0000000..f687a3e
--- /dev/null
@@ -0,0 +1,33 @@
+/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it
+   and/or modify it under the terms of the GNU Library General Public
+   License as published by the Free Software Foundation; either
+   version 2 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be
+   useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If
+   not, write to the Free Software Foundation, Inc., 59 Temple Place -
+   Suite 330, Boston, MA 02111-1307, USA.  */
+
+#ifndef _NETDB_H
+# error "Never include <bits/netdb.h> directly; use <netdb.h> instead."
+#endif
+
+
+/* Description of data base entry for a single network.  NOTE: here a
+   poor assumption is made.  The network number is expected to fit
+   into an unsigned long int variable.  */
+struct netent
+{
+  char *n_name;                        /* Official name of network.  */
+  char **n_aliases;            /* Alias list.  */
+  int n_addrtype;              /* Net address type.  */
+  uint32_t n_net;              /* Network number.  */
+};
index 1269b78..73f3108 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -49,7 +49,10 @@ typedef long long int                int64_t;
 /* Unsigned.  */
 typedef unsigned char          uint8_t;
 typedef unsigned short int     uint16_t;
+#ifndef __uint32_t_defined
 typedef unsigned int           uint32_t;
+# define __uint32_t_defined
+#endif
 #if __WORDSIZE == 64
 typedef unsigned long int      uint64_t;
 #else
diff --git a/sysdeps/unix/sysv/linux/alpha/bits/netdb.h b/sysdeps/unix/sysv/linux/alpha/bits/netdb.h
new file mode 100644 (file)
index 0000000..f5a33d9
--- /dev/null
@@ -0,0 +1,35 @@
+/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it
+   and/or modify it under the terms of the GNU Library General Public
+   License as published by the Free Software Foundation; either
+   version 2 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be
+   useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If
+   not, write to the Free Software Foundation, Inc., 59 Temple Place -
+   Suite 330, Boston, MA 02111-1307, USA.  */
+
+#ifndef _NETDB_H
+# error "Never include <bits/netdb.h> directly; use <netdb.h> instead."
+#endif
+
+
+/* Description of data base entry for a single network.  NOTE: here a
+   poor assumption is made.  The network number is expected to fit
+   into an unsigned long int variable.  */
+struct netent
+{
+  char *n_name;                        /* Official name of network.  */
+  char **n_aliases;            /* Alias list.  */
+  int n_addrtype;              /* Net address type.  */
+  /* XXX We should probably use uint32_t for the field and ensure
+     compatiblity by adding appropriate padding.  */
+  unsigned long        int n_net;      /* Network number.  */
+};