08.01.2013 Views

Dialogic® Global Call API Library Reference

Dialogic® Global Call API Library Reference

Dialogic® Global Call API Library Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

find a parameter in a GC_PARM_BLK — gc_util_find_parm_ex( )<br />

The gc_util_find_parm_ex( ) function can be used to determine whether a particular parameter<br />

exists, or to retrieve a particular parameter, or both. If the specified parameter is found in the<br />

GC_PARM_BLK, the function fills in the GC_PARM_DATA_EXT structure with the parameter<br />

data and returns GC_SUCCESS. If the parameter does not exist in the GC_PARM_BLK, or if no<br />

more parameters of the specified type are found, the function returns EGC_NO_MORE_PARMS.<br />

To search from the beginning of the GC_PARM_BLK, initialize the GC_PARM_DATA_EXT<br />

structure by using INIT_GC_PARM_DATA_EXT(parm) before calling<br />

gc_util_find_parm_ex( ). If the structure pointed to by parm contains parameter information that<br />

was retrieved in a previous call to this function, the function will begin its search at that parameter<br />

rather than the beginning of the parameter block.<br />

Parameter Description<br />

parm_blk points to a valid GC_PARM_BLK that will be searched for a parameter of<br />

the specified type<br />

setID set ID of the parameter to be found<br />

parmID parameter ID of the parameter to be found<br />

parm points to a valid GC_PARM_DATA_EXT provided by the application. If a<br />

pointer to a newly initialized structure is passed in the function call, the<br />

function searches from the beginning of the GC_PARM_BLK; if the<br />

structure contains data from a previously found parameter, the function<br />

searches from that parameter onward. When the function completes<br />

successfully, the structure is updated to contain retrieved information for the<br />

parameter that was found.<br />

Cautions<br />

Errors<br />

Unlike the similar gc_util_find_parm( ) function, the parm pointer used in this function<br />

cannot be used to update the parameter itself because it points to a data structure that is in the<br />

application’s memory rather than a location in the GC_PARM_BLK itself.<br />

The parm parameter must point to a valid GC_PARM_DATA_EXT structure. If it is desired to<br />

search from the beginning of the parameter block, the application must initialize the structure<br />

via INIT_GC_PARM_DATA_EXT(parm) before calling gc_util_find_parm_ex( ).<br />

If this function returns GC_ERROR to indicate failure, use the gc_ErrorInfo( ) function to retrieve<br />

the reason for the error. See the “Error Handling” section in the Dialogic ® <strong>Global</strong> <strong>Call</strong> <strong>API</strong><br />

Programming Guide. All <strong>Global</strong> <strong>Call</strong> error codes are defined in the gcerr.h file.<br />

Example<br />

#include "gclib.h"<br />

#include "gcip.h"<br />

void search_parm_block(GC_PARM_BLKP parm_blkp)<br />

{<br />

GC_PARM_DATA_EXT parm_data_ext;<br />

int ret = 0;<br />

Dialogic ® <strong>Global</strong> <strong>Call</strong> <strong>API</strong> <strong>Library</strong> <strong>Reference</strong> — January 2008 377<br />

Dialogic Corporation

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!