better texture binding
[voxelands-alt.git] / inc / array.h
blob18f54578e41d1a5cd37935bb31efef8a285dd77c
1 #ifndef _ARRAY_H_
2 #define _ARRAY_H_
4 #include "common.h"
6 #include <stdint.h>
8 #define ARRAY_TYPE_NONE 0
9 #define ARRAY_TYPE_INT 1
10 #define ARRAY_TYPE_STRING 2
11 #define ARRAY_TYPE_FLOAT 3
12 #define ARRAY_TYPE_PTR 4
14 /* defined in array.c */
15 void array_init(array_t *a, uint32_t type);
16 array_t *array_create(uint32_t type);
17 array_t *array_copy(array_t *a);
18 int array_cmp(array_t *a1, array_t *a2);
19 void array_free(array_t *a, int freestruct);
20 int array_push_int(array_t *a, uint32_t v);
21 int array_push_float(array_t *a, float v);
22 int array_push_string(array_t *a, char* v);
23 int array_push_ptr(array_t *a, void *v);
24 int array_push_colour(array_t *a, colour_t *c);
25 int array_push_v3t(array_t *a, v3_t *v);
26 int array_push_v2t(array_t *a, v2_t *v);
27 int array_set_int(array_t *a, uint32_t v, int i);
28 int array_set_float(array_t *a, float v, int i);
29 int array_set_string(array_t *a, char* v, int i);
30 int array_set_ptr(array_t *a, void* v, int i);
31 uint32_t array_pop_int(array_t *a);
32 float array_pop_float(array_t *a);
33 char* array_pop_string(array_t *a);
34 void *array_pop_ptr(array_t *a);
35 uint32_t array_get_int(array_t *a, int i);
36 float array_get_float(array_t *a, int i);
37 char* array_get_string(array_t *a, int i);
38 void *array_get_ptr(array_t *a, int i);
39 int array_find_int(array_t *a, uint32_t v);
40 int array_find_float(array_t *a, float v);
41 int array_find_string(array_t *a, char* v);
42 int array_find_ptr(array_t *a, void *v);
43 int array_remove_string(array_t *a, char* v);
44 array_t *array_split(char* str, char* s, int strings);
45 char* array_join(array_t *a, char* glue, int start);
47 #endif