From 75f9922f6d3c1e5bbbe7b90ca170392cc0f5efbc Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Sun, 21 Oct 2018 16:23:23 +0300 Subject: Refactor io utils, add *-address-rw tools Namespace io_ stuff into mem_io_ to be less likely to collision with anything else. Add io-stream utility for working with streams instead of direct buffers. Add address-rw tools for simple memory read/write, where regions aren't needed. --- src/io/io.h | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 src/io/io.h (limited to 'src/io/io.h') diff --git a/src/io/io.h b/src/io/io.h deleted file mode 100644 index 8a0639b..0000000 --- a/src/io/io.h +++ /dev/null @@ -1,27 +0,0 @@ -#pragma once - -#include -#include -#include // pid_t - -struct io { - void *backing; - size_t (*read)(const struct io *io, void *ptr, const size_t offset, const size_t size); - size_t (*write)(const struct io *io, const void *ptr, const size_t offset, const size_t size); - void (*cleanup)(struct io *io); - pid_t pid; -}; - -static inline void -io_release(struct io *io) -{ - if (io->cleanup) - io->cleanup(io); - *io = (struct io){0}; -} - -bool -io_uio_init(struct io *io, const pid_t pid); - -bool -io_ptrace_init(struct io *io, const pid_t pid); -- cgit v1.2.3-70-g09d2