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.
7.7.1. DF_UIO DefinitionThe DF_UIO structure consists of the following fields.
typedef struct df_uio {
int (*u_read)( ); /* User defined replacement for read( ) */
int (*u_write)( ); /* User defined replacement for write( ) */
long (*u_seek)( ); /* User defined replacement for lseek( ) */
};
7.7.2. DF_UIO Field DescriptionsThe 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. |
7.7.3. Usage RulesThe following rules apply to the use of the DF_UIO structure:
Specifying User I/O for fx_sendfax( )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.
Specifying User I/O for fx_rcvfax2( )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.
Click here to contact Dialogic Customer Engineering
Copyright 2002, Intel Corporation