WHATSNEW: Update release notes.
[Samba.git] / nsswitch / nsstest.h
blobe69f17c85785755d7056829438b27fe248f76026
1 /*
2 Unix SMB/CIFS implementation.
3 nss includes for the nss tester
4 Copyright (C) Kai Blin 2007
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef _NSSTEST_H
21 #define _NSSTEST_H
23 #include <pwd.h>
24 #include <grp.h>
26 #ifdef HAVE_NSS_COMMON_H
29 * Sun Solaris
32 #include <nss_common.h>
33 #include <nss_dbdefs.h>
34 #include <nsswitch.h>
36 typedef nss_status_t NSS_STATUS;
38 #define NSS_STATUS_SUCCESS NSS_SUCCESS
39 #define NSS_STATUS_NOTFOUND NSS_NOTFOUND
40 #define NSS_STATUS_UNAVAIL NSS_UNAVAIL
41 #define NSS_STATUS_TRYAGAIN NSS_TRYAGAIN
43 #elif HAVE_NSS_H
46 * Linux (glibc)
49 #include <nss.h>
50 typedef enum nss_status NSS_STATUS;
52 #elif HAVE_NS_API_H
55 * SGI IRIX
58 #ifdef DATUM
59 #define _DATUM_DEFINED
60 #endif
62 #include <ns_api.h>
64 typedef enum
66 NSS_STATUS_SUCCESS=NS_SUCCESS,
67 NSS_STATUS_NOTFOUND=NS_NOTFOUND,
68 NSS_STATUS_UNAVAIL=NS_UNAVAIL,
69 NSS_STATUS_TRYAGAIN=NS_TRYAGAIN
70 } NSS_STATUS;
72 #define NSD_MEM_STATIC 0
73 #define NSD_MEM_VOLATILE 1
74 #define NSD_MEM_DYNAMIC 2
76 #elif defined(HPUX) && defined(HAVE_NSSWITCH_H)
78 /* HP-UX 11 */
80 #include <nsswitch.h>
82 #define NSS_STATUS_SUCCESS NSS_SUCCESS
83 #define NSS_STATUS_NOTFOUND NSS_NOTFOUND
84 #define NSS_STATUS_UNAVAIL NSS_UNAVAIL
85 #define NSS_STATUS_TRYAGAIN NSS_TRYAGAIN
87 #ifdef HAVE_SYNCH_H
88 #include <synch.h>
89 #endif
90 #ifdef HAVE_PTHREAD_H
91 #include <pthread.h>
92 #endif
94 typedef enum {
95 NSS_SUCCESS,
96 NSS_NOTFOUND,
97 NSS_UNAVAIL,
98 NSS_TRYAGAIN
99 } nss_status_t;
101 typedef nss_status_t NSS_STATUS;
103 #else /* Nothing's defined. Neither solaris nor gnu nor sun nor hp */
105 typedef enum
107 NSS_STATUS_SUCCESS=0,
108 NSS_STATUS_NOTFOUND=1,
109 NSS_STATUS_UNAVAIL=2,
110 NSS_STATUS_TRYAGAIN=3
111 } NSS_STATUS;
113 #endif
115 #endif /* _NSSTEST_H */