38 lines
821 B
C
38 lines
821 B
C
|
|
#ifndef BHLIB_FILE_H
|
||
|
|
#define BHLIB_FILE_H
|
||
|
|
|
||
|
|
#include "io.h"
|
||
|
|
|
||
|
|
typedef struct bh_file_s bh_file_t;
|
||
|
|
|
||
|
|
bh_file_t *bh_file_new(const char *path,
|
||
|
|
const char *mode);
|
||
|
|
|
||
|
|
void bh_file_free(bh_file_t *file);
|
||
|
|
|
||
|
|
size_t bh_file_read(bh_file_t *file,
|
||
|
|
char *buffer,
|
||
|
|
size_t size);
|
||
|
|
|
||
|
|
size_t bh_file_write(bh_file_t *file,
|
||
|
|
const char *buffer,
|
||
|
|
size_t size);
|
||
|
|
|
||
|
|
void bh_file_flush(bh_file_t *file);
|
||
|
|
|
||
|
|
void bh_file_seek(bh_file_t *file,
|
||
|
|
bh_off_t pos,
|
||
|
|
int dir);
|
||
|
|
|
||
|
|
bh_off_t bh_file_tell(bh_file_t *file);
|
||
|
|
|
||
|
|
bh_off_t bh_file_available(bh_file_t *file);
|
||
|
|
|
||
|
|
int bh_file_error(bh_file_t *file);
|
||
|
|
|
||
|
|
int bh_file_eof(bh_file_t *file);
|
||
|
|
|
||
|
|
void bh_file_clear(bh_file_t *file);
|
||
|
|
|
||
|
|
#endif /* BHLIB_FILE_H */
|