Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 211
read data from a file — dx_fileread( )
int cd; /* channel device descriptor */
DX_UIO myio; /* user definable I/O structure */
/*
* User defined I/O functions
*/
int my_read(fd,ptr,cnt)
int fd;
char * ptr;
unsigned cnt;
{
printf("My read\n");
return(
dx_fileread(fd,ptr,cnt)
);
}
/*
* my write function
*/
int my_write(fd,ptr,cnt)
int fd;
char * ptr;
unsigned cnt;
{
printf("My write \n");
return(dx_filewrite(fd,ptr,cnt));
}
/*
* my seek function
*/
long my_seek(fd,offset,whence)
int fd;
long offset;
int whence;
{
printf("My seek\n");
return(dx_fileseek(fd,offset,whence));
}
void main(argc,argv)
int argc;
char *argv[];
{
.
. /* Other initialization */
.
DX_UIO uioblk;
/* Initialize the UIO structure */
uioblk.u_read=my_read;
uioblk.u_write=my_write;
uioblk.u_seek=my_seek;
/* Install my I/O routines */
dx_setuio(uioblk);
vodat_fd = dx_fileopen("JUNK.VOX",O_RDWR|O_BINARY);
/*This block uses standard I/O functions */
iott->io_type = IO_DEV|IO_CONT
iott->io_fhandle = vodat_fd;
iott->io_offset = 0;
iott->io_length = 20000;