dsekai
World engine for retrocomputers.
Loading...
Searching...
No Matches
Modules | Data Structures | Macros | Functions

Abstraction for dealing with streams from files or memory. More...

Collaboration diagram for Unilayer DIO Streams:

Modules

 Unilayer Static Lists
 

Data Structures

union  DIO_BUFFER
 
struct  DIO_STREAM
 

Macros

#define dio_assert_stream(stream)
 Assert DIO_STREAM is open and ready for operations.
 

Functions

int32_t dio_open_stream_file (const char *path, const char *mode, struct DIO_STREAM *stream)
 Open a stream as a file on disk.
 
int32_t dio_open_stream_buffer (uint8_t *, uint32_t, struct DIO_STREAM *)
 
void dio_close_stream (struct DIO_STREAM *)
 
int32_t dio_seek_stream (struct DIO_STREAM *, int32_t, uint8_t)
 
int32_t dio_tell_stream (struct DIO_STREAM *)
 
int32_t dio_sz_stream (struct DIO_STREAM *)
 
int32_t dio_position_stream (struct DIO_STREAM *)
 
uint8_t dio_type_stream (struct DIO_STREAM *)
 
int32_t dio_read_stream (MEMORY_PTR, uint32_t, struct DIO_STREAM *)
 
int32_t dio_write_stream (const MEMORY_PTR, uint32_t, struct DIO_STREAM *)
 

Detailed Description

Abstraction for dealing with streams from files or memory.

Macro Definition Documentation

◆ dio_assert_stream

#define dio_assert_stream (   stream)
Value:
assert( \
0 <= stream->id && \
((DIO_STREAM_BUFFER == stream->type && NULL != stream->buffer.bytes ) || \
(DIO_STREAM_FILE == stream->type && NULL != stream->buffer.file )) )

Assert DIO_STREAM is open and ready for operations.

Parameters
streamDIO_STREAM to test.

Function Documentation

◆ dio_open_stream_file()

int32_t dio_open_stream_file ( const char *  path,
const char *  mode,
struct DIO_STREAM stream 
)

Open a stream as a file on disk.

Parameters
pathPath to the file on disk to open.
modeStandard FILE mode string (e.g. "r", "w", or "rb" for binary).
streamDIO_STREAM object to open file into.
Returns