aboutsummaryrefslogtreecommitdiff
path: root/src/internal/nc-util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal/nc-util.h')
-rw-r--r--src/internal/nc-util.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/internal/nc-util.h b/src/internal/nc-util.h
index 9026d29..9f72470 100644
--- a/src/internal/nc-util.h
+++ b/src/internal/nc-util.h
@@ -3,7 +3,7 @@
* Copyright (c) 2024 Vaughn Nugent
*
* Package: noscrypt
-* File: nc-util.c
+* File: nc-util.h
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -59,4 +59,30 @@
#define STATIC_ASSERT(x, m)
#endif
+#include <stdint.h>
+
+typedef struct memory_span_struct
+{
+ uint8_t* data;
+ uint64_t size;
+} span_t;
+
+typedef struct read_only_memory_span_struct
+{
+ const uint8_t* data;
+ uint64_t size;
+} cspan_t;
+
+static void ncSpanInitC(cspan_t* span, const uint8_t* data, uint64_t size)
+{
+ span->data = data;
+ span->size = size;
+}
+
+static void ncSpanInit(span_t* span, uint8_t* data, uint64_t size)
+{
+ span->data = data;
+ span->size = size;
+}
+
#endif /* NC_UTIL_H */ \ No newline at end of file