DexterPluginIVersion

DexterPluginIVersion — Interface to Libdexter version information

Synopsis

#include <dexterplugin.h>

#define             DEXTER_VERSION_MAJOR
#define             DEXTER_VERSION_MINOR
#define             DEXTER_VERSION_MICRO

#define             DEXTER_CHECK_VERSION_EXACT
#define             DEXTER_CHECK_VERSION_COMPATIBLE

                    DexterPluginIVersion;
struct              DexterPluginIVersionInterface;

guint               dexterplugin_iversion_get_version_major
                                                        (DexterPluginIVersion *iversion);
guint               dexterplugin_iversion_get_version_minor
                                                        (DexterPluginIVersion *iversion);
guint               dexterplugin_iversion_get_version_micro
                                                        (DexterPluginIVersion *iversion);
void                dexterplugin_iversion_check_version_exact
                                                        (DexterPluginIVersion *iversion,
                                                         guint major,
                                                         guint minor,
                                                         guint micro);
void                dexterplugin_iversion_check_version_compatible
                                                        (DexterPluginIVersion *iversion,
                                                         guint major,
                                                         guint minor,
                                                         guint micro);

Object Hierarchy

  GInterface
   +----DexterPluginIVersion

Prerequisites

DexterPluginIVersion requires GObject.

Description

Plugins can access version information using this interface.

The plugin should use this interface during initialization to verify that it is being loaded by a version of Libdexter that is compatible with the version with which the plugin was compiled.

#include <dexterplugin.h>

void dexter_plugin_init (GTypeModule      *module)
{
  ...
  /* check for version compatibility with main library */
  dexterplugin_iversion_check_version_compatible (dexterplugin_main_imain_get ()->iversion,
                                                  DEXTER_VERSION_MAJOR,
                                                  DEXTER_VERSION_MINOR,
                                                  DEXTER_VERSION_MICRO);
  
  /* or you can use the following shortcut macro */
  DEXTER_CHECK_VERSION_COMPATIBLE;
  ...
}

Details

DEXTER_VERSION_MAJOR

#define DEXTER_VERSION_MAJOR    0 

The major version of Libdexter.


DEXTER_VERSION_MINOR

#define DEXTER_VERSION_MINOR    2

The minor version of Libdexter.


DEXTER_VERSION_MICRO

#define DEXTER_VERSION_MICRO    1

The mirco version of Libdexter.


DEXTER_CHECK_VERSION_EXACT

#define             DEXTER_CHECK_VERSION_EXACT

Shortcut macro for calling dexterplugin_iversion_check_version_exact() with required paramaters.


DEXTER_CHECK_VERSION_COMPATIBLE

#define             DEXTER_CHECK_VERSION_COMPATIBLE

Shortcut macro for calling dexterplugin_iversion_check_version_compatible() with required parameters.


DexterPluginIVersion

typedef struct _DexterPluginIVersion DexterPluginIVersion;

The version information interface.


struct DexterPluginIVersionInterface

struct DexterPluginIVersionInterface {
  /* virtual methods */
  guint    (*get_version_major)       (DexterPluginIVersion *iversion);
  guint    (*get_version_minor)       (DexterPluginIVersion *iversion);
  guint    (*get_version_micro)       (DexterPluginIVersion *iversion);

  void     (*check_version_exact)     (DexterPluginIVersion *iversion,
                                       guint                 major, 
                                       guint                 minor, 
                                       guint                 micro);
    
  void    (*check_version_compatible) (DexterPluginIVersion *iversion,
                                       guint                 major, 
                                       guint                 minor, 
                                       guint                 micro);
};

Definition of the version information interface.

get_version_major ()

See dexterplugin_iversion_get_version_major().

get_version_minor ()

See dexterplugin_iversion_get_version_minor().

get_version_micro ()

See dexterplugin_iversion_get_version_micro().

check_version_exact ()

See dexterplugin_iversion_check_version_exact().

check_version_compatible ()

See dexterplugin_iversion_check_version_compatible().

dexterplugin_iversion_get_version_major ()

guint               dexterplugin_iversion_get_version_major
                                                        (DexterPluginIVersion *iversion);

Returns the major version number of Libdexter.

iversion :

a DexterPluginIVersion.

Returns :

gint major version number.

dexterplugin_iversion_get_version_minor ()

guint               dexterplugin_iversion_get_version_minor
                                                        (DexterPluginIVersion *iversion);

Returns the minor version number of Libdexter.

iversion :

a DexterPluginIVersion.

Returns :

gint minor version number.

dexterplugin_iversion_get_version_micro ()

guint               dexterplugin_iversion_get_version_micro
                                                        (DexterPluginIVersion *iversion);

Returns the micro version number of Libdexter.

iversion :

a DexterPluginIVersion.

Returns :

gint micro version number.

dexterplugin_iversion_check_version_exact ()

void                dexterplugin_iversion_check_version_exact
                                                        (DexterPluginIVersion *iversion,
                                                         guint major,
                                                         guint minor,
                                                         guint micro);

Verifies that the specified (major, minor, micro) version number exactly matches that of the Libdexter library.

Used by plugins that require a specific library version.

iversion :

a DexterPluginIVersion.

major :

guint major version number.

minor :

guint minor version number.

micro :

guint micro version number.

dexterplugin_iversion_check_version_compatible ()

void                dexterplugin_iversion_check_version_compatible
                                                        (DexterPluginIVersion *iversion,
                                                         guint major,
                                                         guint minor,
                                                         guint micro);

Verifies that the specified (major, minor, micro) version number is compatible with the Libdexter library.

It is generally sufficient to use this function to verify compatibility when loading plugins.

iversion :

a DexterPluginIVersion.

major :

guint major version number.

minor :

guint minor version number.

micro :

guint micro version number.