Squash  0.7.0
Macros | Functions
SquashVersion

Library version information. More...

Macros

#define SQUASH_VERSION_MAJOR   0
 
#define SQUASH_VERSION_MINOR   7
 
#define SQUASH_VERSION_REVISION   0
 
#define SQUASH_VERSION_API   "0.7"
 
#define SQUASH_VERSION_CURRENT   SQUASH_VERSION(SQUASH_VERSION_MAJOR, SQUASH_VERSION_MINOR, SQUASH_VERSION_REVISION)
 
#define SQUASH_VERSION_EXTRACT_MAJOR(version)   (((version) >> 16) & 0xff)
 
#define SQUASH_VERSION_EXTRACT_MINOR(version)   (((version) >> 8) & 0xff)
 
#define SQUASH_VERSION_EXTRACT_REVISION(version)   ((version) & 0xff)
 
#define SQUASH_VERSION(major, minor, revision)   (((major) << 16) | ((minor) << 8) | (revision))
 

Functions

unsigned int squash_version (void)
 Get the library version. More...
 
const char * squash_version_api (void)
 Get the API version. More...
 

Detailed Description

Library version information.

Macro Definition Documentation

#define SQUASH_VERSION (   major,
  minor,
  revision 
)    (((major) << 16) | ((minor) << 8) | (revision))

Encode the major, minor, and revisions into a single number

Parameters
majorMajor version number
minorMinor version number
revisionRevision number
Returns
Encoded version

Definition at line 39 of file version.h.

#define SQUASH_VERSION_API   "0.7"

API version

Definition at line 37 of file version.h.

Current version, encoded as a single number

Definition at line 40 of file version.h.

#define SQUASH_VERSION_EXTRACT_MAJOR (   version)    (((version) >> 16) & 0xff)

Extract the major version number from an encoded version

See also
SQUASH_VERSION

Definition at line 42 of file version.h.

#define SQUASH_VERSION_EXTRACT_MINOR (   version)    (((version) >> 8) & 0xff)

Extract the minor version number from an encoded version

See also
SQUASH_VERSION

Definition at line 43 of file version.h.

#define SQUASH_VERSION_EXTRACT_REVISION (   version)    ((version) & 0xff)

Extract the revision number from an encoded version

See also
SQUASH_VERSION

Definition at line 44 of file version.h.

#define SQUASH_VERSION_MAJOR   0

Major version number

Definition at line 34 of file version.h.

#define SQUASH_VERSION_MINOR   7

Minor version number

Definition at line 35 of file version.h.

#define SQUASH_VERSION_REVISION   0

Revision version number

Definition at line 36 of file version.h.

Function Documentation

unsigned int squash_version ( void  )

Get the library version.

This function will return the version of the library currently in use. Note that this may be different than the version you compiled against; generally you should only use this function to make sure it is greater than or equal to SQUASH_VERSION_CURRENT, or for reporting purposes.

Returns
the library version

Definition at line 113 of file version.c.

const char* squash_version_api ( void  )

Get the API version.

Unlike the library version, the API version will only change when backwards-incompatible changes are made (i.e., it should be "1.0" for every 1.x release). Code linked against a library version not exactly equal to what it was compiled with will almost certainly fail.

Returns
the API version

Definition at line 129 of file version.c.