(LOOKUP_NAME_CASE): New macro for case insensitive comparing.
authordrepper <drepper>
Tue, 20 Jan 1998 18:16:39 +0000 (18:16 +0000)
committerdrepper <drepper>
Tue, 20 Jan 1998 18:16:39 +0000 (18:16 +0000)
nss/nss_files/files-parse.c

index 76df1c6..198b359 100644 (file)
@@ -1,5 +1,5 @@
 /* Common code for file-based database parsers in nss_files module.
-   Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 1998 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
@@ -232,6 +232,18 @@ parse_list (char *line, struct parser_data *data, size_t datalen, int *errnop)
     break;                                                                   \
 }
 
+#define LOOKUP_NAME_CASE(nameelt, aliaselt)                                  \
+{                                                                            \
+  char **ap;                                                                 \
+  if (! strcasecmp (name, result->nameelt))                                  \
+    break;                                                                   \
+  for (ap = result->aliaselt; *ap; ++ap)                                     \
+    if (! strcasecmp (name, *ap))                                            \
+      break;                                                                 \
+  if (*ap)                                                                   \
+    break;                                                                   \
+}
+
 
 /* This is defined by db-*.c to include "../nss_db/db-XXX.c" instead.  */
 #ifndef GENERIC