#include #include #include #include #include #include #include #include #include #include #include #include void fingerprint_write(fp, name, this) output_ty *fp; char *name; fingerprint this; { if (!this) return; trace(("fingerprint_write(name = \"%s\", this = %08lX)\n{\n"/*}*/, name, (long)this)); assert(((fingerprint)this)->reference_count > 0); trace(("rc = %d;\n", ((fingerprint)this)->reference_count)); if (name) { output_fputs(fp, name); output_fputs(fp, " =\n"); } output_fputs(fp, "{\n"/*}*/); time_write(fp, "youngest", this->youngest); time_write(fp, "oldest", this->oldest); string_write(fp, "crypto", this->crypto); output_fputs(fp, /*{*/"}"); if (name) output_fputs(fp, ";\n"); trace((/*{*/"}\n")); } static void *fingerprint_alloc _((void)); static void * fingerprint_alloc() { fingerprint this; trace(("fingerprint_alloc()\n{\n"/*}*/)); this = mem_alloc(sizeof(struct fingerprint)); this->reference_count = 1; this->mask = 0; this->youngest = 0; this->oldest = 0; this->crypto = 0; trace(("return %08lX;\n", (long)this)); trace((/*{*/"}\n")); return this; } fingerprint fingerprint_copy(this) fingerprint this; { trace(("fingerprint_copy()\n{\n"/*}*/)); this->reference_count++; trace(("return %08lX;\n", (long)this)); trace((/*{*/"}\n")); return this; } static void fingerprint_free _((void *)); static void fingerprint_free(that) void *that; { fingerprint this = that; if (!this) return; this->reference_count--; assert(this->reference_count >= 0); if (this->reference_count > 0) return; trace(("fingerprint_free(this = %08lX)\n{\n"/*}*/, (long)this)); str_free(this->crypto); mem_free(this); trace((/*{*/"}\n")); } static type_table_ty fingerprint_table[] = { { "youngest", offsetof(struct fingerprint, youngest), &time_type, fingerprint_youngest_mask, }, { "oldest", offsetof(struct fingerprint, oldest), &time_type, fingerprint_oldest_mask, }, { "crypto", offsetof(struct fingerprint, crypto), &string_type, fingerprint_crypto_mask, }, }; static void *fingerprint_parse _((void *, string_ty *, type_ty **, unsigned long *)); static void * fingerprint_parse(this, name, type_pp, mask_p) void *this; string_ty *name; type_ty **type_pp; unsigned long *mask_p; { void *addr; trace(("fingerprint_parse(this = %08lX, name = %08lX, type_pp = %08lX)\n{\n"/*}*/, (long)this, (long)name, (long)type_pp)); assert(((fingerprint)this)->reference_count > 0); assert(sizeof(fingerprint) == sizeof(generic_struct_ty *)); addr = generic_struct_parse ( this, name, type_pp, mask_p, fingerprint_table, SIZEOF(fingerprint_table) ); trace((/*{*/"return %08lX;\n}\n", (long)addr)); return addr; } static string_ty *fingerprint_fuzzy _((string_ty *)); static string_ty * fingerprint_fuzzy(name) string_ty *name; { string_ty *result; trace(("fingerprint_fuzzy(name = %08lX)\n{\n"/*}*/, (long)name)); result = generic_struct_fuzzy ( name, fingerprint_table, SIZEOF(fingerprint_table) ); trace(("return %08lX;\n", (long)result)); trace((/*{*/"}\n")); return result; } static struct rpt_value_ty *fingerprint_convert _((void *)); static struct rpt_value_ty * fingerprint_convert(this) void *this; { struct rpt_value_ty *result; trace(("fingerprint_convert(name = %08lX)\n{\n"/*}*/, (long)this)); assert(((fingerprint)this)->reference_count > 0); result = generic_struct_convert ( this, fingerprint_table, SIZEOF(fingerprint_table) ); trace(("return %08lX;\n", (long)result)); trace((/*{*/"}\n")); return result; } type_ty fingerprint_type = { "fingerprint", fingerprint_alloc, fingerprint_free, 0, /* enum_parse */ 0, /* list_parse */ fingerprint_parse, fingerprint_fuzzy, fingerprint_convert, generic_struct_is_set, }; void fstate_src_architecture_times_write(fp, name, this) output_ty *fp; char *name; fstate_src_architecture_times this; { if (!this) return; trace(("fstate_src_architecture_times_write(name = \"%s\", this = %08lX)\n{\n"/*}*/, name, (long)this)); assert(((fstate_src_architecture_times)this)->reference_count > 0); trace(("rc = %d;\n", ((fstate_src_architecture_times)this)->reference_count)); if (name) { output_fputs(fp, name); output_fputs(fp, " =\n"); } output_fputs(fp, "{\n"/*}*/); string_write(fp, "variant", this->variant); time_write(fp, "test_time", this->test_time); time_write(fp, "test_baseline_time", this->test_baseline_time); output_fputs(fp, /*{*/"}"); if (name) output_fputs(fp, ";\n"); trace((/*{*/"}\n")); } static void *fstate_src_architecture_times_alloc _((void)); static void * fstate_src_architecture_times_alloc() { fstate_src_architecture_times this; trace(("fstate_src_architecture_times_alloc()\n{\n"/*}*/)); this = mem_alloc(sizeof(struct fstate_src_architecture_times)); this->reference_count = 1; this->mask = 0; this->variant = 0; this->test_time = 0; this->test_baseline_time = 0; trace(("return %08lX;\n", (long)this)); trace((/*{*/"}\n")); return this; } fstate_src_architecture_times fstate_src_architecture_times_copy(this) fstate_src_architecture_times this; { trace(("fstate_src_architecture_times_copy()\n{\n"/*}*/)); this->reference_count++; trace(("return %08lX;\n", (long)this)); trace((/*{*/"}\n")); return this; } static void fstate_src_architecture_times_free _((void *)); static void fstate_src_architecture_times_free(that) void *that; { fstate_src_architecture_times this = that; if (!this) return; this->reference_count--; assert(this->reference_count >= 0); if (this->reference_count > 0) return; trace(("fstate_src_architecture_times_free(this = %08lX)\n{\n"/*}*/, (long)this)); str_free(this->variant); mem_free(this); trace((/*{*/"}\n")); } static type_table_ty fstate_src_architecture_times_table[] = { { "variant", offsetof(struct fstate_src_architecture_times, variant), &string_type, fstate_src_architecture_times_variant_mask, }, { "test_time", offsetof(struct fstate_src_architecture_times, test_time), &time_type, fstate_src_architecture_times_test_time_mask, }, { "test_baseline_time", offsetof(struct fstate_src_architecture_times, test_baseline_time), &time_type, fstate_src_architecture_times_test_baseline_time_mask, }, }; static void *fstate_src_architecture_times_parse _((void *, string_ty *, type_ty **, unsigned long *)); static void * fstate_src_architecture_times_parse(this, name, type_pp, mask_p) void *this; string_ty *name; type_ty **type_pp; unsigned long *mask_p; { void *addr; trace(("fstate_src_architecture_times_parse(this = %08lX, name = %08lX, type_pp = %08lX)\n{\n"/*}*/, (long)this, (long)name, (long)type_pp)); assert(((fstate_src_architecture_times)this)->reference_count > 0); assert(sizeof(fstate_src_architecture_times) == sizeof(generic_struct_ty *)); addr = generic_struct_parse ( this, name, type_pp, mask_p, fstate_src_architecture_times_table, SIZEOF(fstate_src_architecture_times_table) ); trace((/*{*/"return %08lX;\n}\n", (long)addr)); return addr; } static string_ty *fstate_src_architecture_times_fuzzy _((string_ty *)); static string_ty * fstate_src_architecture_times_fuzzy(name) string_ty *name; { string_ty *result; trace(("fstate_src_architecture_times_fuzzy(name = %08lX)\n{\n"/*}*/, (long)name)); result = generic_struct_fuzzy ( name, fstate_src_architecture_times_table, SIZEOF(fstate_src_architecture_times_table) ); trace(("return %08lX;\n", (long)result)); trace((/*{*/"}\n")); return result; } static struct rpt_value_ty *fstate_src_architecture_times_convert _((void *)); static struct rpt_value_ty * fstate_src_architecture_times_convert(this) void *this; { struct rpt_value_ty *result; trace(("fstate_src_architecture_times_convert(name = %08lX)\n{\n"/*}*/, (long)this)); assert(((fstate_src_architecture_times)this)->reference_count > 0); result = generic_struct_convert ( this, fstate_src_architecture_times_table, SIZEOF(fstate_src_architecture_times_table) ); trace(("return %08lX;\n", (long)result)); trace((/*{*/"}\n")); return result; } type_ty fstate_src_architecture_times_type = { "fstate_src_architecture_times", fstate_src_architecture_times_alloc, fstate_src_architecture_times_free, 0, /* enum_parse */ 0, /* list_parse */ fstate_src_architecture_times_parse, fstate_src_architecture_times_fuzzy, fstate_src_architecture_times_convert, generic_struct_is_set, }; #include void fstate_src_architecture_times_list_write(fp, name, this) output_ty *fp; char *name; fstate_src_architecture_times_list this; { size_t j; if (!this) return; trace(("fstate_src_architecture_times_list_write(name = \"%s\", this = %08lX)\n{\n"/*}*/, name, (long)this)); if (name) { output_fputs(fp, name); output_fputs(fp, " =\n"); } assert(this->length <= this->maximum); assert(!this->list == !this->maximum); output_fputs(fp, "[\n"/*]*/); for (j = 0; j < this->length; ++j) { fstate_src_architecture_times_write(fp, (char *)0, this->list[j]); output_fputs(fp, ",\n"); } output_fputs(fp, /*[*/"]"); if (name) output_fputs(fp, ";\n"); trace((/*{*/"}\n")); } static void *fstate_src_architecture_times_list_alloc _((void)); static void * fstate_src_architecture_times_list_alloc() { fstate_src_architecture_times_list result; trace(("fstate_src_architecture_times_list_alloc()\n{\n"/*}*/)); result = mem_alloc(sizeof(struct fstate_src_architecture_times_list)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace((/*{*/"}\n")); return result; } static void fstate_src_architecture_times_list_free _((void *)); static void fstate_src_architecture_times_list_free(that) void *that; { fstate_src_architecture_times_list this = that; size_t j; if (!this) return; trace(("fstate_src_architecture_times_list_free(this = %08lX)\n{\n"/*}*/, (long)this)); assert(this->length <= this->maximum); assert(!this->list == !this->maximum); for (j = 0; j < this->length; ++j) fstate_src_architecture_times_free(this->list[j]); if (this->list) mem_free(this->list); mem_free(this); trace((/*{*/"}\n")); } static void *fstate_src_architecture_times_list_parse _((void *, type_ty **)); static void * fstate_src_architecture_times_list_parse(that, type_pp) void *that; type_ty **type_pp; { fstate_src_architecture_times_list this = that; void *addr; trace(("fstate_src_architecture_times_list_parse(this = %08lX, type_pp = %08lX)\n{\n"/*}*/, (long)this, (long)type_pp)); assert(this->length <= this->maximum); assert(!this->list == !this->maximum); *type_pp = &fstate_src_architecture_times_type; trace_pointer(*type_pp); if (this->length >= this->maximum) { size_t nbytes; this->maximum = this->maximum * 2 + 16; nbytes = this->maximum * sizeof(this->list[0]); this->list = mem_change_size(this->list, nbytes); } addr = &this->list[this->length++]; trace(("return %08lX;\n", (long)addr)); trace((/*{*/"}\n")); return addr; } static rpt_value_ty *fstate_src_architecture_times_list_convert _((void *)); static rpt_value_ty * fstate_src_architecture_times_list_convert(that) void *that; { fstate_src_architecture_times_list this; rpt_value_ty *result; size_t j; rpt_value_ty *vp; this = *(fstate_src_architecture_times_list *)that; if (!this) return 0; trace(("fstate_src_architecture_times_list_convert(this = %08lX)\n{\n"/*}*/, (long)this)); assert(this->length <= this->maximum); assert(!this->list == !this->maximum); result = rpt_value_list(); for (j = 0; j < this->length; ++j) { vp = fstate_src_architecture_times_type.convert(&this->list[j]); assert(vp); rpt_value_list_append(result, vp); rpt_value_free(vp); } trace((/*{*/"}\n")); trace(("return %08lX;\n", (long)result)); return result; } type_ty fstate_src_architecture_times_list_type = { "fstate_src_architecture_times_list", fstate_src_architecture_times_list_alloc, fstate_src_architecture_times_list_free, 0, /* enum_parse */ fstate_src_architecture_times_list_parse, 0, /* struct_parse */ 0, /* fuzzy */ fstate_src_architecture_times_list_convert, generic_struct_is_set, }; void fstate_src_test_list_write(fp, name, this) output_ty *fp; char *name; fstate_src_test_list this; { size_t j; if (!this) return; trace(("fstate_src_test_list_write(name = \"%s\", this = %08lX)\n{\n"/*}*/, name, (long)this)); if (name) { output_fputs(fp, name); output_fputs(fp, " =\n"); } assert(this->length <= this->maximum); assert(!this->list == !this->maximum); output_fputs(fp, "[\n"/*]*/); for (j = 0; j < this->length; ++j) { string_write(fp, (char *)0, this->list[j]); output_fputs(fp, ",\n"); } output_fputs(fp, /*[*/"]"); if (name) output_fputs(fp, ";\n"); trace((/*{*/"}\n")); } static void *fstate_src_test_list_alloc _((void)); static void * fstate_src_test_list_alloc() { fstate_src_test_list result; trace(("fstate_src_test_list_alloc()\n{\n"/*}*/)); result = mem_alloc(sizeof(struct fstate_src_test_list)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace((/*{*/"}\n")); return result; } static void fstate_src_test_list_free _((void *)); static void fstate_src_test_list_free(that) void *that; { fstate_src_test_list this = that; size_t j; if (!this) return; trace(("fstate_src_test_list_free(this = %08lX)\n{\n"/*}*/, (long)this)); assert(this->length <= this->maximum); assert(!this->list == !this->maximum); for (j = 0; j < this->length; ++j) str_free(this->list[j]); if (this->list) mem_free(this->list); mem_free(this); trace((/*{*/"}\n")); } static void *fstate_src_test_list_parse _((void *, type_ty **)); static void * fstate_src_test_list_parse(that, type_pp) void *that; type_ty **type_pp; { fstate_src_test_list this = that; void *addr; trace(("fstate_src_test_list_parse(this = %08lX, type_pp = %08lX)\n{\n"/*}*/, (long)this, (long)type_pp)); assert(this->length <= this->maximum); assert(!this->list == !this->maximum); *type_pp = &string_type; trace_pointer(*type_pp); if (this->length >= this->maximum) { size_t nbytes; this->maximum = this->maximum * 2 + 16; nbytes = this->maximum * sizeof(this->list[0]); this->list = mem_change_size(this->list, nbytes); } addr = &this->list[this->length++]; trace(("return %08lX;\n", (long)addr)); trace((/*{*/"}\n")); return addr; } static rpt_value_ty *fstate_src_test_list_convert _((void *)); static rpt_value_ty * fstate_src_test_list_convert(that) void *that; { fstate_src_test_list this; rpt_value_ty *result; size_t j; rpt_value_ty *vp; this = *(fstate_src_test_list *)that; if (!this) return 0; trace(("fstate_src_test_list_convert(this = %08lX)\n{\n"/*}*/, (long)this)); assert(this->length <= this->maximum); assert(!this->list == !this->maximum); result = rpt_value_list(); for (j = 0; j < this->length; ++j) { vp = string_type.convert(&this->list[j]); assert(vp); rpt_value_list_append(result, vp); rpt_value_free(vp); } trace((/*{*/"}\n")); trace(("return %08lX;\n", (long)result)); return result; } type_ty fstate_src_test_list_type = { "fstate_src_test_list", fstate_src_test_list_alloc, fstate_src_test_list_free, 0, /* enum_parse */ fstate_src_test_list_parse, 0, /* struct_parse */ 0, /* fuzzy */ fstate_src_test_list_convert, generic_struct_is_set, }; void fstate_src_write(fp, name, this) output_ty *fp; char *name; fstate_src this; { if (!this) return; trace(("fstate_src_write(name = \"%s\", this = %08lX)\n{\n"/*}*/, name, (long)this)); assert(((fstate_src)this)->reference_count > 0); trace(("rc = %d;\n", ((fstate_src)this)->reference_count)); if (name) { output_fputs(fp, name); output_fputs(fp, " =\n"); } output_fputs(fp, "{\n"/*}*/); string_write(fp, "file_name", this->file_name); file_action_write(fp, "action", this->action); history_version_write(fp, "edit", this->edit); string_write(fp, "edit_number", this->edit_number); history_version_write(fp, "edit_origin", this->edit_origin); string_write(fp, "edit_number_origin", this->edit_number_origin); history_version_write(fp, "edit_origin_new", this->edit_origin_new); string_write(fp, "edit_number_origin_new", this->edit_number_origin_new); file_usage_write(fp, "usage", this->usage); fingerprint_write(fp, "file_fp", this->file_fp); fingerprint_write(fp, "diff_file_fp", this->diff_file_fp); fingerprint_write(fp, "idiff_file_fp", this->idiff_file_fp); fstate_src_architecture_times_list_write(fp, "architecture_times", this->architecture_times); string_write(fp, "move", this->move); integer_write(fp, "locked_by", this->locked_by); integer_write(fp, "about_to_be_created_by", this->about_to_be_created_by); integer_write(fp, "about_to_be_copied_by", this->about_to_be_copied_by); integer_write(fp, "deleted_by", this->deleted_by); fstate_src_test_list_write(fp, "test", this->test); metric_list_write(fp, "metrics", this->metrics); output_fputs(fp, /*{*/"}"); if (name) output_fputs(fp, ";\n"); trace((/*{*/"}\n")); } static void *fstate_src_alloc _((void)); static void * fstate_src_alloc() { fstate_src this; trace(("fstate_src_alloc()\n{\n"/*}*/)); this = mem_alloc(sizeof(struct fstate_src)); this->reference_count = 1; this->mask = 0; this->file_name = 0; this->action = 0; this->edit = 0; this->edit_number = 0; this->edit_origin = 0; this->edit_number_origin = 0; this->edit_origin_new = 0; this->edit_number_origin_new = 0; this->usage = 0; this->file_fp = 0; this->diff_file_fp = 0; this->idiff_file_fp = 0; this->architecture_times = 0; this->move = 0; this->locked_by = 0; this->about_to_be_created_by = 0; this->about_to_be_copied_by = 0; this->deleted_by = 0; this->test = 0; this->metrics = 0; trace(("return %08lX;\n", (long)this)); trace((/*{*/"}\n")); return this; } fstate_src fstate_src_copy(this) fstate_src this; { trace(("fstate_src_copy()\n{\n"/*}*/)); this->reference_count++; trace(("return %08lX;\n", (long)this)); trace((/*{*/"}\n")); return this; } static void fstate_src_free _((void *)); static void fstate_src_free(that) void *that; { fstate_src this = that; if (!this) return; this->reference_count--; assert(this->reference_count >= 0); if (this->reference_count > 0) return; trace(("fstate_src_free(this = %08lX)\n{\n"/*}*/, (long)this)); str_free(this->file_name); history_version_type.free(this->edit); str_free(this->edit_number); history_version_type.free(this->edit_origin); str_free(this->edit_number_origin); history_version_type.free(this->edit_origin_new); str_free(this->edit_number_origin_new); fingerprint_free(this->file_fp); fingerprint_free(this->diff_file_fp); fingerprint_free(this->idiff_file_fp); fstate_src_architecture_times_list_free(this->architecture_times); str_free(this->move); fstate_src_test_list_free(this->test); metric_list_type.free(this->metrics); mem_free(this); trace((/*{*/"}\n")); } static type_table_ty fstate_src_table[] = { { "file_name", offsetof(struct fstate_src, file_name), &string_type, fstate_src_file_name_mask, }, { "action", offsetof(struct fstate_src, action), &file_action_type, fstate_src_action_mask, }, { "edit", offsetof(struct fstate_src, edit), &history_version_type, fstate_src_edit_mask, }, { "edit_number", offsetof(struct fstate_src, edit_number), &string_type, fstate_src_edit_number_mask, }, { "edit_origin", offsetof(struct fstate_src, edit_origin), &history_version_type, fstate_src_edit_origin_mask, }, { "edit_number_origin", offsetof(struct fstate_src, edit_number_origin), &string_type, fstate_src_edit_number_origin_mask, }, { "edit_origin_new", offsetof(struct fstate_src, edit_origin_new), &history_version_type, fstate_src_edit_origin_new_mask, }, { "edit_number_origin_new", offsetof(struct fstate_src, edit_number_origin_new), &string_type, fstate_src_edit_number_origin_new_mask, }, { "usage", offsetof(struct fstate_src, usage), &file_usage_type, fstate_src_usage_mask, }, { "file_fp", offsetof(struct fstate_src, file_fp), &fingerprint_type, fstate_src_file_fp_mask, }, { "diff_file_fp", offsetof(struct fstate_src, diff_file_fp), &fingerprint_type, fstate_src_diff_file_fp_mask, }, { "idiff_file_fp", offsetof(struct fstate_src, idiff_file_fp), &fingerprint_type, fstate_src_idiff_file_fp_mask, }, { "architecture_times", offsetof(struct fstate_src, architecture_times), &fstate_src_architecture_times_list_type, fstate_src_architecture_times_mask, }, { "move", offsetof(struct fstate_src, move), &string_type, fstate_src_move_mask, }, { "locked_by", offsetof(struct fstate_src, locked_by), &integer_type, fstate_src_locked_by_mask, }, { "about_to_be_created_by", offsetof(struct fstate_src, about_to_be_created_by), &integer_type, fstate_src_about_to_be_created_by_mask, }, { "about_to_be_copied_by", offsetof(struct fstate_src, about_to_be_copied_by), &integer_type, fstate_src_about_to_be_copied_by_mask, }, { "deleted_by", offsetof(struct fstate_src, deleted_by), &integer_type, fstate_src_deleted_by_mask, }, { "test", offsetof(struct fstate_src, test), &fstate_src_test_list_type, fstate_src_test_mask, }, { "metrics", offsetof(struct fstate_src, metrics), &metric_list_type, fstate_src_metrics_mask, }, }; static void *fstate_src_parse _((void *, string_ty *, type_ty **, unsigned long *)); static void * fstate_src_parse(this, name, type_pp, mask_p) void *this; string_ty *name; type_ty **type_pp; unsigned long *mask_p; { void *addr; trace(("fstate_src_parse(this = %08lX, name = %08lX, type_pp = %08lX)\n{\n"/*}*/, (long)this, (long)name, (long)type_pp)); assert(((fstate_src)this)->reference_count > 0); assert(sizeof(fstate_src) == sizeof(generic_struct_ty *)); addr = generic_struct_parse ( this, name, type_pp, mask_p, fstate_src_table, SIZEOF(fstate_src_table) ); trace((/*{*/"return %08lX;\n}\n", (long)addr)); return addr; } static string_ty *fstate_src_fuzzy _((string_ty *)); static string_ty * fstate_src_fuzzy(name) string_ty *name; { string_ty *result; trace(("fstate_src_fuzzy(name = %08lX)\n{\n"/*}*/, (long)name)); result = generic_struct_fuzzy ( name, fstate_src_table, SIZEOF(fstate_src_table) ); trace(("return %08lX;\n", (long)result)); trace((/*{*/"}\n")); return result; } static struct rpt_value_ty *fstate_src_convert _((void *)); static struct rpt_value_ty * fstate_src_convert(this) void *this; { struct rpt_value_ty *result; trace(("fstate_src_convert(name = %08lX)\n{\n"/*}*/, (long)this)); assert(((fstate_src)this)->reference_count > 0); result = generic_struct_convert ( this, fstate_src_table, SIZEOF(fstate_src_table) ); trace(("return %08lX;\n", (long)result)); trace((/*{*/"}\n")); return result; } type_ty fstate_src_type = { "fstate_src", fstate_src_alloc, fstate_src_free, 0, /* enum_parse */ 0, /* list_parse */ fstate_src_parse, fstate_src_fuzzy, fstate_src_convert, generic_struct_is_set, }; void fstate_src_list_write(fp, name, this) output_ty *fp; char *name; fstate_src_list this; { size_t j; if (!this) return; trace(("fstate_src_list_write(name = \"%s\", this = %08lX)\n{\n"/*}*/, name, (long)this)); if (name) { output_fputs(fp, name); output_fputs(fp, " =\n"); } assert(this->length <= this->maximum); assert(!this->list == !this->maximum); output_fputs(fp, "[\n"/*]*/); for (j = 0; j < this->length; ++j) { fstate_src_write(fp, (char *)0, this->list[j]); output_fputs(fp, ",\n"); } output_fputs(fp, /*[*/"]"); if (name) output_fputs(fp, ";\n"); trace((/*{*/"}\n")); } static void *fstate_src_list_alloc _((void)); static void * fstate_src_list_alloc() { fstate_src_list result; trace(("fstate_src_list_alloc()\n{\n"/*}*/)); result = mem_alloc(sizeof(struct fstate_src_list)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace((/*{*/"}\n")); return result; } static void fstate_src_list_free _((void *)); static void fstate_src_list_free(that) void *that; { fstate_src_list this = that; size_t j; if (!this) return; trace(("fstate_src_list_free(this = %08lX)\n{\n"/*}*/, (long)this)); assert(this->length <= this->maximum); assert(!this->list == !this->maximum); for (j = 0; j < this->length; ++j) fstate_src_free(this->list[j]); if (this->list) mem_free(this->list); mem_free(this); trace((/*{*/"}\n")); } static void *fstate_src_list_parse _((void *, type_ty **)); static void * fstate_src_list_parse(that, type_pp) void *that; type_ty **type_pp; { fstate_src_list this = that; void *addr; trace(("fstate_src_list_parse(this = %08lX, type_pp = %08lX)\n{\n"/*}*/, (long)this, (long)type_pp)); assert(this->length <= this->maximum); assert(!this->list == !this->maximum); *type_pp = &fstate_src_type; trace_pointer(*type_pp); if (this->length >= this->maximum) { size_t nbytes; this->maximum = this->maximum * 2 + 16; nbytes = this->maximum * sizeof(this->list[0]); this->list = mem_change_size(this->list, nbytes); } addr = &this->list[this->length++]; trace(("return %08lX;\n", (long)addr)); trace((/*{*/"}\n")); return addr; } static rpt_value_ty *fstate_src_list_convert _((void *)); static rpt_value_ty * fstate_src_list_convert(that) void *that; { fstate_src_list this; rpt_value_ty *result; size_t j; rpt_value_ty *vp; this = *(fstate_src_list *)that; if (!this) return 0; trace(("fstate_src_list_convert(this = %08lX)\n{\n"/*}*/, (long)this)); assert(this->length <= this->maximum); assert(!this->list == !this->maximum); result = rpt_value_list(); for (j = 0; j < this->length; ++j) { vp = fstate_src_type.convert(&this->list[j]); assert(vp); rpt_value_list_append(result, vp); rpt_value_free(vp); } trace((/*{*/"}\n")); trace(("return %08lX;\n", (long)result)); return result; } type_ty fstate_src_list_type = { "fstate_src_list", fstate_src_list_alloc, fstate_src_list_free, 0, /* enum_parse */ fstate_src_list_parse, 0, /* struct_parse */ 0, /* fuzzy */ fstate_src_list_convert, generic_struct_is_set, }; void fstate_write(fp, this) output_ty *fp; fstate this; { if (!this) return; trace(("fstate_write(this = %08lX)\n{\n"/*}*/, this)); assert(((fstate)this)->reference_count > 0); trace(("rc = %d;\n", ((fstate)this)->reference_count)); fstate_src_list_write(fp, "src", this->src); trace((/*{*/"}\n")); } static void *fstate_alloc _((void)); static void * fstate_alloc() { fstate this; trace(("fstate_alloc()\n{\n"/*}*/)); this = mem_alloc(sizeof(struct fstate)); this->reference_count = 1; this->mask = 0; this->src = 0; trace(("return %08lX;\n", (long)this)); trace((/*{*/"}\n")); return this; } fstate fstate_copy(this) fstate this; { trace(("fstate_copy()\n{\n"/*}*/)); this->reference_count++; trace(("return %08lX;\n", (long)this)); trace((/*{*/"}\n")); return this; } static void fstate_free _((void *)); static void fstate_free(that) void *that; { fstate this = that; if (!this) return; this->reference_count--; assert(this->reference_count >= 0); if (this->reference_count > 0) return; trace(("fstate_free(this = %08lX)\n{\n"/*}*/, (long)this)); fstate_src_list_free(this->src); mem_free(this); trace((/*{*/"}\n")); } static type_table_ty fstate_table[] = { { "src", offsetof(struct fstate, src), &fstate_src_list_type, fstate_src_mask, }, }; static void *fstate_parse _((void *, string_ty *, type_ty **, unsigned long *)); static void * fstate_parse(this, name, type_pp, mask_p) void *this; string_ty *name; type_ty **type_pp; unsigned long *mask_p; { void *addr; trace(("fstate_parse(this = %08lX, name = %08lX, type_pp = %08lX)\n{\n"/*}*/, (long)this, (long)name, (long)type_pp)); assert(((fstate)this)->reference_count > 0); assert(sizeof(fstate) == sizeof(generic_struct_ty *)); addr = generic_struct_parse ( this, name, type_pp, mask_p, fstate_table, SIZEOF(fstate_table) ); trace((/*{*/"return %08lX;\n}\n", (long)addr)); return addr; } static string_ty *fstate_fuzzy _((string_ty *)); static string_ty * fstate_fuzzy(name) string_ty *name; { string_ty *result; trace(("fstate_fuzzy(name = %08lX)\n{\n"/*}*/, (long)name)); result = generic_struct_fuzzy ( name, fstate_table, SIZEOF(fstate_table) ); trace(("return %08lX;\n", (long)result)); trace((/*{*/"}\n")); return result; } static struct rpt_value_ty *fstate_convert _((void *)); static struct rpt_value_ty * fstate_convert(this) void *this; { struct rpt_value_ty *result; trace(("fstate_convert(name = %08lX)\n{\n"/*}*/, (long)this)); assert(((fstate)this)->reference_count > 0); result = generic_struct_convert ( this, fstate_table, SIZEOF(fstate_table) ); trace(("return %08lX;\n", (long)result)); trace((/*{*/"}\n")); return result; } type_ty fstate_type = { "fstate", fstate_alloc, fstate_free, 0, /* enum_parse */ 0, /* list_parse */ fstate_parse, fstate_fuzzy, fstate_convert, generic_struct_is_set, }; fstate fstate_read_file(filename) string_ty *filename; { fstate result; trace(("fstate_read_file(filename = \"%s\")\n{\n"/*}*/, (filename ? filename->str_text : ""))); os_become_must_be_active(); result = parse(filename, &fstate_type); trace(("return %08lX;\n", result)); trace((/*{*/"}\n")); return result; } void fstate_write_file(filename, value, compress) string_ty *filename; fstate value; int compress; { output_ty *fp; trace(("fstate_write_file(filename = \"%s\", value = %08lX)\n{\n"/*}*/, (filename ? filename->str_text : ""), (long)value)); if (filename) os_become_must_be_active(); if (compress) { fp = output_file_binary_open(filename); fp = output_gzip(fp); } else { fp = output_file_text_open(filename); } fp = output_indent(fp); io_comment_emit(fp); fstate_write(fp, value); type_enum_option_clear(); output_delete(fp); trace((/*{*/"}\n")); } void fstate__rpt_init() { trace(("fstate__rpt_init()\n{\n"/*}*/)); trace((/*{*/"}\n")); }