REFACTOR: Completely redid push_back and create
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#define CAPACITY 1024
|
||||
#define SUCCESS 0
|
||||
|
||||
#define FAILURE 1
|
||||
#define ERR_ALLOC_FAIL 20
|
||||
#define ERR_BUF_NULL 21
|
||||
#define ERR_BAD_TYPE 22
|
||||
#define ERR_INVALID_SIZE 23
|
||||
#define ERR_VECTOR_NULL 24
|
||||
#define ERR_MAX_PASSED 25
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user