diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2010-09-24 15:04:06 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2010-09-24 15:04:06 +0200 |
commit | e21d0b3e3a87c9a361ecde9560c3fd07226e97d1 (patch) | |
tree | 0bbb3533783e17276abd69128d685169a0bd963f /compat | |
parent | 2bdae403811d7d995cd921b4232c9f9256068ab5 (diff) |
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
Diffstat (limited to 'compat')
-rw-r--r-- | compat/nss_compat.h | 35 |
1 files changed, 35 insertions, 0 deletions
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 |