gc_util_find_parm( )
Termination Events | Cautions | Errors | Example | See Also
Name: GC_PARM_DATAP gc_util_find_parm(parm_blk, setID, parmID ) Inputs:
- pointer to GC_PARM_BLK where parameter is possibly located
Returns: a pointer to GC_PARM_DATAP if successful
NULL if the parameter is not found in the given GC_PARM_BLK
Includes: Category: Mode: Platform and Technology: Description
The gc_util_find_parm( ) function is used to find a parameter in a GC_PARM_BLK. The gc_util_find_parm( ) function can be used to verify that a particular parameter exists, or to retrieve a particular parameter, or both. The function returns a pointer to the parameter if the parameter exists, or NULL if the parameter is not found in the specified GC_PARM_BLK.
parm_blk points to a valid GC_PARM_BLK where the parameter is possibly located setID set ID of the parameter to be found parmID parm ID of the parameter to be found Termination Events
Cautions
- If the same parameter is included twice inside the GC_PARM_BLK, only the first instance of the parameter is returned.
- The pointer returned by gc_util_find_parm( ) can be used to modify that specific parameter within the GC_PARM_BLK. When the GC_PARM_BLK is modified, the changes will not take effect until the appropriate function, such as gc_SetConfigData( ), is called. The size of the data must remain the same.
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
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation