diff options
Diffstat (limited to 'toxav')
-rw-r--r-- | toxav/toxav.c | 24 | ||||
-rw-r--r-- | toxav/toxav.h | 68 |
2 files changed, 0 insertions, 92 deletions
diff --git a/toxav/toxav.c b/toxav/toxav.c index a5314d23..c0f64648 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c | |||
@@ -106,30 +106,6 @@ ToxAVCall *call_remove(ToxAVCall *call); | |||
106 | bool call_prepare_transmission(ToxAVCall *call); | 106 | bool call_prepare_transmission(ToxAVCall *call); |
107 | void call_kill_transmission(ToxAVCall *call); | 107 | void call_kill_transmission(ToxAVCall *call); |
108 | 108 | ||
109 | uint32_t toxav_version_major(void) | ||
110 | { | ||
111 | return TOXAV_VERSION_MAJOR; | ||
112 | } | ||
113 | |||
114 | uint32_t toxav_version_minor(void) | ||
115 | { | ||
116 | return TOXAV_VERSION_MINOR; | ||
117 | } | ||
118 | |||
119 | uint32_t toxav_version_patch(void) | ||
120 | { | ||
121 | return TOXAV_VERSION_PATCH; | ||
122 | } | ||
123 | |||
124 | bool toxav_version_is_compatible(uint32_t major, uint32_t minor, uint32_t patch) | ||
125 | { | ||
126 | return (TOXAV_VERSION_MAJOR == major && /* Force the major version */ | ||
127 | (TOXAV_VERSION_MINOR > minor || /* Current minor version must be newer than requested -- or -- */ | ||
128 | (TOXAV_VERSION_MINOR == minor && TOXAV_VERSION_PATCH >= patch) /* the patch must be the same or newer */ | ||
129 | ) | ||
130 | ); | ||
131 | } | ||
132 | |||
133 | ToxAV *toxav_new(Tox *tox, TOXAV_ERR_NEW *error) | 109 | ToxAV *toxav_new(Tox *tox, TOXAV_ERR_NEW *error) |
134 | { | 110 | { |
135 | TOXAV_ERR_NEW rc = TOXAV_ERR_NEW_OK; | 111 | TOXAV_ERR_NEW rc = TOXAV_ERR_NEW_OK; |
diff --git a/toxav/toxav.h b/toxav/toxav.h index 38ba354e..298dbbd0 100644 --- a/toxav/toxav.h +++ b/toxav/toxav.h | |||
@@ -93,74 +93,6 @@ typedef struct ToxAV ToxAV; | |||
93 | 93 | ||
94 | /******************************************************************************* | 94 | /******************************************************************************* |
95 | * | 95 | * |
96 | * :: API version | ||
97 | * | ||
98 | ******************************************************************************/ | ||
99 | |||
100 | |||
101 | |||
102 | /** | ||
103 | * The major version number. Incremented when the API or ABI changes in an | ||
104 | * incompatible way. | ||
105 | * | ||
106 | * The function variants of these constants return the version number of the | ||
107 | * library. They can be used to display the Tox library version or to check | ||
108 | * whether the client is compatible with the dynamically linked version of Tox. | ||
109 | */ | ||
110 | #define TOXAV_VERSION_MAJOR 0 | ||
111 | |||
112 | uint32_t toxav_version_major(void); | ||
113 | |||
114 | /** | ||
115 | * The minor version number. Incremented when functionality is added without | ||
116 | * breaking the API or ABI. Set to 0 when the major version number is | ||
117 | * incremented. | ||
118 | */ | ||
119 | #define TOXAV_VERSION_MINOR 0 | ||
120 | |||
121 | uint32_t toxav_version_minor(void); | ||
122 | |||
123 | /** | ||
124 | * The patch or revision number. Incremented when bugfixes are applied without | ||
125 | * changing any functionality or API or ABI. | ||
126 | */ | ||
127 | #define TOXAV_VERSION_PATCH 0 | ||
128 | |||
129 | uint32_t toxav_version_patch(void); | ||
130 | |||
131 | /** | ||
132 | * A macro to check at preprocessing time whether the client code is compatible | ||
133 | * with the installed version of ToxAV. | ||
134 | */ | ||
135 | #define TOXAV_VERSION_IS_API_COMPATIBLE(MAJOR, MINOR, PATCH) \ | ||
136 | (TOXAV_VERSION_MAJOR == MAJOR && \ | ||
137 | (TOXAV_VERSION_MINOR > MINOR || \ | ||
138 | (TOXAV_VERSION_MINOR == MINOR && \ | ||
139 | TOXAV_VERSION_PATCH >= PATCH))) | ||
140 | |||
141 | /** | ||
142 | * A macro to make compilation fail if the client code is not compatible with | ||
143 | * the installed version of ToxAV. | ||
144 | */ | ||
145 | #define TOXAV_VERSION_REQUIRE(MAJOR, MINOR, PATCH) \ | ||
146 | typedef char toxav_required_version[TOXAV_IS_COMPATIBLE(MAJOR, MINOR, PATCH) ? 1 : -1] | ||
147 | |||
148 | /** | ||
149 | * A convenience macro to call toxav_version_is_compatible with the currently | ||
150 | * compiling API version. | ||
151 | */ | ||
152 | #define TOXAV_VERSION_IS_ABI_COMPATIBLE() \ | ||
153 | toxav_version_is_compatible(TOXAV_VERSION_MAJOR, TOXAV_VERSION_MINOR, TOXAV_VERSION_PATCH) | ||
154 | |||
155 | /** | ||
156 | * Return whether the compiled library version is compatible with the passed | ||
157 | * version numbers. | ||
158 | */ | ||
159 | bool toxav_version_is_compatible(uint32_t major, uint32_t minor, uint32_t patch); | ||
160 | |||
161 | |||
162 | /******************************************************************************* | ||
163 | * | ||
164 | * :: Creation and destruction | 96 | * :: Creation and destruction |
165 | * | 97 | * |
166 | ******************************************************************************/ | 98 | ******************************************************************************/ |