X-Git-Url: http://git.squeep.com/?p=dcpu16;a=blobdiff_plain;f=common.h;fp=common.h;h=09e1509c96eec5eab8961163dd70cecf8596c039;hp=02db4d77fdc131f63166d63d9cdb5d0ecca7d73c;hb=5ee7307cad8c222933e144787cb8b265646878df;hpb=33efa05d43acf927c97daab10c00d1cbc2a7b9f6 diff --git a/common.h b/common.h index 02db4d7..09e1509 100644 --- a/common.h +++ b/common.h @@ -2,6 +2,7 @@ #define COMMON_H_QPRCB1BH #include +#include struct dynamic_array { size_t entry_size; @@ -16,11 +17,14 @@ struct dynamic_array { int dynarray_init(struct dynamic_array *da, size_t entry_size, size_t grow_size); struct dynamic_array *dynarray_new(size_t entry_size, size_t grow_size); void *dynarray_add(struct dynamic_array *da, void *item); +void dynarray_empty(struct dynamic_array *da, void (*free_element)(void *)); int str_to_word(char *s); char *strqtok_r(char *str, const char *sep, int esc, const char *quote, char **lastq, char **lasts); -int timeval_subtract(struct timeval *result, struct timeval *x, struct timeval *y); +int gettimespecofday(struct timespec *ts); +int timespec_add(struct timespec *result, const struct timespec *x); +int timespec_subtract(struct timespec *result, struct timespec *x, struct timespec *y); #endif /* COMMON_H_QPRCB1BH */