idmap_hash: Add the idmap/nss-info provider from Likewise Open.
[Samba/bb.git] / source / winbindd / idmap_hash / idmap_hash.h
blob621520e950e5ec7e6aa3d1e50811f704b9b48ca1
1 /*
2 * lwopen.h
4 * Copyright (C) Gerald Carter <jerry@samba.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
21 #ifndef _LWOPEN_H
22 #define _LWOPEN_H
24 #define BAIL_ON_NTSTATUS_ERROR(x) \
25 do { \
26 if (!NT_STATUS_IS_OK(x)) { \
27 DEBUG(10,("Failed! (%s)\n", nt_errstr(x))); \
28 goto done; \
29 } \
30 } \
31 while (0); \
33 #define BAIL_ON_PTR_NT_ERROR(p, x) \
34 do { \
35 if ((p) == NULL ) { \
36 DEBUG(10,("NULL pointer!\n")); \
37 x = NT_STATUS_NO_MEMORY; \
38 goto done; \
39 } else { \
40 x = NT_STATUS_OK; \
41 } \
42 } while (0);
44 #define PRINT_NTSTATUS_ERROR(x, hdr, level) \
45 do { \
46 if (!NT_STATUS_IS_OK(x)) { \
47 DEBUG(level,("Likewise Open ("hdr"): %s\n", nt_errstr(x))); \
48 } \
49 } while(0);
52 NTSTATUS mapfile_lookup_key(TALLOC_CTX *ctx,
53 const char *value,
54 char **key);
56 NTSTATUS mapfile_lookup_value(TALLOC_CTX *ctx,
57 const char *key,
58 char **value);
60 #endif /* _LWOPEN_H */