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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

etrieve the next parameter in a GC_PARM_BLK — gc_util_next_parm_ex( )<br />

The gc_util_next_parm_ex( ) function updates the data structure referenced by the parm pointer<br />

and returns GC_SUCCESS if there is another parameter element in the GC_PARM_BLK<br />

following the element that was identified in the function call. If the current parameter data structure<br />

referenced by parm identifies the last parameter element in the GC_PARM_BLK, the next<br />

function call returns EGC_NO_MORE_PARMS.<br />

Parameter Description<br />

parm_blk points to the valid GC_PARM_BLK structure where data is stored<br />

parm pointer to a valid GC_PARM_DATA_EXT structure provided by the<br />

application. If the pointer that is passed in the function call refers to a structure<br />

that was just initialized with INIT_GC_PARM_DATA_EXT(parm), the<br />

function retrieves the first parameter element in the GC_PARM_BLK. If the<br />

passed pointer references a structure that contains data from a previously<br />

found parameter element, the function retrieves the next parameter element in<br />

the block (if any). When the function completes successfully, the<br />

GC_PARM_DATA_EXT structure is updated to contain the retrieved<br />

information for the parameter element.<br />

Cautions<br />

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

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

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

Errors<br />

Example<br />

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

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

<strong>API</strong> Programming Guide. All <strong>Global</strong> <strong>Call</strong> error codes are defined in the gcerr.h file.<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_next_parm_ex( ).<br />

#include "gclib.h"<br />

#include "gcip.h"<br />

void process_parm_block(GC_PARM_BLKP pparm_blk)<br />

{<br />

GC_PARM_DATA_EXT parm_data_ext;<br />

int ret = 0;<br />

/* Initialize this structure for two reasons:<br />

* 1. To retrieve the first parameter in the parm block<br />

* 2. The first time this structure is used it must be initialized<br />

*/<br />

INIT_GC_PARM_DATA_EXT(&parm_data_ext);<br />

/* Loop to retrieve all of the parameters and associated data from the GC_PARM_BLK<br />

*/<br />

while ( GC_SUCCESS == (ret = gc_util_next_parm_ex( pparm_blk, &parm_dat_ext)) )<br />

{<br />

/* Process set_ID/parm_ID pairs */<br />

switch(parm_data_ext.set_ID);<br />

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

Dialogic Corporation

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

Saved successfully!

Ooh no, something went wrong!