blob: 055486a1ef48dd6529927e7260409e9ee7e4f401 (
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
/*************************************************************************************************
* The abstract database API of EJDB
* Copyright (C) 2012-2015 Softmotions Ltd <info@softmotions.com>
* This file is part of EJDB.
* EJDB is free software; you can redistribute it and/or modify it under the terms of
* the GNU Lesser General Public License as published by the Free Software Foundation; either
* version 2.1 of the License or any later version. EJDB is distributed in the hope
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
* You should have received a copy of the GNU Lesser General Public License along with Tokyo
* Cabinet; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA.
*************************************************************************************************/
#ifndef BASEDEFS_H
#define BASEDEFS_H
#define EJDB_VERSION "@ejdb_VERSION@"
#define EJDB_VERSION_MAJOR @ejdb_VERSION_MAJOR@
#define EJDB_VERSION_MINOR @ejdb_VERSION_MINOR@
#define EJDB_VERSION_PATCH @ejdb_VERSION_PATCH@
#ifdef __cplusplus
#define EJDB_EXTERN_C_START extern "C" {
#define EJDB_EXTERN_C_END }
#else
#define EJDB_EXTERN_C_START
#define EJDB_EXTERN_C_END
#endif
EJDB_EXTERN_C_START
#ifdef __GNUC__
#define EJDB_INLINE static inline
#else
#define EJDB_INLINE static
#endif
#if (defined(_WIN32) || defined(_WIN64))
# if (defined(EJDB_NODLL) || defined(EJDB_STATIC))
# define EJDB_EXPORT
# else
# ifdef EJDB_API_EXPORTS
# define EJDB_EXPORT __declspec(dllexport)
# else
# define EJDB_EXPORT __declspec(dllimport)
# endif
# endif
#else
# if __GNUC__ >= 4
# define EJDB_EXPORT __attribute__ ((visibility("default")))
# else
# define EJDB_EXPORT
# endif
#endif
#ifdef _WIN32
#include <windows.h>
#define INVALIDHANDLE(_HNDL) (((_HNDL) == INVALID_HANDLE_VALUE) || (_HNDL) == NULL)
#else
typedef int HANDLE;
#define INVALID_HANDLE_VALUE (-1)
#define INVALIDHANDLE(_HNDL) ((_HNDL) < 0 || (_HNDL) == UINT16_MAX)
#endif
#define JDBIDKEYNAME "_id" /**> Name of PK _id field in BSONs */
#define JDBIDKEYNAMEL 3
EJDB_EXTERN_C_END
#endif /* BASEDEFS_H */
|