mirror of
https://github.com/javalsai/lidm.git
synced 2025-08-30 18:08:00 +02:00
chore: make specific vector (heap stack) impl
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <keys.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
enum keys find_keyname(char *);
|
||||
@@ -10,4 +11,19 @@ enum keys find_ansi(char *);
|
||||
void read_press(u_char *, char *);
|
||||
void strcln(char **dest, const char *source);
|
||||
|
||||
struct Vector {
|
||||
uint32_t length;
|
||||
uint32_t alloc_len;
|
||||
uint16_t alloc_size;
|
||||
void** pages;
|
||||
};
|
||||
|
||||
struct Vector vec_new();
|
||||
int vec_push(struct Vector*, void* item);
|
||||
void vec_free(struct Vector*);
|
||||
void vec_clear(struct Vector*);
|
||||
void vec_reset(struct Vector*);
|
||||
void* vec_pop(struct Vector*); // wont free it, nor shrink vec list space
|
||||
void* vec_get(struct Vector*, uint32_t index);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user