00001
00002
00003
00004
00005
00006
00007
00008 #ifndef LIBAEGIS_FSTATE_H
00009 #define LIBAEGIS_FSTATE_H
00010
00011 #include <common/ac/time.h>
00012
00013 #include <common/str.h>
00014 #include <libaegis/output.h>
00015 #include <libaegis/meta_lex.h>
00016 #include <libaegis/meta_parse.h>
00017 #include <libaegis/meta_type.h>
00018
00019 class nstring;
00020
00021 #ifndef change_cause_DEF
00022 #define change_cause_DEF
00023 enum change_cause_ty
00024 {
00025 change_cause_external_bug,
00026 change_cause_external_enhancement,
00027 change_cause_external_improvement,
00028 change_cause_internal_bug,
00029 change_cause_internal_enhancement,
00030 change_cause_internal_improvement,
00031 change_cause_chain
00032 };
00033 #define change_cause_max 7
00034 #endif // change_cause_DEF
00035
00036 extern meta_type change_cause_type;
00037
00038 void change_cause_write(const output::pointer &fp, const char *name, change_cause_ty value, bool show);
00039 void change_cause_write_xml(const output::pointer &fp, const char *name, change_cause_ty value, bool show);
00040 const char *change_cause_ename(change_cause_ty);
00041
00042 #ifndef file_action_DEF
00043 #define file_action_DEF
00044 enum file_action_ty
00045 {
00046 file_action_create,
00047 file_action_modify,
00048 file_action_remove,
00049 file_action_insulate,
00050 file_action_transparent
00051 };
00052 #define file_action_max 5
00053 #endif // file_action_DEF
00054
00055 extern meta_type file_action_type;
00056
00057 void file_action_write(const output::pointer &fp, const char *name, file_action_ty value, bool show);
00058 void file_action_write_xml(const output::pointer &fp, const char *name, file_action_ty value, bool show);
00059 const char *file_action_ename(file_action_ty);
00060
00061 #ifndef file_usage_DEF
00062 #define file_usage_DEF
00063 enum file_usage_ty
00064 {
00065 file_usage_source,
00066 file_usage_config,
00067 file_usage_build,
00068 file_usage_test,
00069 file_usage_manual_test
00070 };
00071 #define file_usage_max 5
00072 #endif // file_usage_DEF
00073
00074 extern meta_type file_usage_type;
00075
00076 void file_usage_write(const output::pointer &fp, const char *name, file_usage_ty value, bool show);
00077 void file_usage_write_xml(const output::pointer &fp, const char *name, file_usage_ty value, bool show);
00078 const char *file_usage_ename(file_usage_ty);
00079
00080 #ifndef metric_DEF
00081 #define metric_DEF
00082
00083 #define metric_name_mask ((unsigned long)0)
00084 #define metric_value_mask ((unsigned long)1 << 0)
00085
00086 struct metric_ty
00087 {
00088 long reference_count;
00089 unsigned long mask;
00090 string_ty *errpos;
00091 string_ty *name;
00092 double value;
00093 };
00094 #endif // metric_DEF
00095
00096 extern meta_type metric_type;
00097
00098 void metric_write(const output::pointer &fp, const char *name, metric_ty *value);
00099 void metric_write_xml(const output::pointer &fp, const char *name, metric_ty *value);
00100 metric_ty *metric_copy(metric_ty *);
00101 metric_ty *metric_clone(metric_ty *);
00102 #ifdef DEBUG
00103 void metric_trace_real(const char *name, const metric_ty *value);
00104 #define metric_trace(x) ((void)(trace_pretest_ && (trace_where_, metric_trace_real(trace_stringize(x), x), 0)))
00105 #else
00106 #define metric_trace(x)
00107 #endif
00108
00109 #ifndef metric_list_DEF
00110 #define metric_list_DEF
00111 struct metric_list_ty
00112 {
00113 size_t length;
00114 size_t maximum;
00115 metric_ty **list;
00116 };
00117 #endif // metric_list_DEF
00118
00119 extern meta_type metric_list_type;
00120
00121 metric_list_ty *metric_list_copy(metric_list_ty *);
00122 metric_list_ty *metric_list_clone(metric_list_ty *);
00123 void metric_list_write(const output::pointer &fp, const char *name, metric_list_ty *value);
00124 void metric_list_write_xml(const output::pointer &fp, const char *name, metric_list_ty *value);
00125 #ifdef DEBUG
00126 void metric_list_trace_real(const char *name, const metric_list_ty *value);
00127 #define metric_list_trace(x) ((void)(trace_pretest_ && (trace_where_, metric_list_trace_real(trace_stringize(x), x), 0)))
00128 #else
00129 #define metric_list_trace(x)
00130 #endif
00131
00132 #ifndef history_version_encoding_DEF
00133 #define history_version_encoding_DEF
00134 enum history_version_encoding_ty
00135 {
00136 history_version_encoding_none,
00137 history_version_encoding_quoted_printable,
00138 history_version_encoding_base64
00139 };
00140 #define history_version_encoding_max 3
00141 #endif // history_version_encoding_DEF
00142
00143 extern meta_type history_version_encoding_type;
00144
00145 void history_version_encoding_write(const output::pointer &fp, const char *name, history_version_encoding_ty value, bool show);
00146 void history_version_encoding_write_xml(const output::pointer &fp, const char *name, history_version_encoding_ty value, bool show);
00147 const char *history_version_encoding_ename(history_version_encoding_ty);
00148
00149 #ifndef history_version_DEF
00150 #define history_version_DEF
00151
00152 #define history_version_revision_mask ((unsigned long)0)
00153 #define history_version_encoding_mask ((unsigned long)1 << 0)
00154
00155 struct history_version_ty
00156 {
00157 long reference_count;
00158 unsigned long mask;
00159 string_ty *errpos;
00160 string_ty *revision;
00161 history_version_encoding_ty encoding;
00162 };
00163 #endif // history_version_DEF
00164
00165 extern meta_type history_version_type;
00166
00167 void history_version_write(const output::pointer &fp, const char *name, history_version_ty *value);
00168 void history_version_write_xml(const output::pointer &fp, const char *name, history_version_ty *value);
00169 history_version_ty *history_version_copy(history_version_ty *);
00170 history_version_ty *history_version_clone(history_version_ty *);
00171 #ifdef DEBUG
00172 void history_version_trace_real(const char *name, const history_version_ty *value);
00173 #define history_version_trace(x) ((void)(trace_pretest_ && (trace_where_, history_version_trace_real(trace_stringize(x), x), 0)))
00174 #else
00175 #define history_version_trace(x)
00176 #endif
00177
00178 #ifndef attributes_DEF
00179 #define attributes_DEF
00180
00181 #define attributes_name_mask ((unsigned long)0)
00182 #define attributes_value_mask ((unsigned long)0)
00183
00184 struct attributes_ty
00185 {
00186 long reference_count;
00187 unsigned long mask;
00188 string_ty *errpos;
00189 string_ty *name;
00190 string_ty *value;
00191 };
00192 #endif // attributes_DEF
00193
00194 extern meta_type attributes_type;
00195
00196 void attributes_write(const output::pointer &fp, const char *name, attributes_ty *value);
00197 void attributes_write_xml(const output::pointer &fp, const char *name, attributes_ty *value);
00198 attributes_ty *attributes_copy(attributes_ty *);
00199 attributes_ty *attributes_clone(attributes_ty *);
00200 #ifdef DEBUG
00201 void attributes_trace_real(const char *name, const attributes_ty *value);
00202 #define attributes_trace(x) ((void)(trace_pretest_ && (trace_where_, attributes_trace_real(trace_stringize(x), x), 0)))
00203 #else
00204 #define attributes_trace(x)
00205 #endif
00206
00207 #ifndef attributes_list_DEF
00208 #define attributes_list_DEF
00209 struct attributes_list_ty
00210 {
00211 size_t length;
00212 size_t maximum;
00213 attributes_ty **list;
00214 };
00215 #endif // attributes_list_DEF
00216
00217 extern meta_type attributes_list_type;
00218
00219 attributes_list_ty *attributes_list_copy(attributes_list_ty *);
00220 attributes_list_ty *attributes_list_clone(attributes_list_ty *);
00221 void attributes_list_write(const output::pointer &fp, const char *name, attributes_list_ty *value);
00222 void attributes_list_write_xml(const output::pointer &fp, const char *name, attributes_list_ty *value);
00223 #ifdef DEBUG
00224 void attributes_list_trace_real(const char *name, const attributes_list_ty *value);
00225 #define attributes_list_trace(x) ((void)(trace_pretest_ && (trace_where_, attributes_list_trace_real(trace_stringize(x), x), 0)))
00226 #else
00227 #define attributes_list_trace(x)
00228 #endif
00229
00230 #ifndef fingerprint_DEF
00231 #define fingerprint_DEF
00232
00233 #define fingerprint_youngest_mask ((unsigned long)1 << 0)
00234 #define fingerprint_oldest_mask ((unsigned long)1 << 1)
00235 #define fingerprint_crypto_mask ((unsigned long)0)
00236
00237 struct fingerprint_ty
00238 {
00239 long reference_count;
00240 unsigned long mask;
00241 string_ty *errpos;
00242 time_t youngest;
00243 time_t oldest;
00244 string_ty *crypto;
00245 };
00246 #endif // fingerprint_DEF
00247
00248 extern meta_type fingerprint_type;
00249
00250 void fingerprint_write(const output::pointer &fp, const char *name, fingerprint_ty *value);
00251 void fingerprint_write_xml(const output::pointer &fp, const char *name, fingerprint_ty *value);
00252 fingerprint_ty *fingerprint_copy(fingerprint_ty *);
00253 fingerprint_ty *fingerprint_clone(fingerprint_ty *);
00254 #ifdef DEBUG
00255 void fingerprint_trace_real(const char *name, const fingerprint_ty *value);
00256 #define fingerprint_trace(x) ((void)(trace_pretest_ && (trace_where_, fingerprint_trace_real(trace_stringize(x), x), 0)))
00257 #else
00258 #define fingerprint_trace(x)
00259 #endif
00260
00261 #ifndef fstate_src_architecture_times_DEF
00262 #define fstate_src_architecture_times_DEF
00263
00264 #define fstate_src_architecture_times_variant_mask ((unsigned long)0)
00265 #define fstate_src_architecture_times_test_time_mask ((unsigned long)1 << 0)
00266 #define fstate_src_architecture_times_test_baseline_time_mask ((unsigned long)1 << 1)
00267
00268 struct fstate_src_architecture_times_ty
00269 {
00270 long reference_count;
00271 unsigned long mask;
00272 string_ty *errpos;
00273 string_ty *variant;
00274 time_t test_time;
00275 time_t test_baseline_time;
00276 };
00277 #endif // fstate_src_architecture_times_DEF
00278
00279 extern meta_type fstate_src_architecture_times_type;
00280
00281 void fstate_src_architecture_times_write(const output::pointer &fp, const char *name, fstate_src_architecture_times_ty *value);
00282 void fstate_src_architecture_times_write_xml(const output::pointer &fp, const char *name, fstate_src_architecture_times_ty *value);
00283 fstate_src_architecture_times_ty *fstate_src_architecture_times_copy(fstate_src_architecture_times_ty *);
00284 fstate_src_architecture_times_ty *fstate_src_architecture_times_clone(fstate_src_architecture_times_ty *);
00285 #ifdef DEBUG
00286 void fstate_src_architecture_times_trace_real(const char *name, const fstate_src_architecture_times_ty *value);
00287 #define fstate_src_architecture_times_trace(x) ((void)(trace_pretest_ && (trace_where_, fstate_src_architecture_times_trace_real(trace_stringize(x), x), 0)))
00288 #else
00289 #define fstate_src_architecture_times_trace(x)
00290 #endif
00291
00292 #ifndef fstate_src_architecture_times_list_DEF
00293 #define fstate_src_architecture_times_list_DEF
00294 struct fstate_src_architecture_times_list_ty
00295 {
00296 size_t length;
00297 size_t maximum;
00298 fstate_src_architecture_times_ty **list;
00299 };
00300 #endif // fstate_src_architecture_times_list_DEF
00301
00302 extern meta_type fstate_src_architecture_times_list_type;
00303
00304 fstate_src_architecture_times_list_ty *fstate_src_architecture_times_list_copy(fstate_src_architecture_times_list_ty *);
00305 fstate_src_architecture_times_list_ty *fstate_src_architecture_times_list_clone(fstate_src_architecture_times_list_ty *);
00306 void fstate_src_architecture_times_list_write(const output::pointer &fp, const char *name, fstate_src_architecture_times_list_ty *value);
00307 void fstate_src_architecture_times_list_write_xml(const output::pointer &fp, const char *name, fstate_src_architecture_times_list_ty *value);
00308 #ifdef DEBUG
00309 void fstate_src_architecture_times_list_trace_real(const char *name, const fstate_src_architecture_times_list_ty *value);
00310 #define fstate_src_architecture_times_list_trace(x) ((void)(trace_pretest_ && (trace_where_, fstate_src_architecture_times_list_trace_real(trace_stringize(x), x), 0)))
00311 #else
00312 #define fstate_src_architecture_times_list_trace(x)
00313 #endif
00314
00315 #ifndef fstate_src_test_list_DEF
00316 #define fstate_src_test_list_DEF
00317 struct fstate_src_test_list_ty
00318 {
00319 size_t length;
00320 size_t maximum;
00321 string_ty **list;
00322 };
00323 #endif // fstate_src_test_list_DEF
00324
00325 extern meta_type fstate_src_test_list_type;
00326
00327 fstate_src_test_list_ty *fstate_src_test_list_copy(fstate_src_test_list_ty *);
00328 fstate_src_test_list_ty *fstate_src_test_list_clone(fstate_src_test_list_ty *);
00329 void fstate_src_test_list_write(const output::pointer &fp, const char *name, fstate_src_test_list_ty *value);
00330 void fstate_src_test_list_write_xml(const output::pointer &fp, const char *name, fstate_src_test_list_ty *value);
00331 #ifdef DEBUG
00332 void fstate_src_test_list_trace_real(const char *name, const fstate_src_test_list_ty *value);
00333 #define fstate_src_test_list_trace(x) ((void)(trace_pretest_ && (trace_where_, fstate_src_test_list_trace_real(trace_stringize(x), x), 0)))
00334 #else
00335 #define fstate_src_test_list_trace(x)
00336 #endif
00337
00338 #ifndef fstate_src_DEF
00339 #define fstate_src_DEF
00340
00341 #define fstate_src_file_name_mask ((unsigned long)0)
00342 #define fstate_src_uuid_mask ((unsigned long)0)
00343 #define fstate_src_action_mask ((unsigned long)1 << 0)
00344 #define fstate_src_edit_mask ((unsigned long)0)
00345 #define fstate_src_edit_number_mask ((unsigned long)0)
00346 #define fstate_src_edit_origin_mask ((unsigned long)0)
00347 #define fstate_src_edit_number_origin_mask ((unsigned long)0)
00348 #define fstate_src_edit_origin_new_mask ((unsigned long)0)
00349 #define fstate_src_edit_number_origin_new_mask ((unsigned long)0)
00350 #define fstate_src_usage_mask ((unsigned long)1 << 1)
00351 #define fstate_src_file_fp_mask ((unsigned long)0)
00352 #define fstate_src_diff_file_fp_mask ((unsigned long)0)
00353 #define fstate_src_idiff_file_fp_mask ((unsigned long)0)
00354 #define fstate_src_architecture_times_mask ((unsigned long)0)
00355 #define fstate_src_move_mask ((unsigned long)0)
00356 #define fstate_src_locked_by_mask ((unsigned long)1 << 2)
00357 #define fstate_src_about_to_be_created_by_mask ((unsigned long)1 << 3)
00358 #define fstate_src_about_to_be_copied_by_mask ((unsigned long)1 << 4)
00359 #define fstate_src_deleted_by_mask ((unsigned long)1 << 5)
00360 #define fstate_src_test_mask ((unsigned long)0)
00361 #define fstate_src_metrics_mask ((unsigned long)0)
00362 #define fstate_src_executable_mask ((unsigned long)1 << 6)
00363 #define fstate_src_attribute_mask ((unsigned long)0)
00364
00365 struct fstate_src_ty
00366 {
00367 long reference_count;
00368 unsigned long mask;
00369 string_ty *errpos;
00370 string_ty *file_name;
00371 string_ty *uuid;
00372 file_action_ty action;
00373 history_version_ty *edit;
00374 string_ty *edit_number;
00375 history_version_ty *edit_origin;
00376 string_ty *edit_number_origin;
00377 history_version_ty *edit_origin_new;
00378 string_ty *edit_number_origin_new;
00379 file_usage_ty usage;
00380 fingerprint_ty *file_fp;
00381 fingerprint_ty *diff_file_fp;
00382 fingerprint_ty *idiff_file_fp;
00383 fstate_src_architecture_times_list_ty *architecture_times;
00384 string_ty *move;
00385 long locked_by;
00386 long about_to_be_created_by;
00387 long about_to_be_copied_by;
00388 long deleted_by;
00389 fstate_src_test_list_ty *test;
00390 metric_list_ty *metrics;
00391 bool executable;
00392 attributes_list_ty *attribute;
00393 };
00394 #endif // fstate_src_DEF
00395
00396 extern meta_type fstate_src_type;
00397
00398 void fstate_src_write(const output::pointer &fp, const char *name, fstate_src_ty *value);
00399 void fstate_src_write_xml(const output::pointer &fp, const char *name, fstate_src_ty *value);
00400 fstate_src_ty *fstate_src_copy(fstate_src_ty *);
00401 fstate_src_ty *fstate_src_clone(fstate_src_ty *);
00402 #ifdef DEBUG
00403 void fstate_src_trace_real(const char *name, const fstate_src_ty *value);
00404 #define fstate_src_trace(x) ((void)(trace_pretest_ && (trace_where_, fstate_src_trace_real(trace_stringize(x), x), 0)))
00405 #else
00406 #define fstate_src_trace(x)
00407 #endif
00408
00409 #ifndef fstate_src_list_DEF
00410 #define fstate_src_list_DEF
00411 struct fstate_src_list_ty
00412 {
00413 size_t length;
00414 size_t maximum;
00415 fstate_src_ty **list;
00416 };
00417 #endif // fstate_src_list_DEF
00418
00419 extern meta_type fstate_src_list_type;
00420
00421 fstate_src_list_ty *fstate_src_list_copy(fstate_src_list_ty *);
00422 fstate_src_list_ty *fstate_src_list_clone(fstate_src_list_ty *);
00423 void fstate_src_list_write(const output::pointer &fp, const char *name, fstate_src_list_ty *value);
00424 void fstate_src_list_write_xml(const output::pointer &fp, const char *name, fstate_src_list_ty *value);
00425 #ifdef DEBUG
00426 void fstate_src_list_trace_real(const char *name, const fstate_src_list_ty *value);
00427 #define fstate_src_list_trace(x) ((void)(trace_pretest_ && (trace_where_, fstate_src_list_trace_real(trace_stringize(x), x), 0)))
00428 #else
00429 #define fstate_src_list_trace(x)
00430 #endif
00431
00432 #ifndef fstate_DEF
00433 #define fstate_DEF
00434
00435 #define fstate_src_mask ((unsigned long)0)
00436
00437 struct fstate_ty
00438 {
00439 long reference_count;
00440 unsigned long mask;
00441 string_ty *errpos;
00442 fstate_src_list_ty *src;
00443 };
00444 #endif // fstate_DEF
00445
00446 extern meta_type fstate_type;
00447
00448 void fstate_write(const output::pointer &fp, fstate_ty *value);
00449 void fstate_write_xml(const output::pointer &fp, fstate_ty *value);
00450 fstate_ty *fstate_copy(fstate_ty *);
00451 fstate_ty *fstate_clone(fstate_ty *);
00452 #ifdef DEBUG
00453 void fstate_trace_real(const char *name, const fstate_ty *value);
00454 #define fstate_trace(x) ((void)(trace_pretest_ && (trace_where_, fstate_trace_real(trace_stringize(x), x), 0)))
00455 #else
00456 #define fstate_trace(x)
00457 #endif
00458
00475 void fstate_write_file(string_ty *filename, fstate_ty *value, int comp);
00476
00493 void fstate_write_file(const nstring &filnam, fstate_ty *value, bool comp);
00494
00511 fstate_ty *fstate_read_file(string_ty *filename);
00512
00529 fstate_ty *fstate_read_file(const nstring &filename);
00530 void fstate__rpt_init(void);
00531
00532 #endif // LIBAEGIS_FSTATE_H