00001 /* Command line option handling. 00002 Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 00003 00004 This file is part of GCC. 00005 00006 GCC is free software; you can redistribute it and/or modify it under 00007 the terms of the GNU General Public License as published by the Free 00008 Software Foundation; either version 2, or (at your option) any later 00009 version. 00010 00011 GCC is distributed in the hope that it will be useful, but WITHOUT ANY 00012 WARRANTY; without even the implied warranty of MERCHANTABILITY or 00013 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00014 for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with GCC; see the file COPYING. If not, write to the Free 00018 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 00019 02110-1301, USA. */ 00020 00021 #ifndef GCC_OPTS_H 00022 #define GCC_OPTS_H 00023 00024 /* Specifies how a switch's VAR_VALUE relates to its FLAG_VAR. */ 00025 enum cl_var_type { 00026 /* The switch is enabled when FLAG_VAR is nonzero. */ 00027 CLVC_BOOLEAN, 00028 00029 /* The switch is enabled when FLAG_VAR == VAR_VALUE. */ 00030 CLVC_EQUAL, 00031 00032 /* The switch is enabled when VAR_VALUE is not set in FLAG_VAR. */ 00033 CLVC_BIT_CLEAR, 00034 00035 /* The switch is enabled when VAR_VALUE is set in FLAG_VAR. */ 00036 CLVC_BIT_SET, 00037 00038 /* The switch takes a string argument and FLAG_VAR points to that 00039 argument. */ 00040 CLVC_STRING 00041 }; 00042 00043 struct cl_option 00044 { 00045 const char *opt_text; 00046 const char *help; 00047 unsigned short back_chain; 00048 unsigned char opt_len; 00049 int neg_index; 00050 unsigned int flags; 00051 void *flag_var; 00052 enum cl_var_type var_type; 00053 int var_value; 00054 }; 00055 00056 /* Records that the state of an option consists of SIZE bytes starting 00057 at DATA. DATA might point to CH in some cases. */ 00058 struct cl_option_state { 00059 const void *data; 00060 size_t size; 00061 char ch; 00062 }; 00063 00064 extern const struct cl_option cl_options[]; 00065 extern const unsigned int cl_options_count; 00066 extern const char *const lang_names[]; 00067 extern bool no_unit_at_a_time_default; 00068 00069 #define CL_DISABLED (1 << 21) /* Disabled in this configuration. */ 00070 #define CL_TARGET (1 << 22) /* Target-specific option. */ 00071 #define CL_REPORT (1 << 23) /* Report argument with -fverbose-asm */ 00072 #define CL_JOINED (1 << 24) /* If takes joined argument. */ 00073 #define CL_SEPARATE (1 << 25) /* If takes a separate argument. */ 00074 #define CL_REJECT_NEGATIVE (1 << 26) /* Reject no- form. */ 00075 #define CL_MISSING_OK (1 << 27) /* Missing argument OK (joined). */ 00076 #define CL_UINTEGER (1 << 28) /* Argument is an integer >=0. */ 00077 #define CL_COMMON (1 << 29) /* Language-independent. */ 00078 #define CL_UNDOCUMENTED (1 << 30) /* Do not output with --help. */ 00079 00080 /* Input file names. */ 00081 00082 extern const char **in_fnames; 00083 00084 /* The count of input filenames. */ 00085 00086 extern unsigned num_in_fnames; 00087 00088 size_t find_opt (const char *input, int lang_mask); 00089 extern void prune_options (int *argcp, char ***argvp); 00090 extern void decode_options (unsigned int argc, const char **argv); 00091 extern int option_enabled (int opt_idx); 00092 extern bool get_option_state (int, struct cl_option_state *); 00093 00094 #endif
1.5.6