diff options
author | nalin <nalin> | 2002-11-18 22:05:08 +0000 |
---|---|---|
committer | nalin <nalin> | 2002-11-18 22:05:08 +0000 |
commit | dbf919855d755917146a86ab4e3201041ade0332 (patch) | |
tree | 07af350ac300b38df79a96f11ff80f729644613d /src/protocols.c | |
parent | 4e355429e4b3f16de43ef0ac94eafe0a820b0406 (diff) | |
download | nss_directories-dbf919855d755917146a86ab4e3201041ade0332.tar.gz nss_directories-dbf919855d755917146a86ab4e3201041ade0332.tar.xz nss_directories-dbf919855d755917146a86ab4e3201041ade0332.zip |
* src/files-parse.c, src/glibc-parse.c: add glibc-based parsing internally
* src/passwd.c,src/services.c,src/group.c,src/protocols.c,src/shadow.c: use
the new parsing code
* src/generic.c (setent): return SUCCESS on successful open, not UNAVAIL
* src/Makefile.am: export only _nss_directories_[sge]*, to export the setent,
getent/getby, and endent functions, but not the parsers.
Diffstat (limited to 'src/protocols.c')
-rw-r--r-- | src/protocols.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/protocols.c b/src/protocols.c index 0a89a81..a7c3074 100644 --- a/src/protocols.c +++ b/src/protocols.c @@ -16,14 +16,34 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ident "$Id: protocols.c,v 1.1 2002/11/18 19:53:21 nalin Exp $" +#ident "$Id: protocols.c,v 1.2 2002/11/18 22:08:14 nalin Exp $" #include <sys/types.h> #include <netdb.h> +/* Shared information. */ #define STRUCTURE protoent -#define FILENAME "protocols" +#define DATABASE "protocols" +/* Parser. */ +#define ENTNAME protoent +struct protoent_data {}; + +#define libc_hidden_def(ignored) +#define _nss_files_parse_ _nss_directories_parse_ + +#define TRAILING_LIST_MEMBER p_aliases +#define TRAILING_LIST_SEPARATOR_P isspace + +#include "files-parse.c" + +LINE_PARSER +("#", + STRING_FIELD (result->p_name, isspace, 1); + INT_FIELD (result->p_proto, isspace, 1, 10,); +) + +/* Lookups. */ #define getnam _nss_directories_getprotobyname_r #define getnam_field p_name #define getnam_fields p_aliases @@ -36,6 +56,4 @@ #define getent _nss_directories_getprotoent_r #define endent _nss_directories_endprotoent -#define parser _nss_files_parse_protoent - #include "generic.c" |