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 | static bool build_nmake (); |
---|
17 | static void build_OS9_makefile (const cmt_string& target); |
---|
18 | static void build_prefix (const cmt_string& package, cmt_string& prefix); |
---|
19 | static void clear (); |
---|
20 | |
---|
21 | static void configure (); |
---|
22 | static void configure_cmt_path (Use* use); |
---|
23 | static void configure_config_tag (); |
---|
24 | static void configure_current_dir (); |
---|
25 | static void configure_current_package (); |
---|
26 | static void configure_default_path (); |
---|
27 | static void configure_home (Use* use); |
---|
28 | static void configure_user_context (Use* use); |
---|
29 | static void configure_hosttype_tag (); |
---|
30 | static void configure_site_tag (Use* use); |
---|
31 | static void configure_tags (Use* use); |
---|
32 | static void configure_uname_tag (); |
---|
33 | |
---|
34 | static void do_awk (const CmtSystem::cmt_string_vector& arguments); |
---|
35 | static void do_broadcast (const CmtSystem::cmt_string_vector& arguments, |
---|
36 | int argc, |
---|
37 | char* argv[]); |
---|
38 | static void do_build_constituent_makefile (const CmtSystem::cmt_string_vector& arguments, |
---|
39 | int argc, |
---|
40 | char* argv[]); |
---|
41 | static void do_build_constituents_makefile (const CmtSystem::cmt_string_vector& arguments, |
---|
42 | int argc, |
---|
43 | char* argv[]); |
---|
44 | static void do_build_dependencies (const CmtSystem::cmt_string_vector& arguments, |
---|
45 | int argc, |
---|
46 | char* argv[]); |
---|
47 | static void do_build_library_links (); |
---|
48 | static void do_build_make_setup (); |
---|
49 | static void do_build_msdev (const CmtSystem::cmt_string_vector& arguments); |
---|
50 | static void do_build_os9_makefile (const CmtSystem::cmt_string_vector& arguments); |
---|
51 | static void do_build_prototype (const CmtSystem::cmt_string_vector& arguments); |
---|
52 | static void do_build_readme (const CmtSystem::cmt_string_vector& arguments); |
---|
53 | static void do_build_tag_makefile (); |
---|
54 | static void do_build_temporary_name (); |
---|
55 | static void do_build_triggers (const CmtSystem::cmt_string_vector& arguments); |
---|
56 | static void do_build_windefs (const CmtSystem::cmt_string_vector& arguments); |
---|
57 | static void do_check_configuration (); |
---|
58 | static void do_check_files (const CmtSystem::cmt_string_vector& arguments); |
---|
59 | static void do_check_version (const CmtSystem::cmt_string_vector& arguments); |
---|
60 | static void do_checkout (const CmtSystem::cmt_string_vector& arguments); |
---|
61 | static void do_cleanup (PrintMode& mode); |
---|
62 | static void do_config (); |
---|
63 | static void do_create (const CmtSystem::cmt_string_vector& arguments); |
---|
64 | static void do_cvsbranches (const CmtSystem::cmt_string_vector& arguments); |
---|
65 | static void do_cvssubpackages (const CmtSystem::cmt_string_vector& arguments); |
---|
66 | static void do_cvstags (const CmtSystem::cmt_string_vector& arguments); |
---|
67 | static void do_expand_model (const CmtSystem::cmt_string_vector& arguments); |
---|
68 | static void do_filter (const CmtSystem::cmt_string_vector& arguments); |
---|
69 | static void do_help (); |
---|
70 | static void do_lock (const cmt_string& package, |
---|
71 | const cmt_string& version, |
---|
72 | const cmt_string& path); |
---|
73 | static void do_remove (const cmt_string& package, |
---|
74 | const cmt_string& version, |
---|
75 | const cmt_string& path); |
---|
76 | static void do_remove_library_links (); |
---|
77 | static void do_run (const CmtSystem::cmt_string_vector& arguments); |
---|
78 | static void do_run_sequence (const CmtSystem::cmt_string_vector& arguments); |
---|
79 | static void do_setup (PrintMode& mode); |
---|
80 | static void do_show_all_tags (); |
---|
81 | static void do_show_applied_patterns (); |
---|
82 | static void do_show_author (); |
---|
83 | static void do_show_branches (PrintMode& mode); |
---|
84 | static void do_show_clients (const CmtSystem::cmt_string_vector& arguments); |
---|
85 | static void do_show_constituent (const CmtSystem::cmt_string_vector& arguments); |
---|
86 | static void do_show_constituent_names (); |
---|
87 | static void do_show_constituents (); |
---|
88 | static void do_show_fragment (const CmtSystem::cmt_string_vector& arguments); |
---|
89 | static void do_show_fragments (); |
---|
90 | static void do_show_groups (); |
---|
91 | static void do_show_include_dirs (); |
---|
92 | static void do_show_language (const CmtSystem::cmt_string_vector& arguments); |
---|
93 | static void do_show_languages (); |
---|
94 | static void do_show_macro (const CmtSystem::cmt_string_vector& arguments, |
---|
95 | PrintMode& mode); |
---|
96 | static void do_show_macro_names (const CmtSystem::cmt_string_vector& arguments, |
---|
97 | PrintMode& mode); |
---|
98 | static void do_show_macro_value (const CmtSystem::cmt_string_vector& arguments, |
---|
99 | PrintMode& mode); |
---|
100 | static void do_show_macros (const CmtSystem::cmt_string_vector& arguments, |
---|
101 | PrintMode& mode); |
---|
102 | static void do_show_manager (); |
---|
103 | static void do_show_packages (const CmtSystem::cmt_string_vector& arguments); |
---|
104 | static void do_show_path (); |
---|
105 | static void do_show_pattern (const CmtSystem::cmt_string_vector& arguments); |
---|
106 | static void do_show_pattern_names (); |
---|
107 | static void do_show_patterns (); |
---|
108 | static void do_show_pwd (); |
---|
109 | static void do_show_set (const CmtSystem::cmt_string_vector& arguments, |
---|
110 | PrintMode& mode); |
---|
111 | static void do_show_set_names (const CmtSystem::cmt_string_vector& arguments, |
---|
112 | PrintMode& mode); |
---|
113 | static void do_show_set_value (const CmtSystem::cmt_string_vector& arguments, |
---|
114 | PrintMode& mode); |
---|
115 | static void do_show_sets (const CmtSystem::cmt_string_vector& arguments, |
---|
116 | PrintMode& mode); |
---|
117 | static void do_show_strategies (); |
---|
118 | static void do_show_tags (); |
---|
119 | static void do_show_uses (); |
---|
120 | static void do_show_version (); |
---|
121 | static void do_show_versions (const CmtSystem::cmt_string_vector& arguments); |
---|
122 | static void do_show_system (); |
---|
123 | static void do_unlock (const cmt_string& package, |
---|
124 | const cmt_string& version, |
---|
125 | const cmt_string& path); |
---|
126 | static void do_version (); |
---|
127 | |
---|
128 | |
---|
129 | static const cmt_string& filter_dir (const cmt_string& dir); |
---|
130 | |
---|
131 | static ActionType get_action (); |
---|
132 | static const CmtSystem::cmt_string_vector& get_cmt_path (); |
---|
133 | static const cmt_string& get_cmt_home (); |
---|
134 | static const cmt_string& get_cmt_user_context (); |
---|
135 | static const cmt_string& get_current_dir (); |
---|
136 | static const cmt_string& get_current_package (); |
---|
137 | static AccessMode get_current_access (); |
---|
138 | static VersionStrategy get_current_strategy (); |
---|
139 | static const cmt_string& get_current_version (); |
---|
140 | static const cmt_string& get_current_target (); |
---|
141 | static bool get_debug (); |
---|
142 | static bool get_quiet (); |
---|
143 | static bool get_recursive (); |
---|
144 | static ScopeType get_scope (); |
---|
145 | |
---|
146 | static void install_cleanup_scripts (); |
---|
147 | static void install_setup_scripts (); |
---|
148 | static void install_test_cleanup_scripts (); |
---|
149 | static void install_test_setup_scripts (); |
---|
150 | static bool load (const cmt_string& path, |
---|
151 | const cmt_string& package, |
---|
152 | const cmt_string& version, |
---|
153 | const cmt_string& tag_name = ""); |
---|
154 | static bool need_prototypes (); |
---|
155 | static void parse_arguments (int argc, char* argv[], |
---|
156 | CmtSystem::cmt_string_vector& arguments, |
---|
157 | cmt_string& extra_line, |
---|
158 | cmt_string& extra_file, |
---|
159 | PrintMode& mode); |
---|
160 | static void parse_requirements (const cmt_string& file_name, Use* use); |
---|
161 | static void parse_requirements_line (const cmt_string& line, |
---|
162 | Use* use, |
---|
163 | const cmt_string& file_name = "", |
---|
164 | int line_number = 0); |
---|
165 | static void parse_requirements_text (const cmt_string& text, |
---|
166 | const cmt_string& file_name, |
---|
167 | Use* use); |
---|
168 | static int parser (const cmt_string& command_line); |
---|
169 | static int parser (int argc, char* argv[]); |
---|
170 | static void print (PrintMode mode); |
---|
171 | static void print_clean (PrintMode mode); |
---|
172 | static void print_context (Use& use, PrintMode mode, const cmt_string& tag); |
---|
173 | static void print_macros (PrintMode mode, const cmt_string& pattern = ""); |
---|
174 | static void print_symbol_names (PrintMode mode, const cmt_string& pattern = ""); |
---|
175 | static void print_tabs (int tabs); |
---|
176 | static int reach_current_package (); |
---|
177 | static void restore_all_tags (Use* use); |
---|
178 | static void select (const CmtSystem::cmt_string_vector& words, Use* use, |
---|
179 | const cmt_string& file_name, |
---|
180 | int line_number); |
---|
181 | static void set_standard_macros (); |
---|
182 | static void use_cmt (); |
---|
183 | static void use_home_requirements (); |
---|
184 | static void use_user_context_requirements (); |
---|
185 | static cmt_string vector_to_string (const CmtSystem::cmt_string_vector& v); |
---|
186 | static void vector_to_string (const CmtSystem::cmt_string_vector& v, |
---|
187 | const cmt_string& separator, |
---|
188 | cmt_string& result); |
---|
189 | |
---|
190 | private: |
---|
191 | |
---|
192 | /// All Attributes are private |
---|
193 | |
---|
194 | static ActionType m_action; |
---|
195 | static bool m_build_nmake; |
---|
196 | static cmt_string m_cmt_config; |
---|
197 | static CmtSystem::cmt_string_vector m_cmt_path; |
---|
198 | static CmtSystem::cmt_string_vector m_cmt_path_pwds; |
---|
199 | static CmtSystem::cmt_string_vector m_cmt_path_sources; |
---|
200 | static cmt_string m_cmt_root; |
---|
201 | static cmt_string m_cmt_home; |
---|
202 | static cmt_string m_cmt_user_context; |
---|
203 | static cmt_string m_cmt_site; |
---|
204 | static cmt_string m_cmt_version; |
---|
205 | |
---|
206 | static int m_current_build_strategy; |
---|
207 | |
---|
208 | static cmt_string m_current_dir; |
---|
209 | static cmt_string m_current_package; |
---|
210 | static cmt_string m_current_config; |
---|
211 | static cmt_string m_current_path; |
---|
212 | static cmt_string m_current_prefix; |
---|
213 | |
---|
214 | static AccessMode m_current_access; |
---|
215 | static VersionStrategy m_current_strategy; |
---|
216 | static CmtDirStyle m_current_style; |
---|
217 | |
---|
218 | static cmt_string m_current_tag; |
---|
219 | static cmt_string m_current_target; |
---|
220 | static cmt_string m_current_version; |
---|
221 | |
---|
222 | static cmt_string m_extra_tags; |
---|
223 | static cmt_string m_configure_error; |
---|
224 | |
---|
225 | static bool m_debug; |
---|
226 | |
---|
227 | static cmt_string m_default_path; |
---|
228 | static cmt_string m_filtered_text; |
---|
229 | static bool m_quiet; |
---|
230 | static bool m_recursive; |
---|
231 | static ScopeType m_scope; |
---|
232 | static bool m_simulation; |
---|
233 | static bool m_standard_macros_done; |
---|
234 | }; |
---|
235 | |
---|
236 | #endif |
---|