-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathopt_parser.h
More file actions
37 lines (30 loc) · 964 Bytes
/
opt_parser.h
File metadata and controls
37 lines (30 loc) · 964 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
#ifndef __OPT_PARSER_H__
#define __OPT_PARSER_H__
#include "struct_def.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <getopt.h>
#define DEFAULT_LCP_LEVEL 5
#define DEFAULT_THREAD_NUMBER 1
/**
* @brief Frees memory allocated for the opt_arg structure.
*
* @param args A pointer to the `opt_arg` structure to be freed.
*/
void free_opt_arg(struct opt_arg *args);
/**
* @brief Parses command-line options and arguments.
*
* This function processes the command-line arguments passed to the program,
* extracts options and their associated values, and populates the provided
* `opt_arg` structure.
*
* @param argc The number of arguments passed to the program.
* @param argv The array of argument strings.
* @param args A pointer to the `opt_arg` structure where the parsed options
* and their values will be stored.
*/
void parse_opts(int argc, char* argv[], struct opt_arg *args);
#endif