885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose/*
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose Unix SMB/CIFS implementation.
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose Winbind client API
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose Copyright (C) Gerald (Jerry) Carter 2007
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose This library is free software; you can redistribute it and/or
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose modify it under the terms of the GNU Lesser General Public
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose License as published by the Free Software Foundation; either
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose version 3 of the License, or (at your option) any later version.
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose This library is distributed in the hope that it will be useful,
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose but WITHOUT ANY WARRANTY; without even the implied warranty of
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose Library General Public License for more details.
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose You should have received a copy of the GNU Lesser General Public License
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose along with this program. If not, see <http://www.gnu.org/licenses/>.
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose*/
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose#ifndef _WBC_ERR_INTERNAL_H
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose#define _WBC_ERR_INTERNAL_H
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose/* Private macros */
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose#define BAIL_ON_WBC_ERROR(x) \
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose do { \
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose if (!WBC_ERROR_IS_OK(x)) { \
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose goto done; \
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose } \
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose } while(0)
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose#define BAIL_ON_PTR_ERROR(x, status) \
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose do { \
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose if ((x) == NULL) { \
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose status = WBC_ERR_NO_MEMORY; \
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose goto done; \
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose } else { \
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose status = WBC_ERR_SUCCESS; \
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose } \
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose } while (0)
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose#endif /* _WBC_ERR_INTERNAL_H */