#ifndef UTILS_H #define UTILS_H #include #include #define CAPACITY 1024 #define SUCCESS 0 #define FAILURE 1 #define ERR_ALLOC_FAIL 20 #define ERR_BUF_NULL 21 #define ERR_SIZE_ZERO 22 #define ERR_VECTOR_NULL 23 #define ERR_MAX_PASSED 24 #define ERR_OUT_OF_BOUNDS 25 #define ERR_NULL 26 #define ERR_DOUBLE_BUF 27 extern const char* error_messages[]; #define LOG(msg) printf("LOG: %s\n", msg) /**< Print log message*/ #define LOGERROR(error_code) \ printf("ERROR: %s\n", \ error_messages[error_code]) /**< Print log error message*/ #define find_len(arr) sizeof(arr) / sizeof(arr[0]) static const size_t VEC_MAX = SIZE_MAX / sizeof(int); #endif