cannam@226
|
1 /*
|
cannam@226
|
2 Copyright 2012 David Robillard <http://drobilla.net>
|
cannam@226
|
3
|
cannam@226
|
4 Permission to use, copy, modify, and/or distribute this software for any
|
cannam@226
|
5 purpose with or without fee is hereby granted, provided that the above
|
cannam@226
|
6 copyright notice and this permission notice appear in all copies.
|
cannam@226
|
7
|
cannam@226
|
8 THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
cannam@226
|
9 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
cannam@226
|
10 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
cannam@226
|
11 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
cannam@226
|
12 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
cannam@226
|
13 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
cannam@226
|
14 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
cannam@226
|
15 */
|
cannam@226
|
16
|
cannam@226
|
17 #ifndef ZIX_COMMON_H
|
cannam@226
|
18 #define ZIX_COMMON_H
|
cannam@226
|
19
|
cannam@226
|
20 /**
|
cannam@226
|
21 @addtogroup zix
|
cannam@226
|
22 @{
|
cannam@226
|
23 */
|
cannam@226
|
24
|
cannam@226
|
25 /** @cond */
|
cannam@226
|
26 #ifdef ZIX_SHARED
|
cannam@226
|
27 # ifdef _WIN32
|
cannam@226
|
28 # define ZIX_LIB_IMPORT __declspec(dllimport)
|
cannam@226
|
29 # define ZIX_LIB_EXPORT __declspec(dllexport)
|
cannam@226
|
30 # else
|
cannam@226
|
31 # define ZIX_LIB_IMPORT __attribute__((visibility("default")))
|
cannam@226
|
32 # define ZIX_LIB_EXPORT __attribute__((visibility("default")))
|
cannam@226
|
33 # endif
|
cannam@226
|
34 # ifdef ZIX_INTERNAL
|
cannam@226
|
35 # define ZIX_API ZIX_LIB_EXPORT
|
cannam@226
|
36 # else
|
cannam@226
|
37 # define ZIX_API ZIX_LIB_IMPORT
|
cannam@226
|
38 # endif
|
cannam@226
|
39 # define ZIX_PRIVATE static
|
cannam@226
|
40 #elif defined(ZIX_INLINE)
|
cannam@226
|
41 # define ZIX_API static inline
|
cannam@226
|
42 # define ZIX_PRIVATE static inline
|
cannam@226
|
43 #else
|
cannam@226
|
44 # define ZIX_API
|
cannam@226
|
45 # define ZIX_PRIVATE static
|
cannam@226
|
46 #endif
|
cannam@226
|
47 /** @endcond */
|
cannam@226
|
48
|
cannam@226
|
49 #ifdef __cplusplus
|
cannam@226
|
50 extern "C" {
|
cannam@226
|
51 #else
|
cannam@226
|
52 # include <stdbool.h>
|
cannam@226
|
53 #endif
|
cannam@226
|
54
|
cannam@226
|
55 typedef enum {
|
cannam@226
|
56 ZIX_STATUS_SUCCESS,
|
cannam@226
|
57 ZIX_STATUS_ERROR,
|
cannam@226
|
58 ZIX_STATUS_NO_MEM,
|
cannam@226
|
59 ZIX_STATUS_NOT_FOUND,
|
cannam@226
|
60 ZIX_STATUS_EXISTS,
|
cannam@226
|
61 ZIX_STATUS_BAD_ARG,
|
cannam@226
|
62 ZIX_STATUS_BAD_PERMS,
|
cannam@226
|
63 } ZixStatus;
|
cannam@226
|
64
|
cannam@226
|
65 /**
|
cannam@226
|
66 Function for comparing two elements.
|
cannam@226
|
67 */
|
cannam@226
|
68 typedef int (*ZixComparator)(const void* a, const void* b, void* user_data);
|
cannam@226
|
69
|
cannam@226
|
70 /**
|
cannam@226
|
71 Function for testing equality of two elements.
|
cannam@226
|
72 */
|
cannam@226
|
73 typedef bool (*ZixEqualFunc)(const void* a, const void* b);
|
cannam@226
|
74
|
cannam@226
|
75 /**
|
cannam@226
|
76 Function to destroy an element.
|
cannam@226
|
77 */
|
cannam@226
|
78 typedef void (*ZixDestroyFunc)(void* ptr);
|
cannam@226
|
79
|
cannam@226
|
80 /**
|
cannam@226
|
81 @}
|
cannam@226
|
82 */
|
cannam@226
|
83
|
cannam@226
|
84 #ifdef __cplusplus
|
cannam@226
|
85 } /* extern "C" */
|
cannam@226
|
86 #endif
|
cannam@226
|
87
|
cannam@226
|
88 #endif /* ZIX_COMMON_H */
|