[1] | 1 | #ifndef __cmt_h__ |
---|
| 2 | #define __cmt_h__ |
---|
| 3 | |
---|
| 4 | #include "cmt_parser.h" |
---|
| 5 | #include "cmt_system.h" |
---|
| 6 | |
---|
| 7 | class Symbol; |
---|
| 8 | class Tag; |
---|
| 9 | |
---|
| 10 | class Cmt |
---|
| 11 | { |
---|
| 12 | public: |
---|
| 13 | static void build_config (const cmt_string& prefix, cmt_string& config); |
---|
| 14 | static void build_makefile (const cmt_string& target); |
---|
| 15 | static void build_msdev_file (const cmt_string& target); |
---|
| 16 | // Visual Studio.Net Support |
---|
| 17 | static void build_vsnet_file (const cmt_string& target); |
---|
| 18 | |
---|
| 19 | static bool build_nmake (); |
---|
| 20 | static void build_OS9_makefile (const cmt_string& target); |
---|
| 21 | static void build_prefix (const cmt_string& package, cmt_string& prefix); |
---|
| 22 | static void clear (); |
---|
| 23 | |
---|
| 24 | static void configure (); |
---|
| 25 | static void configure_cmt_path (Use* use); |
---|
| 26 | static void configure_config_tag (); |
---|
| 27 | static void configure_current_cmtpath (); |
---|
| 28 | static void configure_current_dir (); |
---|
| 29 | static void configure_current_package (); |
---|
| 30 | static void configure_current_structuring_style (); |
---|
| 31 | static void configure_default_path (); |
---|
| 32 | static void configure_home (Use* use); |
---|
| 33 | static void configure_user_context (Use* use); |
---|
| 34 | static void configure_hosttype_tag (); |
---|
| 35 | static void configure_site_tag (Use* use); |
---|
| 36 | static void configure_tags (Use* use); |
---|
| 37 | static void configure_uname_tag (); |
---|
| 38 | static void configure_version_tag (); |
---|
| 39 | |
---|
| 40 | static void do_awk (const CmtSystem::cmt_string_vector& arguments); |
---|
| 41 | static void do_broadcast (const CmtSystem::cmt_string_vector& arguments, |
---|
| 42 | int argc, |
---|
| 43 | char* argv[]); |
---|
| 44 | static void do_build_constituent_makefile (const CmtSystem::cmt_string_vector& arguments, |
---|
| 45 | int argc, |
---|
| 46 | char* argv[]); |
---|
| 47 | static void do_build_constituents_makefile (const CmtSystem::cmt_string_vector& arguments, |
---|
| 48 | int argc, |
---|
| 49 | char* argv[]); |
---|
| 50 | static void do_build_dependencies (const CmtSystem::cmt_string_vector& arguments, |
---|
| 51 | int argc, |
---|
| 52 | char* argv[]); |
---|
| 53 | static void do_build_library_links (); |
---|
| 54 | static void do_build_make_setup (); |
---|
| 55 | static void do_build_msdev (const CmtSystem::cmt_string_vector& arguments); |
---|
| 56 | static void do_build_CMT_pacman (); |
---|
| 57 | // Visual Studio.Net Support |
---|
| 58 | static void do_build_vsnet (const CmtSystem::cmt_string_vector& arguments); |
---|
| 59 | |
---|
| 60 | static void do_build_os9_makefile (const CmtSystem::cmt_string_vector& arguments); |
---|
| 61 | static void do_build_prototype (const CmtSystem::cmt_string_vector& arguments); |
---|
| 62 | static void do_build_readme (const CmtSystem::cmt_string_vector& arguments); |
---|
| 63 | static void do_build_tag_makefile (); |
---|
| 64 | static void do_build_temporary_name (); |
---|
| 65 | static void do_build_triggers (const CmtSystem::cmt_string_vector& arguments); |
---|
| 66 | static void do_build_windefs (const CmtSystem::cmt_string_vector& arguments); |
---|
| 67 | static void do_check_configuration (); |
---|
| 68 | static void do_check_files (const CmtSystem::cmt_string_vector& arguments); |
---|
| 69 | static void do_check_version (const CmtSystem::cmt_string_vector& arguments); |
---|
| 70 | static void do_checkout (const CmtSystem::cmt_string_vector& arguments); |
---|
| 71 | static void do_cleanup (PrintMode& mode); |
---|
| 72 | static void do_config (); |
---|
| 73 | static void do_create (const CmtSystem::cmt_string_vector& arguments); |
---|
| 74 | static void do_cvsbranches (const CmtSystem::cmt_string_vector& arguments); |
---|
| 75 | static void do_cvssubpackages (const CmtSystem::cmt_string_vector& arguments); |
---|
| 76 | static void do_cvstags (const CmtSystem::cmt_string_vector& arguments); |
---|
| 77 | static void do_expand_model (const CmtSystem::cmt_string_vector& arguments); |
---|
| 78 | static void do_filter (const CmtSystem::cmt_string_vector& arguments); |
---|
| 79 | static void do_help (ActionType help_action = action_none); |
---|
| 80 | static void do_lock (const cmt_string& package, |
---|
| 81 | const cmt_string& version, |
---|
| 82 | const cmt_string& path); |
---|
| 83 | static void do_remove (const cmt_string& package, |
---|
| 84 | const cmt_string& version, |
---|
| 85 | const cmt_string& path); |
---|
| 86 | static void do_remove_library_links (); |
---|
| 87 | static void do_run (const CmtSystem::cmt_string_vector& arguments); |
---|
| 88 | static void do_run_sequence (const CmtSystem::cmt_string_vector& arguments); |
---|
| 89 | |
---|
| 90 | static void do_set_version (const CmtSystem::cmt_string_vector& arguments); |
---|
| 91 | static void do_set_versions (const CmtSystem::cmt_string_vector& arguments); |
---|
| 92 | |
---|
| 93 | static void do_setup (PrintMode& mode); |
---|
| 94 | static void do_show_all_tags (); |
---|
| 95 | static void do_show_applied_patterns (); |
---|
| 96 | static void do_show_author (); |
---|
| 97 | static void do_show_branches (PrintMode& mode); |
---|
| 98 | static void do_show_clients (const CmtSystem::cmt_string_vector& arguments); |
---|
| 99 | static void do_show_cmtpath_patterns (); |
---|
| 100 | static void do_show_constituent (const CmtSystem::cmt_string_vector& arguments); |
---|
| 101 | static void do_show_constituent_names (); |
---|
| 102 | static void do_show_constituents (); |
---|
| 103 | static void do_show_cycles (); |
---|
| 104 | static void do_show_fragment (const CmtSystem::cmt_string_vector& arguments); |
---|
| 105 | static void do_show_fragments (); |
---|
| 106 | static void do_show_groups (); |
---|
| 107 | static void do_show_include_dirs (); |
---|
| 108 | static void do_show_language (const CmtSystem::cmt_string_vector& arguments); |
---|
| 109 | static void do_show_languages (); |
---|
| 110 | static void do_show_macro (const CmtSystem::cmt_string_vector& arguments, |
---|
| 111 | PrintMode& mode); |
---|
| 112 | static void do_show_macro_names (const CmtSystem::cmt_string_vector& arguments, |
---|
| 113 | PrintMode& mode); |
---|
| 114 | static void do_show_macro_value (const CmtSystem::cmt_string_vector& arguments, |
---|
| 115 | PrintMode& mode); |
---|
| 116 | static void do_show_macros (const CmtSystem::cmt_string_vector& arguments, |
---|
| 117 | PrintMode& mode); |
---|
| 118 | static void do_show_manager (); |
---|
| 119 | static void do_show_packages (const CmtSystem::cmt_string_vector& arguments); |
---|
| 120 | static void do_show_path (); |
---|
| 121 | static void do_show_pattern (const CmtSystem::cmt_string_vector& arguments); |
---|
| 122 | static void do_show_pattern_names (); |
---|
| 123 | static void do_show_patterns (); |
---|
| 124 | static void do_show_projects (); |
---|
| 125 | static void do_show_pwd (); |
---|
| 126 | static void do_show_setup (); |
---|
| 127 | static void do_show_set (const CmtSystem::cmt_string_vector& arguments, |
---|
| 128 | PrintMode& mode); |
---|
| 129 | static void do_show_set_names (const CmtSystem::cmt_string_vector& arguments, |
---|
| 130 | PrintMode& mode); |
---|
| 131 | static void do_show_set_value (const CmtSystem::cmt_string_vector& arguments, |
---|
| 132 | PrintMode& mode); |
---|
| 133 | static void do_show_sets (const CmtSystem::cmt_string_vector& arguments, |
---|
| 134 | PrintMode& mode); |
---|
| 135 | static void do_show_strategies (); |
---|
| 136 | static void do_show_tags (); |
---|
| 137 | static void do_show_use_paths (const CmtSystem::cmt_string_vector& arguments); |
---|
| 138 | static void do_show_uses (); |
---|
| 139 | static void do_show_version (); |
---|
| 140 | static void do_show_versions (const CmtSystem::cmt_string_vector& arguments); |
---|
| 141 | static void do_show_system (); |
---|
| 142 | static void do_unlock (const cmt_string& package, |
---|
| 143 | const cmt_string& version, |
---|
| 144 | const cmt_string& path); |
---|
| 145 | static void do_version (); |
---|
| 146 | |
---|
| 147 | |
---|
| 148 | static const cmt_string& filter_dir (const cmt_string& dir); |
---|
| 149 | |
---|
| 150 | static ActionType get_action (); |
---|
| 151 | |
---|
| 152 | static cmt_string find_in_cmt_paths (const cmt_string& path); |
---|
| 153 | |
---|
| 154 | static const CmtSystem::cmt_string_vector& get_cmt_path (); |
---|
| 155 | static const CmtSystem::cmt_string_vector& get_cmt_path_pwds (); |
---|
| 156 | static const CmtSystem::cmt_string_vector& get_cmt_path_sources (); |
---|
| 157 | static const cmt_string& get_cmt_home (); |
---|
| 158 | static const cmt_string& get_cmt_user_context (); |
---|
| 159 | static const cmt_string& get_current_dir (); |
---|
| 160 | static const cmt_string& get_current_package (); |
---|
| 161 | static const cmt_string& get_current_cmtpath (); |
---|
| 162 | static const cmt_string& get_current_offset (); |
---|
| 163 | static AccessMode get_current_access (); |
---|
| 164 | static int get_current_build_strategy (); |
---|
| 165 | static int get_current_setup_strategy (); |
---|
| 166 | static VersionStrategy get_current_strategy (); |
---|
| 167 | static CmtStructuringStyle get_current_structuring_style (); |
---|
| 168 | static CmtDirStyle get_current_style (); |
---|
| 169 | static const cmt_string& get_current_version (); |
---|
| 170 | static const cmt_string& get_current_target (); |
---|
| 171 | static bool get_debug (); |
---|
| 172 | static bool get_quiet (); |
---|
| 173 | static bool get_recursive (); |
---|
| 174 | static ScopeType get_scope (); |
---|
| 175 | static CmtScopeFilteringMode get_scope_filtering_mode (); |
---|
| 176 | |
---|
| 177 | static void install_cleanup_scripts (); |
---|
| 178 | static void install_setup_scripts (); |
---|
| 179 | static void install_test_cleanup_scripts (); |
---|
| 180 | static void install_test_setup_scripts (); |
---|
| 181 | static bool load (const cmt_string& path, |
---|
| 182 | const cmt_string& package, |
---|
| 183 | const cmt_string& version, |
---|
| 184 | const cmt_string& tag_name = ""); |
---|
| 185 | static bool need_prototypes (); |
---|
| 186 | static void parse_arguments (int argc, char* argv[], |
---|
| 187 | CmtSystem::cmt_string_vector& arguments, |
---|
| 188 | cmt_string& extra_line, |
---|
| 189 | cmt_string& extra_file, |
---|
| 190 | PrintMode& mode); |
---|
| 191 | static int parser (const cmt_string& command_line); |
---|
| 192 | static int parser (int argc, char* argv[]); |
---|
| 193 | static void print (PrintMode mode); |
---|
| 194 | static void print_clean (PrintMode mode); |
---|
| 195 | static void print_context (Use& use, PrintMode mode, const cmt_string& tag); |
---|
| 196 | static void print_macros (PrintMode mode, const cmt_string& pattern = ""); |
---|
| 197 | static void print_symbol_names (PrintMode mode, const cmt_string& pattern = ""); |
---|
| 198 | static void print_tabs (int tabs); |
---|
| 199 | static int reach_current_package (); |
---|
| 200 | static void restore_all_tags (Use* use); |
---|
| 201 | static void set_current_access (AccessMode mode); |
---|
| 202 | static void set_current_build_strategy (int strategy); |
---|
| 203 | static void set_current_setup_strategy (int strategy); |
---|
| 204 | static void set_current_strategy (VersionStrategy strategy); |
---|
| 205 | static void set_scope (ScopeType scope); |
---|
| 206 | static void set_scope_filtering_mode (CmtScopeFilteringMode mode); |
---|
| 207 | static void set_standard_macros (); |
---|
| 208 | static void use_cmt (); |
---|
| 209 | static void use_home_requirements (); |
---|
| 210 | static void use_user_context_requirements (); |
---|
| 211 | static cmt_string vector_to_string (const CmtSystem::cmt_string_vector& v); |
---|
| 212 | static void vector_to_string (const CmtSystem::cmt_string_vector& v, |
---|
| 213 | const cmt_string& separator, |
---|
| 214 | cmt_string& result); |
---|
| 215 | |
---|
| 216 | private: |
---|
| 217 | |
---|
| 218 | /// All Attributes are private |
---|
| 219 | |
---|
| 220 | static ActionType m_action; |
---|
| 221 | static ActionType m_help_action; |
---|
| 222 | static bool m_build_nmake; |
---|
| 223 | static cmt_string m_cmt_config; |
---|
| 224 | static CmtSystem::cmt_string_vector m_cmt_path; |
---|
| 225 | static CmtSystem::cmt_string_vector m_cmt_path_pwds; |
---|
| 226 | static CmtSystem::cmt_string_vector m_cmt_path_sources; |
---|
| 227 | static cmt_string m_cmt_root; |
---|
| 228 | static cmt_string m_cmt_home; |
---|
| 229 | static cmt_string m_cmt_user_context; |
---|
| 230 | static cmt_string m_cmt_site; |
---|
| 231 | static cmt_string m_cmt_version; |
---|
| 232 | |
---|
| 233 | static int m_current_build_strategy; |
---|
| 234 | static int m_current_setup_strategy; |
---|
| 235 | |
---|
| 236 | static cmt_string m_current_dir; |
---|
| 237 | static cmt_string m_current_package; |
---|
| 238 | static cmt_string m_current_config; |
---|
| 239 | static cmt_string m_current_path; |
---|
| 240 | static cmt_string m_current_prefix; |
---|
| 241 | static cmt_string m_current_cmtpath; |
---|
| 242 | static cmt_string m_current_offset; |
---|
| 243 | |
---|
| 244 | static AccessMode m_current_access; |
---|
| 245 | static VersionStrategy m_current_strategy; |
---|
| 246 | static CmtDirStyle m_current_style; |
---|
| 247 | static CmtStructuringStyle m_current_structuring_style; |
---|
| 248 | |
---|
| 249 | static cmt_string m_current_tag; |
---|
| 250 | static cmt_string m_current_target; |
---|
| 251 | static cmt_string m_current_version; |
---|
| 252 | |
---|
| 253 | static cmt_string m_extra_tags; |
---|
| 254 | static cmt_string m_configure_error; |
---|
| 255 | |
---|
| 256 | static bool m_debug; |
---|
| 257 | |
---|
| 258 | static cmt_string m_default_path; |
---|
| 259 | static bool m_quiet; |
---|
| 260 | static bool m_recursive; |
---|
| 261 | static ScopeType m_scope; |
---|
| 262 | static CmtScopeFilteringMode m_scope_filtering_mode; |
---|
| 263 | static bool m_simulation; |
---|
| 264 | static bool m_standard_macros_done; |
---|
| 265 | }; |
---|
| 266 | |
---|
| 267 | #endif |
---|