1168515Sgshapiro<HTML> 2168515Sgshapiro<HEAD><TITLE>smfi_version()</TITLE></HEAD> 3168515Sgshapiro<BODY> 4168515Sgshapiro<!-- 5266692Sgshapiro$Id: smfi_version.html,v 1.7 2013-11-22 20:51:39 ca Exp $ 6168515Sgshapiro--> 7168515Sgshapiro<H1>smfi_version()</H1> 8168515Sgshapiro 9168515Sgshapiro<TABLE BORDER="0" CELLSPACING=4 CELLPADDING=4> 10168515Sgshapiro<!---------- Synopsis -----------> 11168515Sgshapiro<TR><TH VALIGN="TOP" ALIGN=LEFT WIDTH=100>SYNOPSIS</TH><TD> 12168515Sgshapiro<PRE> 13168515Sgshapiro#include <libmilter/mfapi.h> 14168515Sgshapiroint smfi_version( 15168515Sgshapiro unsigned int *pmajor, 16168515Sgshapiro unsigned int *pminor, 17168515Sgshapiro unsigned int *ppl 18168515Sgshapiro); 19168515Sgshapiro</PRE> 20168515SgshapiroGet the (runtime) version of libmilter. 21168515Sgshapiro</TD></TR> 22168515Sgshapiro 23168515Sgshapiro<!----------- Description ----------> 24168515Sgshapiro<TR><TH VALIGN="TOP" ALIGN=LEFT>DESCRIPTION</TH><TD> 25168515Sgshapiro<TABLE BORDER="1" CELLSPACING=1 CELLPADDING=4> 26168515Sgshapiro<TR ALIGN="LEFT" VALIGN=TOP> 27168515Sgshapiro<TH WIDTH="80">Called When</TH> 28168515Sgshapiro<TD>smfi_version may be called at any time.</TD> 29168515Sgshapiro</TR> 30168515Sgshapiro<TR ALIGN="LEFT" VALIGN=TOP> 31168515Sgshapiro<TH WIDTH="80">Effects</TH> 32168515Sgshapiro<TD>None.</TD> 33168515Sgshapiro</TR> 34168515Sgshapiro</TABLE> 35168515Sgshapiro 36168515Sgshapiro<!----------- Arguments ----------> 37168515Sgshapiro<TR><TH VALIGN="TOP" ALIGN=LEFT>ARGUMENTS</TH><TD> 38168515Sgshapiro <TABLE BORDER="1" CELLSPACING=0> 39168515Sgshapiro <TR BGCOLOR="#dddddd"><TH>Argument</TH><TH>Description</TH></TR> 40168515Sgshapiro <TR VALIGN="TOP"><TD>pmajor</TD> 41168515Sgshapiro <TD>Pointer to an unsigned int variable to store major version number. 42168515Sgshapiro </TD></TR> 43168515Sgshapiro <TR VALIGN="TOP"><TD>pminor</TD> 44168515Sgshapiro <TD>Pointer to an unsigned int variable to store minor version number. 45168515Sgshapiro </TD></TR> 46168515Sgshapiro <TR VALIGN="TOP"><TD>ppl</TD> 47168515Sgshapiro <TD>Pointer to an unsigned int variable to store patch level number. 48168515Sgshapiro </TD></TR> 49168515Sgshapiro </TABLE> 50168515Sgshapiro</TD></TR> 51168515Sgshapiro 52168515Sgshapiro<!----------- Return values ----------> 53168515Sgshapiro<TR> 54168515Sgshapiro<TH VALIGN="TOP" ALIGN=LEFT>RETURN VALUES</TH> 55168515Sgshapiro<TD>smfi_version returns MI_SUCCESS.</TD> 56168515Sgshapiro</TR> 57168515Sgshapiro 58168515Sgshapiro</TABLE> 59168515Sgshapiro 60168515SgshapiroNote: the compile time version of libmilter is available in the macro 61168515Sgshapiro<CODE>SMFI_VERSION</CODE>. 62182352SgshapiroTo extract the major and minor version as well as the current patch level 63182352Sgshapirofrom this macro, the macros 64182352Sgshapiro<CODE>SM_LM_VRS_MAJOR(v)</CODE>, 65182352Sgshapiro<CODE>SM_LM_VRS_MINOR(v)</CODE>, and 66182352Sgshapiro<CODE>SM_LM_VRS_PLVL(v)</CODE> 67182352Sgshapirocan be used, respectively. 68182352SgshapiroA milter can check the 69182352Sgshapiro<CODE>SMFI_VERSION</CODE> 70182352Sgshapiromacro to determine which functions to use 71168515Sgshapiro(at compile time via C preprocessor statements). 72168515SgshapiroUsing this macro and the 73168515Sgshapiro<CODE>smfi_version()</CODE> 74168515Sgshapirofunction, 75168515Sgshapiroa milter can determine at runtime whether it has been (dynamically) 76168515Sgshapirolinked against the expected libmilter version. 77182352SgshapiroSuch a function should only compare the major and minor version, 78182352Sgshapironot the patch level, 79182352Sgshapiroi.e., the libmilter library will be compatible despite 80182352Sgshapirodifferent patch levels. 81168515Sgshapiro 82168515Sgshapiro 83168515Sgshapiro<HR SIZE="1"> 84168515Sgshapiro<FONT SIZE="-1"> 85261363SgshapiroCopyright (c) 2006-2008 Proofpoint, Inc. and its suppliers. 86168515SgshapiroAll rights reserved. 87168515Sgshapiro<BR> 88168515SgshapiroBy using this file, you agree to the terms and conditions set 89168515Sgshapiroforth in the LICENSE. 90168515Sgshapiro</FONT> 91168515Sgshapiro</BODY> 92168515Sgshapiro</HTML> 93