Next Up Previous Contents

4.1 Version Control

Version Control

/* The major version number that represents this interface.  */
#define SANE_CURRENT_MAJOR      0

/* The interface version that a backend implements is represented as a
   version code stored in a SANE_Word.  A version consists of a major
   version number, a minor version number and a build number.
   Incompatible interfaces _must_ have different major versions
   (though compatible interface still might differ in the major
   version).  The minor version is incremented for each official
   release of a backend implementing the SANE interface.  The build
   number is simply an integer that is increased with each build of a
   backend.  The version code is encoded such that it is totally
   ordered.  That is, it is possible (and easier) to use the version
   code instead of the major/minor/build numbers to determine
   compatibility between two versions.  */
#define SANE_VERSION_CODE(major, minor, build)  \
  (  (((SANE_Word) (major) &   0xff) << 24)     \
   | (((SANE_Word) (minor) &   0xff) << 16)     \
   | (((SANE_Word) (build) & 0xffff) <<  0))

#define SANE_VERSION_MAJOR(code)        ((((SANE_Word)(code)) >> 24) &   0xff)
#define SANE_VERSION_MINOR(code)        ((((SANE_Word)(code)) >> 16) &   0xff)
#define SANE_VERSION_BUILD(code)        ((((SANE_Word)(code)) >>  0) & 0xffff)


Next Up Previous Contents