
Description | Cautions | Example | Errors | See Also
Name: |
int dx_clrtpt(tptp,size) | |
Inputs: |
DV_TPT *tptp |
|
int size |
| |
Returns: |
0 if success | |
-1 if failure | ||
Includes: |
srllib.h | |
Category: |
Structure Clearance | |
The dx_clrtpt( ) function clears all fields in a DV_TPT structure, except tp_type and tp_nextp in the number of DV_TPT structures indicated in the size parameter. dx_clrtpt( ) is provided as a convenient way of clearing a DV_TPT structure, if this is required before initializing it for a new set of terminating conditions.
| |
| |
If tp_type is set to IO_LINK, you MUST set tp_nextp to point to the next DV_TPT in the chain. dx_clrtpt( ) uses the information in tp_type, and in tp_nextp if IO_LINK is set, to access the next DV_TPT. By setting the tp_type and tp_nextp fields appropriately, dx_clrtpt( ) can be used to clear a combination of contiguous and linked DV_TPT structures.
The function parameters are defined as follows:
Parameter |
Description |
tptp |
points to the first DV_TPT to be cleared. |
size |
indicates the number of DV_TPT structures to clear. If size is set to 0, the function will return a 0 to indicate success. |
dx_clrtpt( ) uses the information present in tp_type and tp_nextp (if IO_LINK is set) to access the next DV_TPT in the chain. The last DV_TPT in the chain must have its tp_type field set to IO_EOT. If the DV_TPTs have to be reinitialized with a new set of conditions, dx_clrtpt( ) must be called only after the links have been set up, as illustrated below.
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
main()
{
DV_TPT tpt1[2];
DV_TPT tpt2[2];
/* Set up the links in the DV_TPTs */
tpt1[0].tp_type = IO_CONT;
tpt1[1].tp_type = IO_LINK;
tpt1[1].tp_nextp = &tpt2[0];
tpt2[0].tp_type = IO_CONT;
tpt2[1].tp_type = IO_EOT;
/* set up the other DV_TPT fields as required for termination */
.
.
/* play a voice file, get digits, etc. */
.
.
/* clear out the DV_TPT structures if required */
dx_clrtpt(&tpt1[0],4);
/* now set up the DV_TPT structures for the next play */
.
.
}
The function will fail and return -1 if IO_EOT is encountered in the tp_type field before the number of DV_TPT structures specified in size have been cleared.
Click here to contact Dialogic Customer Engineering
Copyright 2002, Dialogic Corporation