
Name: |
void fx_setuio(df_uio) | |
Inputs: |
DF_UIO df_uio |
DF_UIO structure |
Returns: |
none | |
Includes: |
srllib.h | |
|
dxxxlib.h | |
|
faxlib.h | |
Category: |
miscellaneous | |
Mode: |
synchronous | |
|
||
The fx_setuio( ) function registers user-defined I/O functions, replacements for the standard I/O functions read( ), write( ) and lseek( ) with the Dialogic fax library. This function is useful for applications requiring access and/or storage of data from, for example, a network device that requires the use of specific I/O functions.
Parameter |
Description |
df_uio |
Specifies the DF_UIO structure. |
Your application provides the addresses of user-defined read( ), write( ) and lseek( ) functions (with pointers to the user-defined read( ), write( ) and lseek( ) functions) by initializing the DF_UIO structure. The application then installs the user-defined functions by issuing the fx_setuio( ) function.
If you specify the user-defined I/O mode during a fax send or receive, the fax library uses the I/O functions registered by fx_setuio( ) instead of the standard I/O functions provided by the operating system. The user-defined I/O functions are passed the same arguments as the standard read( ), write( ) and lseek( ) I/O functions.
When issuing the fx_setuio( ) function to receive a fax, you must provide a user-defined write( ) function. When issuing this function to send a fax, you must provide a user-defined read( ) function.
#include <stdio.h>
#include <windows.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <faxlib.h>
DF_UIO userio;
/* User read function (note: same arguments as read( )) */
int user_read(filedes, buf, size)
int filedes;
char * buf;
unsigned size;
{
/* Application specific read( ) function. */
.
.
}
/* User write function (Note: Same arguments as write( )). */
int user_write(filedes, buf, size)
int filedes;
char * buf;
unsigned nbyte;
{
/* Application specific read( ) function. */
.
.
}
/* User lseek function (Note: Same arguments as lseek( )). */
long user_lseek(filedes, offset, whence)
int filedes;
long offset;
int whence;
{
/* Application specific lseek( ) function. */
.
.
}
main( )
{
.
.
userio.u_read = user_read;
userio.u_write = user_write;
userio.u_seek = user_lseek;
/* Register these functions with the FAX library. */
fx_setuio(userio);
.
.
}
Click here to contact Dialogic Customer Engineering
Copyright 2002, Intel Corporation