From e21d0b3e3a87c9a361ecde9560c3fd07226e97d1 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Fri, 24 Sep 2010 13:04:06 +0000 Subject: switch to using nss_status_t throughout the code and provide compatibility code to use whatever nss_status type is used on the system git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1214 ef36b2f9-881f-0410-afb5-c4e39611909c --- compat/nss_compat.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'compat') diff --git a/compat/nss_compat.h b/compat/nss_compat.h index 238f77c..2f79196 100644 --- a/compat/nss_compat.h +++ b/compat/nss_compat.h @@ -45,6 +45,41 @@ #include "compat/ether.h" +/* define missing status codes */ +#ifndef HAVE_ENUM_NSS_STATUS +#ifndef NSS_STATUS_SUCCESS +#define NSS_STATUS_SUCCESS NSS_SUCCESS +#endif +#ifndef NSS_STATUS_NOTFOUND +#define NSS_STATUS_NOTFOUND NSS_NOTFOUND +#endif +#ifndef NSS_STATUS_UNAVAIL +#define NSS_STATUS_UNAVAIL NSS_UNAVAIL +#endif +#ifndef NSS_STATUS_TRYAGAIN +#define NSS_STATUS_TRYAGAIN NSS_TRYAGAIN +#endif +#ifndef NSS_STATUS_RETURN +#define NSS_STATUS_RETURN NSS_NOTFOUND +#endif +#endif /* not HAVE_ENUM_NSS_STATUS */ + +/* define nss_status_t */ +#ifdef HAVE_ENUM_NSS_STATUS +typedef enum nss_status nss_status_t; +#endif + +#ifndef HAVE_ENUM_NSS_STATUS +enum nss_status +{ + NSS_STATUS_TRYAGAIN = NSS_TRYAGAIN, + NSS_STATUS_UNAVAIL = NSS_UNAVAIL, + NSS_STATUS_NOTFOUND = NSS_NOTFOUND, + NSS_STATUS_SUCCESS = NSS_SUCCESS, + NSS_STATUS_RETURN = NSS_NOTFOUND +}; +#endif + /* Define an aliasent if it was not found on the system. */ #ifndef HAVE_STRUCT_ALIASENT struct aliasent -- cgit v1.2.3