PatchworkOS
Loading...
Searching...
No Matches
argv.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdint.h>
4
22typedef struct
23{
24 char** buffer;
25 char* empty[1];
28} argv_t;
29
38uint64_t argv_init(argv_t* argv, const char** src);
39
45void argv_deinit(argv_t* argv);
46
55const char* argv_get_strings(const argv_t* argv, uint64_t* length);
56
void argv_deinit(argv_t *argv)
Deinitializes an argument vector, freeing any allocated memory.
Definition argv.c:65
uint64_t argv_init(argv_t *argv, const char **src)
Initializes an argument vector from a source array of strings.
Definition argv.c:9
const char * argv_get_strings(const argv_t *argv, uint64_t *length)
Retrieves a pointer to the start of the first string.
Definition argv.c:74
__UINT64_TYPE__ uint64_t
Definition stdint.h:17
Argument Vector structure.
Definition argv.h:23
char ** buffer
Definition argv.h:24
uint64_t size
!< Used to avoid allocations for empty argv
Definition argv.h:26
uint64_t amount
!< Size of the buffer in bytes.
Definition argv.h:27