if we are adding a new sambaAccount, make sure that we add a
[Samba.git] / source / nsswitch / nss.h
blobd83a5e237ed32505311bf40d04917633575f4980
1 #ifndef _NSSWITCH_NSS_H
2 #define _NSSWITCH_NSS_H
3 /*
4 Unix SMB/CIFS implementation.
6 a common place to work out how to define NSS_STATUS on various
7 platforms
9 Copyright (C) Tim Potter 2000
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.
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.
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.
27 #ifdef HAVE_NSS_COMMON_H
29 /* Sun Solaris */
31 #include <nss_common.h>
32 #include <nss_dbdefs.h>
33 #include <nsswitch.h>
35 typedef nss_status_t NSS_STATUS;
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
42 #elif HAVE_NSS_H
44 /* GNU */
46 #include <nss.h>
48 typedef enum nss_status NSS_STATUS;
50 #elif HAVE_NS_API_H
52 /* SGI IRIX */
54 /* following required to prevent warnings of double definition
55 * of datum from ns_api.h
57 #ifdef DATUM
58 #define _DATUM_DEFINED
59 #endif
61 #include <ns_api.h>
63 typedef enum
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;
71 #define NSD_MEM_STATIC 0
72 #define NSD_MEM_VOLATILE 1
73 #define NSD_MEM_DYNAMIC 2
75 #elif defined(HPUX) && defined(HAVE_NSSWITCH_H)
76 /* HP-UX 11 */
78 #include "nsswitch/hp_nss_common.h"
79 #include "nsswitch/hp_nss_dbdefs.h"
80 #include <nsswitch.h>
82 #ifndef _HAVE_TYPEDEF_NSS_STATUS
83 #define _HAVE_TYPEDEF_NSS_STATUS
84 typedef nss_status_t NSS_STATUS;
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 */
92 #else /* Nothing's defined. Neither gnu nor sun nor hp */
94 typedef enum
96 NSS_STATUS_SUCCESS=0,
97 NSS_STATUS_NOTFOUND=1,
98 NSS_STATUS_UNAVAIL=2,
99 NSS_STATUS_TRYAGAIN=3
100 } NSS_STATUS;
102 #endif
104 #endif /* _NSSWITCH_NSS_H */