#ifndef __SAFEC_ARRAY_H
#define __SAFEC_ARRAY_H
#include "types.h"

typedef struct {
    size_t length;
    size_t elemsz;
    void* __data;
} array_t;

void* array_at(const array_t array, size_t idx);
array_t array_slice(const array_t array, size_t start, size_t length);

array_t array_init(void* data, size_t length, size_t elemsz);

array_t array_heap_alloc(size_t length, size_t elemsz);
void array_heap_destroy(array_t array);

#endif
