Add IO type checking functions, add ReadLine

This commit is contained in:
2025-11-08 18:50:13 +03:00
parent 44057e96f3
commit 6d02598e20
14 changed files with 310 additions and 0 deletions

View File

@@ -86,16 +86,25 @@ BH_IO *BH_FileNew(const char *path,
int *result);
int BH_IOIsFile(BH_IO *device);
BH_IO *BH_BufferNew(BH_IO *device,
size_t size,
int *result);
int BH_IOIsBuffer(BH_IO *device);
BH_IO *BH_BytesNew(char *data,
size_t size,
int *result);
int BH_IOIsBytes(BH_IO *device);
void BH_IOFree(BH_IO *device);
@@ -155,4 +164,14 @@ int BH_IOEndOfFile(BH_IO *device);
int BH_IOClear(BH_IO *device);
char *BH_IOReadLine(BH_IO *device,
char *str,
size_t size);
char *BH_IOReadLineFull(BH_IO *device,
char *str,
size_t size);
#endif /* BH_IO_H */