From 08bea16be07c41455bb18f43ce678ee9c0911ac1 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Fri, 21 Jul 2023 14:45:57 -0700 Subject: [PATCH] c: add new cursor util this is used by nostrdb as well. so add it here ahead of time. --- damus-c/cursor.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/damus-c/cursor.h b/damus-c/cursor.h index 43304db2..84ba5e48 100644 --- 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));