8#ifndef ZAPPY_ARG_PARSE_H
9 #define ZAPPY_ARG_PARSE_H
36 { {
"-p",
true,
false,
"port number",
true, NULL } },
37 { {
"-x",
true,
false,
"width of the world",
true, NULL } },
38 { {
"-y",
true,
false,
"height of the world",
true, NULL} },
39 { {
"-n",
true,
true,
"name of the team",
true, NULL} },
int get_nb_parameter(int ac, const char **av)
Get the number of parameter passed to the program.
int check_mandatory_set(int ac, const char **av, int nb_param, const struct option_list_s *opt_list)
Check if there's every mandatory options in the arguments passed to the program.
int get_arg_value(int ac, const char **av, const struct option_s *param, struct arg_s **arg)
Get the variables of a parameter and store it in arg_s structure.
struct arg_s ** get_zappy_args(int ac, const char **av, const struct option_list_s *opt_l)
The principal function to get every arguments.
int is_param(const char *str, const struct option_list_s *opt_list)
Check if a string is a parameter.
int check_values_validity(const struct arg_s **arguments, const size_t size)
Check if the values of the parameters are correct.
int get_nb_mandatory_option(const struct option_list_s *opt_list)
Get the number of mandatory options needed for the server.
#define NB_PARAM
! PARSING CONSTANTS !!