Previous PageTable Of Contents../index.htmlIndexNext Page

dx_setdevuio( )

Description | Cautions | Errors | Example | See Also

Name:

int dx_setdevuio(chdev, setuiop, getuiopp)

Inputs:

int chdev

  Valid Dialogic channel device handle

 

DX_UIO *setuiop

  Pointer to user I/O routines structure

 

DX_UIO **getuiopp

  Pointer to return pointer for user I/O routines structure

 

short evtlen

Length of the data block in bytes

 

unsigned short flags

SENDSELF/SENDOTHERS/SENDALL

Returns:

0 if successful

 

-1 error return code

Includes:

dxxxlib.h

  srllib.h

Mode:

Synchronous

Top Of PageDescription

The dx_setdevuio( ) function will enable the application to install and retrieve user-defined I/O functions on a per Dialogic channel device basis. The user I/O functions installed using this function will be used on all subsequent I/O operations performed on the channel even if the application installs global user I/O functions for all devices using the dx_setuio( ) function. The user I/O functions are installed by installing a pointer to a DX_UIO structure which contains addresses of the user-defined I/O functions.

The first argument to the function is chdev, the descriptor of a Dialogic channel device. This specifies the channel for which the user-defined I/O functions will be installed. The second argument, setuiop, is a pointer to an application-defined global DX_UIO structure which contains the addresses of the user-defined I/O functions. This pointer to the DX_UIO structure will be stored in the Dialogic Voice DLL for the specified chdev channel device. The application must not overwrite the DX_UIO structure until dx_setdevuio( ) has been called again for this device with the pointer to another DX_UIO structure. The third argument, getuiopp, is the address of a pointer to a DX_UIO structure. Any previously installed I/O functions for the chdev device are returned to the application as a pointer to DX_UIO structure in getuiopp. If this is the first time dx_setdevuio( ) is called for a device, then getuiopp will be filled with the pointer to the global DX_UIO structure which may contain addresses of the user-defined I/O function that apply to all devices.

Either of setuiop or getuiopp may be NULL, but not both at the same time. If getuiopp is NULL, the dx_setdevuio( ) function will only install the user I/O functions specified via the DX_UIO pointer in setuiop but will not return the address of the previously installed DX_UIO structure. If setuiop is NULL, then the previously installed DX_UIO structure pointer will be returned in getuiopp but no new functions will be installed.

Top Of PageCautions

The DX_UIO structure pointed to by setuiop must not be altered until the next call to dx_setdevuio( ) with new values for user-defined I/O functions.

For proper operation, it is the application's responsibility to properly define the three DX_UIO user routines; u_read, u_write and u_seek. Refer to the DX_UIO structure in the chapter on Data Structures for more information.

Top Of PageErrors

If the function returns -1 to indicate an error, use the SRL Standard Attribute function ATDV_LASTERR( ) to obtain the error code or you can use ATDV_ERRMSGP( ) to obtain a descriptive error message. The error codes returned by ATDV_LASTERR( ) are:

Equate

Returned When

EDX_BADPARM

Invalid Parameter

EDX_BADDEV

Invalid Device Descriptor

Top Of PageExample

Top Of PageSee Also

dx_setuio( )


Previous PageTable Of ContentsTop Of PageIndexNext Page

Click here to contact Dialogic Customer Engineering

Copyright 2002, Dialogic Corporation
All rights reserved
This page generated February, 2002