aboutsummaryrefslogtreecommitdiff
path: root/include/bh/file.h
blob: 304eb553d1fd8ba4d952c7de30dcc354f9ccdcbb (plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef BH_FILE_H
#define BH_FILE_H

#include "bh.h"
#include "io.h"

typedef struct bh_file_s bh_file_t;

bh_file_t *bh_file_new(const char *path);

#define bh_file_free(file) \
    bh_io_free((bh_io_t *)(file))

#define bh_file_open(file, mode) \
    bh_io_open((bh_io_t *)(file), (mode))

#define bh_file_close(file) \
    bh_io_close((bh_io_t *)(file))

#define bh_file_is_open(file) \
    bh_io_is_open((bh_io_t *)(file))

#define bh_file_read(file, data, size) \
    bh_io_read((bh_io_t *)(file), (data), (size))

#define bh_file_peek(file, data, size) \
    bh_io_peek((bh_io_t *)(file), (data), (size))

#define bh_file_write(file, data, size) \
    bh_io_write((bh_io_t *)(file), (data), (size))

#define bh_file_flush(file) \
    bh_io_flush((bh_io_t *)(file))

#define bh_file_seek(file, pos, dir) \
    bh_io_seek((bh_io_t *)(file), (pos), (dir))

#define bh_file_size(file) \
    bh_io_size((bh_io_t *)(file))

#define bh_file_tell(file) \
    bh_io_tell((bh_io_t *)(file))

#define bh_file_available(file) \
    bh_io_available((bh_io_t *)(file))

#define bh_file_clear(file) \
    bh_io_clear((bh_io_t *)(file))

#define bh_file_error(file) \
    bh_io_error((bh_io_t *)(file))

#define bh_file_eof(file) \
    bh_io_eof((bh_io_t *)(file))

#endif /* BH_FILE_H */