2007-12-08 23:42:33 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
/// \file args.h
|
|
|
|
/// \brief Argument parsing
|
|
|
|
//
|
2023-07-17 18:51:48 +02:00
|
|
|
// Authors: Lasse Collin
|
|
|
|
// Jia Tan
|
2007-12-08 23:42:33 +01:00
|
|
|
//
|
2009-04-13 10:27:40 +02:00
|
|
|
// This file has been put into the public domain.
|
|
|
|
// You can do whatever you want with this file.
|
2007-12-08 23:42:33 +01:00
|
|
|
//
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2008-11-19 19:46:52 +01:00
|
|
|
typedef struct {
|
|
|
|
/// Filenames from command line
|
|
|
|
char **arg_names;
|
2007-12-08 23:42:33 +01:00
|
|
|
|
2008-11-19 19:46:52 +01:00
|
|
|
/// Number of filenames from command line
|
2015-03-07 18:54:00 +01:00
|
|
|
unsigned int arg_count;
|
2007-12-08 23:42:33 +01:00
|
|
|
|
2008-11-19 19:46:52 +01:00
|
|
|
/// Name of the file from which to read filenames. This is NULL
|
|
|
|
/// if --files or --files0 was not used.
|
2022-12-08 18:24:22 +01:00
|
|
|
const char *files_name;
|
2007-12-08 23:42:33 +01:00
|
|
|
|
2008-11-19 19:46:52 +01:00
|
|
|
/// File opened for reading from which filenames are read. This is
|
|
|
|
/// non-NULL only if files_name is non-NULL.
|
|
|
|
FILE *files_file;
|
|
|
|
|
|
|
|
/// Delimiter for filenames read from files_file
|
|
|
|
char files_delim;
|
|
|
|
|
|
|
|
} args_info;
|
2007-12-08 23:42:33 +01:00
|
|
|
|
|
|
|
|
|
|
|
extern bool opt_stdout;
|
|
|
|
extern bool opt_force;
|
|
|
|
extern bool opt_keep_original;
|
|
|
|
// extern bool opt_recursive;
|
2009-11-16 17:16:45 +01:00
|
|
|
extern bool opt_robot;
|
2014-08-05 21:32:36 +02:00
|
|
|
extern bool opt_ignore_check;
|
2007-12-08 23:42:33 +01:00
|
|
|
|
2010-09-05 20:11:33 +02:00
|
|
|
extern const char stdin_filename[];
|
2007-12-08 23:42:33 +01:00
|
|
|
|
2008-11-19 19:46:52 +01:00
|
|
|
extern void args_parse(args_info *args, int argc, char **argv);
|
2012-07-03 20:16:39 +02:00
|
|
|
extern void args_free(void);
|