Initial commit
This commit is contained in:
40
source/array.h
Executable file
40
source/array.h
Executable file
@@ -0,0 +1,40 @@
|
||||
#ifndef ARRAY_H
|
||||
#define ARRAY_H
|
||||
|
||||
#define ARRAY_INIT_CAPACITY 1000000
|
||||
|
||||
#include "text.h"
|
||||
|
||||
typedef struct array {
|
||||
|
||||
void * * items;
|
||||
|
||||
int capacity;
|
||||
|
||||
int total;
|
||||
|
||||
} array;
|
||||
|
||||
array * array_new();
|
||||
|
||||
int array_length( array * );
|
||||
|
||||
static void array_resize( array *, int );
|
||||
|
||||
void array_add( array *, void * );
|
||||
|
||||
void array_set( array *, int, void * );
|
||||
|
||||
void * array_get( array *, int );
|
||||
|
||||
void array_delete( array *, int );
|
||||
|
||||
void array_free( array * );
|
||||
|
||||
char * array_join( struct array * parts, char * separator );
|
||||
|
||||
void array_unshift( array * v, void * item );
|
||||
|
||||
void * array_pop( array * v );
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user