-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparse_arg.h
More file actions
39 lines (30 loc) · 789 Bytes
/
parse_arg.h
File metadata and controls
39 lines (30 loc) · 789 Bytes
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
29
30
31
32
33
34
35
36
37
38
39
/*
** parse_arg.h for parse_arg in /home/leroy_v/Perso/parse_arg
**
** Made by vincent leroy
** Login <leroy_v@epitech.eu>
**
** Started on Mon Aug 18 14:24:49 2014 vincent leroy
** Last update Thu Apr 30 14:58:02 2015 vincent leroy
*/
#ifndef PARSE_ARG_H_
# define PARSE_ARG_H_
#include <stdbool.h>
#include "parse_error.h"
typedef bool (*arg_callback)(const char*, const char*, void*);
typedef enum argument
{
NO_ARG = 0,
OPTIONAL_ARG = 1,
REQUIRED_ARG = 2
} argument;
typedef struct opts
{
char short_opt;
const char *long_opt;
argument has_arg;
arg_callback cb;
void *user_data;
} opts;
int parse_arg(int *ac, char ***av, const opts options[], opt_error *error);
#endif /* !PARSE_ARG_H_ */