if we are adding a new sambaAccount, make sure that we add a
[Samba.git] / source / nsswitch / winbind_nss_config.h
blob00cd5c12e4798dc08131cb3de47d8d92cc318c71
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 #include <sys/types.h>
66 #include <sys/stat.h>
67 #include <errno.h>
68 #include <pwd.h>
69 #include "nsswitch/nss.h"
71 /* Declarations for functions in winbind_nss.c
72 needed in winbind_nss_solaris.c (solaris wrapper to nss) */
74 NSS_STATUS _nss_winbind_setpwent(void);
75 NSS_STATUS _nss_winbind_endpwent(void);
76 NSS_STATUS _nss_winbind_getpwent_r(struct passwd* result, char* buffer,
77 size_t buflen, int* errnop);
78 NSS_STATUS _nss_winbind_getpwuid_r(uid_t, struct passwd*, char* buffer,
79 size_t buflen, int* errnop);
80 NSS_STATUS _nss_winbind_getpwnam_r(const char* name, struct passwd* result,
81 char* buffer, size_t buflen, int* errnop);
83 NSS_STATUS _nss_winbind_setgrent(void);
84 NSS_STATUS _nss_winbind_endgrent(void);
85 NSS_STATUS _nss_winbind_getgrent_r(struct group* result, char* buffer,
86 size_t buflen, int* errnop);
87 NSS_STATUS _nss_winbind_getgrnam_r(const char *name,
88 struct group *result, char *buffer,
89 size_t buflen, int *errnop);
90 NSS_STATUS _nss_winbind_getgrgid_r(gid_t gid,
91 struct group *result, char *buffer,
92 size_t buflen, int *errnop);
94 /* I'm trying really hard not to include anything from smb.h with the
95 result of some silly looking redeclaration of structures. */
97 #ifndef _PSTRING
98 #define _PSTRING
99 #define PSTRING_LEN 1024
100 #define FSTRING_LEN 256
101 typedef char pstring[PSTRING_LEN];
102 typedef char fstring[FSTRING_LEN];
103 #endif
105 #ifndef _BOOL
106 #define _BOOL /* So we don't typedef BOOL again in vfs.h */
107 #define False (0)
108 #define True (1)
109 #define Auto (2)
110 typedef int BOOL;
111 #endif
113 #if !defined(uint32)
114 #if (SIZEOF_INT == 4)
115 #define uint32 unsigned int
116 #elif (SIZEOF_LONG == 4)
117 #define uint32 unsigned long
118 #elif (SIZEOF_SHORT == 4)
119 #define uint32 unsigned short
120 #endif
121 #endif
123 #if !defined(uint16)
124 #if (SIZEOF_SHORT == 4)
125 #define uint16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
126 #else /* SIZEOF_SHORT != 4 */
127 #define uint16 unsigned short
128 #endif /* SIZEOF_SHORT != 4 */
129 #endif
131 #ifndef uint8
132 #define uint8 unsigned char
133 #endif
135 /* zero a structure */
136 #ifndef ZERO_STRUCT
137 #define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
138 #endif
140 /* zero a structure given a pointer to the structure */
141 #ifndef ZERO_STRUCTP
142 #define ZERO_STRUCTP(x) { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); }
143 #endif
145 /* Some systems (SCO) treat UNIX domain sockets as FIFOs */
147 #ifndef S_IFSOCK
148 #define S_IFSOCK S_IFIFO
149 #endif
151 #ifndef S_ISSOCK
152 #define S_ISSOCK(mode) ((mode & S_IFSOCK) == S_IFSOCK)
153 #endif
155 #endif