#include #include #include #include #include #include #include #include #include #include #include #include void tstrslt_test_result_write(fp, name, this) output_ty *fp; char *name; tstrslt_test_result this; { if (!this) return; trace(("tstrslt_test_result_write(name = \"%s\", this = %08lX)\n{\n"/*}*/, name, (long)this)); assert(((tstrslt_test_result)this)->reference_count > 0); trace(("rc = %d;\n", ((tstrslt_test_result)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); integer_write(fp, "exit_status", this->exit_status); output_fputs(fp, /*{*/"}"); if (name) output_fputs(fp, ";\n"); trace((/*{*/"}\n")); } static void *tstrslt_test_result_alloc _((void)); static void * tstrslt_test_result_alloc() { tstrslt_test_result this; trace(("tstrslt_test_result_alloc()\n{\n"/*}*/)); this = mem_alloc(sizeof(struct tstrslt_test_result)); this->reference_count = 1; this->mask = 0; this->file_name = 0; this->exit_status = 0; trace(("return %08lX;\n", (long)this)); trace((/*{*/"}\n")); return this; } tstrslt_test_result tstrslt_test_result_copy(this) tstrslt_test_result this; { trace(("tstrslt_test_result_copy()\n{\n"/*}*/)); this->reference_count++; trace(("return %08lX;\n", (long)this)); trace((/*{*/"}\n")); return this; } static void tstrslt_test_result_free _((void *)); static void tstrslt_test_result_free(that) void *that; { tstrslt_test_result this = that; if (!this) return; this->reference_count--; assert(this->reference_count >= 0); if (this->reference_count > 0) return; trace(("tstrslt_test_result_free(this = %08lX)\n{\n"/*}*/, (long)this)); str_free(this->file_name); mem_free(this); trace((/*{*/"}\n")); } static type_table_ty tstrslt_test_result_table[] = { { "file_name", offsetof(struct tstrslt_test_result, file_name), &string_type, tstrslt_test_result_file_name_mask, }, { "exit_status", offsetof(struct tstrslt_test_result, exit_status), &integer_type, tstrslt_test_result_exit_status_mask, }, }; static void *tstrslt_test_result_parse _((void *, string_ty *, type_ty **, unsigned long *)); static void * tstrslt_test_result_parse(this, name, type_pp, mask_p) void *this; string_ty *name; type_ty **type_pp; unsigned long *mask_p; { void *addr; trace(("tstrslt_test_result_parse(this = %08lX, name = %08lX, type_pp = %08lX)\n{\n"/*}*/, (long)this, (long)name, (long)type_pp)); assert(((tstrslt_test_result)this)->reference_count > 0); assert(sizeof(tstrslt_test_result) == sizeof(generic_struct_ty *)); addr = generic_struct_parse ( this, name, type_pp, mask_p, tstrslt_test_result_table, SIZEOF(tstrslt_test_result_table) ); trace((/*{*/"return %08lX;\n}\n", (long)addr)); return addr; } static string_ty *tstrslt_test_result_fuzzy _((string_ty *)); static string_ty * tstrslt_test_result_fuzzy(name) string_ty *name; { string_ty *result; trace(("tstrslt_test_result_fuzzy(name = %08lX)\n{\n"/*}*/, (long)name)); result = generic_struct_fuzzy ( name, tstrslt_test_result_table, SIZEOF(tstrslt_test_result_table) ); trace(("return %08lX;\n", (long)result)); trace((/*{*/"}\n")); return result; } static struct rpt_value_ty *tstrslt_test_result_convert _((void *)); static struct rpt_value_ty * tstrslt_test_result_convert(this) void *this; { struct rpt_value_ty *result; trace(("tstrslt_test_result_convert(name = %08lX)\n{\n"/*}*/, (long)this)); assert(((tstrslt_test_result)this)->reference_count > 0); result = generic_struct_convert ( this, tstrslt_test_result_table, SIZEOF(tstrslt_test_result_table) ); trace(("return %08lX;\n", (long)result)); trace((/*{*/"}\n")); return result; } type_ty tstrslt_test_result_type = { "tstrslt_test_result", tstrslt_test_result_alloc, tstrslt_test_result_free, 0, /* enum_parse */ 0, /* list_parse */ tstrslt_test_result_parse, tstrslt_test_result_fuzzy, tstrslt_test_result_convert, generic_struct_is_set, }; #include void tstrslt_test_result_list_write(fp, name, this) output_ty *fp; char *name; tstrslt_test_result_list this; { size_t j; if (!this) return; trace(("tstrslt_test_result_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) { tstrslt_test_result_write(fp, (char *)0, this->list[j]); output_fputs(fp, ",\n"); } output_fputs(fp, /*[*/"]"); if (name) output_fputs(fp, ";\n"); trace((/*{*/"}\n")); } static void *tstrslt_test_result_list_alloc _((void)); static void * tstrslt_test_result_list_alloc() { tstrslt_test_result_list result; trace(("tstrslt_test_result_list_alloc()\n{\n"/*}*/)); result = mem_alloc(sizeof(struct tstrslt_test_result_list)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace((/*{*/"}\n")); return result; } static void tstrslt_test_result_list_free _((void *)); static void tstrslt_test_result_list_free(that) void *that; { tstrslt_test_result_list this = that; size_t j; if (!this) return; trace(("tstrslt_test_result_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) tstrslt_test_result_free(this->list[j]); if (this->list) mem_free(this->list); mem_free(this); trace((/*{*/"}\n")); } static void *tstrslt_test_result_list_parse _((void *, type_ty **)); static void * tstrslt_test_result_list_parse(that, type_pp) void *that; type_ty **type_pp; { tstrslt_test_result_list this = that; void *addr; trace(("tstrslt_test_result_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 = &tstrslt_test_result_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 *tstrslt_test_result_list_convert _((void *)); static rpt_value_ty * tstrslt_test_result_list_convert(that) void *that; { tstrslt_test_result_list this; rpt_value_ty *result; size_t j; rpt_value_ty *vp; this = *(tstrslt_test_result_list *)that; if (!this) return 0; trace(("tstrslt_test_result_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 = tstrslt_test_result_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 tstrslt_test_result_list_type = { "tstrslt_test_result_list", tstrslt_test_result_list_alloc, tstrslt_test_result_list_free, 0, /* enum_parse */ tstrslt_test_result_list_parse, 0, /* struct_parse */ 0, /* fuzzy */ tstrslt_test_result_list_convert, generic_struct_is_set, }; void tstrslt_write(fp, this) output_ty *fp; tstrslt this; { if (!this) return; trace(("tstrslt_write(this = %08lX)\n{\n"/*}*/, this)); assert(((tstrslt)this)->reference_count > 0); trace(("rc = %d;\n", ((tstrslt)this)->reference_count)); tstrslt_test_result_list_write(fp, "test_result", this->test_result); trace((/*{*/"}\n")); } static void *tstrslt_alloc _((void)); static void * tstrslt_alloc() { tstrslt this; trace(("tstrslt_alloc()\n{\n"/*}*/)); this = mem_alloc(sizeof(struct tstrslt)); this->reference_count = 1; this->mask = 0; this->test_result = 0; trace(("return %08lX;\n", (long)this)); trace((/*{*/"}\n")); return this; } tstrslt tstrslt_copy(this) tstrslt this; { trace(("tstrslt_copy()\n{\n"/*}*/)); this->reference_count++; trace(("return %08lX;\n", (long)this)); trace((/*{*/"}\n")); return this; } static void tstrslt_free _((void *)); static void tstrslt_free(that) void *that; { tstrslt this = that; if (!this) return; this->reference_count--; assert(this->reference_count >= 0); if (this->reference_count > 0) return; trace(("tstrslt_free(this = %08lX)\n{\n"/*}*/, (long)this)); tstrslt_test_result_list_free(this->test_result); mem_free(this); trace((/*{*/"}\n")); } static type_table_ty tstrslt_table[] = { { "test_result", offsetof(struct tstrslt, test_result), &tstrslt_test_result_list_type, tstrslt_test_result_mask, }, }; static void *tstrslt_parse _((void *, string_ty *, type_ty **, unsigned long *)); static void * tstrslt_parse(this, name, type_pp, mask_p) void *this; string_ty *name; type_ty **type_pp; unsigned long *mask_p; { void *addr; trace(("tstrslt_parse(this = %08lX, name = %08lX, type_pp = %08lX)\n{\n"/*}*/, (long)this, (long)name, (long)type_pp)); assert(((tstrslt)this)->reference_count > 0); assert(sizeof(tstrslt) == sizeof(generic_struct_ty *)); addr = generic_struct_parse ( this, name, type_pp, mask_p, tstrslt_table, SIZEOF(tstrslt_table) ); trace((/*{*/"return %08lX;\n}\n", (long)addr)); return addr; } static string_ty *tstrslt_fuzzy _((string_ty *)); static string_ty * tstrslt_fuzzy(name) string_ty *name; { string_ty *result; trace(("tstrslt_fuzzy(name = %08lX)\n{\n"/*}*/, (long)name)); result = generic_struct_fuzzy ( name, tstrslt_table, SIZEOF(tstrslt_table) ); trace(("return %08lX;\n", (long)result)); trace((/*{*/"}\n")); return result; } static struct rpt_value_ty *tstrslt_convert _((void *)); static struct rpt_value_ty * tstrslt_convert(this) void *this; { struct rpt_value_ty *result; trace(("tstrslt_convert(name = %08lX)\n{\n"/*}*/, (long)this)); assert(((tstrslt)this)->reference_count > 0); result = generic_struct_convert ( this, tstrslt_table, SIZEOF(tstrslt_table) ); trace(("return %08lX;\n", (long)result)); trace((/*{*/"}\n")); return result; } type_ty tstrslt_type = { "tstrslt", tstrslt_alloc, tstrslt_free, 0, /* enum_parse */ 0, /* list_parse */ tstrslt_parse, tstrslt_fuzzy, tstrslt_convert, generic_struct_is_set, }; tstrslt tstrslt_read_file(filename) string_ty *filename; { tstrslt result; trace(("tstrslt_read_file(filename = \"%s\")\n{\n"/*}*/, (filename ? filename->str_text : ""))); os_become_must_be_active(); result = parse(filename, &tstrslt_type); trace(("return %08lX;\n", result)); trace((/*{*/"}\n")); return result; } void tstrslt_write_file(filename, value, compress) string_ty *filename; tstrslt value; int compress; { output_ty *fp; trace(("tstrslt_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); tstrslt_write(fp, value); type_enum_option_clear(); output_delete(fp); trace((/*{*/"}\n")); } void tstrslt__rpt_init() { trace(("tstrslt__rpt_init()\n{\n"/*}*/)); trace((/*{*/"}\n")); }