Tue Jul 2 10:44:37 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
authorroland <roland>
Tue, 2 Jul 1996 19:34:41 +0000 (19:34 +0000)
committerroland <roland>
Tue, 2 Jul 1996 19:34:41 +0000 (19:34 +0000)
* nss/nss_files/files-network.c: Pass empty for new DB_LOOKUP args.
(DATABASE): Define this instead of DATAFILE.
* nss/nss_files/files-hosts.c: Likewise.
(hostbyname): Use LOOKUP_NAME macro.

nss/nss_files/files-hosts.c
nss/nss_files/files-network.c

index 19a0075..bc9eaa3 100644 (file)
@@ -30,7 +30,7 @@ Cambridge, MA 02139, USA.  */
 
 
 #define ENTNAME                hostent
-#define DATAFILE       _PATH_HOSTS
+#define DATABASE       "hosts"
 
 #define ENTDATA hostent_data
 struct hostent_data
@@ -93,19 +93,11 @@ LINE_PARSER
 
 #include "files-XXX.c"
 
-DB_LOOKUP (hostbyname,
-          {
-            char **ap;
-            if (! strcmp (name, result->h_name))
-              break;
-            for (ap = result->h_aliases; *ap; ++ap)
-              if (! strcmp (name, *ap))
-                break;
-            if (*ap)
-              break;
-          }, const char *name)
+DB_LOOKUP (hostbyname, ,,
+          LOOKUP_NAME (h_name, h_aliases),
+          const char *name)
 
-DB_LOOKUP (hostbyaddr,
+DB_LOOKUP (hostbyaddr, ,,
           {
             if (result->h_addrtype == type && result->h_length == len &&
                 ! memcmp (addr, result->h_addr_list[0], len))
index c6cd718..acfbc31 100644 (file)
@@ -22,7 +22,7 @@ Cambridge, MA 02139, USA.  */
 #include <netdb.h>
 
 #define ENTNAME                netent
-#define DATAFILE       _PATH_NETWORKS
+#define DATABASE       "networks"
 
 struct netent_data {};
 
@@ -43,11 +43,11 @@ LINE_PARSER
 
 #include "files-XXX.c"
 
-DB_LOOKUP (netbyname,
+DB_LOOKUP (netbyname, ,,
           LOOKUP_NAME (n_name, n_aliases),
           const char *name)
 
-DB_LOOKUP (netbyaddr,
+DB_LOOKUP (netbyaddr, ,,
           {
             if (result->n_addrtype == type && result->n_net == net)
               /* Bingo!  */