123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #ifndef arr_h
- #define arr_h
- // this header needs
- #include "byte_arr.h"
- // this array is different from bytarr in the sense that
- // it adds a few more information about the elements in the array
- typedef struct
- {
- // the array pointer with its byte size
- owl_mem_space * arr;
- // variable related functions
- struct {
- owl_type type;
- owl_umax size;
- owl_umax (* print_elem)(owl_byte *, owl_umax size);
- owl_char (* comp_elem)(owl_byte *, owl_byte *);
- } var;
- } owl_arr;
- typedef enum
- {
- OWL_TYPE_ARR = OWL_TYPE_BYTARR + 1,
- } owl_type_arr_h;
- // arr functions
- owl_bool owl_check_arr_pointer(owl_byte * src, owl_umax size);
- owl_bool owl_check_arr_members(owl_byte * ptr, owl_umax arr_size, owl_type type, owl_umax var_size,
- owl_umax (* print_elem)(owl_byte *, owl_umax size),
- owl_char (* comp_elem)(owl_byte *, owl_byte *));
- owl_bool owl_check_arr_all(owl_arr * data, owl_umax size);
- owl_arr * owl_create_arr(owl_byte * data, owl_umax arr_size, owl_type type, owl_umax var_size,
- owl_umax (* print_elem)(owl_byte *, owl_umax size),
- owl_char (* comp_elem)(owl_byte *, owl_byte *));
- owl_umax owl_free_arr(owl_arr * arr);
- owl_umax owl_print_arr(owl_byte * src, owl_umax size);
- owl_char owl_comp_arr(owl_byte * arr1, owl_byte * arr2);
- // specific functions
- owl_umax owl_reverse_arr(owl_arr * arr);
- owl_byte * owl_find_arr_elem(owl_arr * arr, owl_byte * elem, owl_umax size);
- // to do later (probably)
- owl_umax owl_sort_arr(owl_arr * arr);
- #include "arr.c"
- #endif // arr_h
|