summaryrefslogtreecommitdiff
path: root/lib9p/internal.h
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-09-27 22:27:01 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-09-27 22:27:01 -0600
commit7ec97df3ee8edfd102fe573eaa61cf4e5c6284cb (patch)
treee696f30da5645cdd3cb09971d9544622e9943bcf /lib9p/internal.h
parentfa357459f88bb8f0170d1a68df66e7d068d59996 (diff)
wip fixes
Diffstat (limited to 'lib9p/internal.h')
-rw-r--r--lib9p/internal.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib9p/internal.h b/lib9p/internal.h
index ebdc3f3..a5175af 100644
--- a/lib9p/internal.h
+++ b/lib9p/internal.h
@@ -8,13 +8,15 @@
#define _LIB9P_INTERNAL_H_
#include <assert.h>
-#include <stdbool.h>
+#include <stddef.h> /* for size_t */
+#include <limits.h> /* for SSIZE_MAX */
#include <lib9p/9p.h>
-#define USE_CONFIG_LIB9P
+#define USE_CONFIG_9P
#include "config.h"
-static_assert(CONFIG_LIB9P_MAX_ERR_SIZE <= UINT16_MAX);
+static_assert(CONFIG_9P_MAX_ERR_SIZE <= UINT16_MAX);
+static_assert(CONFIG_9P_MAX_MSG_SIZE <= SSIZE_MAX);
/* C language *****************************************************************/
@@ -34,7 +36,7 @@ struct lib9p_ctx {
/* state */
uint32_t err_num;
- char err_msg[CONFIG_LIB9P_MAX_ERR_SIZE];
+ char err_msg[CONFIG_9P_MAX_ERR_SIZE];
};
/* vtables ********************************************************************/
@@ -42,7 +44,7 @@ struct lib9p_ctx {
struct _checksize_ctx {
struct lib9p_ctx *ctx;
uint32_t net_size;
- uint8_t net_bytes;
+ uint8_t *net_bytes;
uint32_t net_offset;
/* Increment `host_extra` to pre-allocate space that is
@@ -52,6 +54,7 @@ struct _checksize_ctx {
struct _unmarshal_ctx {
struct lib9p_ctx *ctx;
+ uint8_t *net_bytes;
uint32_t net_offset;
/* `extra` points to the beginning of unallocated space. */