coan 4.2.4
args.h
Go to the documentation of this file.
00001 #ifndef ARGS_H
00002 #define ARGS_H
00003 /***************************************************************************
00004  *   Copyright (C) 2004 - 2006 Symbian Software Ltd.                       *
00005  *   All rights reserved.                                                  *
00006  *   Copyright (C) 2007-2011 Mike Kinghan, imk@strudl.org            *
00007  *   All rights reserved.                                                  *
00008  *                                                                         *
00009  *   Contributed originally by Mike Kinghan, imk@strudl.org                *
00010  *                                                                         *
00011  *   Redistribution and use in source and binary forms, with or without    *
00012  *   modification, are permitted provided that the following conditions    *
00013  *   are met:                                                              *
00014  *                                                                         *
00015  *   Redistributions of source code must retain the above copyright        *
00016  *   notice, this list of conditions and the following disclaimer.         *
00017  *                                                                         *
00018  *   Redistributions in binary form must reproduce the above copyright     *
00019  *   notice, this list of conditions and the following disclaimer in the   *
00020  *   documentation and/or other materials provided with the distribution.  *
00021  *                                                                         *
00022  *   Neither the name of Symbian Software Ltd. nor the names of its        *
00023  *   contributors may be used to endorse or promote products derived from  *
00024  *   this software without specific prior written permission.              *
00025  *                                                                         *
00026  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   *
00027  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     *
00028  *   LIMITED TO, THE IMPLIED WARRANTIES OF  MERCHANTABILITY AND FITNESS    *
00029  *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE        *
00030  *   COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,   *
00031  *   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,  *
00032  *   BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS *
00033  *   OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED    *
00034  *   AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,*
00035  *   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF *
00036  *   THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH  *
00037  *   DAMAGE.                                                               *
00038  *                                                                         *
00039  **************************************************************************/
00040 
00041 #include "state_utils.h"
00042 #include "get_options.h"
00043 
00044 
00052 
00054 typedef enum {
00055     DISCARD_DROP,       
00056     DISCARD_BLANK,      
00057     DISCARD_COMMENT 
00058 } discard_policy_t;
00059 
00061 enum command_codes {
00062     CMD_HELP = 1,       
00063     CMD_VERSION,        
00064     CMD_SOURCE, 
00065     CMD_SYMBOLS,        
00066     CMD_INCLUDES,       
00067     CMD_DEFS,   
00068     CMD_PRAGMAS,        
00069     CMD_ERRORS, 
00070     CMD_DIRECTIVES      
00071 };
00072 
00074 enum command_flags {
00075     CMD_HELP_MASK = 1 << (CMD_HELP - 1),        
00076     CMD_VERSION_MASK = 1 << (CMD_VERSION - 1),  
00077     CMD_SOURCE_MASK = 1 << (CMD_SOURCE - 1),    
00078     CMD_SYMBOLS_MASK = 1 << (CMD_SYMBOLS - 1),  
00079     CMD_INCLUDES_MASK = 1 << (CMD_INCLUDES - 1),        
00080     CMD_DEFS_MASK = 1 << (CMD_DEFS - 1),        
00081     CMD_PRAGMAS_MASK = 1 << (CMD_PRAGMAS - 1),  
00082     CMD_ERRORS_MASK = 1 << (CMD_ERRORS - 1),    
00083     CMD_DIRECTIVES_MASK = CMD_INCLUDES_MASK | CMD_DEFS_MASK | CMD_PRAGMAS_MASK
00084     | CMD_ERRORS_MASK
00086 };
00087 
00097 extern void
00098 parse_executable(char **argv);
00099 
00106 extern void
00107 parse_args(int argc, char *argv[]);
00108 
00112 extern void finish_args(void);
00113 
00118 
00121 PUBLIC_STATE_DEF(args)
00122 {
00123     cmd_option_t * command;
00125     char        *exec_path;
00127     char        *prog_name;
00129     char        *backup_suffix;
00131     bool        got_opts;
00133     bool        replace;
00135     bool        list_locate;
00137     bool        list_only_once;
00139     bool        list_only_active;
00141     bool        list_only_inactive;
00143     bool        list_symbols_in_ifs;
00145     bool        list_symbols_in_defs;
00147     bool        list_symbols_in_undefs;
00149     bool        list_symbols_in_includes;
00151     bool        list_system_includes;
00153     bool        list_local_includes;
00155     bool        complement;
00157     bool        eval_consts;
00160     bool        resolve_symbols;
00162     discard_policy_t    discard_policy;
00164     bool        line_directives;
00166     bool        plaintext;
00168     bool        recurse;
00170     bool        keepgoing;
00172     bool        implicit;
00174     int         diagnostic_filter;
00176 }
00177 PUBLIC_STATE_T(args);
00178 
00179 IMPORT(args);
00183 #endif /* EOF*/
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines