Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-13 09:13:47

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