first public release of samba4 code
[bbaumbach/samba-autobuild/.git] / source4 / nsswitch / nss.h
1 #ifndef _NSSWITCH_NSS_H
2 #define _NSSWITCH_NSS_H
3 /* 
4    Unix SMB/CIFS implementation.
5
6    a common place to work out how to define NSS_STATUS on various
7    platforms
8
9    Copyright (C) Tim Potter 2000
10    
11    This library is free software; you can redistribute it and/or
12    modify it under the terms of the GNU Library General Public
13    License as published by the Free Software Foundation; either
14    version 2 of the License, or (at your option) any later version.
15    
16    This library is distributed in the hope that it will be useful,
17    but WITHOUT ANY WARRANTY; without even the implied warranty of
18    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19    Library General Public License for more details.
20    
21    You should have received a copy of the GNU Library General Public
22    License along with this library; if not, write to the
23    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24    Boston, MA  02111-1307, USA.   
25 */
26
27 #ifdef HAVE_NSS_COMMON_H
28
29 /* Sun Solaris */
30
31 #include <nss_common.h>
32 #include <nss_dbdefs.h>
33 #include <nsswitch.h>
34
35 typedef nss_status_t NSS_STATUS;
36
37 #define NSS_STATUS_SUCCESS     NSS_SUCCESS
38 #define NSS_STATUS_NOTFOUND    NSS_NOTFOUND
39 #define NSS_STATUS_UNAVAIL     NSS_UNAVAIL
40 #define NSS_STATUS_TRYAGAIN    NSS_TRYAGAIN
41
42 #elif HAVE_NSS_H
43
44 /* GNU */
45
46 #include <nss.h>
47
48 typedef enum nss_status NSS_STATUS;
49
50 #elif HAVE_NS_API_H
51
52 /* SGI IRIX */
53
54 /* following required to prevent warnings of double definition
55  * of datum from ns_api.h
56 */
57 #ifdef DATUM
58 #define _DATUM_DEFINED
59 #endif
60
61 #include <ns_api.h>
62
63 typedef enum
64 {
65   NSS_STATUS_SUCCESS=NS_SUCCESS,
66   NSS_STATUS_NOTFOUND=NS_NOTFOUND,
67   NSS_STATUS_UNAVAIL=NS_UNAVAIL,
68   NSS_STATUS_TRYAGAIN=NS_TRYAGAIN
69 } NSS_STATUS;
70
71 #define NSD_MEM_STATIC 0
72 #define NSD_MEM_VOLATILE 1
73 #define NSD_MEM_DYNAMIC 2
74
75 #elif defined(HPUX) && defined(HAVE_NSSWITCH_H)
76 /* HP-UX 11 */
77
78 #include "nsswitch/hp_nss_common.h"
79 #include "nsswitch/hp_nss_dbdefs.h"
80 #include <nsswitch.h>
81
82 #ifndef _HAVE_TYPEDEF_NSS_STATUS
83 #define _HAVE_TYPEDEF_NSS_STATUS
84 typedef nss_status_t NSS_STATUS;
85
86 #define NSS_STATUS_SUCCESS     NSS_SUCCESS
87 #define NSS_STATUS_NOTFOUND    NSS_NOTFOUND
88 #define NSS_STATUS_UNAVAIL     NSS_UNAVAIL
89 #define NSS_STATUS_TRYAGAIN    NSS_TRYAGAIN
90 #endif /* HPUX */
91
92 #else /* Nothing's defined. Neither gnu nor sun nor hp */
93
94 typedef enum
95 {
96   NSS_STATUS_SUCCESS=0,
97   NSS_STATUS_NOTFOUND=1,
98   NSS_STATUS_UNAVAIL=2,
99   NSS_STATUS_TRYAGAIN=3
100 } NSS_STATUS;
101
102 #endif
103
104 #endif /* _NSSWITCH_NSS_H */