sync'ing up for 3.0alpha20 release
[Samba.git] / source / nsswitch / winbind_nss_config.h
blobd9a9b8aaaefe07a250b89cc79070febc212940ef
1 /*
2 Unix SMB/CIFS implementation.
4 Winbind daemon for ntdom nss module
6 Copyright (C) Tim Potter 2000
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.
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.
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.
24 #ifndef _WINBIND_NSS_CONFIG_H
25 #define _WINBIND_NSS_CONFIG_H
27 /* Include header files from data in config.h file */
29 #include <config.h>
31 #include <stdio.h>
33 #ifdef HAVE_STDLIB_H
34 #include <stdlib.h>
35 #endif
37 #ifdef HAVE_UNISTD_H
38 #include <unistd.h>
39 #endif
41 #ifdef HAVE_SYS_SELECT_H
42 #include <sys/select.h>
43 #endif
45 #ifdef HAVE_SYS_SOCKET_H
46 #include <sys/socket.h>
47 #endif
49 #ifdef HAVE_UNIXSOCKET
50 #include <sys/un.h>
51 #endif
53 #ifdef HAVE_SYS_TIME_H
54 #include <sys/time.h>
55 #endif
57 #ifdef HAVE_GRP_H
58 #include <grp.h>
59 #endif
61 #ifdef HAVE_STRING_H
62 #include <string.h>
63 #endif
65 #ifdef HAVE_FCNTL_H
66 #include <fcntl.h>
67 #else
68 #ifdef HAVE_SYS_FCNTL_H
69 #include <sys/fcntl.h>
70 #endif
71 #endif
73 #include <sys/types.h>
74 #include <sys/stat.h>
75 #include <errno.h>
76 #include <pwd.h>
77 #include "nsswitch/nss.h"
79 /* Declarations for functions in winbind_nss.c
80 needed in winbind_nss_solaris.c (solaris wrapper to nss) */
82 NSS_STATUS _nss_winbind_setpwent(void);
83 NSS_STATUS _nss_winbind_endpwent(void);
84 NSS_STATUS _nss_winbind_getpwent_r(struct passwd* result, char* buffer,
85 size_t buflen, int* errnop);
86 NSS_STATUS _nss_winbind_getpwuid_r(uid_t, struct passwd*, char* buffer,
87 size_t buflen, int* errnop);
88 NSS_STATUS _nss_winbind_getpwnam_r(const char* name, struct passwd* result,
89 char* buffer, size_t buflen, int* errnop);
91 NSS_STATUS _nss_winbind_setgrent(void);
92 NSS_STATUS _nss_winbind_endgrent(void);
93 NSS_STATUS _nss_winbind_getgrent_r(struct group* result, char* buffer,
94 size_t buflen, int* errnop);
95 NSS_STATUS _nss_winbind_getgrnam_r(const char *name,
96 struct group *result, char *buffer,
97 size_t buflen, int *errnop);
98 NSS_STATUS _nss_winbind_getgrgid_r(gid_t gid,
99 struct group *result, char *buffer,
100 size_t buflen, int *errnop);
102 /* I'm trying really hard not to include anything from smb.h with the
103 result of some silly looking redeclaration of structures. */
105 #ifndef _PSTRING
106 #define _PSTRING
107 #define PSTRING_LEN 1024
108 #define FSTRING_LEN 256
109 typedef char pstring[PSTRING_LEN];
110 typedef char fstring[FSTRING_LEN];
111 #endif
113 #ifndef _BOOL
114 #define _BOOL /* So we don't typedef BOOL again in vfs.h */
115 #define False (0)
116 #define True (1)
117 #define Auto (2)
118 typedef int BOOL;
119 #endif
121 #if !defined(uint32)
122 #if (SIZEOF_INT == 4)
123 #define uint32 unsigned int
124 #elif (SIZEOF_LONG == 4)
125 #define uint32 unsigned long
126 #elif (SIZEOF_SHORT == 4)
127 #define uint32 unsigned short
128 #endif
129 #endif
131 #if !defined(uint16)
132 #if (SIZEOF_SHORT == 4)
133 #define uint16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
134 #else /* SIZEOF_SHORT != 4 */
135 #define uint16 unsigned short
136 #endif /* SIZEOF_SHORT != 4 */
137 #endif
139 #ifndef uint8
140 #define uint8 unsigned char
141 #endif
143 /* zero a structure */
144 #ifndef ZERO_STRUCT
145 #define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
146 #endif
148 /* zero a structure given a pointer to the structure */
149 #ifndef ZERO_STRUCTP
150 #define ZERO_STRUCTP(x) { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); }
151 #endif
153 /* Some systems (SCO) treat UNIX domain sockets as FIFOs */
155 #ifndef S_IFSOCK
156 #define S_IFSOCK S_IFIFO
157 #endif
159 #ifndef S_ISSOCK
160 #define S_ISSOCK(mode) ((mode & S_IFSOCK) == S_IFSOCK)
161 #endif
163 #endif