PREV TOC HOME INDEX NEXT


gc_util_next_parm( )


Termination Events | Cautions | Errors | Example | See Also

Name: gc_util_next_parm(parm_blk, cur_parm )
Inputs:

GC_PARM_BLKP *parm_blk

 

GC_PARM_DATAP *cur_parm

  • pointer to current parameter
Returns:

a pointer if successful

NULL if no more parameters exist

Includes:

gclib.h

gcerr.h

Category:

GC_PARM_BLK utility

Mode:

synchronous

Platform and Technology:

All

Description

The gc_util_next_parm( ) function must be used to retrieve the next parameter in a GC_PARM_BLK. The function takes a GC_PARM_BLK pointer to the block where the data resides and a GC_PARM_DATA pointer returned by a previous call to this function. If the first parameter in the block is desired, NULL can be used. The function locates and returns the pointer to the next parameter, or NULL if no more parameters exist.

Parameter

Description

parm_blk points to the parameter block where data is stored
cur_parm points to the current parameter. The pointer is obtained through a previous call to this function. Use NULL if the first parameter is desired.

Termination Events

None

Cautions

This function always returns a pointer to the next parameter relative to the given parameters, for example, this function will return the pointer to the third element if given the pointer to the second element. It does not return the pointer to the next element relative to the previous call of this function.

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.

Example

#include "gclib.h" 
void main( ) 
{
    GC_PARM_BLKP my_blkp = NULL;
    GC_PARM_DATAP my_parmp;
    int type = 1; 
    /* insert parm by reference */
    if ( gc_util_insert_parm_ref( &my_blkp, GC_SET_SERVREQ, PARM_REQTYPE,
         sizeof( int ), &type ) != GC_SUCCESS )
    {
        /* Process error */
    } 
    /* insert parm by value */
    if ( gc_util_insert_parm_val( &my_blkp, GC_SET_SERVREQ, PARM_ACK,
         sizeof( short ), GC_ACK ) != GC_SUCCESS )
    {
        /* Process error */
    } 
    /* Now we should have a GC_PARM_BLK with 2 parameters */ 
    /* Following use of gc_util_next_parm retrieves the first parameter in a
     * GC_PARM_BLK, which in this case is PARM_REQTYPE */
    my_parmp = gc_util_next_parm( my_blkp, NULL ); 
    /* Retrieve the next parameter after getting the first one */
    my_parmp = gc_util_next_parm( my_blkp, my_parmp ); 
    /* This function finds and returns specified parameter, NULL if not found */
    my_parmp = gc_util_find_parm( my_blkp, GC_SET_SERVREQ, PARM_ACK ); 
    /* After GC_PARM_BLK is no longer needed, delete the block */
    gc_util_delete_parm_blk( my_blkp ); 
    /* Set my_blkp to NULL now that the block has been deleted */
    my_blkp = NULL;
} 

See Also


PREV TOC HOME INDEX NEXT

Click here to contact Telecom Support Resources

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