deal with allocation size of 0 in prs_unistr when UNMARSHALLING
[Samba.git] / source / nsswitch / winbind_nss_config.h
blobc8e43f396c2f85919448eb9efb6b74da55a7b37a
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 _NTDOM_CONFIG_H
26 #define _NTDOM_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_SYS_UN_H
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 #include <sys/types.h>
59 #include <sys/stat.h>
60 #include <errno.h>
61 #include <pwd.h>
63 #ifdef HAVE_NSS_H
64 #include <nss.h>
65 #else
66 /* Minimal needed to compile.. */
67 enum nss_status {
68 NSS_STATUS_SUCCESS,
69 NSS_STATUS_NOTFOUND,
70 NSS_STATUS_UNAVAIL
72 #endif
74 /* I'm trying really hard not to include anything from smb.h with the
75 result of some silly looking redeclaration of structures. */
77 #ifndef _PSTRING
78 #define _PSTRING
79 #define PSTRING_LEN 1024
80 #define FSTRING_LEN 128
81 typedef char pstring[PSTRING_LEN];
82 typedef char fstring[FSTRING_LEN];
83 #endif
85 #ifndef _BOOL
86 #define _BOOL /* So we don't typedef BOOL again in vfs.h */
87 #define False (0)
88 #define True (1)
89 #define Auto (2)
90 typedef int BOOL;
91 #endif
93 #if !defined(uint32)
94 #if (SIZEOF_INT == 4)
95 #define uint32 unsigned int
96 #elif (SIZEOF_LONG == 4)
97 #define uint32 unsigned long
98 #elif (SIZEOF_SHORT == 4)
99 #define uint32 unsigned short
100 #endif
101 #endif
103 #if !defined(uint16)
104 #if (SIZEOF_SHORT == 4)
105 #define uint16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
106 #else /* SIZEOF_SHORT != 4 */
107 #define uint16 unsigned short
108 #endif /* SIZEOF_SHORT != 4 */
109 #endif
111 #ifndef uint8
112 #define uint8 unsigned char
113 #endif
115 /* zero a structure */
116 #define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
118 /* zero a structure given a pointer to the structure */
119 #define ZERO_STRUCTP(x) { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); }
121 #endif