summaryrefslogtreecommitdiff
path: root/src/io.h
diff options
context:
space:
mode:
authorjakob <jakob@memeware.net>2017-02-19 10:57:47 -0500
committerjakob <jakob@memeware.net>2017-02-19 10:57:47 -0500
commit32fb7b11d83138cc288d62c1f1674d95cc94e8de (patch)
tree290c5a27b58e24bb82bd46decba0aa5e1282e003 /src/io.h
parent1fc6cc323dbaa5387d84630615c0d4cab0c1c5ba (diff)
Implemented table linked list, decompression and encryption. Tests have been improved.
Diffstat (limited to 'src/io.h')
-rw-r--r--src/io.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/io.h b/src/io.h
index 0914c9f..87f93b2 100644
--- a/src/io.h
+++ b/src/io.h
@@ -19,7 +19,7 @@
#pragma once
-#include <stdbool.h>
+#include <stdint.h>
#include <stddef.h>
/* Internal enumerable type for representing the location of a memory
@@ -53,3 +53,16 @@ void stream_read(void *dest, struct stream *s, size_t n);
/* Copies `n` bytes into the given stream from the memory area specified
by `src`. The stream's cursor is advanced appropriately. */
void stream_write(struct stream *s, void *src, size_t n);
+
+/* Applies an initial and primary key to the given stream, effectively
+ encrypting or decrypting it. */
+void stream_xor(struct stream *s, uint8_t initial, uint8_t primary);
+
+/* Obtains the current value of the stream's position indicator. */
+size_t stream_tell(struct stream *s);
+
+/* Sets the stream's position indicator to the given `pos`. */
+void stream_seek(struct stream *s, size_t pos);
+
+/* Sets the stream's position indicator to the beginning. */
+void stream_rewind(struct stream *s);