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