1
0
mirror of git://jb55.com/damus synced 2024-09-18 19:23:49 +00:00

c: add new cursor util

this is used by nostrdb as well. so add it here ahead of time.
This commit is contained in:
William Casarin 2023-07-21 14:45:57 -07:00
parent 8f04b12a90
commit 08bea16be0

View File

@ -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));