You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
naka/include/slice.h

18 lines
292 B

//! Generic pointer slice
#ifndef _SLICE_H
#define _SLICE_H
#include "ints.h"
typedef struct _slice {
union {
void* ptr;
u8* bytes;
};
usize len;
} slice_t;
#define SLICE(origin, length) ((struct _slice){ .ptr = ((void*)(origin)), .len = ((usize)(length)) })
#endif /* _SLICE_H */