PREV TOC HOME INDEX NEXT


gc_GetVer( )


Termination Events | Cautions | Errors | Example | See Also

Name: int gc_GetVer(linedev, releasenump, intnump, component)
Inputs:

LINEDEV linedev

  • Global Call line device handle
 

unsigned int *releasenump

  • pointer to location where production release number will be stored
 

unsigned int *intnump

  • pointer to location where internal release number will be stored
 

long component

  • system component
Returns:

0 if successful

<0 if failure

Includes:

gclib.h

gcerr.h

Category:

optional call handling

Mode:

synchronous

Platform and Technology:

Springware: T-1/E-1, ISDN, Analog

SS7

IP (host-based stack and embedded stack)

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:

For example:

Parameter

Description

linedev Global Call line device handle. If this parameter is set to 0, the version number of the Global Call API is returned.
releasenump points to the location where the production release number and type indicator will be stored
intnump points to the location where the internal release number will be stored
component specifies the software component to which the version number applies. Selections are:
  • GC_LIB
    Global Call library
  • GC_ICAPI_LIB
    ICAPI library
  • GC_ANAPI_LIB
    ANAPI library
  • GC_PDKRT_LIB
    PDKRT library

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:

Table 8. gc_GetVer( ) Return Values 

*releasenump

*intnump

1

2

3 & 4

5 & 6

7 & 8

Type

Production Number

Internal Number

Production

Major Production Number

Minor Production Number

N/A

N/A

Beta

Major Production Number

Minor Production Number

Beta Number

N/A

Nibble(s) [4 bits each]

Termination Events

None

Cautions

None

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

None


PREV TOC HOME INDEX NEXT

Click here to contact Telecom Support Resources

Copyright 2003, Intel Corporation
All rights reserved
This page generated February, 2003