preparing for release of 3.0-alpha11
[Samba/ekacnet.git] / source / nsswitch / winbind_nss_config.h
blob88561ee80844bd8e9049d6b512d4eb49c5ca16d1
1 /*
2 Unix SMB/Netbios implementation.
3 Version 2.0
5 Winbind daemon for ntdom nss module
7 Copyright (C) Tim Potter 2000
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public
11 License as published by the Free Software Foundation; either
12 version 2 of the License, or (at your option) any later version.
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Library General Public License for more details.
19 You should have received a copy of the GNU Library General Public
20 License along with this library; if not, write to the
21 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA.
25 #ifndef _WINBIND_NSS_CONFIG_H
26 #define _WINBIND_NSS_CONFIG_H
28 /* Include header files from data in config.h file */
30 #include <config.h>
32 #include <stdio.h>
34 #ifdef HAVE_STDLIB_H
35 #include <stdlib.h>
36 #endif
38 #ifdef HAVE_UNISTD_H
39 #include <unistd.h>
40 #endif
42 #ifdef HAVE_SYS_SOCKET_H
43 #include <sys/socket.h>
44 #endif
46 #ifdef HAVE_UNIXSOCKET
47 #include <sys/un.h>
48 #endif
50 #ifdef HAVE_SYS_TIME_H
51 #include <sys/time.h>
52 #endif
54 #ifdef HAVE_GRP_H
55 #include <grp.h>
56 #endif
58 #ifdef HAVE_STRING_H
59 #include <string.h>
60 #endif
62 #include <sys/types.h>
63 #include <sys/stat.h>
64 #include <errno.h>
65 #include <pwd.h>
66 #include "nsswitch/nss.h"
68 /* Declarations for functions in winbind_nss.c
69 needed in winbind_nss_solaris.c (solaris wrapper to nss) */
71 NSS_STATUS _nss_winbind_setpwent(void);
72 NSS_STATUS _nss_winbind_endpwent(void);
73 NSS_STATUS _nss_winbind_getpwent_r(struct passwd* result, char* buffer,
74 size_t buflen, int* errnop);
75 NSS_STATUS _nss_winbind_getpwuid_r(uid_t, struct passwd*, char* buffer,
76 size_t buflen, int* errnop);
77 NSS_STATUS _nss_winbind_getpwnam_r(const char* name, struct passwd* result,
78 char* buffer, size_t buflen, int* errnop);
80 NSS_STATUS _nss_winbind_setgrent(void);
81 NSS_STATUS _nss_winbind_endgrent(void);
82 NSS_STATUS _nss_winbind_getgrent_r(struct group* result, char* buffer,
83 size_t buflen, int* errnop);
84 NSS_STATUS _nss_winbind_getgrnam_r(const char *name,
85 struct group *result, char *buffer,
86 size_t buflen, int *errnop);
87 NSS_STATUS _nss_winbind_getgrgid_r(gid_t gid,
88 struct group *result, char *buffer,
89 size_t buflen, int *errnop);
91 /* I'm trying really hard not to include anything from smb.h with the
92 result of some silly looking redeclaration of structures. */
94 #ifndef _PSTRING
95 #define _PSTRING
96 #define PSTRING_LEN 1024
97 #define FSTRING_LEN 256
98 typedef char pstring[PSTRING_LEN];
99 typedef char fstring[FSTRING_LEN];
100 #endif
102 #ifndef _BOOL
103 #define _BOOL /* So we don't typedef BOOL again in vfs.h */
104 #define False (0)
105 #define True (1)
106 #define Auto (2)
107 typedef int BOOL;
108 #endif
110 #if !defined(uint32)
111 #if (SIZEOF_INT == 4)
112 #define uint32 unsigned int
113 #elif (SIZEOF_LONG == 4)
114 #define uint32 unsigned long
115 #elif (SIZEOF_SHORT == 4)
116 #define uint32 unsigned short
117 #endif
118 #endif
120 #if !defined(uint16)
121 #if (SIZEOF_SHORT == 4)
122 #define uint16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
123 #else /* SIZEOF_SHORT != 4 */
124 #define uint16 unsigned short
125 #endif /* SIZEOF_SHORT != 4 */
126 #endif
128 #ifndef uint8
129 #define uint8 unsigned char
130 #endif
132 /* zero a structure */
133 #define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
135 /* zero a structure given a pointer to the structure */
136 #define ZERO_STRUCTP(x) { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); }
138 /* Some systems (SCO) treat UNIX domain sockets as FIFOs */
140 #ifndef S_IFSOCK
141 #define S_IFSOCK S_IFIFO
142 #endif
144 #ifndef S_ISSOCK
145 #define S_ISSOCK(mode) ((mode & S_IFSOCK) == S_IFSOCK)
146 #endif
148 #endif