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

General abstractions for common stdlib-related tasks. More...

#include <stdio.h>
Include dependency graph for dio.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  DIO_BUFFER
 
struct  DIO_STREAM
 

Macros

#define DIO_ERROR_NULL_PTR   -1
 
#define DIO_ERROR_COPY_MISMATCH   -2
 
#define DIO_ERROR_COULD_NOT_OPEN_FILE   -3
 
#define DIO_ERROR_INVALID_STREAM   -4
 
#define dio_assert_stream(stream)
 Assert DIO_STREAM is open and ready for operations.
 
#define LIST_ERROR_MAX   -100
 
#define dio_list_append(node, list, list_sz, list_max, list_type)
 Append a copy of the given node to the end of a static list.
 
#define dio_list_remove(idx, list, list_sz, list_type)   assert( (idx) < (list_sz) ); while( (idx) + 1 < (list_sz) ) { memory_copy_ptr( (MEMORY_PTR)&(list[idx]), (MEMORY_PTR)&(list[idx + 1]), sizeof( list_type ) ); (idx)++; } (list_sz)--;
 Remove an item from a static list and move the other items up, then shrink the list.
 

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 *)
 
uint32_t dio_reverse_endian_32 (uint32_t)
 
uint16_t dio_reverse_endian_16 (uint16_t)
 
int32_t dio_char_idx (const char *, int32_t, char)
 
int32_t dio_char_idx_r (const char *, int32_t, char)
 
int16_t dio_mktemp_path (char *, uint16_t, const char *)
 
int32_t dio_basename (const char *, uint32_t)
 
int32_t dio_copy_file (const char *, const char *)
 
uint32_t dio_read_file (const char *, MEMORY_HANDLE *)
 
int32_t dio_move_file (const char *, const char *)
 
int16_t dio_strnchr (const char *, uint16_t, char)
 
int16_t dio_itoa (char *, uint16_t, int16_t, uint8_t)
 
int16_t dio_atoi (const char *, uint8_t)
 
int16_t dio_snprintf (char *, uint16_t, const char *,...)
 

Variables

int8_t g_dio_error
 Holds return errors for macro-based utilities.
 

Detailed Description

General abstractions for common stdlib-related tasks.