db_headers.h revision d67944fbe3fa0b31893a7116a09b0718eecf6078
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _DB_HEADERS_H
#define _DB_HEADERS_H
#include <syslog.h>
#include <stdlib.h>
#include <setjmp.h>
#ifdef __cplusplus
extern "C" {
#endif
extern int verbose;
#ifdef __cplusplus
}
#endif
{ \
return; \
}
{ \
return (retval); \
}
#ifdef NISDB_MT_DEBUG
{ \
if (lockcode != 0) { \
abort(); \
} \
}
#else
{ \
if (lockcode != 0) { \
} \
}
#endif /* NISDB_MT_DEBUG */
{ \
int lockcode; \
if (lockcode != 0) \
return; \
}
{ \
int lockcode; \
if (lockcode != 0) \
return (retval); \
}
/* Ditto, but return without a value (i.e., a "void" function */
/* As READLOCK/READUNLOCK, but set rescode instead of returning on failure */
/* As READLOCK/READUNLOCK, but use a write lock */
/* Non-blocking write lock */
/* Ditto, but return without a value */
/* As WRITELOCK/WRITEUNLOCK, but set rescode instead of returning on failure */
/* Apply a second write lock when already holding another write lock */
if (this != 0) { \
if (lockcode2 != 0) { \
if (that != 0) { \
} \
return (retval); \
} \
}
/* Release two write locks */
{ \
if (this != 0) { \
} \
if (that != 0) { \
} \
if (lockcode2 != 0) { \
return (retval2); \
} else if (lockcode1 != 0) { \
return (retval1); \
} \
}
/* Apply a second read lock when already holding another read lock */
if (this != 0) { \
if (lockcode2 != 0) { \
if (that != 0) { \
} \
return (retval); \
} \
}
/* Release two read locks */
{ \
if (this != 0) { \
} \
if (that != 0) { \
} \
if (lockcode2 != 0) { \
return (retval2); \
} else if (lockcode1 != 0) { \
return (retval1); \
} \
}
{ \
int lc; \
return (retval); \
} \
}
#endif /* _DB_HEADERS_H */