Initial Import
[profile/ivi/json-glib.git] / json-glib / json-version.h
1 /* json-version.h - JSON-GLib versioning information
2  * 
3  * This file is part of JSON-GLib
4  * Copyright (C) 2007  OpenedHand Ltd.
5  * Copyright (C) 2009  Intel Corp.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
19  *
20  * Author:
21  *   Emmanuele Bassi  <ebassi@linux.intel.com>
22  */
23
24 #if !defined(__JSON_GLIB_INSIDE__) && !defined(JSON_COMPILATION)
25 #error "Only <json-glib/json-glib.h> can be included directly."
26 #endif
27
28 #ifndef __JSON_VERSION_H__
29 #define __JSON_VERSION_H__
30
31 /**
32  * SECTION:json-version
33  * @short_description: JSON-GLib version checking
34  *
35  * JSON-GLib provides macros to check the version of the library
36  * at compile-time
37  */
38
39 /**
40  * JSON_MAJOR_VERSION:
41  *
42  * Json major version component (e.g. 1 if %JSON_VERSION is 1.2.3)
43  */
44 #define JSON_MAJOR_VERSION              (0)
45
46 /**
47  * JSON_MINOR_VERSION:
48  *
49  * Json minor version component (e.g. 2 if %JSON_VERSION is 1.2.3)
50  */
51 #define JSON_MINOR_VERSION              (14)
52
53 /**
54  * JSON_MICRO_VERSION:
55  *
56  * Json micro version component (e.g. 3 if %JSON_VERSION is 1.2.3)
57  */
58 #define JSON_MICRO_VERSION              (2)
59
60 /**
61  * JSON_VERSION
62  *
63  * Json version.
64  */
65 #define JSON_VERSION                    (0.14.2)
66
67 /**
68  * JSON_VERSION_S:
69  *
70  * Json version, encoded as a string, useful for printing and
71  * concatenation.
72  */
73 #define JSON_VERSION_S                  "0.14.2"
74
75 /**
76  * JSON_VERSION_HEX:
77  *
78  * Json version, encoded as an hexadecimal number, useful for
79  * integer comparisons.
80  */
81 #define JSON_VERSION_HEX                (JSON_MAJOR_VERSION << 24 | \
82                                          JSON_MINOR_VERSION << 16 | \
83                                          JSON_MICRO_VERSION << 8)
84
85 /**
86  * JSON_CHECK_VERSION:
87  * @major: required major version
88  * @minor: required minor version
89  * @micro: required micro version
90  *
91  * Compile-time version checking. Evaluates to %TRUE if the version
92  * of Json is greater than the required one.
93  */
94 #define JSON_CHECK_VERSION(major,minor,micro)   \
95         (JSON_MAJOR_VERSION > (major) || \
96          (JSON_MAJOR_VERSION == (major) && JSON_MINOR_VERSION > (minor)) || \
97          (JSON_MAJOR_VERSION == (major) && JSON_MINOR_VERSION == (minor) && \
98           JSON_MICRO_VERSION >= (micro)))
99
100 #endif /* __JSON_VERSION_H__ */