Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Module Magic Number
Collaboration diagram for Module Magic Number:

Macros

#define MODULE_MAGIC_COOKIE   0x41503235UL /* "AP25" */
 
#define MODULE_MAGIC_NUMBER_MAJOR   20180720
 
#define MODULE_MAGIC_NUMBER_MINOR   2 /* 0...n */
 
#define AP_MODULE_MAGIC_AT_LEAST(major, minor)
 
#define MODULE_MAGIC_NUMBER   MODULE_MAGIC_NUMBER_MAJOR
 
#define MODULE_MAGIC_AT_LEAST   old_broken_macro_we_hope_you_are_not_using
 

Detailed Description

MODULE_MAGIC_NUMBER_MAJOR
Major API changes that could cause compatibility problems for older modules such as structure size changes. No binary compatibility is possible across a change in the major version.

MODULE_MAGIC_NUMBER_MINOR
Minor API changes that do not cause binary compatibility problems. Should be reset to 0 when upgrading MODULE_MAGIC_NUMBER_MAJOR.

See the AP_MODULE_MAGIC_AT_LEAST macro below for an example.

Macro Definition Documentation

#define AP_MODULE_MAGIC_AT_LEAST (   major,
  minor 
)
Value:
|| ((major) == MODULE_MAGIC_NUMBER_MAJOR \
&& (minor) <= MODULE_MAGIC_NUMBER_MINOR))
#define MODULE_MAGIC_NUMBER_MINOR
Definition: ap_mmn.h:599
#define MODULE_MAGIC_NUMBER_MAJOR
Definition: ap_mmn.h:597

Determine if the server's current MODULE_MAGIC_NUMBER is at least a specified value.

Useful for testing for features. For example, suppose you wish to use the apr_table_overlap function. You can do this:

#if AP_MODULE_MAGIC_AT_LEAST(19980812,2)
#else
... alternative code which doesn't use apr_table_overlap()
#endif
Parameters
majorThe major module magic number.
minorThe minor module magic number.
#define MODULE_MAGIC_AT_LEAST   old_broken_macro_we_hope_you_are_not_using
Deprecated:
Use AP_MODULE_MAGIC_AT_LEAST.
#define MODULE_MAGIC_COOKIE   0x41503235UL /* "AP25" */
#define MODULE_MAGIC_NUMBER   MODULE_MAGIC_NUMBER_MAJOR
Deprecated:
Present for backwards compatibility.
#define MODULE_MAGIC_NUMBER_MAJOR   20180720
#define MODULE_MAGIC_NUMBER_MINOR   2 /* 0...n */