File: file.h

package info (click to toggle)
poc-streamer 0.4.2-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,000 kB
  • sloc: ansic: 8,782; makefile: 307; ruby: 152; perl: 135; yacc: 115; lex: 36; sh: 30
file content (43 lines) | stat: -rw-r--r-- 739 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*C
  (c) 2005 bl0rg.net
**/

#ifndef FILE_H__
#define FILE_H__

#include <sys/types.h>

/*M
  \emph{Error returned by file_read and file_write.}
**/

#define EEOF (-1)
#define ESYNC (-2)

typedef struct file_s {
  /*M
    File descriptor.
  **/
  int fd;
  /*M
    Offset into file.
  **/
  unsigned long offset;
  /*M
    Size of file.
  **/
  unsigned long size;
  unsigned short maxsync;
} file_t;

int file_open_read(file_t *file, char *filename);
int file_open_write(file_t *file, char *filename);
int file_close(file_t *file);
int file_read(file_t *file, unsigned char *buf, size_t size);
int file_seek_fwd(file_t *file, size_t size);
int file_write(file_t *file, unsigned char *buf, size_t size);

#endif /* FILE_H__ */

/*C
  **/