commit 08bea16be07c41455bb18f43ce678ee9c0911ac1
parent 8f04b12a90cd717ee0dc2bd9f416308db45c9968
Author: William Casarin <jb55@jb55.com>
Date: Fri, 21 Jul 2023 14:45:57 -0700
c: add new cursor util
this is used by nostrdb as well. so add it here ahead of time.
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/damus-c/cursor.h b/damus-c/cursor.h
@@ -303,6 +303,10 @@ static inline int cursor_pull_int(struct cursor *cursor, int *i)
return cursor_pull(cursor, (u8*)i, sizeof(*i));
}
+static inline int cursor_push_u32(struct cursor *cursor, uint32_t i) {
+ return cursor_push(cursor, (unsigned char*)&i, sizeof(i));
+}
+
static inline int cursor_push_u16(struct cursor *cursor, u16 i)
{
return cursor_push(cursor, (u8*)&i, sizeof(i));