blob: ddf086d39c2caa659821137c140348e26b23a18e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#ifndef UTILS_ARGS_H
#define UTILS_ARGS_H
#include <stdbool.h>
struct option
{
char short_name[16];
char name[32];
bool has_param;
// first: args struct; second: param;
void (*handle)(void *, const char *);
};
// ALR stands for Args Load Result
enum alr
{
ALR_OK,
ALR_INVALID_OPTION
};
/*
* opt_length: options length
* args: args struct
*/
enum alr process_args(int argc, char **argv, struct option *options, int opt_length, void *args);
#endif
|