root/source3/winbindd/idmap_hash/idmap_hash.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  *  lwopen.h
   3  *
   4  *  Copyright (C) Gerald Carter  <jerry@samba.org>
   5  *
   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.
  10  *
  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.
  15  *
  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/>.
  18  *
  19  */
  20 
  21 #ifndef _LWOPEN_H
  22 #define _LWOPEN_H
  23 
  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);                         \
  32 
  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);
  43 
  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);
  50 
  51 
  52 NTSTATUS mapfile_lookup_key(TALLOC_CTX *ctx,
  53                             const char *value,
  54                             char **key);
  55 
  56 NTSTATUS mapfile_lookup_value(TALLOC_CTX *ctx,
  57                               const char *key,
  58                               char **value);
  59 
  60 #endif /* _LWOPEN_H */

/* [<][>][^][v][top][bottom][index][help] */