mirror of
https://github.com/javalsai/lidm.git
synced 2026-02-27 03:50:44 +01:00
* chore(organization): allow nested header and c files * feat: add shell login "middleware" & etc: * lidm now calls `bash` (or other shells, depends on PACKAGE cfg) in login mode as a session wrapper to source most env (can be disabled) * this fixes a lot of env problems with all `/etc/profile` and more Extra: * implemented a musl compatible version of `execvpe` and now lidm should search for PATH everywhere it needs to * `search_path` now also checks if the found binary is properly executable * lidm now uses `confstr` for a decent PATH default if none is found * logs are unbuffered for cases where debug logs appear empty (exit without handlers moment) * chore: one-time evaluate certain makefile vars --------- Co-authored-by: grialion <48643945+grialion@users.noreply.github.com>
27 lines
741 B
C
27 lines
741 B
C
#ifndef UTIL_VEC_H
|
|
#define UTIL_VEC_H
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
struct Vector {
|
|
uint32_t length;
|
|
uint32_t capacity;
|
|
void** pages;
|
|
};
|
|
|
|
struct Vector vec_from_raw(void** raw);
|
|
void** vec_as_raw(struct Vector self);
|
|
extern const struct Vector VEC_NEW;
|
|
int vec_resize(struct Vector* self, size_t size);
|
|
int vec_reserve(struct Vector* self, size_t size);
|
|
int vec_reserve_exact(struct Vector* self, size_t size);
|
|
int vec_push(struct Vector* self, void* item);
|
|
void vec_free(struct Vector* self);
|
|
void vec_clear(struct Vector* self);
|
|
void vec_reset(struct Vector* self);
|
|
void* vec_pop(struct Vector* self); // won't free it, nor shrink vec list space
|
|
void* vec_get(struct Vector* self, size_t index);
|
|
|
|
#endif /* UTIL_VEC_H */
|