00001
00002
00003
00004
00005
00006
00007
00008 #ifndef LIBAEGIS_PATTR_H
00009 #define LIBAEGIS_PATTR_H
00010
00011 #include <common/str.h>
00012 #include <libaegis/output.h>
00013 #include <libaegis/meta_lex.h>
00014 #include <libaegis/meta_parse.h>
00015 #include <libaegis/meta_type.h>
00016
00017 class nstring;
00018
00019 #ifndef change_cause_DEF
00020 #define change_cause_DEF
00021 enum change_cause_ty
00022 {
00023 change_cause_external_bug,
00024 change_cause_external_enhancement,
00025 change_cause_external_improvement,
00026 change_cause_internal_bug,
00027 change_cause_internal_enhancement,
00028 change_cause_internal_improvement,
00029 change_cause_chain
00030 };
00031 #define change_cause_max 7
00032 #endif // change_cause_DEF
00033
00034 extern meta_type change_cause_type;
00035
00036 void change_cause_write(const output::pointer &fp, const char *name, change_cause_ty value, bool show);
00037 void change_cause_write_xml(const output::pointer &fp, const char *name, change_cause_ty value, bool show);
00038 const char *change_cause_ename(change_cause_ty);
00039
00040 #ifndef file_action_DEF
00041 #define file_action_DEF
00042 enum file_action_ty
00043 {
00044 file_action_create,
00045 file_action_modify,
00046 file_action_remove,
00047 file_action_insulate,
00048 file_action_transparent
00049 };
00050 #define file_action_max 5
00051 #endif // file_action_DEF
00052
00053 extern meta_type file_action_type;
00054
00055 void file_action_write(const output::pointer &fp, const char *name, file_action_ty value, bool show);
00056 void file_action_write_xml(const output::pointer &fp, const char *name, file_action_ty value, bool show);
00057 const char *file_action_ename(file_action_ty);
00058
00059 #ifndef file_usage_DEF
00060 #define file_usage_DEF
00061 enum file_usage_ty
00062 {
00063 file_usage_source,
00064 file_usage_config,
00065 file_usage_build,
00066 file_usage_test,
00067 file_usage_manual_test
00068 };
00069 #define file_usage_max 5
00070 #endif // file_usage_DEF
00071
00072 extern meta_type file_usage_type;
00073
00074 void file_usage_write(const output::pointer &fp, const char *name, file_usage_ty value, bool show);
00075 void file_usage_write_xml(const output::pointer &fp, const char *name, file_usage_ty value, bool show);
00076 const char *file_usage_ename(file_usage_ty);
00077
00078 #ifndef metric_DEF
00079 #define metric_DEF
00080
00081 #define metric_name_mask ((unsigned long)0)
00082 #define metric_value_mask ((unsigned long)1 << 0)
00083
00084 struct metric_ty
00085 {
00086 long reference_count;
00087 unsigned long mask;
00088 string_ty *errpos;
00089 string_ty *name;
00090 double value;
00091 };
00092 #endif // metric_DEF
00093
00094 extern meta_type metric_type;
00095
00096 void metric_write(const output::pointer &fp, const char *name, metric_ty *value);
00097 void metric_write_xml(const output::pointer &fp, const char *name, metric_ty *value);
00098 metric_ty *metric_copy(metric_ty *);
00099 metric_ty *metric_clone(metric_ty *);
00100 #ifdef DEBUG
00101 void metric_trace_real(const char *name, const metric_ty *value);
00102 #define metric_trace(x) ((void)(trace_pretest_ && (trace_where_, metric_trace_real(trace_stringize(x), x), 0)))
00103 #else
00104 #define metric_trace(x)
00105 #endif
00106
00107 #ifndef metric_list_DEF
00108 #define metric_list_DEF
00109 struct metric_list_ty
00110 {
00111 size_t length;
00112 size_t maximum;
00113 metric_ty **list;
00114 };
00115 #endif // metric_list_DEF
00116
00117 extern meta_type metric_list_type;
00118
00119 metric_list_ty *metric_list_copy(metric_list_ty *);
00120 metric_list_ty *metric_list_clone(metric_list_ty *);
00121 void metric_list_write(const output::pointer &fp, const char *name, metric_list_ty *value);
00122 void metric_list_write_xml(const output::pointer &fp, const char *name, metric_list_ty *value);
00123 #ifdef DEBUG
00124 void metric_list_trace_real(const char *name, const metric_list_ty *value);
00125 #define metric_list_trace(x) ((void)(trace_pretest_ && (trace_where_, metric_list_trace_real(trace_stringize(x), x), 0)))
00126 #else
00127 #define metric_list_trace(x)
00128 #endif
00129
00130 #ifndef history_version_encoding_DEF
00131 #define history_version_encoding_DEF
00132 enum history_version_encoding_ty
00133 {
00134 history_version_encoding_none,
00135 history_version_encoding_quoted_printable,
00136 history_version_encoding_base64
00137 };
00138 #define history_version_encoding_max 3
00139 #endif // history_version_encoding_DEF
00140
00141 extern meta_type history_version_encoding_type;
00142
00143 void history_version_encoding_write(const output::pointer &fp, const char *name, history_version_encoding_ty value, bool show);
00144 void history_version_encoding_write_xml(const output::pointer &fp, const char *name, history_version_encoding_ty value, bool show);
00145 const char *history_version_encoding_ename(history_version_encoding_ty);
00146
00147 #ifndef history_version_DEF
00148 #define history_version_DEF
00149
00150 #define history_version_revision_mask ((unsigned long)0)
00151 #define history_version_encoding_mask ((unsigned long)1 << 0)
00152
00153 struct history_version_ty
00154 {
00155 long reference_count;
00156 unsigned long mask;
00157 string_ty *errpos;
00158 string_ty *revision;
00159 history_version_encoding_ty encoding;
00160 };
00161 #endif // history_version_DEF
00162
00163 extern meta_type history_version_type;
00164
00165 void history_version_write(const output::pointer &fp, const char *name, history_version_ty *value);
00166 void history_version_write_xml(const output::pointer &fp, const char *name, history_version_ty *value);
00167 history_version_ty *history_version_copy(history_version_ty *);
00168 history_version_ty *history_version_clone(history_version_ty *);
00169 #ifdef DEBUG
00170 void history_version_trace_real(const char *name, const history_version_ty *value);
00171 #define history_version_trace(x) ((void)(trace_pretest_ && (trace_where_, history_version_trace_real(trace_stringize(x), x), 0)))
00172 #else
00173 #define history_version_trace(x)
00174 #endif
00175
00176 #ifndef attributes_DEF
00177 #define attributes_DEF
00178
00179 #define attributes_name_mask ((unsigned long)0)
00180 #define attributes_value_mask ((unsigned long)0)
00181
00182 struct attributes_ty
00183 {
00184 long reference_count;
00185 unsigned long mask;
00186 string_ty *errpos;
00187 string_ty *name;
00188 string_ty *value;
00189 };
00190 #endif // attributes_DEF
00191
00192 extern meta_type attributes_type;
00193
00194 void attributes_write(const output::pointer &fp, const char *name, attributes_ty *value);
00195 void attributes_write_xml(const output::pointer &fp, const char *name, attributes_ty *value);
00196 attributes_ty *attributes_copy(attributes_ty *);
00197 attributes_ty *attributes_clone(attributes_ty *);
00198 #ifdef DEBUG
00199 void attributes_trace_real(const char *name, const attributes_ty *value);
00200 #define attributes_trace(x) ((void)(trace_pretest_ && (trace_where_, attributes_trace_real(trace_stringize(x), x), 0)))
00201 #else
00202 #define attributes_trace(x)
00203 #endif
00204
00205 #ifndef attributes_list_DEF
00206 #define attributes_list_DEF
00207 struct attributes_list_ty
00208 {
00209 size_t length;
00210 size_t maximum;
00211 attributes_ty **list;
00212 };
00213 #endif // attributes_list_DEF
00214
00215 extern meta_type attributes_list_type;
00216
00217 attributes_list_ty *attributes_list_copy(attributes_list_ty *);
00218 attributes_list_ty *attributes_list_clone(attributes_list_ty *);
00219 void attributes_list_write(const output::pointer &fp, const char *name, attributes_list_ty *value);
00220 void attributes_list_write_xml(const output::pointer &fp, const char *name, attributes_list_ty *value);
00221 #ifdef DEBUG
00222 void attributes_list_trace_real(const char *name, const attributes_list_ty *value);
00223 #define attributes_list_trace(x) ((void)(trace_pretest_ && (trace_where_, attributes_list_trace_real(trace_stringize(x), x), 0)))
00224 #else
00225 #define attributes_list_trace(x)
00226 #endif
00227
00228 #ifndef pattr_copyright_years_list_DEF
00229 #define pattr_copyright_years_list_DEF
00230 struct pattr_copyright_years_list_ty
00231 {
00232 size_t length;
00233 size_t maximum;
00234 long *list;
00235 };
00236 #endif // pattr_copyright_years_list_DEF
00237
00238 extern meta_type pattr_copyright_years_list_type;
00239
00240 pattr_copyright_years_list_ty *pattr_copyright_years_list_copy(pattr_copyright_years_list_ty *);
00241 pattr_copyright_years_list_ty *pattr_copyright_years_list_clone(pattr_copyright_years_list_ty *);
00242 void pattr_copyright_years_list_write(const output::pointer &fp, const char *name, pattr_copyright_years_list_ty *value);
00243 void pattr_copyright_years_list_write_xml(const output::pointer &fp, const char *name, pattr_copyright_years_list_ty *value);
00244 #ifdef DEBUG
00245 void pattr_copyright_years_list_trace_real(const char *name, const pattr_copyright_years_list_ty *value);
00246 #define pattr_copyright_years_list_trace(x) ((void)(trace_pretest_ && (trace_where_, pattr_copyright_years_list_trace_real(trace_stringize(x), x), 0)))
00247 #else
00248 #define pattr_copyright_years_list_trace(x)
00249 #endif
00250
00251 #ifndef pattr_develop_end_action_DEF
00252 #define pattr_develop_end_action_DEF
00253 enum pattr_develop_end_action_ty
00254 {
00255 pattr_develop_end_action_goto_being_reviewed,
00256 pattr_develop_end_action_goto_awaiting_review,
00257 pattr_develop_end_action_goto_awaiting_integration
00258 };
00259 #define pattr_develop_end_action_max 3
00260 #endif // pattr_develop_end_action_DEF
00261
00262 extern meta_type pattr_develop_end_action_type;
00263
00264 void pattr_develop_end_action_write(const output::pointer &fp, const char *name, pattr_develop_end_action_ty value, bool show);
00265 void pattr_develop_end_action_write_xml(const output::pointer &fp, const char *name, pattr_develop_end_action_ty value, bool show);
00266 const char *pattr_develop_end_action_ename(pattr_develop_end_action_ty);
00267
00268 #ifndef pattr_DEF
00269 #define pattr_DEF
00270
00271 #define pattr_description_mask ((unsigned long)0)
00272 #define pattr_developer_may_review_mask ((unsigned long)1 << 0)
00273 #define pattr_developer_may_integrate_mask ((unsigned long)1 << 1)
00274 #define pattr_reviewer_may_integrate_mask ((unsigned long)1 << 2)
00275 #define pattr_developers_may_create_changes_mask ((unsigned long)1 << 3)
00276 #define pattr_forced_develop_begin_notify_command_mask ((unsigned long)0)
00277 #define pattr_develop_end_notify_command_mask ((unsigned long)0)
00278 #define pattr_develop_end_undo_notify_command_mask ((unsigned long)0)
00279 #define pattr_review_begin_notify_command_mask ((unsigned long)0)
00280 #define pattr_review_begin_undo_notify_command_mask ((unsigned long)0)
00281 #define pattr_review_pass_notify_command_mask ((unsigned long)0)
00282 #define pattr_review_pass_undo_notify_command_mask ((unsigned long)0)
00283 #define pattr_review_fail_notify_command_mask ((unsigned long)0)
00284 #define pattr_integrate_pass_notify_command_mask ((unsigned long)0)
00285 #define pattr_integrate_fail_notify_command_mask ((unsigned long)0)
00286 #define pattr_default_development_directory_mask ((unsigned long)0)
00287 #define pattr_umask_mask ((unsigned long)1 << 4)
00288 #define pattr_default_test_exemption_mask ((unsigned long)1 << 5)
00289 #define pattr_default_test_regression_exemption_mask ((unsigned long)1 << 6)
00290 #define pattr_copyright_years_mask ((unsigned long)0)
00291 #define pattr_minimum_change_number_mask ((unsigned long)1 << 7)
00292 #define pattr_reuse_change_numbers_mask ((unsigned long)1 << 8)
00293 #define pattr_minimum_branch_number_mask ((unsigned long)1 << 9)
00294 #define pattr_skip_unlucky_mask ((unsigned long)1 << 10)
00295 #define pattr_compress_database_mask ((unsigned long)1 << 11)
00296 #define pattr_develop_end_action_mask ((unsigned long)1 << 12)
00297 #define pattr_protect_development_directory_mask ((unsigned long)1 << 13)
00298
00299 struct pattr_ty
00300 {
00301 long reference_count;
00302 unsigned long mask;
00303 string_ty *errpos;
00304 string_ty *description;
00305 bool developer_may_review;
00306 bool developer_may_integrate;
00307 bool reviewer_may_integrate;
00308 bool developers_may_create_changes;
00309 string_ty *forced_develop_begin_notify_command;
00310 string_ty *develop_end_notify_command;
00311 string_ty *develop_end_undo_notify_command;
00312 string_ty *review_begin_notify_command;
00313 string_ty *review_begin_undo_notify_command;
00314 string_ty *review_pass_notify_command;
00315 string_ty *review_pass_undo_notify_command;
00316 string_ty *review_fail_notify_command;
00317 string_ty *integrate_pass_notify_command;
00318 string_ty *integrate_fail_notify_command;
00319 string_ty *default_development_directory;
00320 long umask;
00321 bool default_test_exemption;
00322 bool default_test_regression_exemption;
00323 pattr_copyright_years_list_ty *copyright_years;
00324 long minimum_change_number;
00325 bool reuse_change_numbers;
00326 long minimum_branch_number;
00327 bool skip_unlucky;
00328 bool compress_database;
00329 pattr_develop_end_action_ty develop_end_action;
00330 bool protect_development_directory;
00331 };
00332 #endif // pattr_DEF
00333
00334 extern meta_type pattr_type;
00335
00336 void pattr_write(const output::pointer &fp, pattr_ty *value);
00337 void pattr_write_xml(const output::pointer &fp, pattr_ty *value);
00338 pattr_ty *pattr_copy(pattr_ty *);
00339 pattr_ty *pattr_clone(pattr_ty *);
00340 #ifdef DEBUG
00341 void pattr_trace_real(const char *name, const pattr_ty *value);
00342 #define pattr_trace(x) ((void)(trace_pretest_ && (trace_where_, pattr_trace_real(trace_stringize(x), x), 0)))
00343 #else
00344 #define pattr_trace(x)
00345 #endif
00346
00363 void pattr_write_file(string_ty *filename, pattr_ty *value, int comp);
00364
00381 void pattr_write_file(const nstring &filnam, pattr_ty *value, bool comp);
00382
00399 pattr_ty *pattr_read_file(string_ty *filename);
00400
00417 pattr_ty *pattr_read_file(const nstring &filename);
00418 void pattr__rpt_init(void);
00419
00420 #endif // LIBAEGIS_PATTR_H