LFX Mentorship 2023
|
Basic functions for Option operation. More...
#include <stdbool.h>
Go to the source code of this file.
Classes | |
struct | opt |
Option Struct. More... | |
Typedefs | |
typedef struct opt | Option |
Option Struct. More... | |
Functions | |
Option * | create_Option (char *opt_name, int args_len, bool(*handle_func)(const Option *)) |
Create a ParseData pointer, need to be deleted before exit execution. More... | |
void | delete_Option (Option *opt) |
Delete a Option pointer from create_Option(). More... | |
void | delete_Option_array (Option **opt, int opt_len) |
Delete a Option pointer array. More... | |
void | show_opt (const Option *opt) |
Print Option. More... | |
Basic functions for Option operation.
Option Struct.
opt_name | option name. |
args_len | args length. |
args | char pointer arrary. It contains arguments. |
found | initialize to false. Set to true if the option is found. |
handle_func | pointer of option handler. |
Create a ParseData pointer, need to be deleted before exit execution.
opt_name | is the name of option. |
args_len | is the expected length of arguments. -1 means the option will accept |
func_ptr | pointer of option handler (option handler should be a function). all arguments after it. |
void delete_Option | ( | Option * | opt | ) |
Delete a Option pointer from create_Option().
opt | is a Option pointer. |
void delete_Option_array | ( | Option ** | opt, |
int | opt_len | ||
) |
Delete a Option pointer array.
opt | is a Option pointer array. |
opt_len | is the length of Option pointer array. |
void show_opt | ( | const Option * | opt | ) |
Print Option.
opt | is a Option pointer |