args.h revision 292588
1///////////////////////////////////////////////////////////////////////////////
2//
3/// \file       args.h
4/// \brief      Argument parsing
5//
6//  Author:     Lasse Collin
7//
8//  This file has been put into the public domain.
9//  You can do whatever you want with this file.
10//
11///////////////////////////////////////////////////////////////////////////////
12
13typedef struct {
14	/// Filenames from command line
15	char **arg_names;
16
17	/// Number of filenames from command line
18	unsigned int arg_count;
19
20	/// Name of the file from which to read filenames. This is NULL
21	/// if --files or --files0 was not used.
22	char *files_name;
23
24	/// File opened for reading from which filenames are read. This is
25	/// non-NULL only if files_name is non-NULL.
26	FILE *files_file;
27
28	/// Delimiter for filenames read from files_file
29	char files_delim;
30
31} args_info;
32
33
34extern bool opt_stdout;
35extern bool opt_force;
36extern bool opt_keep_original;
37// extern bool opt_recursive;
38extern bool opt_robot;
39extern bool opt_ignore_check;
40
41extern const char stdin_filename[];
42
43extern void args_parse(args_info *args, int argc, char **argv);
44extern void args_free(void);
45