~ubuntu-branches/ubuntu/oneiric/likewise-open/oneiric

« back to all changes in this revision

Viewing changes to librpc/netlib/net_util.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Salley
  • Date: 2010-11-22 12:06:00 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20101122120600-8lba1fpceot71wlb
Tags: 6.0.0.53010-1
Likewise Open 6.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Editor Settings: expandtabs and use 4 spaces for indentation
2
 
 * ex: set softtabstop=4 tabstop=8 expandtab shiftwidth=4: *
3
 
 */
4
 
 
5
 
/*
6
 
 * Copyright Likewise Software    2004-2008
7
 
 * All rights reserved.
8
 
 *
9
 
 * This library is free software; you can redistribute it and/or modify it
10
 
 * under the terms of the GNU Lesser General Public License as published by
11
 
 * the Free Software Foundation; either version 2.1 of the license, or (at
12
 
 * your option) any later version.
13
 
 *
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 Lesser
17
 
 * General Public License for more details.  You should have received a copy
18
 
 * of the GNU Lesser General Public License along with this program.  If
19
 
 * not, see <http://www.gnu.org/licenses/>.
20
 
 *
21
 
 * LIKEWISE SOFTWARE MAKES THIS SOFTWARE AVAILABLE UNDER OTHER LICENSING
22
 
 * TERMS AS WELL.  IF YOU HAVE ENTERED INTO A SEPARATE LICENSE AGREEMENT
23
 
 * WITH LIKEWISE SOFTWARE, THEN YOU MAY ELECT TO USE THE SOFTWARE UNDER THE
24
 
 * TERMS OF THAT SOFTWARE LICENSE AGREEMENT INSTEAD OF THE TERMS OF THE GNU
25
 
 * LESSER GENERAL PUBLIC LICENSE, NOTWITHSTANDING THE ABOVE NOTICE.  IF YOU
26
 
 * HAVE QUESTIONS, OR WISH TO REQUEST A COPY OF THE ALTERNATE LICENSING
27
 
 * TERMS OFFERED BY LIKEWISE SOFTWARE, PLEASE CONTACT LIKEWISE SOFTWARE AT
28
 
 * license@likewisesoftware.com
29
 
 */
30
 
 
31
 
#ifndef _NET_UTIL_H_
32
 
#define _NET_UTIL_H_
33
 
 
34
 
 
35
 
#define BAIL_ON_NTSTATUS_ERROR(s)            \
36
 
    if ((s) != STATUS_SUCCESS) {             \
37
 
        status = (s);                        \
38
 
        err = NtStatusToWin32Error((s));     \
39
 
        goto error;                          \
40
 
    }
41
 
 
42
 
#define BAIL_ON_WINERR_ERROR(e)              \
43
 
    if ((e) != ERROR_SUCCESS) {              \
44
 
        err = (e);                           \
45
 
        goto error;                          \
46
 
    }
47
 
 
48
 
#define BAIL_ON_LDERR_ERROR(e)               \
49
 
    if ((e) != LDAP_SUCCESS) {               \
50
 
        lderr = (e);                         \
51
 
        goto error;                          \
52
 
    }
53
 
 
54
 
#define BAIL_ON_NO_MEMORY(p)                 \
55
 
    if ((p) == NULL) {                       \
56
 
        err = ERROR_OUTOFMEMORY;             \
57
 
        goto error;                          \
58
 
    }
59
 
 
60
 
#define goto_if_no_memory_lderr(p, lbl) \
61
 
    if ((p) == NULL) {                  \
62
 
        lderr = LDAP_NO_MEMORY;         \
63
 
        err = ERROR_OUTOFMEMORY;        \
64
 
        goto lbl;                       \
65
 
    }
66
 
 
67
 
#define BAIL_ON_INVALID_PTR(p)                 \
68
 
    if ((p) == NULL) {                         \
69
 
        status = STATUS_INVALID_PARAMETER;     \
70
 
        err = ERROR_INVALID_PARAMETER;         \
71
 
        goto error;                            \
72
 
    }
73
 
 
74
 
 
75
 
#if !defined(MACHPASS_LEN)
76
 
#define MACHPASS_LEN  (16)
77
 
#endif
78
 
 
79
 
 
80
 
#endif /* _NET_UTIL_H_ */
81
 
 
82
 
 
83
 
/*
84
 
local variables:
85
 
mode: c
86
 
c-basic-offset: 4
87
 
indent-tabs-mode: nil
88
 
tab-width: 4
89
 
end:
90
 
*/