feature: parsing with getopt pretty much done (some checks tbd)

This commit is contained in:
0x35c
2025-05-29 00:10:41 +02:00
parent 60f23e9250
commit 6538a085b9
5 changed files with 123 additions and 16 deletions

20
include/parsing.h Normal file
View File

@ -0,0 +1,20 @@
#pragma once
#define NB_OPTIONS 5
typedef enum {
FL_HELP,
FL_PORTS,
FL_IP,
FL_SPEEDUP,
FL_SCAN,
} e_flag;
struct option_lst {
e_flag flag;
char *arg;
struct option_lst *next;
};
struct option_lst *parse_options(int ac, char *const *av);
char *get_option_arg(struct option_lst *options, e_flag flag);