Sync to the latest version.

Can be broken or partially implemented.
This commit is contained in:
2024-04-23 23:45:43 +03:00
parent ec499b6cfc
commit 692b5b4297
26 changed files with 785 additions and 60 deletions

37
include/bh/file.h Normal file
View File

@@ -0,0 +1,37 @@
#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 */