smfi_version Function

Purpose

The smfi_version function provides the libmilter (runtime) version information.

Syntax

#include <libmilter/mfapi.h>
int smfi_version(
	unsigned int *pmajor,
	unsigned int *pminor,
	unsigned int *ppl
);

Description

The smfi_version callback function might be called at any time.

The compile-time version of the libmilter library is available in the SMFI_VERSION macro. To extract the major and minor version as well as the current patch level from this macro, the SM_LM_VRS_MAJOR(v), SM_LM_VRS_MINOR(v), and SM_LM_VRS_PLVL(v) macros might be used. A milter parameter can check the SMFI_VERSION macro to determine which functions to use (at compile time via C preprocessor statements). Using this macro and the smfi_version function, a milter parameter can determine at run time whether it has been (dynamically) linked against the expected libmilter version. Such a function must compare the major and minor version only, not the patch level, that is, the libmilter library will be compatible despite different patch levels.

Arguments

Table 1. Arguments
Item Description
pmajor A pointer to an unsigned int variable to store major version number.
pminor A pointer to an unsigned int variable to store minor version number.
ppl A pointer to an unsigned int variable to store patch level number.

Return values

The smfi_version function returns the MI_SUCCESS value.