summaryrefslogtreecommitdiff
path: root/src/include/wiredtiger_ext.h
blob: 88ccd8385b01092b552fd4b38e443ca923592617 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*-
 * Copyright (c) 2008-2012 WiredTiger, Inc.
 *	All rights reserved.
 *
 * See the file LICENSE for redistribution information.
 */

#ifndef	__WIREDTIGER_EXT_H_
#define	__WIREDTIGER_EXT_H_

#include <wiredtiger.h>

#if defined(__cplusplus)
extern "C" {
#endif

/*! @addtogroup wt_ext
 * @{
 */

/*! Table of WiredTiger extension functions.
 *
 * This structure is used to avoid the need to link extension modules with the
 * library.
 */
struct __wt_extension_api {
/* !!! To maintain backwards compatibility, this structure is append-only. */
	/*! Put an error message on the WiredTiger error stream.  */
	void (*err_printf)(WT_SESSION *, const char *fmt, ...);
#define	wiredtiger_err_printf	wt_api->err_printf

	/*! Allocate short-term use scratch memory. */
	void *(*scr_alloc)(WT_SESSION *, size_t);
#define	wiredtiger_scr_alloc	wt_api->scr_alloc

	/*! Free short-term use scratch memory. */
	void (*scr_free)(WT_SESSION *, void *);
#define	wiredtiger_scr_free	wt_api->scr_free
};

/*! This global variable must appear in each extension module. */
extern WT_EXTENSION_API	*wt_api;

/*! @} */

#if defined(__cplusplus)
}
#endif
#endif /* __WIREDTIGER_EXT_H_ */