2002-06-04 18:44:03 +00:00
|
|
|
/*
|
2002-10-22 14:53:18 +00:00
|
|
|
options.h
|
2002-06-04 18:44:03 +00:00
|
|
|
|
2002-10-22 14:53:18 +00:00
|
|
|
command line options handlnig
|
2002-06-04 18:44:03 +00:00
|
|
|
|
2002-10-22 14:53:18 +00:00
|
|
|
Copyright (C) 2001 Jeff Teunissen <deek@d2dc.net>
|
2002-06-04 18:44:03 +00:00
|
|
|
|
2002-10-22 14:53:18 +00:00
|
|
|
Author: Jeff Teunissen <deek@d2dc.net>
|
|
|
|
Date: 2002/06/04
|
2002-06-04 18:44:03 +00:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to:
|
|
|
|
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
59 Temple Place - Suite 330
|
|
|
|
Boston, MA 02111-1307, USA
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __options_h
|
|
|
|
#define __options_h
|
|
|
|
|
|
|
|
#include "QF/qtypes.h"
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
qboolean cow; // Turn constants into variables if written to
|
2012-05-02 15:22:24 +00:00
|
|
|
qboolean crc; // Write progsdef.h crc to progs.dat
|
2002-06-04 18:44:03 +00:00
|
|
|
qboolean debug; // Generate debug info for the engine
|
2003-10-22 08:27:38 +00:00
|
|
|
qboolean short_circuit; // short circuit logic for && and ||
|
2012-12-01 02:13:45 +00:00
|
|
|
qboolean optimize; // perform optimizations
|
2004-04-27 20:24:37 +00:00
|
|
|
qboolean fast_float; // use floats directly in ifs
|
2005-06-10 07:31:25 +00:00
|
|
|
qboolean vector_calls; // use floats instead of vectors for constant function args
|
2007-04-10 13:01:45 +00:00
|
|
|
qboolean local_merging; // merge function locals into one block
|
2007-04-10 13:00:21 +00:00
|
|
|
unsigned progsversion; // Progs version to generate code for
|
2011-03-07 01:21:40 +00:00
|
|
|
qboolean vector_components; // add *_[xyz] symbols for vectors
|
2012-12-20 01:05:17 +00:00
|
|
|
qboolean ifstring; // expand if (str) to if (str != "")
|
2020-02-23 13:51:00 +00:00
|
|
|
qboolean const_initializers; // initialied globals are constant
|
2020-03-08 11:11:21 +00:00
|
|
|
qboolean promote_float; // promote float through ...
|
2002-06-04 18:44:03 +00:00
|
|
|
} code_options_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
qboolean promote; // Promote warnings to errors
|
|
|
|
qboolean cow; // Warn on copy-on-write detection
|
|
|
|
qboolean undefined_function; // Warn on undefined function use
|
|
|
|
qboolean uninited_variable; // Warn on use of uninitialized vars
|
|
|
|
qboolean vararg_integer; // Warn on passing an integer to vararg func
|
|
|
|
qboolean integer_divide; // Warn on integer constant division
|
2003-07-29 18:31:12 +00:00
|
|
|
qboolean interface_check; // Warn for methods not in interface
|
2004-02-17 00:39:21 +00:00
|
|
|
qboolean unused; // Warn on unused local variables
|
|
|
|
qboolean executable; // Warn on expressions with no effect
|
|
|
|
qboolean traditional; // Warn on bogus constructs allowed by qcc
|
|
|
|
qboolean precedence; // Warn on precedence issues
|
|
|
|
qboolean initializer; // Warn on excessive initializer elements
|
|
|
|
qboolean unimplemented; // Warn on unimplemented class methods
|
2010-02-20 12:01:49 +00:00
|
|
|
qboolean redeclared; // Warn on redeclared local variables
|
2013-06-26 00:08:51 +00:00
|
|
|
qboolean enum_switch; // Warn on unhandled enum values in switch
|
2002-06-04 18:44:03 +00:00
|
|
|
} warn_options_t;
|
|
|
|
|
2002-06-20 19:29:06 +00:00
|
|
|
typedef struct {
|
|
|
|
qboolean promote; // Promote notices to warnings
|
|
|
|
qboolean silent; // don't even bother (overrides promote)
|
|
|
|
} notice_options_t;
|
|
|
|
|
2020-02-15 09:44:53 +00:00
|
|
|
typedef struct {
|
|
|
|
qboolean promote; // Promote bugs to internal errors
|
|
|
|
qboolean silent; // don't even bother (overrides promote)
|
|
|
|
} bug_options_t;
|
|
|
|
|
2012-05-04 00:45:51 +00:00
|
|
|
typedef struct {
|
|
|
|
qboolean initial;
|
|
|
|
qboolean thread;
|
|
|
|
qboolean dead;
|
|
|
|
qboolean final;
|
2012-07-18 06:29:30 +00:00
|
|
|
qboolean dags;
|
2012-11-26 12:00:28 +00:00
|
|
|
qboolean expr;
|
2018-08-21 06:56:39 +00:00
|
|
|
qboolean statements;
|
2012-12-10 03:17:20 +00:00
|
|
|
qboolean reaching;
|
2012-12-10 06:14:12 +00:00
|
|
|
qboolean live;
|
2012-10-30 10:25:35 +00:00
|
|
|
qboolean flow;
|
2012-11-19 06:24:09 +00:00
|
|
|
qboolean post;
|
2012-05-04 00:45:51 +00:00
|
|
|
} blockdot_options_t;
|
|
|
|
|
2002-06-04 18:44:03 +00:00
|
|
|
typedef struct {
|
|
|
|
code_options_t code; // Code generation options
|
|
|
|
warn_options_t warnings; // Warning options
|
2002-06-20 19:29:06 +00:00
|
|
|
notice_options_t notices; // Notice options
|
2020-02-15 09:44:53 +00:00
|
|
|
bug_options_t bug; // Bug options
|
2012-05-04 00:45:51 +00:00
|
|
|
blockdot_options_t block_dot; // Statement block flow diagrams
|
2002-06-04 18:44:03 +00:00
|
|
|
|
|
|
|
int verbosity; // 0=silent, goes up to 2 currently
|
2006-05-24 14:35:39 +00:00
|
|
|
qboolean single_cpp; // process progs.src into a series of
|
|
|
|
// #include directives and then compile
|
|
|
|
// that
|
2012-01-04 04:17:57 +00:00
|
|
|
qboolean no_default_paths; // no default -I or -L
|
2002-06-04 18:44:03 +00:00
|
|
|
qboolean save_temps; // save temporary files
|
|
|
|
qboolean files_dat; // generate files.dat
|
2012-11-21 11:50:45 +00:00
|
|
|
qboolean frames_files; // generate <basename>.frame files
|
2007-04-28 05:40:22 +00:00
|
|
|
qboolean progdefs_h; // generate progdefs.h
|
2009-12-25 07:59:25 +00:00
|
|
|
qboolean qccx_escapes; // use qccx escapes instead of standard C
|
2012-07-14 07:32:48 +00:00
|
|
|
int traditional; // behave more like qcc
|
2022-02-04 00:27:07 +00:00
|
|
|
int advanced; // behold the power of Ruamoko
|
2002-06-21 20:46:56 +00:00
|
|
|
qboolean compile; // serparate compilation mode
|
2002-07-12 04:50:31 +00:00
|
|
|
qboolean partial_link; // partial linking
|
2010-01-13 06:42:26 +00:00
|
|
|
qboolean preprocess_only;// run only cpp, don't compile
|
2003-02-23 23:43:43 +00:00
|
|
|
qboolean gzip; // compress qfo files when writing
|
2002-06-24 22:53:21 +00:00
|
|
|
const char *output_file;
|
2011-03-09 02:09:46 +00:00
|
|
|
const char *debug_file;
|
2002-06-04 18:44:03 +00:00
|
|
|
} options_t;
|
|
|
|
|
|
|
|
extern options_t options;
|
|
|
|
int DecodeArgs (int argc, char **argv);
|
|
|
|
extern const char *progs_src;
|
2002-06-25 21:36:10 +00:00
|
|
|
extern const char **source_files;
|
2002-06-04 18:44:03 +00:00
|
|
|
extern const char *this_program;
|
|
|
|
extern const char *sourcedir;
|
|
|
|
|
|
|
|
#endif//__options_h
|