14 argv->
size =
sizeof(
const char*);
32 uint64_t size =
sizeof(
const char*) * (argc + 1);
43 char** dest =
malloc(size);
49 char* strings = (
char*)((
uintptr_t)dest +
sizeof(
char*) * (argc + 1));
54 strings +=
strlen(src[i]) + 1;
83 *length = argv->
size - (
sizeof(
char*) * (argv->
amount + 1));
#define MAX_PATH
Maximum length of filepaths.
void argv_deinit(argv_t *argv)
Deinitializes an argument vector, freeing any allocated memory.
uint64_t argv_init(argv_t *argv, const char **src)
Initializes an argument vector from a source array of strings.
const char * argv_get_strings(const argv_t *argv, uint64_t *length)
Retrieves a pointer to the start of the first string.
#define CONFIG_MAX_ARGC
Maximum argument vector configuration.
#define NULL
Pointer error value.
#define ERR
Integer error value.
__UINTPTR_TYPE__ uintptr_t
_PUBLIC void * malloc(size_t size)
_PUBLIC void free(void *ptr)
_PUBLIC size_t strlen(const char *s)
_PUBLIC char * strcpy(char *_RESTRICT s1, const char *_RESTRICT s2)
size_t strnlen_s(const char *s, size_t maxsize)
Argument Vector structure.
uint64_t size
!< Used to avoid allocations for empty argv
char * empty[1]
!< Stores both pointers and strings.
uint64_t amount
!< Size of the buffer in bytes.