diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2010-10-04 21:37:47 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2010-10-04 21:37:47 +0200 |
commit | 24fae4c5df0c5152891893ab677edb4a9b497d11 (patch) | |
tree | 298a9d6b2a657a1d1e1c8ced9348f2dbc084888a /nss/rpc.c | |
parent | b7c3c078c873b1596519b661fdc5b35d48794ace (diff) |
improve consistency of code layout
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1240 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nss/rpc.c')
-rw-r--r-- | nss/rpc.c | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -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); |