]> icculus.org git repositories - icculus/xz.git/blob - src/xz/args.h
b07b210002fc24f2cf902294beb0266b0e6f02a4
[icculus/xz.git] / src / xz / args.h
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file       args.h
4 /// \brief      Argument parsing
5 //
6 //  Copyright (C) 2007 Lasse Collin
7 //
8 //  This program is free software; you can redistribute it and/or
9 //  modify it under the terms of the GNU Lesser General Public
10 //  License as published by the Free Software Foundation; either
11 //  version 2.1 of the License, or (at your option) any later version.
12 //
13 //  This program is distributed in the hope that it will be useful,
14 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
15 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 //  Lesser General Public License for more details.
17 //
18 ///////////////////////////////////////////////////////////////////////////////
19
20 typedef struct {
21         /// Filenames from command line
22         char **arg_names;
23
24         /// Number of filenames from command line
25         size_t arg_count;
26
27         /// Name of the file from which to read filenames. This is NULL
28         /// if --files or --files0 was not used.
29         char *files_name;
30
31         /// File opened for reading from which filenames are read. This is
32         /// non-NULL only if files_name is non-NULL.
33         FILE *files_file;
34
35         /// Delimiter for filenames read from files_file
36         char files_delim;
37
38 } args_info;
39
40
41 extern bool opt_stdout;
42 extern bool opt_force;
43 extern bool opt_keep_original;
44 // extern bool opt_recursive;
45
46 extern const char *stdin_filename;
47
48 extern void args_parse(args_info *args, int argc, char **argv);