1 /*
2  * Copyright (c) 2019 Sean Bright <sean.bright@gmail.com>
3  *
4  * Jansson is free software; you can redistribute it and/or modify
5  * it under the terms of the MIT license. See LICENSE for details.
6  */
7 
8 #ifndef _GNU_SOURCE
9 #define _GNU_SOURCE
10 #endif
11 
12 #include "jansson.h"
13 
jansson_version_str(void)14 const char *jansson_version_str(void) { return JANSSON_VERSION; }
15 
jansson_version_cmp(int major,int minor,int micro)16 int jansson_version_cmp(int major, int minor, int micro) {
17     int diff;
18 
19     if ((diff = JANSSON_MAJOR_VERSION - major)) {
20         return diff;
21     }
22 
23     if ((diff = JANSSON_MINOR_VERSION - minor)) {
24         return diff;
25     }
26 
27     return JANSSON_MICRO_VERSION - micro;
28 }
29