DALIB(3)

NAME
da_init - Initialise a DAT filedescriptor

SYNOPSIS
#include <sys/fcntl.h> #include dataudiolib.h

int
da_init( int fd, int mode)

DESCRIPTION
The da_init() function initialises the library with an already opened filedescriptor. If fd is associated with a tape device, this functions tries to load the last saved state of this tape device (if present).

PARAMETERS

  Input Parameters

fd  A UNIX filedescriptor. This may be one of the standard filedescriptors (associated with stdin or stdout).

mode
    May contain the same flags that can be passed to open(3) as defined in <sys/fcntl.h>. This function only uses O_RDONLY,O_WRONLY and O_RDWR.

RETURN VALUE
This function returns an integer descriptor to be used with other da_xxx functions.
When an error condition arises, this routine returns -1 and sets errno to indicate the reason for the error. Possible values of errno are:

EINVAL
    The filedescriptor is invalid.

other
    All errnos that can be returned by fstat(3) .

USAGE EXAMPLE

Open stdin as a DAT audio device. (You have to start the resp. program using program < /dev/somewhere

		int datfd;
		datfd=da_init(fileno(stdin));

SEE ALSO
da_intro(3),da_init(3)

AUTHOR
Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>