a3ba7629956a355fa6d6451490d5bffe4a6bb0c9
[samba] / source / nsswitch / winbind_nss_solaris.h
1 /* 
2    Unix SMB/CIFS implementation.
3
4    Winbind daemon for ntdom nss module
5
6    Copyright (C) Tim Potter 2000
7    
8    This library is free software; you can redistribute it and/or
9    modify it under the terms of the GNU Library General Public
10    License as published by the Free Software Foundation; either
11    version 2 of the License, or (at your option) any later version.
12    
13    This library is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    Library General Public License for more details.
17    
18    You should have received a copy of the GNU Library General Public
19    License along with this library; if not, write to the
20    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21    Boston, MA  02111-1307, USA.   
22 */
23
24 #ifndef _WINBIND_NSS_SOLARIS_H
25 #define _WINBIND_NSS_SOLARIS_H
26
27 /* Solaris has a broken nss_common header file containing C++ reserved names. */
28 #ifndef __cplusplus
29 #undef class
30 #undef private
31 #undef public
32 #undef protected
33 #undef template
34 #undef this
35 #undef new
36 #undef delete
37 #undef friend
38 #endif
39
40 #include <nss_common.h>
41
42 #ifndef __cplusplus
43 #define class #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
44 #define private #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
45 #define public #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
46 #define protected #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
47 #define template #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
48 #define this #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
49 #define new #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
50 #define delete #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
51 #define friend #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
52 #endif
53
54 #include <nss_dbdefs.h>
55 #include <nsswitch.h>
56
57 typedef nss_status_t NSS_STATUS;
58
59 #define NSS_STATUS_SUCCESS     NSS_SUCCESS
60 #define NSS_STATUS_NOTFOUND    NSS_NOTFOUND
61 #define NSS_STATUS_UNAVAIL     NSS_UNAVAIL
62 #define NSS_STATUS_TRYAGAIN    NSS_TRYAGAIN
63
64 /* The solaris winbind is implemented as a wrapper around the linux
65    version. */
66
67 NSS_STATUS _nss_winbind_setpwent(void);
68 NSS_STATUS _nss_winbind_endpwent(void);
69 NSS_STATUS _nss_winbind_getpwent_r(struct passwd* result, char* buffer,
70                                    size_t buflen, int* errnop);
71 NSS_STATUS _nss_winbind_getpwuid_r(uid_t, struct passwd*, char* buffer,
72                                    size_t buflen, int* errnop);
73 NSS_STATUS _nss_winbind_getpwnam_r(const char* name, struct passwd* result,
74                                    char* buffer, size_t buflen, int* errnop);
75
76 NSS_STATUS _nss_winbind_setgrent(void);
77 NSS_STATUS _nss_winbind_endgrent(void);
78 NSS_STATUS _nss_winbind_getgrent_r(struct group* result, char* buffer,
79                                    size_t buflen, int* errnop);
80 NSS_STATUS _nss_winbind_getgrnam_r(const char *name,
81                                    struct group *result, char *buffer,
82                                    size_t buflen, int *errnop);
83 NSS_STATUS _nss_winbind_getgrgid_r(gid_t gid,
84                                    struct group *result, char *buffer,
85                                    size_t buflen, int *errnop);
86
87 #endif /* _WINBIND_NSS_SOLARIS_H */