diff options
Diffstat (limited to 'src/utils.h')
-rw-r--r-- | src/utils.h | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/src/utils.h b/src/utils.h deleted file mode 100644 index 79c58ca..0000000 --- a/src/utils.h +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef UTILS_H_ -#define UTILS_H_ - -#include <stddef.h> - -typedef void *data_t; - -typedef struct str_array { - char **str; - size_t n; -} str_array_t; - -typedef struct generic_array { - void *data; - size_t elem_size; - size_t n; -} generic_array_t; - -typedef struct node { - data_t data; - struct node *next; -} node_t; - -typedef struct queue { - node_t *front; - node_t *rear; -} queue_t; - -int regex_match(const char *, str_array_t, str_array_t *); - -int repchr(char *str, char t, char r); - -generic_array_t create_array(size_t elem_size, size_t n); - -void free_array(generic_array_t *array); - -void resize_array(generic_array_t *array, size_t new_size); - -void *get_element(generic_array_t *array, size_t index); - -void free_and_nullify(void *p); - -str_array_t create_str_array(size_t n); - -void free_str_array(str_array_t *array); - -void resize_str_array(str_array_t *array, size_t new_size); - -int set_str_element(str_array_t *array, size_t index, const char *value); - -const char *get_str_element(str_array_t *array, size_t index); - -queue_t create_queue(void); - -int is_empty_queue(queue_t *queue); - -void enqueue(queue_t *queue, data_t data); - -data_t dequeue(queue_t *queue); - -void free_queue(queue_t *queue); - -#endif |