(Page 28 of 80 in this chapter)
adiGetVersion
Description
- Gets version, build date, and compatibility level of the library.
Prototype
- DWORD adiGetVersion( ADI_REV_INFO *pinfo,
DWORD size )
- pinfo Pointer to the memory that holds version information.
typedef struct
{
DWORD size; /* size of returned structure */
DWORD majorrev; /* ADI major revision */
DWORD minorrev; /* ADI minor revision */
char builddate [12] ; /* build date, "Mmm dd yyyy\0" */
DWORD compatlevel ; /* Compatibility level */
} ADI_REV_INFO ;
- size Amount of memory available at pinfo, which must be large enough to receive ADI_REV_INFO.
Return Values
Events
- None.
Details
- The version information returned from this function is the revision and build date of the function library you are using.
- NMS attempts to make all software backward compatible, but future releases may require re-compilation of applications. Because the AG Access library is dynamically linked, your application needs a way to determine if it is using a compatible library.
- For increased confidence in application development with AG Access, compatibility level can be checked during run time. The AG Access library exports a revision level; your application can check this level against the compile time value, ADI_COMPATLEVEL. The compatibility level is increased if any release includes changes that require applications to be recompiled.
Example
#include <assert.h>
/* Abort execution right away if the ADI library is not of the
* expected version.
*/
void myCheckADIVersion( CTAHD ctahd )
{
ADI_REV_INFO info;
adiGetVersion( &info, sizeof info );
assert( info.compatlevel == ADI_COMPATLEVEL );
}
(Page 28 of 80 in this chapter)
Tech_Support@nmss.com
Copyright © 1996, Natural MicroSystems, Inc. All rights
reserved.