aboutsummaryrefslogtreecommitdiff
path: root/src/types
diff options
context:
space:
mode:
Diffstat (limited to 'src/types')
-rw-r--r--src/types/parray.c7
-rw-r--r--src/types/parray.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/types/parray.c b/src/types/parray.c
index a1109c5..b1e41a2 100644
--- a/src/types/parray.c
+++ b/src/types/parray.c
@@ -31,6 +31,13 @@ parray_t* parray_init(){
return awa;
}
+parray_t* parray_initl(int len){
+ parray_t* awa = malloc(sizeof * awa);
+ awa->P = malloc(sizeof * awa->P * len);
+ awa->len = len;
+ return awa;
+}
+
/**
* @brief sets value at key to value, adds a new index if new
*
diff --git a/src/types/parray.h b/src/types/parray.h
index fb89689..7972cc1 100644
--- a/src/types/parray.h
+++ b/src/types/parray.h
@@ -17,6 +17,8 @@ enum free_type {
};
parray_t* parray_init();
+parray_t* parray_initl(int len);
+
void parray_set(parray_t*, char*, void*);
void parray_push(parray_t*, char*, void*);
void* parray_get(parray_t* , char*);