diff --git a/include/tlibc/collections/Array.h b/include/tlibc/collections/Array.h index c7ac583..631db5a 100755 --- a/include/tlibc/collections/Array.h +++ b/include/tlibc/collections/Array.h @@ -36,4 +36,13 @@ static inline Array_ Array_copy(Array_ src){ #define Array_len(AR, T) ((AR)->size / sizeof(T)) #define Array_memset(A, VAL) memset((A)->data, VAL, (A)->size) -#define struct_castTo_Array(STRUCT_PTR) Array_construct_size((STRUCT_PTR), sizeof(*STRUCT_PTR)) \ No newline at end of file +#define struct_castTo_Array(STRUCT_PTR) Array_construct_size((STRUCT_PTR), sizeof(*STRUCT_PTR)) + +static inline Array(u8) Array_sliceBefore(Array(u8) a, u32 n){ + return Array_construct_size(a.data, n); +} + + +static inline Array(u8) Array_sliceAfter(Array(u8) a, u32 n){ + return Array_construct_size((u8*)a.data + n, a.size - n); +}