File access.
More...
|
void * | internal |
| Reserved for BD_FILE_H implementation use. More...
|
|
void(* | close )(BD_FILE_H *file) |
| Close file. More...
|
|
int64_t(* | seek )(BD_FILE_H *file, int64_t offset, int32_t origin) |
| Reposition file offset. More...
|
|
int64_t(* | tell )(BD_FILE_H *file) |
| Get current read or write position. More...
|
|
int(* | eof )(BD_FILE_H *file) |
| Check for end of file. More...
|
|
int64_t(* | read )(BD_FILE_H *file, uint8_t *buf, int64_t size) |
| Read from file. More...
|
|
int64_t(* | write )(BD_FILE_H *file, const uint8_t *buf, int64_t size) |
| Write to file. More...
|
|
◆ close
void(* BD_FILE_H::close) (BD_FILE_H *file) |
◆ eof
int(* BD_FILE_H::eof) (BD_FILE_H *file) |
Check for end of file.
- optional, currently not used
- Parameters
-
- Returns
- 1 on EOF, < 0 on error, 0 if not EOF
◆ internal
void* BD_FILE_H::internal |
Reserved for BD_FILE_H implementation use.
Implementation can store here ex. file handle, FILE*, ...
◆ read
int64_t(* BD_FILE_H::read) (BD_FILE_H *file, uint8_t *buf, int64_t size) |
Read from file.
- Parameters
-
file | BD_FILE_H object |
buf | buffer where to store the data |
size | bytes to read |
- Returns
- number of bytes read, 0 on EOF, < 0 on error
◆ seek
int64_t(* BD_FILE_H::seek) (BD_FILE_H *file, int64_t offset, int32_t origin) |
Reposition file offset.
- SEEK_SET: seek to 'offset' bytes from file start
- SEEK_CUR: seek 'offset' bytes from current position
- SEEK_END: seek 'offset' bytes from file end
- Parameters
-
file | BD_FILE_H object |
offset | byte offset |
origin | SEEK_SET, SEEK_CUR or SEEK_END |
- Returns
- current file offset, < 0 on error
◆ tell
int64_t(* BD_FILE_H::tell) (BD_FILE_H *file) |
Get current read or write position.
- Parameters
-
- Returns
- current file offset, < 0 on error
◆ write
int64_t(* BD_FILE_H::write) (BD_FILE_H *file, const uint8_t *buf, int64_t size) |
Write to file.
Writing 0 bytes can be used to flush previous writes and check for errors.
- Parameters
-
file | BD_FILE_H object |
buf | data to be written |
size | bytes to write |
- Returns
- number of bytes written, < 0 on error
The documentation for this struct was generated from the following file: