|
PatchworkOS
|
Argument Vector. More...
Data Structures | |
| struct | argv_t |
| Argument Vector structure. More... | |
Functions | |
| uint64_t | argv_init (argv_t *argv, const char **src) |
| Initializes an argument vector from a source array of strings. | |
| void | argv_deinit (argv_t *argv) |
| Deinitializes an argument vector, freeing any allocated memory. | |
| const char * | argv_get_strings (const argv_t *argv, uint64_t *length) |
| Retrieves a pointer to the start of the first string. | |
Argument Vector.
| void argv_deinit | ( | argv_t * | argv | ) |
Deinitializes an argument vector, freeing any allocated memory.
| argv | Pointer to the argument vector to deinitialize. |
Definition at line 65 of file argv.c.
References argv_t::buffer, argv_t::empty, and free().
Referenced by process_free(), and process_init().
Retrieves a pointer to the start of the first string.
| argv | Pointer to the argument vector. |
| length | Output parameter to store the total length of all strings in bytes, will be set to 0 if there are no strings. |
NULL if there are no strings. Definition at line 74 of file argv.c.
References argv_t::amount, argv_t::buffer, NULL, and argv_t::size.
Referenced by process_cmdline_read().
Initializes an argument vector from a source array of strings.
| argv | Pointer to the argument vector to initialize. |
| src | NULL-terminated array of strings to copy into the argument vector. If NULL, initializes an empty argument vector. |
0. On failure, ERR and errno is set. Definition at line 9 of file argv.c.
References argv_t::amount, argv_t::buffer, CONFIG_MAX_ARGC, argv_t::empty, ERR, malloc(), MAX_PATH, NULL, argv_t::size, strcpy(), strlen(), and strnlen_s().
Referenced by process_init().