1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
|
/* libfo
* libfo-version.h: libfo version
*
* Copyright (C) 2008 Menteith Consulting Ltd
*
* See COPYING for the status of this software.
*/
#ifndef __LIBFO_VERSION_H__
#define __LIBFO_VERSION_H__
/* libfo-features.h is autogenerated. The constants it defines are
documented here. */
#include <libfo/libfo-features.h>
#include <glib.h>
G_BEGIN_DECLS
/**
* SECTION:libfo-version
* @short_description: libfo version checking
*
* The capital-letter macros defined here can be used to check the
* version of libfo at compile-time, and to
* <emphasis>encode</emphasis> libfo versions into integers. The
* functions can be used to check the version of the linked libfo
* library at run-time.
*/
/**
* LIBFO_VERSION_MAJOR:
*
* The major component of the version of libfo available at
* compile-time.
*/
/**
* LIBFO_VERSION_MINOR:
*
* The minor component of the version of libfo available at
* compile-time.
*/
/**
* LIBFO_VERSION_MICRO:
*
* The micro component of the version of libfo available at
* compile-time.
*/
/**
* LIBFO_VERSION_STRING:
*
* A string literal containing the version of libfo available at
* compile-time.
*/
/**
* LIBFO_VERSION_EXTRA:
*
* Extra compile-time version information string literal containing,
* e.g., the Subversion changeset number.
*/
/**
* LIBFO_PIXELS_PER_INCH:
*
* Pixels per inch for use with graphics without intrinsic size.
*/
/**
* LIBFO_VERSION_ENCODE:
* @major: the major component of the version number
* @minor: the minor component of the version number
* @micro: the micro component of the version number
*
*
* This macro encodes the given libfo version into an integer. The
* numbers returned by #LIBFO_VERSION and libfo_version() are encoded
* using this macro. Two encoded version numbers can be compared as
* integers.
*/
#define LIBFO_VERSION_ENCODE(major, minor, micro) ( \
((major) * 10000) \
+ ((minor) * 100) \
+ ((micro) * 1))
/**
* LIBFO_VERSION:
*
* The version of libfo available at compile-time, encoded using
* LIBFO_VERSION_ENCODE().
*/
#define LIBFO_VERSION LIBFO_VERSION_ENCODE( \
LIBFO_VERSION_MAJOR, \
LIBFO_VERSION_MINOR, \
LIBFO_VERSION_MICRO)
/**
* LIBFO_VERSION_CHECK:
* @major: the major component of the version number
* @minor: the minor component of the version number
* @micro: the micro component of the version number
*
* Checks that the version of libfo available at compile-time is
* not older than the provided version number.
*/
#define LIBFO_VERSION_CHECK(major,minor,micro) \
(LIBFO_VERSION >= LIBFO_VERSION_ENCODE(major,minor,micro))
/* Return encoded version of libfo at run-time */
int libfo_version (void);
/* Return run-time libfo version as an string */
const char * libfo_version_string (void);
/* Check that run-time libfo is as new as required */
const char * libfo_version_check (int required_major,
int required_minor,
int required_micro);
int libfo_pixels_per_inch (void);
/**
* LibfoModuleEnum:
* @LIBFO_MODULE_INVALID: Not a module
* @LIBFO_MODULE_XSL_FORMATTER: XSL formatter
* @LIBFO_MODULE_XSLT_PROCESSOR: XSLT processor
* @LIBFO_MODULE_BACKEND: Backend
* @LIBFO_MODULE_PANGO: Pango
*
* The type of a module of libfo.
*/
typedef enum {
LIBFO_MODULE_INVALID,
LIBFO_MODULE_XSL_FORMATTER,
LIBFO_MODULE_XSLT_PROCESSOR,
LIBFO_MODULE_XML_DOC,
LIBFO_MODULE_BACKEND,
LIBFO_MODULE_PANGO
} LibfoModuleEnum;
/**
* LibfoVersionInfo:
* @module: Type of the module
* @nick: Nickname
* @name: #FoObject type name, e.g., #FoDocCairo
* @compiled: Compiled version number
* @compiled_string: Compiled version number string
* @runtime: Runtime version number
* @runtime_string: Runtime version number string
*
* Collected version information about a component of libfo.
*
* Other than @nick, one or more of the parts of the #LibfoVersionInfo
* may be 0 or %NULL if the component is unable to report that
* information.
*/
typedef struct {
LibfoModuleEnum module;
const gchar *nick;
const gchar *name;
gint compiled;
const gchar *compiled_string;
gint runtime;
const gchar *runtime_string;
} LibfoVersionInfo;
const LibfoVersionInfo ** libfo_version_get_info (void);
G_END_DECLS
#endif /* __LIBFO_VERSION_H__ */
|