matt/src/args.h

20 lines
429 B
C

#pragma once
#include <stddef.h>
typedef struct arg {
char *name;
char *value;
} arg_t;
typedef struct args {
arg_t *list;
size_t count;
} args_t;
args_t *args_parse(int argc, char *argv[]);
char *args_get_string(args_t *args, char *name);
bool args_get_bool(args_t *args, char *name);
int args_get_int(args_t *args, char *name);
bool args_split(args_t *args, char *name);
void args_free(args_t *args);