gc_GetVer( )
Termination Events | Cautions | Errors | Example | See Also
Name: int gc_GetVer(linedev, releasenump, intnump, component) Inputs: Returns: Includes: Category: Mode: Platform and Technology: Description
The gc_GetVer( ) function retrieves the version number of a specified component. If the specified component parameter is GCGV_LIB or if the linedev parameter is 0 (zero), the version number of the Global Call library will be returned. Otherwise, the value returned will be the version number of the library associated with the linedev parameter.
An Intel® Dialogic version number consists of two parts:
- the release type: production or beta
- the release number, which consists of different elements depending on the type of release
The gc_GetVer( ) function returns the software version number as a long integer (32 bits) in BCD (binary coded decimal) format. Figure 1 shows the format of the version number that is returned. Each section in the diagram represents a nibble (4 bits).
Figure 1. Component Version Number Format
Nibble 1 returns the type of release. The values convert to:
Nibbles 2, 3, and 4 return the Production Number.
Nibbles 5, 6, 7, and 8 return the Internal Number, which is used for pre-production product releases. The Internal Number is assigned to beta product releases. Nibbles 5 and 6 hold the product's beta number. Nibbles 7 and 8 hold additional information that is used for internal releases.
- Note: Nibbles 2 through 4 are used in all version numbers. Nibbles 5 through 8 contain values only if the release is not a production release.
Table 8 provides the values returned by each nibble in the long int. For example, if a production version number is 1.02, then:
For a version number of 1.02 beta 2, then:
Termination Events
Cautions
Errors
If this function returns <0 to indicate failure, use the gc_ErrorInfo( ) function to retrieve the reason for the error. See the "Error Handling" section in the Global Call API Programming Guide. All Global Call error codes are defined in the gcerr.h file. If the error returned is technology specific, see the technology-specific error header file(s) for the error definition (for example, ccerr.h or isdnerr.h file for the ISDN call control library).
Example
#include <stdio.h> #include <srllib.h> #include <gclib.h> #include <gcerr.h> int print_version(LINEDEV ldev, long component) { unsigned int releasenum; /* Production release number */ unsigned int intnum; /* Internal release number */ GC_INFO gc_error_info; /* GlobalCall error information data */ /* * Get the version number of the library associate with the line * device. */ if (gc_GetVer(ldev, &releasenum, &intnum, component) == GC_SUCCESS) { printf("Production release number = 0x%lx\n", releasenum); printf("Internal release number = 0x%lx\n", intnum); } else { /* process error return as shown */ gc_ErrorInfo( &gc_error_info ); printf ("Error: gc_GetVer() on linedev: 0x%lx, GC ErrorValue: 0x%hx - %s, CCLibID: %i - %s, CC ErrorValue: 0x%lx - %s\n", ldev, gc_error_info.gcValue, gc_error_info.gcMsg, gc_error_info.ccLibId, gc_error_info.ccLibName, gc_error_info.ccValue, gc_error_info.ccMsg); return (gc_error_info.gcValue); } return (0); }See Also
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation