Previous Page Table Of Contents../index.html IndexNext Page


7.7. DF_UIO -- User-Defined I/O

The DF_UIO structure contains pointers to user-defined functions that replace the standard I/O functions read( ), write( ) and lseek( ). This structure is passed to fx_setuio( ).

The user-defined I/O functions are passed the same arguments and must specify the same return type as the standard I/O functions. The fax library stores the pointers to the user-defined read, write and seek functions.

The DF_UIO structure consists of the following fields.

The DF_UIO fields are described in Table 20. DF_UIO Fields.


Table 20. DF_UIO Fields

Field

Description

u_read

A pointer to the user-defined read( ) function.

u_write

A pointer to the user-defined write( ) function.

u_seek

A pointer to the user-defined lseek( ) function.

The following rules apply to the use of the DF_UIO structure:

To specify user-defined I/O functions for use in sending a fax, you must "OR" the io_type field of the appropriate DF_IOTT structure with IO_UIO.

The fax library then calls the user-defined seek and read functions when processing the DF_IOTT structure. The file descriptor argument passed to the user-defined functions is the value specified in the io_fhandle field of the DF_IOTT structure.

NOTE:
In an array of DF_IOTT structures passed to the fx_sendfax( ) function, the user-defined I/O functions are only called for those structures whose IO_UIO bit is set in the io_type field. The standard I/O functions are used for all other DF_IOTT structures.

To specify user-defined I/O functions for use in receiving a fax, you must "OR" the rcvflag argument of the fx_rcvfax2( ) function with the IO_UIO bit.

The fax library then calls the user-defined seek and write functions every time fax data is to be written to the I/O device. The file descriptor passed to the user-defined I/O functions is the fd argument to the fx_rcvfax2( ) function.


Previous PageTable Of ContentsTop Of PageIndexNext Page

Click here to contact Dialogic Customer Engineering

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