Define basic IO abstractions, implement for FD
This commit is contained in:
17
lib/include/io_abs.h
Normal file
17
lib/include/io_abs.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef IO_ABS_H
|
||||
#define IO_ABS_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
struct io_reader {
|
||||
void *ctx;
|
||||
ssize_t (*read)(void *ctx, uint8_t *buf, size_t len);
|
||||
};
|
||||
|
||||
struct io_writer {
|
||||
void *ctx;
|
||||
ssize_t (*write)(void *ctx, const uint8_t *buf, size_t len);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user