mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-29 15:22:11 +02:00
Allows apps to check the library version app is run against, contrary to compiled against
90 lines
2.6 KiB
C
90 lines
2.6 KiB
C
/* Clapper GTK Integration Library
|
|
* Copyright (C) 2024 Rafał Dzięgiel <rafostar.github@gmail.com>
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, see
|
|
* <https://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#if !defined(__CLAPPER_GTK_INSIDE__) && !defined(CLAPPER_GTK_COMPILATION)
|
|
#error "Only <clapper-gtk/clapper-gtk.h> can be included directly."
|
|
#endif
|
|
|
|
#include <glib.h>
|
|
|
|
/**
|
|
* CLAPPER_GTK_MAJOR_VERSION:
|
|
*
|
|
* ClapperGtk major version component
|
|
*/
|
|
#define CLAPPER_GTK_MAJOR_VERSION (@CLAPPER_GTK_MAJOR_VERSION@)
|
|
|
|
/**
|
|
* CLAPPER_GTK_MINOR_VERSION:
|
|
*
|
|
* ClapperGtk minor version component
|
|
*/
|
|
#define CLAPPER_GTK_MINOR_VERSION (@CLAPPER_GTK_MINOR_VERSION@)
|
|
|
|
/**
|
|
* CLAPPER_GTK_MICRO_VERSION:
|
|
*
|
|
* ClapperGtk micro version component
|
|
*/
|
|
#define CLAPPER_GTK_MICRO_VERSION (@CLAPPER_GTK_MICRO_VERSION@)
|
|
|
|
/**
|
|
* CLAPPER_GTK_VERSION:
|
|
*
|
|
* ClapperGtk version
|
|
*/
|
|
#define CLAPPER_GTK_VERSION (@CLAPPER_GTK_VERSION@)
|
|
|
|
/**
|
|
* CLAPPER_GTK_VERSION_S:
|
|
*
|
|
* ClapperGtk version, encoded as a string
|
|
*/
|
|
#define CLAPPER_GTK_VERSION_S "@CLAPPER_GTK_VERSION@"
|
|
|
|
#define CLAPPER_GTK_ENCODE_VERSION(major,minor,micro) \
|
|
((major) << 24 | (minor) << 16 | (micro) << 8)
|
|
|
|
/**
|
|
* CLAPPER_GTK_VERSION_HEX:
|
|
*
|
|
* ClapperGtk version, encoded as an hexadecimal number, useful for integer comparisons.
|
|
*/
|
|
#define CLAPPER_GTK_VERSION_HEX \
|
|
(CLAPPER_GTK_ENCODE_VERSION (CLAPPER_GTK_MAJOR_VERSION, CLAPPER_GTK_MINOR_VERSION, CLAPPER_GTK_MICRO_VERSION))
|
|
|
|
#define CLAPPER_GTK_CHECK_VERSION(major, minor, micro) \
|
|
(CLAPPER_GTK_MAJOR_VERSION > (major) || \
|
|
(CLAPPER_GTK_MAJOR_VERSION == (major) && CLAPPER_GTK_MINOR_VERSION > (minor)) || \
|
|
(CLAPPER_GTK_MAJOR_VERSION == (major) && CLAPPER_GTK_MINOR_VERSION == (minor) && \
|
|
CLAPPER_GTK_MICRO_VERSION >= (micro)))
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
guint clapper_gtk_get_major_version (void);
|
|
|
|
guint clapper_gtk_get_minor_version (void);
|
|
|
|
guint clapper_gtk_get_micro_version (void);
|
|
|
|
const gchar * clapper_gtk_get_version_s (void);
|
|
|
|
G_END_DECLS
|