Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dataIO.h
Go to the documentation of this file.
1 /*
2  * dataIO.h
3  *
4 */
5 
6 #ifndef _DATAIO_INCLUDED
7 #define _DATAIO_INCLUDED
8 
9 static const char sccsidDataIOH[] = "@(#)dataIO.h\t5.2\tCreated 7/27/97 18:54:32, \tcompiled "__DATE__;
10 
11 #define DATAIO_EOF 0 /* file mark or end of tape */
12 #define DATAIO_OK 1 /* no errors */
13 #define DATAIO_EOT 2 /* end of tape */
14 #define DATAIO_ERROR (-1) /* read/write error (message->stderr) */
15 #define DATAIO_BADCRC (-2) /* CRC mismatch error: data is damaged */
16 
17 int data_write(int fd,const void* event); /* automatically regenerates the CRC word */
18 
19 int data_read(int fd,void* buffer,int bufsize);
20 int data_read_alloc(int fd,void **buffer); /* memory pointed by *buffer should be free()ed */
21 
22 int data_flush(int fd); /* Flush internal buffers: should always be called before a close() */
23 
24 int data_writeFM(int fd); /* Write a file mark on tape */
25 
26 int data_findFM(int fd,int count); /* find a File Mark. count>0 seeks forward, count<0 seeks backwards */
27 
28 /*
29  * data_SeekTape: Position the data tape at the requested run number.
30  *
31  * Input arguments: fd - file descriptor of the tape device (as returned by 'open' or 'fileno')
32  * runNo - requested run number
33  *
34  * Return value: 0 if run was found.
35  * (-1) if run was not found
36  *
37  * Output arguments: tapeNo - if a tape label is encountered while
38  * seeking the requested run,
39  * 'tapeNo' will be set to the run number from it.
40  * Otherwise the value is left unchanged.
41 */
42 
43 int data_SeekTape(int fd,int runNo,int *tapeNo);
44 
45 #endif
46 /* endfile */
int data_read(int fd, void *buffer, int bufsize)
int data_writeFM(int fd)
static const char sccsidDataIOH[]
Definition: dataIO.h:9
int data_findFM(int fd, int count)
int data_flush(int fd)
int data_read_alloc(int fd, void **buffer)
int data_write(int fd, const void *event)
int data_SeekTape(int fd, int runNo, int *tapeNo)