API: Properly moved and configured char to new headers for cleaner api calls for later. Now I can add and cleanup easier
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Andrew Haynes
|
||||
* dmm.dev@icloud.com
|
||||
* No LICENSE
|
||||
* Vector Library For C
|
||||
*/
|
||||
|
||||
#ifndef CHAR_H
|
||||
#define CHAR_H
|
||||
|
||||
#define CAPACITY 1024
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char* arr;
|
||||
size_t size;
|
||||
size_t capacity;
|
||||
} Vec8_t;
|
||||
|
||||
Vec8_t
|
||||
create(const Vec8_t* input);
|
||||
|
||||
char*
|
||||
reserve(Vec8_t* ptr, size_t max_size);
|
||||
|
||||
Vec8_t*
|
||||
shrink_to_fit(const Vec8_t* ptr);
|
||||
|
||||
char*
|
||||
data(const Vec8_t* ptr);
|
||||
|
||||
size_t
|
||||
max_size(const Vec8_t* ptr);
|
||||
|
||||
void delete (Vec8_t* vec);
|
||||
|
||||
Vec8_t
|
||||
clear(Vec8_t* vec);
|
||||
|
||||
char
|
||||
at(const Vec8_t* vec, int idx);
|
||||
|
||||
__attribute__((overloadable)) Vec8_t*
|
||||
erase(Vec8_t* vec, size_t iter);
|
||||
|
||||
__attribute__((overloadable)) Vec8_t*
|
||||
erase(Vec8_t* vec, size_t iter_start, size_t iter_end);
|
||||
|
||||
void
|
||||
print_vec(const Vec8_t* vec);
|
||||
|
||||
int
|
||||
begin(const Vec8_t* vec);
|
||||
|
||||
int
|
||||
end(const Vec8_t* vec);
|
||||
|
||||
char
|
||||
front(const Vec8_t* vec);
|
||||
|
||||
char
|
||||
back(const Vec8_t* vec);
|
||||
|
||||
int
|
||||
empty(const Vec8_t* vec);
|
||||
|
||||
Vec8_t
|
||||
add_back(Vec8_t* vec, char val);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user