From 24fae4c5df0c5152891893ab677edb4a9b497d11 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Mon, 4 Oct 2010 19:37:47 +0000 Subject: improve consistency of code layout git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1240 ef36b2f9-881f-0410-afb5-c4e39611909c --- nss/rpc.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'nss/rpc.c') diff --git a/nss/rpc.c b/nss/rpc.c index 596d650..f4663ae 100644 --- a/nss/rpc.c +++ b/nss/rpc.c @@ -2,7 +2,7 @@ rpc.c - NSS lookup functions for rpc database Copyright (C) 2006 West Consulting - Copyright (C) 2006, 2007, 2008 Arthur de Jong + Copyright (C) 2006, 2007, 2008, 2010 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -29,6 +29,7 @@ #include "common.h" #include "compat/attrs.h" +/* read a sinlge rpc entry from the stream */ static nss_status_t read_rpcent( TFILE *fp,struct rpcent *result, char *buffer,size_t buflen,int *errnop) @@ -41,14 +42,20 @@ static nss_status_t read_rpcent( return NSS_STATUS_SUCCESS; } -nss_status_t _nss_ldap_getrpcbyname_r(const char *name,struct rpcent *result,char *buffer,size_t buflen,int *errnop) +/* get a rpc entry by name */ +nss_status_t _nss_ldap_getrpcbyname_r( + const char *name,struct rpcent *result, + char *buffer,size_t buflen,int *errnop) { NSS_BYNAME(NSLCD_ACTION_RPC_BYNAME, name, read_rpcent(fp,result,buffer,buflen,errnop)); } -nss_status_t _nss_ldap_getrpcbynumber_r(int number,struct rpcent *result,char *buffer,size_t buflen,int *errnop) +/* get a rpc entry by number */ +nss_status_t _nss_ldap_getrpcbynumber_r( + int number,struct rpcent *result, + char *buffer,size_t buflen,int *errnop) { NSS_BYINT32(NSLCD_ACTION_RPC_BYNUMBER, number, @@ -58,17 +65,22 @@ nss_status_t _nss_ldap_getrpcbynumber_r(int number,struct rpcent *result,char *b /* thread-local file pointer to an ongoing request */ static __thread TFILE *protoentfp; +/* request a stream to list all rpc entries */ nss_status_t _nss_ldap_setrpcent(int UNUSED(stayopen)) { NSS_SETENT(protoentfp); } -nss_status_t _nss_ldap_getrpcent_r(struct rpcent *result,char *buffer,size_t buflen,int *errnop) +/* get an rpc entry from the list */ +nss_status_t _nss_ldap_getrpcent_r( + struct rpcent *result, + char *buffer,size_t buflen,int *errnop) { NSS_GETENT(protoentfp,NSLCD_ACTION_RPC_ALL, read_rpcent(protoentfp,result,buffer,buflen,errnop)); } +/* close the stream opened by setrpcent() above */ nss_status_t _nss_ldap_endrpcent(void) { NSS_ENDENT(protoentfp); -- cgit v1.2.3