Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:01:42

0001 /* json-version.h - JSON-GLib versioning information
0002  * 
0003  * This file is part of JSON-GLib
0004  * Copyright (C) 2007  OpenedHand Ltd.
0005  * Copyright (C) 2009  Intel Corp.
0006  *
0007  * This library is free software; you can redistribute it and/or
0008  * modify it under the terms of the GNU Lesser General Public
0009  * License as published by the Free Software Foundation; either
0010  * version 2.1 of the License, or (at your option) any later version.
0011  *
0012  * This library is distributed in the hope that it will be useful,
0013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015  * Lesser General Public License for more details.
0016  *
0017  * You should have received a copy of the GNU Lesser General Public
0018  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
0019  *
0020  * Author:
0021  *   Emmanuele Bassi  <ebassi@linux.intel.com>
0022  */
0023 
0024 #ifndef __JSON_VERSION_H__
0025 #define __JSON_VERSION_H__
0026 
0027 #if !defined(__JSON_GLIB_INSIDE__) && !defined(JSON_COMPILATION)
0028 #error "Only <json-glib/json-glib.h> can be included directly."
0029 #endif
0030 
0031 /**
0032  * JSON_MAJOR_VERSION:
0033  *
0034  * Json major version component (e.g. 1 if `JSON_VERSION` is "1.2.3")
0035  */
0036 #define JSON_MAJOR_VERSION              (1)
0037 
0038 /**
0039  * JSON_MINOR_VERSION:
0040  *
0041  * Json minor version component (e.g. 2 if `JSON_VERSION` is "1.2.3")
0042  */
0043 #define JSON_MINOR_VERSION              (6)
0044 
0045 /**
0046  * JSON_MICRO_VERSION:
0047  *
0048  * Json micro version component (e.g. 3 if `JSON_VERSION` is "1.2.3")
0049  */
0050 #define JSON_MICRO_VERSION              (6)
0051 
0052 /**
0053  * JSON_VERSION
0054  *
0055  * The version of JSON-GLib.
0056  */
0057 #define JSON_VERSION                    (1.6.6)
0058 
0059 /**
0060  * JSON_VERSION_S:
0061  *
0062  * The version of JSON-GLib, encoded as a string, useful for printing and
0063  * concatenation.
0064  */
0065 #define JSON_VERSION_S                  "1.6.6"
0066 
0067 /**
0068  * JSON_ENCODE_VERSION:
0069  * @major: (type int): the major version to encode
0070  * @minor: (type int): the minor version to encode
0071  * @micro: (type int): the micro version to encode
0072  *
0073  * Encodes a JSON-GLib version in an hexadecimal number, useful for
0074  * integer comparisons.
0075  */
0076 #define JSON_ENCODE_VERSION(major,minor,micro) \
0077         ((major) << 24 | (minor) << 16 | (micro) << 8)
0078 
0079 /**
0080  * JSON_VERSION_HEX:
0081  *
0082  * The version of JSON-GLib, encoded as an hexadecimal number, useful for
0083  * integer comparisons.
0084  */
0085 #define JSON_VERSION_HEX \
0086         (JSON_ENCODE_VERSION (JSON_MAJOR_VERSION, JSON_MINOR_VERSION, JSON_MICRO_VERSION))
0087 
0088 /**
0089  * JSON_CHECK_VERSION:
0090  * @major: required major version
0091  * @minor: required minor version
0092  * @micro: required micro version
0093  *
0094  * Compile-time version checking. Evaluates to `TRUE` if the version
0095  * of JSON-GLib is greater than the required one.
0096  */
0097 #define JSON_CHECK_VERSION(major,minor,micro)   \
0098         (JSON_MAJOR_VERSION > (major) || \
0099          (JSON_MAJOR_VERSION == (major) && JSON_MINOR_VERSION > (minor)) || \
0100          (JSON_MAJOR_VERSION == (major) && JSON_MINOR_VERSION == (minor) && \
0101           JSON_MICRO_VERSION >= (micro)))
0102 
0103 #endif /* __JSON_VERSION_H__ */