This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'.(This used to...
[ira/wip.git] / source3 / nsswitch / winbind_nss_config.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_CONFIG_H
25 #define _WINBIND_NSS_CONFIG_H
26
27 /* Include header files from data in config.h file */
28
29 #include <config.h>
30
31 #include <stdio.h>
32
33 #ifdef HAVE_STDLIB_H
34 #include <stdlib.h>
35 #endif
36
37 #ifdef HAVE_UNISTD_H
38 #include <unistd.h>
39 #endif
40
41 #ifdef HAVE_SYS_SOCKET_H
42 #include <sys/socket.h>
43 #endif
44
45 #ifdef HAVE_UNIXSOCKET
46 #include <sys/un.h>
47 #endif
48
49 #ifdef HAVE_SYS_TIME_H
50 #include <sys/time.h>
51 #endif
52
53 #ifdef HAVE_GRP_H
54 #include <grp.h>
55 #endif
56
57 #ifdef HAVE_STRING_H
58 #include <string.h>
59 #endif
60
61 #include <sys/types.h>
62 #include <sys/stat.h>
63 #include <errno.h>
64 #include <pwd.h>
65 #include "nsswitch/nss.h"
66
67 /* Declarations for functions in winbind_nss.c
68    needed in winbind_nss_solaris.c (solaris wrapper to nss) */
69
70 NSS_STATUS _nss_winbind_setpwent(void);
71 NSS_STATUS _nss_winbind_endpwent(void);
72 NSS_STATUS _nss_winbind_getpwent_r(struct passwd* result, char* buffer,
73                                    size_t buflen, int* errnop);
74 NSS_STATUS _nss_winbind_getpwuid_r(uid_t, struct passwd*, char* buffer,
75                                    size_t buflen, int* errnop);
76 NSS_STATUS _nss_winbind_getpwnam_r(const char* name, struct passwd* result,
77                                    char* buffer, size_t buflen, int* errnop);
78
79 NSS_STATUS _nss_winbind_setgrent(void);
80 NSS_STATUS _nss_winbind_endgrent(void);
81 NSS_STATUS _nss_winbind_getgrent_r(struct group* result, char* buffer,
82                                    size_t buflen, int* errnop);
83 NSS_STATUS _nss_winbind_getgrnam_r(const char *name,
84                                    struct group *result, char *buffer,
85                                    size_t buflen, int *errnop);
86 NSS_STATUS _nss_winbind_getgrgid_r(gid_t gid,
87                                    struct group *result, char *buffer,
88                                    size_t buflen, int *errnop);
89
90 /* I'm trying really hard not to include anything from smb.h with the
91    result of some silly looking redeclaration of structures. */
92
93 #ifndef _PSTRING
94 #define _PSTRING
95 #define PSTRING_LEN 1024
96 #define FSTRING_LEN 256
97 typedef char pstring[PSTRING_LEN];
98 typedef char fstring[FSTRING_LEN];
99 #endif
100
101 #ifndef _BOOL
102 #define _BOOL                   /* So we don't typedef BOOL again in vfs.h */
103 #define False (0)
104 #define True (1)
105 #define Auto (2)
106 typedef int BOOL;
107 #endif
108
109 #if !defined(uint32)
110 #if (SIZEOF_INT == 4)
111 #define uint32 unsigned int
112 #elif (SIZEOF_LONG == 4)
113 #define uint32 unsigned long
114 #elif (SIZEOF_SHORT == 4)
115 #define uint32 unsigned short
116 #endif
117 #endif
118
119 #if !defined(uint16)
120 #if (SIZEOF_SHORT == 4)
121 #define uint16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
122 #else /* SIZEOF_SHORT != 4 */
123 #define uint16 unsigned short
124 #endif /* SIZEOF_SHORT != 4 */
125 #endif
126
127 #ifndef uint8
128 #define uint8 unsigned char
129 #endif
130
131 /* zero a structure */
132 #define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
133
134 /* zero a structure given a pointer to the structure */
135 #define ZERO_STRUCTP(x) { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); }
136     
137 /* Some systems (SCO) treat UNIX domain sockets as FIFOs */
138
139 #ifndef S_IFSOCK
140 #define S_IFSOCK S_IFIFO
141 #endif
142
143 #ifndef S_ISSOCK
144 #define S_ISSOCK(mode)  ((mode & S_IFSOCK) == S_IFSOCK)
145 #endif
146
147 #endif