// // This file is generated by fmtgen from "libaegis/cstate.def". // If you want to change the contents of this file // you need to edit libaegis/cstate.def // or you need to enhance fmtgen. // #include #include #include #include #include #include #include #include #include #include #include #include #include void cstate_architecture_list_write(const output::pointer &fp, const char *name, cstate_architecture_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_architecture_list_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); fp->fputs("[\n"); for (j = 0; j < this_thing->length; ++j) { string_write(fp, (const char *)0, this_thing->list[j]); fp->fputs(",\n"); } fp->fputs("]"); if (name) fp->fputs(";\n"); trace(("}\n")); } void cstate_architecture_list_write_xml(const output::pointer &fp, const char *name, cstate_architecture_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_architecture_list_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) { string_write_xml(fp, "string", this_thing->list[j]); } fp->fputs("fputs(name); fp->fputs(">\n"); trace(("}\n")); } static void * cstate_architecture_list_alloc(void) { cstate_architecture_list_ty *result; trace(("cstate_architecture_list_alloc()\n{\n")); result = (cstate_architecture_list_ty *)mem_alloc(sizeof(cstate_architecture_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void cstate_architecture_list_free(void *that) { cstate_architecture_list_ty *this_thing; size_t j; this_thing = (cstate_architecture_list_ty *)that; if (!this_thing) return; trace(("cstate_architecture_list_free(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) str_free(this_thing->list[j]); delete [] this_thing->list; mem_free(this_thing); trace(("}\n")); } static void * cstate_architecture_list_parse(void *that, meta_type **type_pp) { cstate_architecture_list_ty *this_thing; void *addr; this_thing = (cstate_architecture_list_ty *)that; trace(("cstate_architecture_list_parse(this_thing = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)type_pp)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); *type_pp = &string_type; trace_pointer(*type_pp); if (this_thing->length >= this_thing->maximum) { this_thing->maximum = this_thing->maximum * 2 + 16; string_ty * *new_list = new string_ty * [this_thing->maximum]; for (size_t j = 0; j < this_thing->length; ++j) new_list[j] = this_thing->list[j]; delete [] this_thing->list; this_thing->list = new_list; } addr = &this_thing->list[this_thing->length++]; trace(("return %08lX;\n", (long)addr)); trace(("}\n")); return addr; } static rpt_value::pointer cstate_architecture_list_convert(void *that) { cstate_architecture_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(cstate_architecture_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("cstate_architecture_list_convert(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); rpt_value_list *p = new rpt_value_list(); rpt_value::pointer result(p); for (j = 0; j < this_thing->length; ++j) { vp = string_type.convert(&this_thing->list[j]); assert(vp); p->append(vp); } trace(("}\n")); trace(("return %08lX;\n", (long)result.get())); return result; } cstate_architecture_list_ty * cstate_architecture_list_copy(cstate_architecture_list_ty *from) { size_t j; cstate_architecture_list_ty *result; if (!from) return 0; trace(("cstate_architecture_list_copy(from = %08lX)\n{\n", (long)from)); result = (cstate_architecture_list_ty *)cstate_architecture_list_alloc(); assert(from->length <= from->maximum); assert(!from->list == !from->maximum); for (j = 0; j < from->length; ++j) { string_ty * mp; string_ty * *mpp; meta_type *bogus; mp = from->list[j]; mpp = (string_ty **)cstate_architecture_list_parse(result, &bogus); *mpp = string_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } cstate_architecture_list_ty * cstate_architecture_list_clone(cstate_architecture_list_ty *from) { return cstate_architecture_list_copy(from); } #ifdef DEBUG void cstate_architecture_list_trace_real(const char *name, const cstate_architecture_list_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("[\n"); trace_printf("// length = %ld\n", (long)value->length); trace_printf("// maximum = %ld\n", (long)value->maximum); assert(value->length <= value->maximum); assert(!value->list == !value->maximum); for (size_t j = 0; j < value->length; ++j) { string_ty * mp = value->list[j]; trace_string_real("", mp); } trace_printf("]"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG meta_type cstate_architecture_list_type = { "cstate_architecture_list", cstate_architecture_list_alloc, cstate_architecture_list_free, 0, // enum_parse cstate_architecture_list_parse, 0, // struct_parse 0, // fuzzy cstate_architecture_list_convert, generic_struct_is_set, }; void cstate_copyright_years_list_write(const output::pointer &fp, const char *name, cstate_copyright_years_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_copyright_years_list_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); fp->fputs("[\n"); for (j = 0; j < this_thing->length; ++j) { integer_write(fp, (const char *)0, this_thing->list[j], 1); fp->fputs(",\n"); } fp->fputs("]"); if (name) fp->fputs(";\n"); trace(("}\n")); } void cstate_copyright_years_list_write_xml(const output::pointer &fp, const char *name, cstate_copyright_years_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_copyright_years_list_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) { integer_write_xml(fp, "integer", this_thing->list[j], 1); } fp->fputs("fputs(name); fp->fputs(">\n"); trace(("}\n")); } static void * cstate_copyright_years_list_alloc(void) { cstate_copyright_years_list_ty *result; trace(("cstate_copyright_years_list_alloc()\n{\n")); result = (cstate_copyright_years_list_ty *)mem_alloc(sizeof(cstate_copyright_years_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void cstate_copyright_years_list_free(void *that) { cstate_copyright_years_list_ty *this_thing; size_t j; this_thing = (cstate_copyright_years_list_ty *)that; if (!this_thing) return; trace(("cstate_copyright_years_list_free(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) ; delete [] this_thing->list; mem_free(this_thing); trace(("}\n")); } static void * cstate_copyright_years_list_parse(void *that, meta_type **type_pp) { cstate_copyright_years_list_ty *this_thing; void *addr; this_thing = (cstate_copyright_years_list_ty *)that; trace(("cstate_copyright_years_list_parse(this_thing = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)type_pp)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); *type_pp = &integer_type; trace_pointer(*type_pp); if (this_thing->length >= this_thing->maximum) { this_thing->maximum = this_thing->maximum * 2 + 16; long *new_list = new long [this_thing->maximum]; for (size_t j = 0; j < this_thing->length; ++j) new_list[j] = this_thing->list[j]; delete [] this_thing->list; this_thing->list = new_list; } addr = &this_thing->list[this_thing->length++]; trace(("return %08lX;\n", (long)addr)); trace(("}\n")); return addr; } static rpt_value::pointer cstate_copyright_years_list_convert(void *that) { cstate_copyright_years_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(cstate_copyright_years_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("cstate_copyright_years_list_convert(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); rpt_value_list *p = new rpt_value_list(); rpt_value::pointer result(p); for (j = 0; j < this_thing->length; ++j) { vp = integer_type.convert(&this_thing->list[j]); assert(vp); p->append(vp); } trace(("}\n")); trace(("return %08lX;\n", (long)result.get())); return result; } cstate_copyright_years_list_ty * cstate_copyright_years_list_copy(cstate_copyright_years_list_ty *from) { size_t j; cstate_copyright_years_list_ty *result; if (!from) return 0; trace(("cstate_copyright_years_list_copy(from = %08lX)\n{\n", (long)from)); result = (cstate_copyright_years_list_ty *)cstate_copyright_years_list_alloc(); assert(from->length <= from->maximum); assert(!from->list == !from->maximum); for (j = 0; j < from->length; ++j) { long mp; long *mpp; meta_type *bogus; mp = from->list[j]; mpp = (long*)cstate_copyright_years_list_parse(result, &bogus); *mpp = integer_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } cstate_copyright_years_list_ty * cstate_copyright_years_list_clone(cstate_copyright_years_list_ty *from) { return cstate_copyright_years_list_copy(from); } #ifdef DEBUG void cstate_copyright_years_list_trace_real(const char *name, const cstate_copyright_years_list_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("[\n"); trace_printf("// length = %ld\n", (long)value->length); trace_printf("// maximum = %ld\n", (long)value->maximum); assert(value->length <= value->maximum); assert(!value->list == !value->maximum); for (size_t j = 0; j < value->length; ++j) { long mp = value->list[j]; trace_long_real("", &mp); } trace_printf("]"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG meta_type cstate_copyright_years_list_type = { "cstate_copyright_years_list", cstate_copyright_years_list_alloc, cstate_copyright_years_list_free, 0, // enum_parse cstate_copyright_years_list_parse, 0, // struct_parse 0, // fuzzy cstate_copyright_years_list_convert, generic_struct_is_set, }; static const char *cstate_state_s[] = { "awaiting_development", "being_developed", "awaiting_review", "being_reviewed", "awaiting_integration", "being_integrated", "completed", }; static string_ty *cstate_state_f[SIZEOF(cstate_state_s)]; const char * cstate_state_ename(cstate_state_ty this_thing) { static char buffer[20]; if ((int)this_thing >= 0 && (int)this_thing < 7) return cstate_state_s[this_thing]; snprintf(buffer, sizeof(buffer), "%d", (int)this_thing); return buffer; } void cstate_state_write(const output::pointer &fp, const char *name, cstate_state_ty this_thing, bool show) { if (this_thing == 0) { if (!show || type_enum_option_query()) return; } if (name) { fp->fputs(name); fp->fputs(" = "); } fp->fputs(cstate_state_s[this_thing]); if (name) fp->fputs(";\n"); } void cstate_state_write_xml(const output::pointer &fp, const char *name, cstate_state_ty this_thing, bool show) { if (this_thing == 0) { if (!show || type_enum_option_query()) return; } assert(name); assert((size_t)this_thing < SIZEOF(cstate_state_s)); fp->fputc('<'); fp->fputs(name); fp->fputc('>'); fp->fputs(cstate_state_s[this_thing]); fp->fputs("fputs(name); fp->fputs(">\n"); } static bool cstate_state_parse(string_ty *name, void *ptr) { slow_to_fast(cstate_state_s, cstate_state_f, SIZEOF(cstate_state_s)); for (size_t j = 0; j < SIZEOF(cstate_state_f); ++j) { if (str_equal(name, cstate_state_f[j])) { *(cstate_state_ty *)ptr = (cstate_state_ty)j; return true; } } return false; } static string_ty * cstate_state_fuzzy(string_ty *name) { return generic_enum_fuzzy(name, cstate_state_f, SIZEOF(cstate_state_f)); } static rpt_value::pointer cstate_state_convert(void *this_thing) { if (!cstate_state_f[0]) slow_to_fast(cstate_state_s, cstate_state_f, SIZEOF(cstate_state_s)); return generic_enum_convert ( (int)*(cstate_state_ty *)this_thing, cstate_state_f, SIZEOF(cstate_state_f) ); } static bool cstate_state_is_set(void *this_thing) { return (*(cstate_state_ty *)this_thing != 0); } meta_type cstate_state_type = { "cstate_state", 0, // alloc 0, // free cstate_state_parse, 0, // list_parse 0, // struct_parse cstate_state_fuzzy, cstate_state_convert, cstate_state_is_set, }; void cstate_architecture_times_write(const output::pointer &fp, const char *name, cstate_architecture_times_ty *this_thing) { if (!this_thing) return; trace(("cstate_architecture_times_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(((cstate_architecture_times_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((cstate_architecture_times_ty *)this_thing)->reference_count)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } fp->fputs("{\n"); string_write(fp, "variant", this_thing->variant); string_write(fp, "node", this_thing->node); time_write(fp, "build_time", this_thing->build_time, 0); time_write(fp, "test_time", this_thing->test_time, 0); time_write(fp, "test_baseline_time", this_thing->test_baseline_time, 0); time_write(fp, "regression_test_time", this_thing->regression_test_time, 0); fp->fputs("}"); if (name) fp->fputs(";\n"); trace(("}\n")); } void cstate_architecture_times_write_xml(const output::pointer &fp, const char *name, cstate_architecture_times_ty *this_thing) { if (!this_thing) return; trace(("cstate_architecture_times_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); assert(((cstate_architecture_times_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((cstate_architecture_times_ty *)this_thing)->reference_count)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); string_write_xml(fp, "variant", this_thing->variant); string_write_xml(fp, "node", this_thing->node); time_write_xml(fp, "build_time", this_thing->build_time, 0); time_write_xml(fp, "test_time", this_thing->test_time, 0); time_write_xml(fp, "test_baseline_time", this_thing->test_baseline_time, 0); time_write_xml(fp, "regression_test_time", this_thing->regression_test_time, 0); fp->fputs("fputs(name); fp->fputs(">\n"); } static void * cstate_architecture_times_alloc(void) { cstate_architecture_times_ty *this_thing; trace(("cstate_architecture_times_alloc()\n{\n")); this_thing = (cstate_architecture_times_ty *)mem_alloc(sizeof(cstate_architecture_times_ty)); this_thing->reference_count = 1; this_thing->mask = 0; this_thing->errpos = str_copy(lex_position()); this_thing->variant = (string_ty *)0; this_thing->node = (string_ty *)0; this_thing->build_time = (time_t)0; this_thing->test_time = (time_t)0; this_thing->test_baseline_time = (time_t)0; this_thing->regression_test_time = (time_t)0; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } cstate_architecture_times_ty * cstate_architecture_times_copy(cstate_architecture_times_ty *this_thing) { trace(("cstate_architecture_times_copy()\n{\n")); this_thing->reference_count++; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } cstate_architecture_times_ty * cstate_architecture_times_clone(cstate_architecture_times_ty *this_thing) { if (!this_thing) return 0; trace(("cstate_architecture_times_clone()\n{\n")); cstate_architecture_times_ty *result = (cstate_architecture_times_ty *)cstate_architecture_times_alloc(); result->variant = str_copy(this_thing->variant); result->node = str_copy(this_thing->node); result->build_time = this_thing->build_time; result->test_time = this_thing->test_time; result->test_baseline_time = this_thing->test_baseline_time; result->regression_test_time = this_thing->regression_test_time; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } #ifdef DEBUG void cstate_architecture_times_trace_real(const char *name, const cstate_architecture_times_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("{\n"); trace_string_real("variant", value->variant); trace_string_real("node", value->node); trace_time_real("build_time", value->build_time); trace_time_real("test_time", value->test_time); trace_time_real("test_baseline_time", value->test_baseline_time); trace_time_real("regression_test_time", value->regression_test_time); trace_printf("}"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG static void cstate_architecture_times_free(void *that) { cstate_architecture_times_ty *this_thing; this_thing = (cstate_architecture_times_ty *)that; if (!this_thing) return; this_thing->reference_count--; assert(this_thing->reference_count >= 0); if (this_thing->reference_count > 0) return; trace(("cstate_architecture_times_free(this_thing = %08lX)\n{\n", (long)this_thing)); if (this_thing->errpos) { str_free(this_thing->errpos); this_thing->errpos = 0; } str_free(this_thing->variant); str_free(this_thing->node); mem_free(this_thing); trace(("}\n")); } static type_table_ty cstate_architecture_times_table[] = { { "variant", offsetof(cstate_architecture_times_ty, variant), &string_type, cstate_architecture_times_variant_mask, 0, // redefinition not ok 0, // fast_name }, { "node", offsetof(cstate_architecture_times_ty, node), &string_type, cstate_architecture_times_node_mask, 0, // redefinition not ok 0, // fast_name }, { "build_time", offsetof(cstate_architecture_times_ty, build_time), &time_type, cstate_architecture_times_build_time_mask, 0, // redefinition not ok 0, // fast_name }, { "test_time", offsetof(cstate_architecture_times_ty, test_time), &time_type, cstate_architecture_times_test_time_mask, 0, // redefinition not ok 0, // fast_name }, { "test_baseline_time", offsetof(cstate_architecture_times_ty, test_baseline_time), &time_type, cstate_architecture_times_test_baseline_time_mask, 0, // redefinition not ok 0, // fast_name }, { "regression_test_time", offsetof(cstate_architecture_times_ty, regression_test_time), &time_type, cstate_architecture_times_regression_test_time_mask, 0, // redefinition not ok 0, // fast_name }, }; static void * cstate_architecture_times_parse(void *this_thing, string_ty *name, meta_type **type_pp, unsigned long *mask_p, int *redef_p) { void *addr; trace(("cstate_architecture_times_parse(this_thing = %08lX, name = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)name, (long)type_pp)); assert(((cstate_architecture_times_ty *)this_thing)->reference_count > 0); addr = generic_struct_parse ( this_thing, name, type_pp, mask_p, redef_p, cstate_architecture_times_table, SIZEOF(cstate_architecture_times_table) ); trace(("return %08lX;\n}\n", (long)addr)); return addr; } static string_ty * cstate_architecture_times_fuzzy(string_ty *name) { string_ty *result; trace(("cstate_architecture_times_fuzzy(name = %08lX)\n{\n", (long)name)); result = generic_struct_fuzzy ( name, cstate_architecture_times_table, SIZEOF(cstate_architecture_times_table) ); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static rpt_value::pointer cstate_architecture_times_convert(void *this_thing) { trace(("cstate_architecture_times_convert(name = %08lX)\n{\n", (long)this_thing)); assert(((cstate_architecture_times_ty *)this_thing)->reference_count > 0); rpt_value::pointer result = generic_struct_convert ( this_thing, cstate_architecture_times_table, SIZEOF(cstate_architecture_times_table) ); trace(("return %08lX;\n", (long)result.get())); trace(("}\n")); return result; } meta_type cstate_architecture_times_type = { "cstate_architecture_times", cstate_architecture_times_alloc, cstate_architecture_times_free, 0, // enum_parse 0, // list_parse cstate_architecture_times_parse, cstate_architecture_times_fuzzy, cstate_architecture_times_convert, generic_struct_is_set, }; void cstate_architecture_times_list_write(const output::pointer &fp, const char *name, cstate_architecture_times_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_architecture_times_list_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); fp->fputs("[\n"); for (j = 0; j < this_thing->length; ++j) { cstate_architecture_times_write(fp, (const char *)0, this_thing->list[j]); fp->fputs(",\n"); } fp->fputs("]"); if (name) fp->fputs(";\n"); trace(("}\n")); } void cstate_architecture_times_list_write_xml(const output::pointer &fp, const char *name, cstate_architecture_times_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_architecture_times_list_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) { cstate_architecture_times_write_xml(fp, "cstate_architecture_times", this_thing->list[j]); } fp->fputs("fputs(name); fp->fputs(">\n"); trace(("}\n")); } static void * cstate_architecture_times_list_alloc(void) { cstate_architecture_times_list_ty *result; trace(("cstate_architecture_times_list_alloc()\n{\n")); result = (cstate_architecture_times_list_ty *)mem_alloc(sizeof(cstate_architecture_times_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void cstate_architecture_times_list_free(void *that) { cstate_architecture_times_list_ty *this_thing; size_t j; this_thing = (cstate_architecture_times_list_ty *)that; if (!this_thing) return; trace(("cstate_architecture_times_list_free(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) cstate_architecture_times_free(this_thing->list[j]); delete [] this_thing->list; mem_free(this_thing); trace(("}\n")); } static void * cstate_architecture_times_list_parse(void *that, meta_type **type_pp) { cstate_architecture_times_list_ty *this_thing; void *addr; this_thing = (cstate_architecture_times_list_ty *)that; trace(("cstate_architecture_times_list_parse(this_thing = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)type_pp)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); *type_pp = &cstate_architecture_times_type; trace_pointer(*type_pp); if (this_thing->length >= this_thing->maximum) { this_thing->maximum = this_thing->maximum * 2 + 16; cstate_architecture_times_ty * *new_list = new cstate_architecture_times_ty * [this_thing->maximum]; for (size_t j = 0; j < this_thing->length; ++j) new_list[j] = this_thing->list[j]; delete [] this_thing->list; this_thing->list = new_list; } addr = &this_thing->list[this_thing->length++]; trace(("return %08lX;\n", (long)addr)); trace(("}\n")); return addr; } static rpt_value::pointer cstate_architecture_times_list_convert(void *that) { cstate_architecture_times_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(cstate_architecture_times_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("cstate_architecture_times_list_convert(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); rpt_value_list *p = new rpt_value_list(); rpt_value::pointer result(p); for (j = 0; j < this_thing->length; ++j) { vp = cstate_architecture_times_type.convert(&this_thing->list[j]); assert(vp); p->append(vp); } trace(("}\n")); trace(("return %08lX;\n", (long)result.get())); return result; } cstate_architecture_times_list_ty * cstate_architecture_times_list_copy(cstate_architecture_times_list_ty *from) { size_t j; cstate_architecture_times_list_ty *result; if (!from) return 0; trace(("cstate_architecture_times_list_copy(from = %08lX)\n{\n", (long)from)); result = (cstate_architecture_times_list_ty *)cstate_architecture_times_list_alloc(); assert(from->length <= from->maximum); assert(!from->list == !from->maximum); for (j = 0; j < from->length; ++j) { cstate_architecture_times_ty * mp; cstate_architecture_times_ty * *mpp; meta_type *bogus; mp = from->list[j]; mpp = (cstate_architecture_times_ty **)cstate_architecture_times_list_parse(result, &bogus); *mpp = cstate_architecture_times_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } cstate_architecture_times_list_ty * cstate_architecture_times_list_clone(cstate_architecture_times_list_ty *from) { return cstate_architecture_times_list_copy(from); } #ifdef DEBUG void cstate_architecture_times_list_trace_real(const char *name, const cstate_architecture_times_list_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("[\n"); trace_printf("// length = %ld\n", (long)value->length); trace_printf("// maximum = %ld\n", (long)value->maximum); assert(value->length <= value->maximum); assert(!value->list == !value->maximum); for (size_t j = 0; j < value->length; ++j) { cstate_architecture_times_ty * mp = value->list[j]; cstate_architecture_times_trace_real("", mp); } trace_printf("]"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG meta_type cstate_architecture_times_list_type = { "cstate_architecture_times_list", cstate_architecture_times_list_alloc, cstate_architecture_times_list_free, 0, // enum_parse cstate_architecture_times_list_parse, 0, // struct_parse 0, // fuzzy cstate_architecture_times_list_convert, generic_struct_is_set, }; static const char *cstate_history_what_s[] = { "new_change", "develop_begin", "develop_begin_undo", "develop_end", "develop_end_2ar", "develop_end_2ai", "develop_end_undo", "review_begin", "review_begin_undo", "review_pass", "review_pass_2ar", "review_pass_2br", "review_pass_undo", "review_pass_undo_2ar", "review_fail", "integrate_begin", "integrate_begin_undo", "integrate_pass", "integrate_fail", }; static string_ty *cstate_history_what_f[SIZEOF(cstate_history_what_s)]; const char * cstate_history_what_ename(cstate_history_what_ty this_thing) { static char buffer[20]; if ((int)this_thing >= 0 && (int)this_thing < 19) return cstate_history_what_s[this_thing]; snprintf(buffer, sizeof(buffer), "%d", (int)this_thing); return buffer; } void cstate_history_what_write(const output::pointer &fp, const char *name, cstate_history_what_ty this_thing, bool show) { if (this_thing == 0) { if (!show || type_enum_option_query()) return; } if (name) { fp->fputs(name); fp->fputs(" = "); } fp->fputs(cstate_history_what_s[this_thing]); if (name) fp->fputs(";\n"); } void cstate_history_what_write_xml(const output::pointer &fp, const char *name, cstate_history_what_ty this_thing, bool show) { if (this_thing == 0) { if (!show || type_enum_option_query()) return; } assert(name); assert((size_t)this_thing < SIZEOF(cstate_history_what_s)); fp->fputc('<'); fp->fputs(name); fp->fputc('>'); fp->fputs(cstate_history_what_s[this_thing]); fp->fputs("fputs(name); fp->fputs(">\n"); } static bool cstate_history_what_parse(string_ty *name, void *ptr) { slow_to_fast(cstate_history_what_s, cstate_history_what_f, SIZEOF(cstate_history_what_s)); for (size_t j = 0; j < SIZEOF(cstate_history_what_f); ++j) { if (str_equal(name, cstate_history_what_f[j])) { *(cstate_history_what_ty *)ptr = (cstate_history_what_ty)j; return true; } } return false; } static string_ty * cstate_history_what_fuzzy(string_ty *name) { return generic_enum_fuzzy(name, cstate_history_what_f, SIZEOF(cstate_history_what_f)); } static rpt_value::pointer cstate_history_what_convert(void *this_thing) { if (!cstate_history_what_f[0]) slow_to_fast(cstate_history_what_s, cstate_history_what_f, SIZEOF(cstate_history_what_s)); return generic_enum_convert ( (int)*(cstate_history_what_ty *)this_thing, cstate_history_what_f, SIZEOF(cstate_history_what_f) ); } static bool cstate_history_what_is_set(void *this_thing) { return (*(cstate_history_what_ty *)this_thing != 0); } meta_type cstate_history_what_type = { "cstate_history_what", 0, // alloc 0, // free cstate_history_what_parse, 0, // list_parse 0, // struct_parse cstate_history_what_fuzzy, cstate_history_what_convert, cstate_history_what_is_set, }; void cstate_history_write(const output::pointer &fp, const char *name, cstate_history_ty *this_thing) { if (!this_thing) return; trace(("cstate_history_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(((cstate_history_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((cstate_history_ty *)this_thing)->reference_count)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } fp->fputs("{\n"); time_write(fp, "when", this_thing->when, 0); cstate_history_what_write(fp, "what", this_thing->what, 1); string_write(fp, "who", this_thing->who); string_write(fp, "why", this_thing->why); fp->fputs("}"); if (name) fp->fputs(";\n"); trace(("}\n")); } void cstate_history_write_xml(const output::pointer &fp, const char *name, cstate_history_ty *this_thing) { if (!this_thing) return; trace(("cstate_history_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); assert(((cstate_history_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((cstate_history_ty *)this_thing)->reference_count)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); time_write_xml(fp, "when", this_thing->when, 0); cstate_history_what_write_xml(fp, "what", this_thing->what, 0); string_write_xml(fp, "who", this_thing->who); string_write_xml(fp, "why", this_thing->why); fp->fputs("fputs(name); fp->fputs(">\n"); } static void * cstate_history_alloc(void) { cstate_history_ty *this_thing; trace(("cstate_history_alloc()\n{\n")); this_thing = (cstate_history_ty *)mem_alloc(sizeof(cstate_history_ty)); this_thing->reference_count = 1; this_thing->mask = 0; this_thing->errpos = str_copy(lex_position()); this_thing->when = (time_t)0; this_thing->what = (cstate_history_what_ty)0; this_thing->who = (string_ty *)0; this_thing->why = (string_ty *)0; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } cstate_history_ty * cstate_history_copy(cstate_history_ty *this_thing) { trace(("cstate_history_copy()\n{\n")); this_thing->reference_count++; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } cstate_history_ty * cstate_history_clone(cstate_history_ty *this_thing) { if (!this_thing) return 0; trace(("cstate_history_clone()\n{\n")); cstate_history_ty *result = (cstate_history_ty *)cstate_history_alloc(); result->when = this_thing->when; result->what = this_thing->what; result->who = str_copy(this_thing->who); result->why = str_copy(this_thing->why); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } #ifdef DEBUG void cstate_history_trace_real(const char *name, const cstate_history_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("{\n"); trace_time_real("when", value->when); trace_printf("what = %s;\n", cstate_history_what_ename(value->what)); trace_string_real("who", value->who); trace_string_real("why", value->why); trace_printf("}"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG static void cstate_history_free(void *that) { cstate_history_ty *this_thing; this_thing = (cstate_history_ty *)that; if (!this_thing) return; this_thing->reference_count--; assert(this_thing->reference_count >= 0); if (this_thing->reference_count > 0) return; trace(("cstate_history_free(this_thing = %08lX)\n{\n", (long)this_thing)); if (this_thing->errpos) { str_free(this_thing->errpos); this_thing->errpos = 0; } str_free(this_thing->who); str_free(this_thing->why); mem_free(this_thing); trace(("}\n")); } static type_table_ty cstate_history_table[] = { { "when", offsetof(cstate_history_ty, when), &time_type, cstate_history_when_mask, 0, // redefinition not ok 0, // fast_name }, { "what", offsetof(cstate_history_ty, what), &cstate_history_what_type, cstate_history_what_mask, 0, // redefinition not ok 0, // fast_name }, { "who", offsetof(cstate_history_ty, who), &string_type, cstate_history_who_mask, 0, // redefinition not ok 0, // fast_name }, { "why", offsetof(cstate_history_ty, why), &string_type, cstate_history_why_mask, 0, // redefinition not ok 0, // fast_name }, }; static void * cstate_history_parse(void *this_thing, string_ty *name, meta_type **type_pp, unsigned long *mask_p, int *redef_p) { void *addr; trace(("cstate_history_parse(this_thing = %08lX, name = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)name, (long)type_pp)); assert(((cstate_history_ty *)this_thing)->reference_count > 0); addr = generic_struct_parse ( this_thing, name, type_pp, mask_p, redef_p, cstate_history_table, SIZEOF(cstate_history_table) ); trace(("return %08lX;\n}\n", (long)addr)); return addr; } static string_ty * cstate_history_fuzzy(string_ty *name) { string_ty *result; trace(("cstate_history_fuzzy(name = %08lX)\n{\n", (long)name)); result = generic_struct_fuzzy ( name, cstate_history_table, SIZEOF(cstate_history_table) ); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static rpt_value::pointer cstate_history_convert(void *this_thing) { trace(("cstate_history_convert(name = %08lX)\n{\n", (long)this_thing)); assert(((cstate_history_ty *)this_thing)->reference_count > 0); rpt_value::pointer result = generic_struct_convert ( this_thing, cstate_history_table, SIZEOF(cstate_history_table) ); trace(("return %08lX;\n", (long)result.get())); trace(("}\n")); return result; } meta_type cstate_history_type = { "cstate_history", cstate_history_alloc, cstate_history_free, 0, // enum_parse 0, // list_parse cstate_history_parse, cstate_history_fuzzy, cstate_history_convert, generic_struct_is_set, }; void cstate_history_list_write(const output::pointer &fp, const char *name, cstate_history_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_history_list_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); fp->fputs("[\n"); for (j = 0; j < this_thing->length; ++j) { cstate_history_write(fp, (const char *)0, this_thing->list[j]); fp->fputs(",\n"); } fp->fputs("]"); if (name) fp->fputs(";\n"); trace(("}\n")); } void cstate_history_list_write_xml(const output::pointer &fp, const char *name, cstate_history_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_history_list_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) { cstate_history_write_xml(fp, "cstate_history", this_thing->list[j]); } fp->fputs("fputs(name); fp->fputs(">\n"); trace(("}\n")); } static void * cstate_history_list_alloc(void) { cstate_history_list_ty *result; trace(("cstate_history_list_alloc()\n{\n")); result = (cstate_history_list_ty *)mem_alloc(sizeof(cstate_history_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void cstate_history_list_free(void *that) { cstate_history_list_ty *this_thing; size_t j; this_thing = (cstate_history_list_ty *)that; if (!this_thing) return; trace(("cstate_history_list_free(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) cstate_history_free(this_thing->list[j]); delete [] this_thing->list; mem_free(this_thing); trace(("}\n")); } static void * cstate_history_list_parse(void *that, meta_type **type_pp) { cstate_history_list_ty *this_thing; void *addr; this_thing = (cstate_history_list_ty *)that; trace(("cstate_history_list_parse(this_thing = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)type_pp)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); *type_pp = &cstate_history_type; trace_pointer(*type_pp); if (this_thing->length >= this_thing->maximum) { this_thing->maximum = this_thing->maximum * 2 + 16; cstate_history_ty * *new_list = new cstate_history_ty * [this_thing->maximum]; for (size_t j = 0; j < this_thing->length; ++j) new_list[j] = this_thing->list[j]; delete [] this_thing->list; this_thing->list = new_list; } addr = &this_thing->list[this_thing->length++]; trace(("return %08lX;\n", (long)addr)); trace(("}\n")); return addr; } static rpt_value::pointer cstate_history_list_convert(void *that) { cstate_history_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(cstate_history_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("cstate_history_list_convert(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); rpt_value_list *p = new rpt_value_list(); rpt_value::pointer result(p); for (j = 0; j < this_thing->length; ++j) { vp = cstate_history_type.convert(&this_thing->list[j]); assert(vp); p->append(vp); } trace(("}\n")); trace(("return %08lX;\n", (long)result.get())); return result; } cstate_history_list_ty * cstate_history_list_copy(cstate_history_list_ty *from) { size_t j; cstate_history_list_ty *result; if (!from) return 0; trace(("cstate_history_list_copy(from = %08lX)\n{\n", (long)from)); result = (cstate_history_list_ty *)cstate_history_list_alloc(); assert(from->length <= from->maximum); assert(!from->list == !from->maximum); for (j = 0; j < from->length; ++j) { cstate_history_ty * mp; cstate_history_ty * *mpp; meta_type *bogus; mp = from->list[j]; mpp = (cstate_history_ty **)cstate_history_list_parse(result, &bogus); *mpp = cstate_history_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } cstate_history_list_ty * cstate_history_list_clone(cstate_history_list_ty *from) { return cstate_history_list_copy(from); } #ifdef DEBUG void cstate_history_list_trace_real(const char *name, const cstate_history_list_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("[\n"); trace_printf("// length = %ld\n", (long)value->length); trace_printf("// maximum = %ld\n", (long)value->maximum); assert(value->length <= value->maximum); assert(!value->list == !value->maximum); for (size_t j = 0; j < value->length; ++j) { cstate_history_ty * mp = value->list[j]; cstate_history_trace_real("", mp); } trace_printf("]"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG meta_type cstate_history_list_type = { "cstate_history_list", cstate_history_list_alloc, cstate_history_list_free, 0, // enum_parse cstate_history_list_parse, 0, // struct_parse 0, // fuzzy cstate_history_list_convert, generic_struct_is_set, }; static const char *cstate_branch_develop_end_action_s[] = { "goto_being_reviewed", "goto_awaiting_review", "goto_awaiting_integration", }; static string_ty *cstate_branch_develop_end_action_f[SIZEOF(cstate_branch_develop_end_action_s)]; const char * cstate_branch_develop_end_action_ename(cstate_branch_develop_end_action_ty this_thing) { static char buffer[20]; if ((int)this_thing >= 0 && (int)this_thing < 3) return cstate_branch_develop_end_action_s[this_thing]; snprintf(buffer, sizeof(buffer), "%d", (int)this_thing); return buffer; } void cstate_branch_develop_end_action_write(const output::pointer &fp, const char *name, cstate_branch_develop_end_action_ty this_thing, bool show) { if (this_thing == 0) { if (!show || type_enum_option_query()) return; } if (name) { fp->fputs(name); fp->fputs(" = "); } fp->fputs(cstate_branch_develop_end_action_s[this_thing]); if (name) fp->fputs(";\n"); } void cstate_branch_develop_end_action_write_xml(const output::pointer &fp, const char *name, cstate_branch_develop_end_action_ty this_thing, bool show) { if (this_thing == 0) { if (!show || type_enum_option_query()) return; } assert(name); assert((size_t)this_thing < SIZEOF(cstate_branch_develop_end_action_s)); fp->fputc('<'); fp->fputs(name); fp->fputc('>'); fp->fputs(cstate_branch_develop_end_action_s[this_thing]); fp->fputs("fputs(name); fp->fputs(">\n"); } static bool cstate_branch_develop_end_action_parse(string_ty *name, void *ptr) { slow_to_fast(cstate_branch_develop_end_action_s, cstate_branch_develop_end_action_f, SIZEOF(cstate_branch_develop_end_action_s)); for (size_t j = 0; j < SIZEOF(cstate_branch_develop_end_action_f); ++j) { if (str_equal(name, cstate_branch_develop_end_action_f[j])) { *(cstate_branch_develop_end_action_ty *)ptr = (cstate_branch_develop_end_action_ty)j; return true; } } return false; } static string_ty * cstate_branch_develop_end_action_fuzzy(string_ty *name) { return generic_enum_fuzzy(name, cstate_branch_develop_end_action_f, SIZEOF(cstate_branch_develop_end_action_f)); } static rpt_value::pointer cstate_branch_develop_end_action_convert(void *this_thing) { if (!cstate_branch_develop_end_action_f[0]) slow_to_fast(cstate_branch_develop_end_action_s, cstate_branch_develop_end_action_f, SIZEOF(cstate_branch_develop_end_action_s)); return generic_enum_convert ( (int)*(cstate_branch_develop_end_action_ty *)this_thing, cstate_branch_develop_end_action_f, SIZEOF(cstate_branch_develop_end_action_f) ); } static bool cstate_branch_develop_end_action_is_set(void *this_thing) { return (*(cstate_branch_develop_end_action_ty *)this_thing != 0); } meta_type cstate_branch_develop_end_action_type = { "cstate_branch_develop_end_action", 0, // alloc 0, // free cstate_branch_develop_end_action_parse, 0, // list_parse 0, // struct_parse cstate_branch_develop_end_action_fuzzy, cstate_branch_develop_end_action_convert, cstate_branch_develop_end_action_is_set, }; void cstate_branch_history_name_list_write(const output::pointer &fp, const char *name, cstate_branch_history_name_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_branch_history_name_list_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); fp->fputs("[\n"); for (j = 0; j < this_thing->length; ++j) { string_write(fp, (const char *)0, this_thing->list[j]); fp->fputs(",\n"); } fp->fputs("]"); if (name) fp->fputs(";\n"); trace(("}\n")); } void cstate_branch_history_name_list_write_xml(const output::pointer &fp, const char *name, cstate_branch_history_name_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_branch_history_name_list_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) { string_write_xml(fp, "string", this_thing->list[j]); } fp->fputs("fputs(name); fp->fputs(">\n"); trace(("}\n")); } static void * cstate_branch_history_name_list_alloc(void) { cstate_branch_history_name_list_ty *result; trace(("cstate_branch_history_name_list_alloc()\n{\n")); result = (cstate_branch_history_name_list_ty *)mem_alloc(sizeof(cstate_branch_history_name_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void cstate_branch_history_name_list_free(void *that) { cstate_branch_history_name_list_ty *this_thing; size_t j; this_thing = (cstate_branch_history_name_list_ty *)that; if (!this_thing) return; trace(("cstate_branch_history_name_list_free(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) str_free(this_thing->list[j]); delete [] this_thing->list; mem_free(this_thing); trace(("}\n")); } static void * cstate_branch_history_name_list_parse(void *that, meta_type **type_pp) { cstate_branch_history_name_list_ty *this_thing; void *addr; this_thing = (cstate_branch_history_name_list_ty *)that; trace(("cstate_branch_history_name_list_parse(this_thing = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)type_pp)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); *type_pp = &string_type; trace_pointer(*type_pp); if (this_thing->length >= this_thing->maximum) { this_thing->maximum = this_thing->maximum * 2 + 16; string_ty * *new_list = new string_ty * [this_thing->maximum]; for (size_t j = 0; j < this_thing->length; ++j) new_list[j] = this_thing->list[j]; delete [] this_thing->list; this_thing->list = new_list; } addr = &this_thing->list[this_thing->length++]; trace(("return %08lX;\n", (long)addr)); trace(("}\n")); return addr; } static rpt_value::pointer cstate_branch_history_name_list_convert(void *that) { cstate_branch_history_name_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(cstate_branch_history_name_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("cstate_branch_history_name_list_convert(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); rpt_value_list *p = new rpt_value_list(); rpt_value::pointer result(p); for (j = 0; j < this_thing->length; ++j) { vp = string_type.convert(&this_thing->list[j]); assert(vp); p->append(vp); } trace(("}\n")); trace(("return %08lX;\n", (long)result.get())); return result; } cstate_branch_history_name_list_ty * cstate_branch_history_name_list_copy(cstate_branch_history_name_list_ty *from) { size_t j; cstate_branch_history_name_list_ty *result; if (!from) return 0; trace(("cstate_branch_history_name_list_copy(from = %08lX)\n{\n", (long)from)); result = (cstate_branch_history_name_list_ty *)cstate_branch_history_name_list_alloc(); assert(from->length <= from->maximum); assert(!from->list == !from->maximum); for (j = 0; j < from->length; ++j) { string_ty * mp; string_ty * *mpp; meta_type *bogus; mp = from->list[j]; mpp = (string_ty **)cstate_branch_history_name_list_parse(result, &bogus); *mpp = string_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } cstate_branch_history_name_list_ty * cstate_branch_history_name_list_clone(cstate_branch_history_name_list_ty *from) { return cstate_branch_history_name_list_copy(from); } #ifdef DEBUG void cstate_branch_history_name_list_trace_real(const char *name, const cstate_branch_history_name_list_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("[\n"); trace_printf("// length = %ld\n", (long)value->length); trace_printf("// maximum = %ld\n", (long)value->maximum); assert(value->length <= value->maximum); assert(!value->list == !value->maximum); for (size_t j = 0; j < value->length; ++j) { string_ty * mp = value->list[j]; trace_string_real("", mp); } trace_printf("]"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG meta_type cstate_branch_history_name_list_type = { "cstate_branch_history_name_list", cstate_branch_history_name_list_alloc, cstate_branch_history_name_list_free, 0, // enum_parse cstate_branch_history_name_list_parse, 0, // struct_parse 0, // fuzzy cstate_branch_history_name_list_convert, generic_struct_is_set, }; void cstate_branch_history_write(const output::pointer &fp, const char *name, cstate_branch_history_ty *this_thing) { if (!this_thing) return; trace(("cstate_branch_history_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(((cstate_branch_history_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((cstate_branch_history_ty *)this_thing)->reference_count)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } fp->fputs("{\n"); integer_write(fp, "delta_number", this_thing->delta_number, 0); integer_write(fp, "change_number", this_thing->change_number, 0); cstate_branch_history_name_list_write(fp, "name", this_thing->name); fp->fputs("}"); if (name) fp->fputs(";\n"); trace(("}\n")); } void cstate_branch_history_write_xml(const output::pointer &fp, const char *name, cstate_branch_history_ty *this_thing) { if (!this_thing) return; trace(("cstate_branch_history_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); assert(((cstate_branch_history_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((cstate_branch_history_ty *)this_thing)->reference_count)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); integer_write_xml(fp, "delta_number", this_thing->delta_number, 0); integer_write_xml(fp, "change_number", this_thing->change_number, 0); cstate_branch_history_name_list_write_xml(fp, "name", this_thing->name); fp->fputs("fputs(name); fp->fputs(">\n"); } static void * cstate_branch_history_alloc(void) { cstate_branch_history_ty *this_thing; trace(("cstate_branch_history_alloc()\n{\n")); this_thing = (cstate_branch_history_ty *)mem_alloc(sizeof(cstate_branch_history_ty)); this_thing->reference_count = 1; this_thing->mask = 0; this_thing->errpos = str_copy(lex_position()); this_thing->delta_number = (long)0; this_thing->change_number = (long)0; this_thing->name = (cstate_branch_history_name_list_ty *)0; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } cstate_branch_history_ty * cstate_branch_history_copy(cstate_branch_history_ty *this_thing) { trace(("cstate_branch_history_copy()\n{\n")); this_thing->reference_count++; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } cstate_branch_history_ty * cstate_branch_history_clone(cstate_branch_history_ty *this_thing) { if (!this_thing) return 0; trace(("cstate_branch_history_clone()\n{\n")); cstate_branch_history_ty *result = (cstate_branch_history_ty *)cstate_branch_history_alloc(); result->delta_number = this_thing->delta_number; result->change_number = this_thing->change_number; result->name = cstate_branch_history_name_list_clone(this_thing->name); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } #ifdef DEBUG void cstate_branch_history_trace_real(const char *name, const cstate_branch_history_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("{\n"); trace_long_real("delta_number", &value->delta_number); trace_long_real("change_number", &value->change_number); cstate_branch_history_name_list_trace_real("name", value->name); trace_printf("}"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG static void cstate_branch_history_free(void *that) { cstate_branch_history_ty *this_thing; this_thing = (cstate_branch_history_ty *)that; if (!this_thing) return; this_thing->reference_count--; assert(this_thing->reference_count >= 0); if (this_thing->reference_count > 0) return; trace(("cstate_branch_history_free(this_thing = %08lX)\n{\n", (long)this_thing)); if (this_thing->errpos) { str_free(this_thing->errpos); this_thing->errpos = 0; } cstate_branch_history_name_list_free(this_thing->name); mem_free(this_thing); trace(("}\n")); } static type_table_ty cstate_branch_history_table[] = { { "delta_number", offsetof(cstate_branch_history_ty, delta_number), &integer_type, cstate_branch_history_delta_number_mask, 0, // redefinition not ok 0, // fast_name }, { "change_number", offsetof(cstate_branch_history_ty, change_number), &integer_type, cstate_branch_history_change_number_mask, 0, // redefinition not ok 0, // fast_name }, { "name", offsetof(cstate_branch_history_ty, name), &cstate_branch_history_name_list_type, cstate_branch_history_name_mask, 0, // redefinition not ok 0, // fast_name }, }; static void * cstate_branch_history_parse(void *this_thing, string_ty *name, meta_type **type_pp, unsigned long *mask_p, int *redef_p) { void *addr; trace(("cstate_branch_history_parse(this_thing = %08lX, name = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)name, (long)type_pp)); assert(((cstate_branch_history_ty *)this_thing)->reference_count > 0); addr = generic_struct_parse ( this_thing, name, type_pp, mask_p, redef_p, cstate_branch_history_table, SIZEOF(cstate_branch_history_table) ); trace(("return %08lX;\n}\n", (long)addr)); return addr; } static string_ty * cstate_branch_history_fuzzy(string_ty *name) { string_ty *result; trace(("cstate_branch_history_fuzzy(name = %08lX)\n{\n", (long)name)); result = generic_struct_fuzzy ( name, cstate_branch_history_table, SIZEOF(cstate_branch_history_table) ); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static rpt_value::pointer cstate_branch_history_convert(void *this_thing) { trace(("cstate_branch_history_convert(name = %08lX)\n{\n", (long)this_thing)); assert(((cstate_branch_history_ty *)this_thing)->reference_count > 0); rpt_value::pointer result = generic_struct_convert ( this_thing, cstate_branch_history_table, SIZEOF(cstate_branch_history_table) ); trace(("return %08lX;\n", (long)result.get())); trace(("}\n")); return result; } meta_type cstate_branch_history_type = { "cstate_branch_history", cstate_branch_history_alloc, cstate_branch_history_free, 0, // enum_parse 0, // list_parse cstate_branch_history_parse, cstate_branch_history_fuzzy, cstate_branch_history_convert, generic_struct_is_set, }; void cstate_branch_history_list_write(const output::pointer &fp, const char *name, cstate_branch_history_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_branch_history_list_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); fp->fputs("[\n"); for (j = 0; j < this_thing->length; ++j) { cstate_branch_history_write(fp, (const char *)0, this_thing->list[j]); fp->fputs(",\n"); } fp->fputs("]"); if (name) fp->fputs(";\n"); trace(("}\n")); } void cstate_branch_history_list_write_xml(const output::pointer &fp, const char *name, cstate_branch_history_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_branch_history_list_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) { cstate_branch_history_write_xml(fp, "cstate_branch_history", this_thing->list[j]); } fp->fputs("fputs(name); fp->fputs(">\n"); trace(("}\n")); } static void * cstate_branch_history_list_alloc(void) { cstate_branch_history_list_ty *result; trace(("cstate_branch_history_list_alloc()\n{\n")); result = (cstate_branch_history_list_ty *)mem_alloc(sizeof(cstate_branch_history_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void cstate_branch_history_list_free(void *that) { cstate_branch_history_list_ty *this_thing; size_t j; this_thing = (cstate_branch_history_list_ty *)that; if (!this_thing) return; trace(("cstate_branch_history_list_free(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) cstate_branch_history_free(this_thing->list[j]); delete [] this_thing->list; mem_free(this_thing); trace(("}\n")); } static void * cstate_branch_history_list_parse(void *that, meta_type **type_pp) { cstate_branch_history_list_ty *this_thing; void *addr; this_thing = (cstate_branch_history_list_ty *)that; trace(("cstate_branch_history_list_parse(this_thing = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)type_pp)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); *type_pp = &cstate_branch_history_type; trace_pointer(*type_pp); if (this_thing->length >= this_thing->maximum) { this_thing->maximum = this_thing->maximum * 2 + 16; cstate_branch_history_ty * *new_list = new cstate_branch_history_ty * [this_thing->maximum]; for (size_t j = 0; j < this_thing->length; ++j) new_list[j] = this_thing->list[j]; delete [] this_thing->list; this_thing->list = new_list; } addr = &this_thing->list[this_thing->length++]; trace(("return %08lX;\n", (long)addr)); trace(("}\n")); return addr; } static rpt_value::pointer cstate_branch_history_list_convert(void *that) { cstate_branch_history_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(cstate_branch_history_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("cstate_branch_history_list_convert(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); rpt_value_list *p = new rpt_value_list(); rpt_value::pointer result(p); for (j = 0; j < this_thing->length; ++j) { vp = cstate_branch_history_type.convert(&this_thing->list[j]); assert(vp); p->append(vp); } trace(("}\n")); trace(("return %08lX;\n", (long)result.get())); return result; } cstate_branch_history_list_ty * cstate_branch_history_list_copy(cstate_branch_history_list_ty *from) { size_t j; cstate_branch_history_list_ty *result; if (!from) return 0; trace(("cstate_branch_history_list_copy(from = %08lX)\n{\n", (long)from)); result = (cstate_branch_history_list_ty *)cstate_branch_history_list_alloc(); assert(from->length <= from->maximum); assert(!from->list == !from->maximum); for (j = 0; j < from->length; ++j) { cstate_branch_history_ty * mp; cstate_branch_history_ty * *mpp; meta_type *bogus; mp = from->list[j]; mpp = (cstate_branch_history_ty **)cstate_branch_history_list_parse(result, &bogus); *mpp = cstate_branch_history_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } cstate_branch_history_list_ty * cstate_branch_history_list_clone(cstate_branch_history_list_ty *from) { return cstate_branch_history_list_copy(from); } #ifdef DEBUG void cstate_branch_history_list_trace_real(const char *name, const cstate_branch_history_list_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("[\n"); trace_printf("// length = %ld\n", (long)value->length); trace_printf("// maximum = %ld\n", (long)value->maximum); assert(value->length <= value->maximum); assert(!value->list == !value->maximum); for (size_t j = 0; j < value->length; ++j) { cstate_branch_history_ty * mp = value->list[j]; cstate_branch_history_trace_real("", mp); } trace_printf("]"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG meta_type cstate_branch_history_list_type = { "cstate_branch_history_list", cstate_branch_history_list_alloc, cstate_branch_history_list_free, 0, // enum_parse cstate_branch_history_list_parse, 0, // struct_parse 0, // fuzzy cstate_branch_history_list_convert, generic_struct_is_set, }; void cstate_branch_change_list_write(const output::pointer &fp, const char *name, cstate_branch_change_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_branch_change_list_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); fp->fputs("[\n"); for (j = 0; j < this_thing->length; ++j) { integer_write(fp, (const char *)0, this_thing->list[j], 1); fp->fputs(",\n"); } fp->fputs("]"); if (name) fp->fputs(";\n"); trace(("}\n")); } void cstate_branch_change_list_write_xml(const output::pointer &fp, const char *name, cstate_branch_change_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_branch_change_list_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) { integer_write_xml(fp, "integer", this_thing->list[j], 1); } fp->fputs("fputs(name); fp->fputs(">\n"); trace(("}\n")); } static void * cstate_branch_change_list_alloc(void) { cstate_branch_change_list_ty *result; trace(("cstate_branch_change_list_alloc()\n{\n")); result = (cstate_branch_change_list_ty *)mem_alloc(sizeof(cstate_branch_change_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void cstate_branch_change_list_free(void *that) { cstate_branch_change_list_ty *this_thing; size_t j; this_thing = (cstate_branch_change_list_ty *)that; if (!this_thing) return; trace(("cstate_branch_change_list_free(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) ; delete [] this_thing->list; mem_free(this_thing); trace(("}\n")); } static void * cstate_branch_change_list_parse(void *that, meta_type **type_pp) { cstate_branch_change_list_ty *this_thing; void *addr; this_thing = (cstate_branch_change_list_ty *)that; trace(("cstate_branch_change_list_parse(this_thing = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)type_pp)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); *type_pp = &integer_type; trace_pointer(*type_pp); if (this_thing->length >= this_thing->maximum) { this_thing->maximum = this_thing->maximum * 2 + 16; long *new_list = new long [this_thing->maximum]; for (size_t j = 0; j < this_thing->length; ++j) new_list[j] = this_thing->list[j]; delete [] this_thing->list; this_thing->list = new_list; } addr = &this_thing->list[this_thing->length++]; trace(("return %08lX;\n", (long)addr)); trace(("}\n")); return addr; } static rpt_value::pointer cstate_branch_change_list_convert(void *that) { cstate_branch_change_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(cstate_branch_change_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("cstate_branch_change_list_convert(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); rpt_value_list *p = new rpt_value_list(); rpt_value::pointer result(p); for (j = 0; j < this_thing->length; ++j) { vp = integer_type.convert(&this_thing->list[j]); assert(vp); p->append(vp); } trace(("}\n")); trace(("return %08lX;\n", (long)result.get())); return result; } cstate_branch_change_list_ty * cstate_branch_change_list_copy(cstate_branch_change_list_ty *from) { size_t j; cstate_branch_change_list_ty *result; if (!from) return 0; trace(("cstate_branch_change_list_copy(from = %08lX)\n{\n", (long)from)); result = (cstate_branch_change_list_ty *)cstate_branch_change_list_alloc(); assert(from->length <= from->maximum); assert(!from->list == !from->maximum); for (j = 0; j < from->length; ++j) { long mp; long *mpp; meta_type *bogus; mp = from->list[j]; mpp = (long*)cstate_branch_change_list_parse(result, &bogus); *mpp = integer_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } cstate_branch_change_list_ty * cstate_branch_change_list_clone(cstate_branch_change_list_ty *from) { return cstate_branch_change_list_copy(from); } #ifdef DEBUG void cstate_branch_change_list_trace_real(const char *name, const cstate_branch_change_list_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("[\n"); trace_printf("// length = %ld\n", (long)value->length); trace_printf("// maximum = %ld\n", (long)value->maximum); assert(value->length <= value->maximum); assert(!value->list == !value->maximum); for (size_t j = 0; j < value->length; ++j) { long mp = value->list[j]; trace_long_real("", &mp); } trace_printf("]"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG meta_type cstate_branch_change_list_type = { "cstate_branch_change_list", cstate_branch_change_list_alloc, cstate_branch_change_list_free, 0, // enum_parse cstate_branch_change_list_parse, 0, // struct_parse 0, // fuzzy cstate_branch_change_list_convert, generic_struct_is_set, }; void cstate_branch_sub_branch_list_write(const output::pointer &fp, const char *name, cstate_branch_sub_branch_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_branch_sub_branch_list_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); fp->fputs("[\n"); for (j = 0; j < this_thing->length; ++j) { integer_write(fp, (const char *)0, this_thing->list[j], 1); fp->fputs(",\n"); } fp->fputs("]"); if (name) fp->fputs(";\n"); trace(("}\n")); } void cstate_branch_sub_branch_list_write_xml(const output::pointer &fp, const char *name, cstate_branch_sub_branch_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_branch_sub_branch_list_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) { integer_write_xml(fp, "integer", this_thing->list[j], 1); } fp->fputs("fputs(name); fp->fputs(">\n"); trace(("}\n")); } static void * cstate_branch_sub_branch_list_alloc(void) { cstate_branch_sub_branch_list_ty *result; trace(("cstate_branch_sub_branch_list_alloc()\n{\n")); result = (cstate_branch_sub_branch_list_ty *)mem_alloc(sizeof(cstate_branch_sub_branch_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void cstate_branch_sub_branch_list_free(void *that) { cstate_branch_sub_branch_list_ty *this_thing; size_t j; this_thing = (cstate_branch_sub_branch_list_ty *)that; if (!this_thing) return; trace(("cstate_branch_sub_branch_list_free(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) ; delete [] this_thing->list; mem_free(this_thing); trace(("}\n")); } static void * cstate_branch_sub_branch_list_parse(void *that, meta_type **type_pp) { cstate_branch_sub_branch_list_ty *this_thing; void *addr; this_thing = (cstate_branch_sub_branch_list_ty *)that; trace(("cstate_branch_sub_branch_list_parse(this_thing = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)type_pp)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); *type_pp = &integer_type; trace_pointer(*type_pp); if (this_thing->length >= this_thing->maximum) { this_thing->maximum = this_thing->maximum * 2 + 16; long *new_list = new long [this_thing->maximum]; for (size_t j = 0; j < this_thing->length; ++j) new_list[j] = this_thing->list[j]; delete [] this_thing->list; this_thing->list = new_list; } addr = &this_thing->list[this_thing->length++]; trace(("return %08lX;\n", (long)addr)); trace(("}\n")); return addr; } static rpt_value::pointer cstate_branch_sub_branch_list_convert(void *that) { cstate_branch_sub_branch_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(cstate_branch_sub_branch_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("cstate_branch_sub_branch_list_convert(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); rpt_value_list *p = new rpt_value_list(); rpt_value::pointer result(p); for (j = 0; j < this_thing->length; ++j) { vp = integer_type.convert(&this_thing->list[j]); assert(vp); p->append(vp); } trace(("}\n")); trace(("return %08lX;\n", (long)result.get())); return result; } cstate_branch_sub_branch_list_ty * cstate_branch_sub_branch_list_copy(cstate_branch_sub_branch_list_ty *from) { size_t j; cstate_branch_sub_branch_list_ty *result; if (!from) return 0; trace(("cstate_branch_sub_branch_list_copy(from = %08lX)\n{\n", (long)from)); result = (cstate_branch_sub_branch_list_ty *)cstate_branch_sub_branch_list_alloc(); assert(from->length <= from->maximum); assert(!from->list == !from->maximum); for (j = 0; j < from->length; ++j) { long mp; long *mpp; meta_type *bogus; mp = from->list[j]; mpp = (long*)cstate_branch_sub_branch_list_parse(result, &bogus); *mpp = integer_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } cstate_branch_sub_branch_list_ty * cstate_branch_sub_branch_list_clone(cstate_branch_sub_branch_list_ty *from) { return cstate_branch_sub_branch_list_copy(from); } #ifdef DEBUG void cstate_branch_sub_branch_list_trace_real(const char *name, const cstate_branch_sub_branch_list_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("[\n"); trace_printf("// length = %ld\n", (long)value->length); trace_printf("// maximum = %ld\n", (long)value->maximum); assert(value->length <= value->maximum); assert(!value->list == !value->maximum); for (size_t j = 0; j < value->length; ++j) { long mp = value->list[j]; trace_long_real("", &mp); } trace_printf("]"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG meta_type cstate_branch_sub_branch_list_type = { "cstate_branch_sub_branch_list", cstate_branch_sub_branch_list_alloc, cstate_branch_sub_branch_list_free, 0, // enum_parse cstate_branch_sub_branch_list_parse, 0, // struct_parse 0, // fuzzy cstate_branch_sub_branch_list_convert, generic_struct_is_set, }; void cstate_branch_administrator_list_write(const output::pointer &fp, const char *name, cstate_branch_administrator_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_branch_administrator_list_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); fp->fputs("[\n"); for (j = 0; j < this_thing->length; ++j) { string_write(fp, (const char *)0, this_thing->list[j]); fp->fputs(",\n"); } fp->fputs("]"); if (name) fp->fputs(";\n"); trace(("}\n")); } void cstate_branch_administrator_list_write_xml(const output::pointer &fp, const char *name, cstate_branch_administrator_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_branch_administrator_list_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) { string_write_xml(fp, "string", this_thing->list[j]); } fp->fputs("fputs(name); fp->fputs(">\n"); trace(("}\n")); } static void * cstate_branch_administrator_list_alloc(void) { cstate_branch_administrator_list_ty *result; trace(("cstate_branch_administrator_list_alloc()\n{\n")); result = (cstate_branch_administrator_list_ty *)mem_alloc(sizeof(cstate_branch_administrator_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void cstate_branch_administrator_list_free(void *that) { cstate_branch_administrator_list_ty *this_thing; size_t j; this_thing = (cstate_branch_administrator_list_ty *)that; if (!this_thing) return; trace(("cstate_branch_administrator_list_free(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) str_free(this_thing->list[j]); delete [] this_thing->list; mem_free(this_thing); trace(("}\n")); } static void * cstate_branch_administrator_list_parse(void *that, meta_type **type_pp) { cstate_branch_administrator_list_ty *this_thing; void *addr; this_thing = (cstate_branch_administrator_list_ty *)that; trace(("cstate_branch_administrator_list_parse(this_thing = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)type_pp)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); *type_pp = &string_type; trace_pointer(*type_pp); if (this_thing->length >= this_thing->maximum) { this_thing->maximum = this_thing->maximum * 2 + 16; string_ty * *new_list = new string_ty * [this_thing->maximum]; for (size_t j = 0; j < this_thing->length; ++j) new_list[j] = this_thing->list[j]; delete [] this_thing->list; this_thing->list = new_list; } addr = &this_thing->list[this_thing->length++]; trace(("return %08lX;\n", (long)addr)); trace(("}\n")); return addr; } static rpt_value::pointer cstate_branch_administrator_list_convert(void *that) { cstate_branch_administrator_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(cstate_branch_administrator_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("cstate_branch_administrator_list_convert(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); rpt_value_list *p = new rpt_value_list(); rpt_value::pointer result(p); for (j = 0; j < this_thing->length; ++j) { vp = string_type.convert(&this_thing->list[j]); assert(vp); p->append(vp); } trace(("}\n")); trace(("return %08lX;\n", (long)result.get())); return result; } cstate_branch_administrator_list_ty * cstate_branch_administrator_list_copy(cstate_branch_administrator_list_ty *from) { size_t j; cstate_branch_administrator_list_ty *result; if (!from) return 0; trace(("cstate_branch_administrator_list_copy(from = %08lX)\n{\n", (long)from)); result = (cstate_branch_administrator_list_ty *)cstate_branch_administrator_list_alloc(); assert(from->length <= from->maximum); assert(!from->list == !from->maximum); for (j = 0; j < from->length; ++j) { string_ty * mp; string_ty * *mpp; meta_type *bogus; mp = from->list[j]; mpp = (string_ty **)cstate_branch_administrator_list_parse(result, &bogus); *mpp = string_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } cstate_branch_administrator_list_ty * cstate_branch_administrator_list_clone(cstate_branch_administrator_list_ty *from) { return cstate_branch_administrator_list_copy(from); } #ifdef DEBUG void cstate_branch_administrator_list_trace_real(const char *name, const cstate_branch_administrator_list_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("[\n"); trace_printf("// length = %ld\n", (long)value->length); trace_printf("// maximum = %ld\n", (long)value->maximum); assert(value->length <= value->maximum); assert(!value->list == !value->maximum); for (size_t j = 0; j < value->length; ++j) { string_ty * mp = value->list[j]; trace_string_real("", mp); } trace_printf("]"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG meta_type cstate_branch_administrator_list_type = { "cstate_branch_administrator_list", cstate_branch_administrator_list_alloc, cstate_branch_administrator_list_free, 0, // enum_parse cstate_branch_administrator_list_parse, 0, // struct_parse 0, // fuzzy cstate_branch_administrator_list_convert, generic_struct_is_set, }; void cstate_branch_developer_list_write(const output::pointer &fp, const char *name, cstate_branch_developer_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_branch_developer_list_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); fp->fputs("[\n"); for (j = 0; j < this_thing->length; ++j) { string_write(fp, (const char *)0, this_thing->list[j]); fp->fputs(",\n"); } fp->fputs("]"); if (name) fp->fputs(";\n"); trace(("}\n")); } void cstate_branch_developer_list_write_xml(const output::pointer &fp, const char *name, cstate_branch_developer_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_branch_developer_list_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) { string_write_xml(fp, "string", this_thing->list[j]); } fp->fputs("fputs(name); fp->fputs(">\n"); trace(("}\n")); } static void * cstate_branch_developer_list_alloc(void) { cstate_branch_developer_list_ty *result; trace(("cstate_branch_developer_list_alloc()\n{\n")); result = (cstate_branch_developer_list_ty *)mem_alloc(sizeof(cstate_branch_developer_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void cstate_branch_developer_list_free(void *that) { cstate_branch_developer_list_ty *this_thing; size_t j; this_thing = (cstate_branch_developer_list_ty *)that; if (!this_thing) return; trace(("cstate_branch_developer_list_free(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) str_free(this_thing->list[j]); delete [] this_thing->list; mem_free(this_thing); trace(("}\n")); } static void * cstate_branch_developer_list_parse(void *that, meta_type **type_pp) { cstate_branch_developer_list_ty *this_thing; void *addr; this_thing = (cstate_branch_developer_list_ty *)that; trace(("cstate_branch_developer_list_parse(this_thing = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)type_pp)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); *type_pp = &string_type; trace_pointer(*type_pp); if (this_thing->length >= this_thing->maximum) { this_thing->maximum = this_thing->maximum * 2 + 16; string_ty * *new_list = new string_ty * [this_thing->maximum]; for (size_t j = 0; j < this_thing->length; ++j) new_list[j] = this_thing->list[j]; delete [] this_thing->list; this_thing->list = new_list; } addr = &this_thing->list[this_thing->length++]; trace(("return %08lX;\n", (long)addr)); trace(("}\n")); return addr; } static rpt_value::pointer cstate_branch_developer_list_convert(void *that) { cstate_branch_developer_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(cstate_branch_developer_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("cstate_branch_developer_list_convert(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); rpt_value_list *p = new rpt_value_list(); rpt_value::pointer result(p); for (j = 0; j < this_thing->length; ++j) { vp = string_type.convert(&this_thing->list[j]); assert(vp); p->append(vp); } trace(("}\n")); trace(("return %08lX;\n", (long)result.get())); return result; } cstate_branch_developer_list_ty * cstate_branch_developer_list_copy(cstate_branch_developer_list_ty *from) { size_t j; cstate_branch_developer_list_ty *result; if (!from) return 0; trace(("cstate_branch_developer_list_copy(from = %08lX)\n{\n", (long)from)); result = (cstate_branch_developer_list_ty *)cstate_branch_developer_list_alloc(); assert(from->length <= from->maximum); assert(!from->list == !from->maximum); for (j = 0; j < from->length; ++j) { string_ty * mp; string_ty * *mpp; meta_type *bogus; mp = from->list[j]; mpp = (string_ty **)cstate_branch_developer_list_parse(result, &bogus); *mpp = string_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } cstate_branch_developer_list_ty * cstate_branch_developer_list_clone(cstate_branch_developer_list_ty *from) { return cstate_branch_developer_list_copy(from); } #ifdef DEBUG void cstate_branch_developer_list_trace_real(const char *name, const cstate_branch_developer_list_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("[\n"); trace_printf("// length = %ld\n", (long)value->length); trace_printf("// maximum = %ld\n", (long)value->maximum); assert(value->length <= value->maximum); assert(!value->list == !value->maximum); for (size_t j = 0; j < value->length; ++j) { string_ty * mp = value->list[j]; trace_string_real("", mp); } trace_printf("]"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG meta_type cstate_branch_developer_list_type = { "cstate_branch_developer_list", cstate_branch_developer_list_alloc, cstate_branch_developer_list_free, 0, // enum_parse cstate_branch_developer_list_parse, 0, // struct_parse 0, // fuzzy cstate_branch_developer_list_convert, generic_struct_is_set, }; void cstate_branch_reviewer_list_write(const output::pointer &fp, const char *name, cstate_branch_reviewer_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_branch_reviewer_list_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); fp->fputs("[\n"); for (j = 0; j < this_thing->length; ++j) { string_write(fp, (const char *)0, this_thing->list[j]); fp->fputs(",\n"); } fp->fputs("]"); if (name) fp->fputs(";\n"); trace(("}\n")); } void cstate_branch_reviewer_list_write_xml(const output::pointer &fp, const char *name, cstate_branch_reviewer_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_branch_reviewer_list_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) { string_write_xml(fp, "string", this_thing->list[j]); } fp->fputs("fputs(name); fp->fputs(">\n"); trace(("}\n")); } static void * cstate_branch_reviewer_list_alloc(void) { cstate_branch_reviewer_list_ty *result; trace(("cstate_branch_reviewer_list_alloc()\n{\n")); result = (cstate_branch_reviewer_list_ty *)mem_alloc(sizeof(cstate_branch_reviewer_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void cstate_branch_reviewer_list_free(void *that) { cstate_branch_reviewer_list_ty *this_thing; size_t j; this_thing = (cstate_branch_reviewer_list_ty *)that; if (!this_thing) return; trace(("cstate_branch_reviewer_list_free(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) str_free(this_thing->list[j]); delete [] this_thing->list; mem_free(this_thing); trace(("}\n")); } static void * cstate_branch_reviewer_list_parse(void *that, meta_type **type_pp) { cstate_branch_reviewer_list_ty *this_thing; void *addr; this_thing = (cstate_branch_reviewer_list_ty *)that; trace(("cstate_branch_reviewer_list_parse(this_thing = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)type_pp)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); *type_pp = &string_type; trace_pointer(*type_pp); if (this_thing->length >= this_thing->maximum) { this_thing->maximum = this_thing->maximum * 2 + 16; string_ty * *new_list = new string_ty * [this_thing->maximum]; for (size_t j = 0; j < this_thing->length; ++j) new_list[j] = this_thing->list[j]; delete [] this_thing->list; this_thing->list = new_list; } addr = &this_thing->list[this_thing->length++]; trace(("return %08lX;\n", (long)addr)); trace(("}\n")); return addr; } static rpt_value::pointer cstate_branch_reviewer_list_convert(void *that) { cstate_branch_reviewer_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(cstate_branch_reviewer_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("cstate_branch_reviewer_list_convert(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); rpt_value_list *p = new rpt_value_list(); rpt_value::pointer result(p); for (j = 0; j < this_thing->length; ++j) { vp = string_type.convert(&this_thing->list[j]); assert(vp); p->append(vp); } trace(("}\n")); trace(("return %08lX;\n", (long)result.get())); return result; } cstate_branch_reviewer_list_ty * cstate_branch_reviewer_list_copy(cstate_branch_reviewer_list_ty *from) { size_t j; cstate_branch_reviewer_list_ty *result; if (!from) return 0; trace(("cstate_branch_reviewer_list_copy(from = %08lX)\n{\n", (long)from)); result = (cstate_branch_reviewer_list_ty *)cstate_branch_reviewer_list_alloc(); assert(from->length <= from->maximum); assert(!from->list == !from->maximum); for (j = 0; j < from->length; ++j) { string_ty * mp; string_ty * *mpp; meta_type *bogus; mp = from->list[j]; mpp = (string_ty **)cstate_branch_reviewer_list_parse(result, &bogus); *mpp = string_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } cstate_branch_reviewer_list_ty * cstate_branch_reviewer_list_clone(cstate_branch_reviewer_list_ty *from) { return cstate_branch_reviewer_list_copy(from); } #ifdef DEBUG void cstate_branch_reviewer_list_trace_real(const char *name, const cstate_branch_reviewer_list_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("[\n"); trace_printf("// length = %ld\n", (long)value->length); trace_printf("// maximum = %ld\n", (long)value->maximum); assert(value->length <= value->maximum); assert(!value->list == !value->maximum); for (size_t j = 0; j < value->length; ++j) { string_ty * mp = value->list[j]; trace_string_real("", mp); } trace_printf("]"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG meta_type cstate_branch_reviewer_list_type = { "cstate_branch_reviewer_list", cstate_branch_reviewer_list_alloc, cstate_branch_reviewer_list_free, 0, // enum_parse cstate_branch_reviewer_list_parse, 0, // struct_parse 0, // fuzzy cstate_branch_reviewer_list_convert, generic_struct_is_set, }; void cstate_branch_integrator_list_write(const output::pointer &fp, const char *name, cstate_branch_integrator_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_branch_integrator_list_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); fp->fputs("[\n"); for (j = 0; j < this_thing->length; ++j) { string_write(fp, (const char *)0, this_thing->list[j]); fp->fputs(",\n"); } fp->fputs("]"); if (name) fp->fputs(";\n"); trace(("}\n")); } void cstate_branch_integrator_list_write_xml(const output::pointer &fp, const char *name, cstate_branch_integrator_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_branch_integrator_list_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) { string_write_xml(fp, "string", this_thing->list[j]); } fp->fputs("fputs(name); fp->fputs(">\n"); trace(("}\n")); } static void * cstate_branch_integrator_list_alloc(void) { cstate_branch_integrator_list_ty *result; trace(("cstate_branch_integrator_list_alloc()\n{\n")); result = (cstate_branch_integrator_list_ty *)mem_alloc(sizeof(cstate_branch_integrator_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void cstate_branch_integrator_list_free(void *that) { cstate_branch_integrator_list_ty *this_thing; size_t j; this_thing = (cstate_branch_integrator_list_ty *)that; if (!this_thing) return; trace(("cstate_branch_integrator_list_free(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) str_free(this_thing->list[j]); delete [] this_thing->list; mem_free(this_thing); trace(("}\n")); } static void * cstate_branch_integrator_list_parse(void *that, meta_type **type_pp) { cstate_branch_integrator_list_ty *this_thing; void *addr; this_thing = (cstate_branch_integrator_list_ty *)that; trace(("cstate_branch_integrator_list_parse(this_thing = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)type_pp)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); *type_pp = &string_type; trace_pointer(*type_pp); if (this_thing->length >= this_thing->maximum) { this_thing->maximum = this_thing->maximum * 2 + 16; string_ty * *new_list = new string_ty * [this_thing->maximum]; for (size_t j = 0; j < this_thing->length; ++j) new_list[j] = this_thing->list[j]; delete [] this_thing->list; this_thing->list = new_list; } addr = &this_thing->list[this_thing->length++]; trace(("return %08lX;\n", (long)addr)); trace(("}\n")); return addr; } static rpt_value::pointer cstate_branch_integrator_list_convert(void *that) { cstate_branch_integrator_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(cstate_branch_integrator_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("cstate_branch_integrator_list_convert(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); rpt_value_list *p = new rpt_value_list(); rpt_value::pointer result(p); for (j = 0; j < this_thing->length; ++j) { vp = string_type.convert(&this_thing->list[j]); assert(vp); p->append(vp); } trace(("}\n")); trace(("return %08lX;\n", (long)result.get())); return result; } cstate_branch_integrator_list_ty * cstate_branch_integrator_list_copy(cstate_branch_integrator_list_ty *from) { size_t j; cstate_branch_integrator_list_ty *result; if (!from) return 0; trace(("cstate_branch_integrator_list_copy(from = %08lX)\n{\n", (long)from)); result = (cstate_branch_integrator_list_ty *)cstate_branch_integrator_list_alloc(); assert(from->length <= from->maximum); assert(!from->list == !from->maximum); for (j = 0; j < from->length; ++j) { string_ty * mp; string_ty * *mpp; meta_type *bogus; mp = from->list[j]; mpp = (string_ty **)cstate_branch_integrator_list_parse(result, &bogus); *mpp = string_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } cstate_branch_integrator_list_ty * cstate_branch_integrator_list_clone(cstate_branch_integrator_list_ty *from) { return cstate_branch_integrator_list_copy(from); } #ifdef DEBUG void cstate_branch_integrator_list_trace_real(const char *name, const cstate_branch_integrator_list_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("[\n"); trace_printf("// length = %ld\n", (long)value->length); trace_printf("// maximum = %ld\n", (long)value->maximum); assert(value->length <= value->maximum); assert(!value->list == !value->maximum); for (size_t j = 0; j < value->length; ++j) { string_ty * mp = value->list[j]; trace_string_real("", mp); } trace_printf("]"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG meta_type cstate_branch_integrator_list_type = { "cstate_branch_integrator_list", cstate_branch_integrator_list_alloc, cstate_branch_integrator_list_free, 0, // enum_parse cstate_branch_integrator_list_parse, 0, // struct_parse 0, // fuzzy cstate_branch_integrator_list_convert, generic_struct_is_set, }; void cstate_branch_write(const output::pointer &fp, const char *name, cstate_branch_ty *this_thing) { if (!this_thing) return; trace(("cstate_branch_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(((cstate_branch_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((cstate_branch_ty *)this_thing)->reference_count)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } fp->fputs("{\n"); integer_write(fp, "umask", this_thing->umask, 0); boolean_write(fp, "developer_may_review", this_thing->developer_may_review, 1); boolean_write(fp, "developer_may_integrate", this_thing->developer_may_integrate, 1); boolean_write(fp, "reviewer_may_integrate", this_thing->reviewer_may_integrate, 1); boolean_write(fp, "developers_may_create_changes", this_thing->developers_may_create_changes, 1); string_write(fp, "forced_develop_begin_notify_command", this_thing->forced_develop_begin_notify_command); string_write(fp, "develop_end_notify_command", this_thing->develop_end_notify_command); string_write(fp, "develop_end_undo_notify_command", this_thing->develop_end_undo_notify_command); string_write(fp, "review_begin_notify_command", this_thing->review_begin_notify_command); string_write(fp, "review_begin_undo_notify_command", this_thing->review_begin_undo_notify_command); string_write(fp, "review_pass_notify_command", this_thing->review_pass_notify_command); string_write(fp, "review_pass_undo_notify_command", this_thing->review_pass_undo_notify_command); string_write(fp, "review_fail_notify_command", this_thing->review_fail_notify_command); string_write(fp, "integrate_pass_notify_command", this_thing->integrate_pass_notify_command); string_write(fp, "integrate_fail_notify_command", this_thing->integrate_fail_notify_command); boolean_write(fp, "default_test_exemption", this_thing->default_test_exemption, 1); boolean_write(fp, "default_test_regression_exemption", this_thing->default_test_regression_exemption, 1); boolean_write(fp, "skip_unlucky", this_thing->skip_unlucky, 1); boolean_write(fp, "compress_database", this_thing->compress_database, 1); cstate_branch_develop_end_action_write(fp, "develop_end_action", this_thing->develop_end_action, 1); cstate_branch_history_list_write(fp, "history", this_thing->history); cstate_branch_change_list_write(fp, "change", this_thing->change); cstate_branch_sub_branch_list_write(fp, "sub_branch", this_thing->sub_branch); cstate_branch_administrator_list_write(fp, "administrator", this_thing->administrator); cstate_branch_developer_list_write(fp, "developer", this_thing->developer); cstate_branch_reviewer_list_write(fp, "reviewer", this_thing->reviewer); cstate_branch_integrator_list_write(fp, "integrator", this_thing->integrator); integer_write(fp, "currently_integrating_change", this_thing->currently_integrating_change, 0); string_write(fp, "default_development_directory", this_thing->default_development_directory); integer_write(fp, "minimum_change_number", this_thing->minimum_change_number, 0); boolean_write(fp, "reuse_change_numbers", this_thing->reuse_change_numbers, 1); integer_write(fp, "minimum_branch_number", this_thing->minimum_branch_number, 0); boolean_write(fp, "protect_development_directory", this_thing->protect_development_directory, 1); fp->fputs("}"); if (name) fp->fputs(";\n"); trace(("}\n")); } void cstate_branch_write_xml(const output::pointer &fp, const char *name, cstate_branch_ty *this_thing) { if (!this_thing) return; trace(("cstate_branch_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); assert(((cstate_branch_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((cstate_branch_ty *)this_thing)->reference_count)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); integer_write_xml(fp, "umask", this_thing->umask, 0); boolean_write_xml(fp, "developer_may_review", this_thing->developer_may_review, 0); boolean_write_xml(fp, "developer_may_integrate", this_thing->developer_may_integrate, 0); boolean_write_xml(fp, "reviewer_may_integrate", this_thing->reviewer_may_integrate, 0); boolean_write_xml(fp, "developers_may_create_changes", this_thing->developers_may_create_changes, 0); string_write_xml(fp, "forced_develop_begin_notify_command", this_thing->forced_develop_begin_notify_command); string_write_xml(fp, "develop_end_notify_command", this_thing->develop_end_notify_command); string_write_xml(fp, "develop_end_undo_notify_command", this_thing->develop_end_undo_notify_command); string_write_xml(fp, "review_begin_notify_command", this_thing->review_begin_notify_command); string_write_xml(fp, "review_begin_undo_notify_command", this_thing->review_begin_undo_notify_command); string_write_xml(fp, "review_pass_notify_command", this_thing->review_pass_notify_command); string_write_xml(fp, "review_pass_undo_notify_command", this_thing->review_pass_undo_notify_command); string_write_xml(fp, "review_fail_notify_command", this_thing->review_fail_notify_command); string_write_xml(fp, "integrate_pass_notify_command", this_thing->integrate_pass_notify_command); string_write_xml(fp, "integrate_fail_notify_command", this_thing->integrate_fail_notify_command); boolean_write_xml(fp, "default_test_exemption", this_thing->default_test_exemption, 0); boolean_write_xml(fp, "default_test_regression_exemption", this_thing->default_test_regression_exemption, 1); boolean_write_xml(fp, "skip_unlucky", this_thing->skip_unlucky, 0); boolean_write_xml(fp, "compress_database", this_thing->compress_database, 0); cstate_branch_develop_end_action_write_xml(fp, "develop_end_action", this_thing->develop_end_action, 0); cstate_branch_history_list_write_xml(fp, "history", this_thing->history); cstate_branch_change_list_write_xml(fp, "change", this_thing->change); cstate_branch_sub_branch_list_write_xml(fp, "sub_branch", this_thing->sub_branch); cstate_branch_administrator_list_write_xml(fp, "administrator", this_thing->administrator); cstate_branch_developer_list_write_xml(fp, "developer", this_thing->developer); cstate_branch_reviewer_list_write_xml(fp, "reviewer", this_thing->reviewer); cstate_branch_integrator_list_write_xml(fp, "integrator", this_thing->integrator); integer_write_xml(fp, "currently_integrating_change", this_thing->currently_integrating_change, 0); string_write_xml(fp, "default_development_directory", this_thing->default_development_directory); integer_write_xml(fp, "minimum_change_number", this_thing->minimum_change_number, 0); boolean_write_xml(fp, "reuse_change_numbers", this_thing->reuse_change_numbers, 0); integer_write_xml(fp, "minimum_branch_number", this_thing->minimum_branch_number, 0); boolean_write_xml(fp, "protect_development_directory", this_thing->protect_development_directory, 0); fp->fputs("fputs(name); fp->fputs(">\n"); } static void * cstate_branch_alloc(void) { cstate_branch_ty *this_thing; trace(("cstate_branch_alloc()\n{\n")); this_thing = (cstate_branch_ty *)mem_alloc(sizeof(cstate_branch_ty)); this_thing->reference_count = 1; this_thing->mask = 0; this_thing->errpos = str_copy(lex_position()); this_thing->umask = (long)0; this_thing->developer_may_review = (bool)0; this_thing->developer_may_integrate = (bool)0; this_thing->reviewer_may_integrate = (bool)0; this_thing->developers_may_create_changes = (bool)0; this_thing->forced_develop_begin_notify_command = (string_ty *)0; this_thing->develop_end_notify_command = (string_ty *)0; this_thing->develop_end_undo_notify_command = (string_ty *)0; this_thing->review_begin_notify_command = (string_ty *)0; this_thing->review_begin_undo_notify_command = (string_ty *)0; this_thing->review_pass_notify_command = (string_ty *)0; this_thing->review_pass_undo_notify_command = (string_ty *)0; this_thing->review_fail_notify_command = (string_ty *)0; this_thing->integrate_pass_notify_command = (string_ty *)0; this_thing->integrate_fail_notify_command = (string_ty *)0; this_thing->default_test_exemption = (bool)0; this_thing->default_test_regression_exemption = (bool)0; this_thing->skip_unlucky = (bool)0; this_thing->compress_database = (bool)0; this_thing->develop_end_action = (cstate_branch_develop_end_action_ty)0; this_thing->history = (cstate_branch_history_list_ty *)0; this_thing->change = (cstate_branch_change_list_ty *)0; this_thing->sub_branch = (cstate_branch_sub_branch_list_ty *)0; this_thing->administrator = (cstate_branch_administrator_list_ty *)0; this_thing->developer = (cstate_branch_developer_list_ty *)0; this_thing->reviewer = (cstate_branch_reviewer_list_ty *)0; this_thing->integrator = (cstate_branch_integrator_list_ty *)0; this_thing->currently_integrating_change = (long)0; this_thing->default_development_directory = (string_ty *)0; this_thing->minimum_change_number = (long)0; this_thing->reuse_change_numbers = (bool)0; this_thing->minimum_branch_number = (long)0; this_thing->protect_development_directory = (bool)0; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } cstate_branch_ty * cstate_branch_copy(cstate_branch_ty *this_thing) { trace(("cstate_branch_copy()\n{\n")); this_thing->reference_count++; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } cstate_branch_ty * cstate_branch_clone(cstate_branch_ty *this_thing) { if (!this_thing) return 0; trace(("cstate_branch_clone()\n{\n")); cstate_branch_ty *result = (cstate_branch_ty *)cstate_branch_alloc(); result->umask = this_thing->umask; result->developer_may_review = this_thing->developer_may_review; result->developer_may_integrate = this_thing->developer_may_integrate; result->reviewer_may_integrate = this_thing->reviewer_may_integrate; result->developers_may_create_changes = this_thing->developers_may_create_changes; result->forced_develop_begin_notify_command = str_copy(this_thing->forced_develop_begin_notify_command); result->develop_end_notify_command = str_copy(this_thing->develop_end_notify_command); result->develop_end_undo_notify_command = str_copy(this_thing->develop_end_undo_notify_command); result->review_begin_notify_command = str_copy(this_thing->review_begin_notify_command); result->review_begin_undo_notify_command = str_copy(this_thing->review_begin_undo_notify_command); result->review_pass_notify_command = str_copy(this_thing->review_pass_notify_command); result->review_pass_undo_notify_command = str_copy(this_thing->review_pass_undo_notify_command); result->review_fail_notify_command = str_copy(this_thing->review_fail_notify_command); result->integrate_pass_notify_command = str_copy(this_thing->integrate_pass_notify_command); result->integrate_fail_notify_command = str_copy(this_thing->integrate_fail_notify_command); result->default_test_exemption = this_thing->default_test_exemption; result->default_test_regression_exemption = this_thing->default_test_regression_exemption; result->skip_unlucky = this_thing->skip_unlucky; result->compress_database = this_thing->compress_database; result->develop_end_action = this_thing->develop_end_action; result->history = cstate_branch_history_list_clone(this_thing->history); result->change = cstate_branch_change_list_clone(this_thing->change); result->sub_branch = cstate_branch_sub_branch_list_clone(this_thing->sub_branch); result->administrator = cstate_branch_administrator_list_clone(this_thing->administrator); result->developer = cstate_branch_developer_list_clone(this_thing->developer); result->reviewer = cstate_branch_reviewer_list_clone(this_thing->reviewer); result->integrator = cstate_branch_integrator_list_clone(this_thing->integrator); result->currently_integrating_change = this_thing->currently_integrating_change; result->default_development_directory = str_copy(this_thing->default_development_directory); result->minimum_change_number = this_thing->minimum_change_number; result->reuse_change_numbers = this_thing->reuse_change_numbers; result->minimum_branch_number = this_thing->minimum_branch_number; result->protect_development_directory = this_thing->protect_development_directory; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } #ifdef DEBUG void cstate_branch_trace_real(const char *name, const cstate_branch_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("{\n"); trace_long_real("umask", &value->umask); trace_bool_real("developer_may_review", value->developer_may_review); trace_bool_real("developer_may_integrate", value->developer_may_integrate); trace_bool_real("reviewer_may_integrate", value->reviewer_may_integrate); trace_bool_real("developers_may_create_changes", value->developers_may_create_changes); trace_string_real("forced_develop_begin_notify_command", value->forced_develop_begin_notify_command); trace_string_real("develop_end_notify_command", value->develop_end_notify_command); trace_string_real("develop_end_undo_notify_command", value->develop_end_undo_notify_command); trace_string_real("review_begin_notify_command", value->review_begin_notify_command); trace_string_real("review_begin_undo_notify_command", value->review_begin_undo_notify_command); trace_string_real("review_pass_notify_command", value->review_pass_notify_command); trace_string_real("review_pass_undo_notify_command", value->review_pass_undo_notify_command); trace_string_real("review_fail_notify_command", value->review_fail_notify_command); trace_string_real("integrate_pass_notify_command", value->integrate_pass_notify_command); trace_string_real("integrate_fail_notify_command", value->integrate_fail_notify_command); trace_bool_real("default_test_exemption", value->default_test_exemption); trace_bool_real("default_test_regression_exemption", value->default_test_regression_exemption); trace_bool_real("skip_unlucky", value->skip_unlucky); trace_bool_real("compress_database", value->compress_database); trace_printf("develop_end_action = %s;\n", cstate_branch_develop_end_action_ename(value->develop_end_action)); cstate_branch_history_list_trace_real("history", value->history); cstate_branch_change_list_trace_real("change", value->change); cstate_branch_sub_branch_list_trace_real("sub_branch", value->sub_branch); cstate_branch_administrator_list_trace_real("administrator", value->administrator); cstate_branch_developer_list_trace_real("developer", value->developer); cstate_branch_reviewer_list_trace_real("reviewer", value->reviewer); cstate_branch_integrator_list_trace_real("integrator", value->integrator); trace_long_real("currently_integrating_change", &value->currently_integrating_change); trace_string_real("default_development_directory", value->default_development_directory); trace_long_real("minimum_change_number", &value->minimum_change_number); trace_bool_real("reuse_change_numbers", value->reuse_change_numbers); trace_long_real("minimum_branch_number", &value->minimum_branch_number); trace_bool_real("protect_development_directory", value->protect_development_directory); trace_printf("}"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG static void cstate_branch_free(void *that) { cstate_branch_ty *this_thing; this_thing = (cstate_branch_ty *)that; if (!this_thing) return; this_thing->reference_count--; assert(this_thing->reference_count >= 0); if (this_thing->reference_count > 0) return; trace(("cstate_branch_free(this_thing = %08lX)\n{\n", (long)this_thing)); if (this_thing->errpos) { str_free(this_thing->errpos); this_thing->errpos = 0; } str_free(this_thing->forced_develop_begin_notify_command); str_free(this_thing->develop_end_notify_command); str_free(this_thing->develop_end_undo_notify_command); str_free(this_thing->review_begin_notify_command); str_free(this_thing->review_begin_undo_notify_command); str_free(this_thing->review_pass_notify_command); str_free(this_thing->review_pass_undo_notify_command); str_free(this_thing->review_fail_notify_command); str_free(this_thing->integrate_pass_notify_command); str_free(this_thing->integrate_fail_notify_command); cstate_branch_history_list_free(this_thing->history); cstate_branch_change_list_free(this_thing->change); cstate_branch_sub_branch_list_free(this_thing->sub_branch); cstate_branch_administrator_list_free(this_thing->administrator); cstate_branch_developer_list_free(this_thing->developer); cstate_branch_reviewer_list_free(this_thing->reviewer); cstate_branch_integrator_list_free(this_thing->integrator); str_free(this_thing->default_development_directory); mem_free(this_thing); trace(("}\n")); } static type_table_ty cstate_branch_table[] = { { "umask", offsetof(cstate_branch_ty, umask), &integer_type, cstate_branch_umask_mask, 0, // redefinition not ok 0, // fast_name }, { "developer_may_review", offsetof(cstate_branch_ty, developer_may_review), &boolean_type, cstate_branch_developer_may_review_mask, 0, // redefinition not ok 0, // fast_name }, { "developer_may_integrate", offsetof(cstate_branch_ty, developer_may_integrate), &boolean_type, cstate_branch_developer_may_integrate_mask, 0, // redefinition not ok 0, // fast_name }, { "reviewer_may_integrate", offsetof(cstate_branch_ty, reviewer_may_integrate), &boolean_type, cstate_branch_reviewer_may_integrate_mask, 0, // redefinition not ok 0, // fast_name }, { "developers_may_create_changes", offsetof(cstate_branch_ty, developers_may_create_changes), &boolean_type, cstate_branch_developers_may_create_changes_mask, 0, // redefinition not ok 0, // fast_name }, { "forced_develop_begin_notify_command", offsetof(cstate_branch_ty, forced_develop_begin_notify_command), &string_type, cstate_branch_forced_develop_begin_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "develop_end_notify_command", offsetof(cstate_branch_ty, develop_end_notify_command), &string_type, cstate_branch_develop_end_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "develop_end_undo_notify_command", offsetof(cstate_branch_ty, develop_end_undo_notify_command), &string_type, cstate_branch_develop_end_undo_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "review_begin_notify_command", offsetof(cstate_branch_ty, review_begin_notify_command), &string_type, cstate_branch_review_begin_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "review_begin_undo_notify_command", offsetof(cstate_branch_ty, review_begin_undo_notify_command), &string_type, cstate_branch_review_begin_undo_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "review_pass_notify_command", offsetof(cstate_branch_ty, review_pass_notify_command), &string_type, cstate_branch_review_pass_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "review_pass_undo_notify_command", offsetof(cstate_branch_ty, review_pass_undo_notify_command), &string_type, cstate_branch_review_pass_undo_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "review_fail_notify_command", offsetof(cstate_branch_ty, review_fail_notify_command), &string_type, cstate_branch_review_fail_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "integrate_pass_notify_command", offsetof(cstate_branch_ty, integrate_pass_notify_command), &string_type, cstate_branch_integrate_pass_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "integrate_fail_notify_command", offsetof(cstate_branch_ty, integrate_fail_notify_command), &string_type, cstate_branch_integrate_fail_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "default_test_exemption", offsetof(cstate_branch_ty, default_test_exemption), &boolean_type, cstate_branch_default_test_exemption_mask, 0, // redefinition not ok 0, // fast_name }, { "default_test_regression_exemption", offsetof(cstate_branch_ty, default_test_regression_exemption), &boolean_type, cstate_branch_default_test_regression_exemption_mask, 0, // redefinition not ok 0, // fast_name }, { "skip_unlucky", offsetof(cstate_branch_ty, skip_unlucky), &boolean_type, cstate_branch_skip_unlucky_mask, 0, // redefinition not ok 0, // fast_name }, { "compress_database", offsetof(cstate_branch_ty, compress_database), &boolean_type, cstate_branch_compress_database_mask, 0, // redefinition not ok 0, // fast_name }, { "develop_end_action", offsetof(cstate_branch_ty, develop_end_action), &cstate_branch_develop_end_action_type, cstate_branch_develop_end_action_mask, 0, // redefinition not ok 0, // fast_name }, { "history", offsetof(cstate_branch_ty, history), &cstate_branch_history_list_type, cstate_branch_history_mask, 0, // redefinition not ok 0, // fast_name }, { "change", offsetof(cstate_branch_ty, change), &cstate_branch_change_list_type, cstate_branch_change_mask, 0, // redefinition not ok 0, // fast_name }, { "sub_branch", offsetof(cstate_branch_ty, sub_branch), &cstate_branch_sub_branch_list_type, cstate_branch_sub_branch_mask, 0, // redefinition not ok 0, // fast_name }, { "administrator", offsetof(cstate_branch_ty, administrator), &cstate_branch_administrator_list_type, cstate_branch_administrator_mask, 0, // redefinition not ok 0, // fast_name }, { "developer", offsetof(cstate_branch_ty, developer), &cstate_branch_developer_list_type, cstate_branch_developer_mask, 0, // redefinition not ok 0, // fast_name }, { "reviewer", offsetof(cstate_branch_ty, reviewer), &cstate_branch_reviewer_list_type, cstate_branch_reviewer_mask, 0, // redefinition not ok 0, // fast_name }, { "integrator", offsetof(cstate_branch_ty, integrator), &cstate_branch_integrator_list_type, cstate_branch_integrator_mask, 0, // redefinition not ok 0, // fast_name }, { "currently_integrating_change", offsetof(cstate_branch_ty, currently_integrating_change), &integer_type, cstate_branch_currently_integrating_change_mask, 0, // redefinition not ok 0, // fast_name }, { "default_development_directory", offsetof(cstate_branch_ty, default_development_directory), &string_type, cstate_branch_default_development_directory_mask, 0, // redefinition not ok 0, // fast_name }, { "minimum_change_number", offsetof(cstate_branch_ty, minimum_change_number), &integer_type, cstate_branch_minimum_change_number_mask, 0, // redefinition not ok 0, // fast_name }, { "reuse_change_numbers", offsetof(cstate_branch_ty, reuse_change_numbers), &boolean_type, cstate_branch_reuse_change_numbers_mask, 0, // redefinition not ok 0, // fast_name }, { "minimum_branch_number", offsetof(cstate_branch_ty, minimum_branch_number), &integer_type, cstate_branch_minimum_branch_number_mask, 0, // redefinition not ok 0, // fast_name }, { "protect_development_directory", offsetof(cstate_branch_ty, protect_development_directory), &boolean_type, cstate_branch_protect_development_directory_mask, 0, // redefinition not ok 0, // fast_name }, }; static void * cstate_branch_parse(void *this_thing, string_ty *name, meta_type **type_pp, unsigned long *mask_p, int *redef_p) { void *addr; trace(("cstate_branch_parse(this_thing = %08lX, name = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)name, (long)type_pp)); assert(((cstate_branch_ty *)this_thing)->reference_count > 0); addr = generic_struct_parse ( this_thing, name, type_pp, mask_p, redef_p, cstate_branch_table, SIZEOF(cstate_branch_table) ); trace(("return %08lX;\n}\n", (long)addr)); return addr; } static string_ty * cstate_branch_fuzzy(string_ty *name) { string_ty *result; trace(("cstate_branch_fuzzy(name = %08lX)\n{\n", (long)name)); result = generic_struct_fuzzy ( name, cstate_branch_table, SIZEOF(cstate_branch_table) ); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static rpt_value::pointer cstate_branch_convert(void *this_thing) { trace(("cstate_branch_convert(name = %08lX)\n{\n", (long)this_thing)); assert(((cstate_branch_ty *)this_thing)->reference_count > 0); rpt_value::pointer result = generic_struct_convert ( this_thing, cstate_branch_table, SIZEOF(cstate_branch_table) ); trace(("return %08lX;\n", (long)result.get())); trace(("}\n")); return result; } meta_type cstate_branch_type = { "cstate_branch", cstate_branch_alloc, cstate_branch_free, 0, // enum_parse 0, // list_parse cstate_branch_parse, cstate_branch_fuzzy, cstate_branch_convert, generic_struct_is_set, }; void cstate_src_write(const output::pointer &fp, const char *name, cstate_src_ty *this_thing) { if (!this_thing) return; trace(("cstate_src_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(((cstate_src_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((cstate_src_ty *)this_thing)->reference_count)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } fp->fputs("{\n"); string_write(fp, "file_name", this_thing->file_name); string_write(fp, "uuid", this_thing->uuid); file_action_write(fp, "action", this_thing->action, 1); string_write(fp, "edit_number", this_thing->edit_number); file_usage_write(fp, "usage", this_thing->usage, 1); time_write(fp, "diff_time", this_thing->diff_time, 0); time_write(fp, "diff_file_time", this_thing->diff_file_time, 0); string_write(fp, "move", this_thing->move); boolean_write(fp, "executable", this_thing->executable, 0); attributes_list_write(fp, "attribute", this_thing->attribute); fp->fputs("}"); if (name) fp->fputs(";\n"); trace(("}\n")); } void cstate_src_write_xml(const output::pointer &fp, const char *name, cstate_src_ty *this_thing) { if (!this_thing) return; trace(("cstate_src_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); assert(((cstate_src_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((cstate_src_ty *)this_thing)->reference_count)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); string_write_xml(fp, "file_name", this_thing->file_name); string_write_xml(fp, "uuid", this_thing->uuid); file_action_write_xml(fp, "action", this_thing->action, 0); string_write_xml(fp, "edit_number", this_thing->edit_number); file_usage_write_xml(fp, "usage", this_thing->usage, 0); time_write_xml(fp, "diff_time", this_thing->diff_time, 0); time_write_xml(fp, "diff_file_time", this_thing->diff_file_time, 0); string_write_xml(fp, "move", this_thing->move); boolean_write_xml(fp, "executable", this_thing->executable, 0); attributes_list_write_xml(fp, "attribute", this_thing->attribute); fp->fputs("fputs(name); fp->fputs(">\n"); } static void * cstate_src_alloc(void) { cstate_src_ty *this_thing; trace(("cstate_src_alloc()\n{\n")); this_thing = (cstate_src_ty *)mem_alloc(sizeof(cstate_src_ty)); this_thing->reference_count = 1; this_thing->mask = 0; this_thing->errpos = str_copy(lex_position()); this_thing->file_name = (string_ty *)0; this_thing->uuid = (string_ty *)0; this_thing->action = (file_action_ty)0; this_thing->edit_number = (string_ty *)0; this_thing->usage = (file_usage_ty)0; this_thing->diff_time = (time_t)0; this_thing->diff_file_time = (time_t)0; this_thing->move = (string_ty *)0; this_thing->executable = (bool)0; this_thing->attribute = (attributes_list_ty *)0; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } cstate_src_ty * cstate_src_copy(cstate_src_ty *this_thing) { trace(("cstate_src_copy()\n{\n")); this_thing->reference_count++; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } cstate_src_ty * cstate_src_clone(cstate_src_ty *this_thing) { if (!this_thing) return 0; trace(("cstate_src_clone()\n{\n")); cstate_src_ty *result = (cstate_src_ty *)cstate_src_alloc(); result->file_name = str_copy(this_thing->file_name); result->uuid = str_copy(this_thing->uuid); result->action = this_thing->action; result->edit_number = str_copy(this_thing->edit_number); result->usage = this_thing->usage; result->diff_time = this_thing->diff_time; result->diff_file_time = this_thing->diff_file_time; result->move = str_copy(this_thing->move); result->executable = this_thing->executable; result->attribute = attributes_list_clone(this_thing->attribute); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } #ifdef DEBUG void cstate_src_trace_real(const char *name, const cstate_src_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("{\n"); trace_string_real("file_name", value->file_name); trace_string_real("uuid", value->uuid); trace_printf("action = %s;\n", file_action_ename(value->action)); trace_string_real("edit_number", value->edit_number); trace_printf("usage = %s;\n", file_usage_ename(value->usage)); trace_time_real("diff_time", value->diff_time); trace_time_real("diff_file_time", value->diff_file_time); trace_string_real("move", value->move); trace_bool_real("executable", value->executable); attributes_list_trace_real("attribute", value->attribute); trace_printf("}"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG static void cstate_src_free(void *that) { cstate_src_ty *this_thing; this_thing = (cstate_src_ty *)that; if (!this_thing) return; this_thing->reference_count--; assert(this_thing->reference_count >= 0); if (this_thing->reference_count > 0) return; trace(("cstate_src_free(this_thing = %08lX)\n{\n", (long)this_thing)); if (this_thing->errpos) { str_free(this_thing->errpos); this_thing->errpos = 0; } str_free(this_thing->file_name); str_free(this_thing->uuid); str_free(this_thing->edit_number); str_free(this_thing->move); attributes_list_type.free(this_thing->attribute); mem_free(this_thing); trace(("}\n")); } static type_table_ty cstate_src_table[] = { { "file_name", offsetof(cstate_src_ty, file_name), &string_type, cstate_src_file_name_mask, 0, // redefinition not ok 0, // fast_name }, { "uuid", offsetof(cstate_src_ty, uuid), &string_type, cstate_src_uuid_mask, 0, // redefinition not ok 0, // fast_name }, { "action", offsetof(cstate_src_ty, action), &file_action_type, cstate_src_action_mask, 0, // redefinition not ok 0, // fast_name }, { "edit_number", offsetof(cstate_src_ty, edit_number), &string_type, cstate_src_edit_number_mask, 0, // redefinition not ok 0, // fast_name }, { "usage", offsetof(cstate_src_ty, usage), &file_usage_type, cstate_src_usage_mask, 0, // redefinition not ok 0, // fast_name }, { "diff_time", offsetof(cstate_src_ty, diff_time), &time_type, cstate_src_diff_time_mask, 0, // redefinition not ok 0, // fast_name }, { "diff_file_time", offsetof(cstate_src_ty, diff_file_time), &time_type, cstate_src_diff_file_time_mask, 0, // redefinition not ok 0, // fast_name }, { "move", offsetof(cstate_src_ty, move), &string_type, cstate_src_move_mask, 0, // redefinition not ok 0, // fast_name }, { "executable", offsetof(cstate_src_ty, executable), &boolean_type, cstate_src_executable_mask, 0, // redefinition not ok 0, // fast_name }, { "attribute", offsetof(cstate_src_ty, attribute), &attributes_list_type, cstate_src_attribute_mask, 0, // redefinition not ok 0, // fast_name }, }; static void * cstate_src_parse(void *this_thing, string_ty *name, meta_type **type_pp, unsigned long *mask_p, int *redef_p) { void *addr; trace(("cstate_src_parse(this_thing = %08lX, name = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)name, (long)type_pp)); assert(((cstate_src_ty *)this_thing)->reference_count > 0); addr = generic_struct_parse ( this_thing, name, type_pp, mask_p, redef_p, cstate_src_table, SIZEOF(cstate_src_table) ); trace(("return %08lX;\n}\n", (long)addr)); return addr; } static string_ty * cstate_src_fuzzy(string_ty *name) { string_ty *result; trace(("cstate_src_fuzzy(name = %08lX)\n{\n", (long)name)); result = generic_struct_fuzzy ( name, cstate_src_table, SIZEOF(cstate_src_table) ); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static rpt_value::pointer cstate_src_convert(void *this_thing) { trace(("cstate_src_convert(name = %08lX)\n{\n", (long)this_thing)); assert(((cstate_src_ty *)this_thing)->reference_count > 0); rpt_value::pointer result = generic_struct_convert ( this_thing, cstate_src_table, SIZEOF(cstate_src_table) ); trace(("return %08lX;\n", (long)result.get())); trace(("}\n")); return result; } meta_type cstate_src_type = { "cstate_src", cstate_src_alloc, cstate_src_free, 0, // enum_parse 0, // list_parse cstate_src_parse, cstate_src_fuzzy, cstate_src_convert, generic_struct_is_set, }; void cstate_src_list_write(const output::pointer &fp, const char *name, cstate_src_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_src_list_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); fp->fputs("[\n"); for (j = 0; j < this_thing->length; ++j) { cstate_src_write(fp, (const char *)0, this_thing->list[j]); fp->fputs(",\n"); } fp->fputs("]"); if (name) fp->fputs(";\n"); trace(("}\n")); } void cstate_src_list_write_xml(const output::pointer &fp, const char *name, cstate_src_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("cstate_src_list_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) { cstate_src_write_xml(fp, "cstate_src", this_thing->list[j]); } fp->fputs("fputs(name); fp->fputs(">\n"); trace(("}\n")); } static void * cstate_src_list_alloc(void) { cstate_src_list_ty *result; trace(("cstate_src_list_alloc()\n{\n")); result = (cstate_src_list_ty *)mem_alloc(sizeof(cstate_src_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void cstate_src_list_free(void *that) { cstate_src_list_ty *this_thing; size_t j; this_thing = (cstate_src_list_ty *)that; if (!this_thing) return; trace(("cstate_src_list_free(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) cstate_src_free(this_thing->list[j]); delete [] this_thing->list; mem_free(this_thing); trace(("}\n")); } static void * cstate_src_list_parse(void *that, meta_type **type_pp) { cstate_src_list_ty *this_thing; void *addr; this_thing = (cstate_src_list_ty *)that; trace(("cstate_src_list_parse(this_thing = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)type_pp)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); *type_pp = &cstate_src_type; trace_pointer(*type_pp); if (this_thing->length >= this_thing->maximum) { this_thing->maximum = this_thing->maximum * 2 + 16; cstate_src_ty * *new_list = new cstate_src_ty * [this_thing->maximum]; for (size_t j = 0; j < this_thing->length; ++j) new_list[j] = this_thing->list[j]; delete [] this_thing->list; this_thing->list = new_list; } addr = &this_thing->list[this_thing->length++]; trace(("return %08lX;\n", (long)addr)); trace(("}\n")); return addr; } static rpt_value::pointer cstate_src_list_convert(void *that) { cstate_src_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(cstate_src_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("cstate_src_list_convert(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); rpt_value_list *p = new rpt_value_list(); rpt_value::pointer result(p); for (j = 0; j < this_thing->length; ++j) { vp = cstate_src_type.convert(&this_thing->list[j]); assert(vp); p->append(vp); } trace(("}\n")); trace(("return %08lX;\n", (long)result.get())); return result; } cstate_src_list_ty * cstate_src_list_copy(cstate_src_list_ty *from) { size_t j; cstate_src_list_ty *result; if (!from) return 0; trace(("cstate_src_list_copy(from = %08lX)\n{\n", (long)from)); result = (cstate_src_list_ty *)cstate_src_list_alloc(); assert(from->length <= from->maximum); assert(!from->list == !from->maximum); for (j = 0; j < from->length; ++j) { cstate_src_ty * mp; cstate_src_ty * *mpp; meta_type *bogus; mp = from->list[j]; mpp = (cstate_src_ty **)cstate_src_list_parse(result, &bogus); *mpp = cstate_src_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } cstate_src_list_ty * cstate_src_list_clone(cstate_src_list_ty *from) { return cstate_src_list_copy(from); } #ifdef DEBUG void cstate_src_list_trace_real(const char *name, const cstate_src_list_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("[\n"); trace_printf("// length = %ld\n", (long)value->length); trace_printf("// maximum = %ld\n", (long)value->maximum); assert(value->length <= value->maximum); assert(!value->list == !value->maximum); for (size_t j = 0; j < value->length; ++j) { cstate_src_ty * mp = value->list[j]; cstate_src_trace_real("", mp); } trace_printf("]"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG meta_type cstate_src_list_type = { "cstate_src_list", cstate_src_list_alloc, cstate_src_list_free, 0, // enum_parse cstate_src_list_parse, 0, // struct_parse 0, // fuzzy cstate_src_list_convert, generic_struct_is_set, }; void cstate_write(const output::pointer &fp, cstate_ty *this_thing) { if (!this_thing) return; trace(("cstate_write(this_thing = %08lX)\n{\n", (long)this_thing)); assert(((cstate_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((cstate_ty *)this_thing)->reference_count)); string_write(fp, "brief_description", this_thing->brief_description); string_write(fp, "description", this_thing->description); change_cause_write(fp, "cause", this_thing->cause, 1); boolean_write(fp, "test_exempt", this_thing->test_exempt, 1); boolean_write(fp, "test_baseline_exempt", this_thing->test_baseline_exempt, 1); boolean_write(fp, "regression_test_exempt", this_thing->regression_test_exempt, 1); cstate_architecture_list_write(fp, "architecture", this_thing->architecture); cstate_copyright_years_list_write(fp, "copyright_years", this_thing->copyright_years); string_write(fp, "version_previous", this_thing->version_previous); attributes_list_write(fp, "attribute", this_thing->attribute); cstate_state_write(fp, "state", this_thing->state, 1); boolean_write(fp, "given_test_exemption", this_thing->given_test_exemption, 0); boolean_write(fp, "given_regression_test_exemption", this_thing->given_regression_test_exemption, 0); integer_write(fp, "delta_number", this_thing->delta_number, 0); string_write(fp, "delta_uuid", this_thing->delta_uuid); boolean_write(fp, "minimum_integration", this_thing->minimum_integration, 0); integer_write(fp, "project_file_command_sync", this_thing->project_file_command_sync, 0); time_write(fp, "build_time", this_thing->build_time, 0); time_write(fp, "test_time", this_thing->test_time, 0); time_write(fp, "test_baseline_time", this_thing->test_baseline_time, 0); time_write(fp, "regression_test_time", this_thing->regression_test_time, 0); cstate_architecture_times_list_write(fp, "architecture_times", this_thing->architecture_times); string_write(fp, "development_directory", this_thing->development_directory); string_write(fp, "integration_directory", this_thing->integration_directory); cstate_history_list_write(fp, "history", this_thing->history); string_write(fp, "uuid", this_thing->uuid); cstate_branch_write(fp, "branch", this_thing->branch); cstate_src_list_write(fp, "src", this_thing->src); trace(("}\n")); } void cstate_write_xml(const output::pointer &fp, cstate_ty *this_thing) { if (!this_thing) return; trace(("cstate_write_xml(this_thing = %08lX)\n{\n", (long)this_thing)); assert(((cstate_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((cstate_ty *)this_thing)->reference_count)); fp->fputs("\n"); string_write_xml(fp, "brief_description", this_thing->brief_description); string_write_xml(fp, "description", this_thing->description); change_cause_write_xml(fp, "cause", this_thing->cause, 0); boolean_write_xml(fp, "test_exempt", this_thing->test_exempt, 0); boolean_write_xml(fp, "test_baseline_exempt", this_thing->test_baseline_exempt, 0); boolean_write_xml(fp, "regression_test_exempt", this_thing->regression_test_exempt, 0); cstate_architecture_list_write_xml(fp, "architecture", this_thing->architecture); cstate_copyright_years_list_write_xml(fp, "copyright_years", this_thing->copyright_years); string_write_xml(fp, "version_previous", this_thing->version_previous); attributes_list_write_xml(fp, "attribute", this_thing->attribute); cstate_state_write_xml(fp, "state", this_thing->state, 0); boolean_write_xml(fp, "given_test_exemption", this_thing->given_test_exemption, 0); boolean_write_xml(fp, "given_regression_test_exemption", this_thing->given_regression_test_exemption, 0); integer_write_xml(fp, "delta_number", this_thing->delta_number, 0); string_write_xml(fp, "delta_uuid", this_thing->delta_uuid); boolean_write_xml(fp, "minimum_integration", this_thing->minimum_integration, 0); integer_write_xml(fp, "project_file_command_sync", this_thing->project_file_command_sync, 0); time_write_xml(fp, "build_time", this_thing->build_time, 0); time_write_xml(fp, "test_time", this_thing->test_time, 0); time_write_xml(fp, "test_baseline_time", this_thing->test_baseline_time, 0); time_write_xml(fp, "regression_test_time", this_thing->regression_test_time, 0); cstate_architecture_times_list_write_xml(fp, "architecture_times", this_thing->architecture_times); string_write_xml(fp, "development_directory", this_thing->development_directory); string_write_xml(fp, "integration_directory", this_thing->integration_directory); cstate_history_list_write_xml(fp, "history", this_thing->history); string_write_xml(fp, "uuid", this_thing->uuid); cstate_branch_write_xml(fp, "branch", this_thing->branch); cstate_src_list_write_xml(fp, "src", this_thing->src); fp->fputs("\n"); } static void * cstate_alloc(void) { cstate_ty *this_thing; trace(("cstate_alloc()\n{\n")); this_thing = (cstate_ty *)mem_alloc(sizeof(cstate_ty)); this_thing->reference_count = 1; this_thing->mask = 0; this_thing->errpos = str_copy(lex_position()); this_thing->brief_description = (string_ty *)0; this_thing->description = (string_ty *)0; this_thing->cause = (change_cause_ty)0; this_thing->test_exempt = (bool)0; this_thing->test_baseline_exempt = (bool)0; this_thing->regression_test_exempt = (bool)0; this_thing->architecture = (cstate_architecture_list_ty *)0; this_thing->copyright_years = (cstate_copyright_years_list_ty *)0; this_thing->version_previous = (string_ty *)0; this_thing->attribute = (attributes_list_ty *)0; this_thing->state = (cstate_state_ty)0; this_thing->given_test_exemption = (bool)0; this_thing->given_regression_test_exemption = (bool)0; this_thing->delta_number = (long)0; this_thing->delta_uuid = (string_ty *)0; this_thing->minimum_integration = (bool)0; this_thing->project_file_command_sync = (long)0; this_thing->build_time = (time_t)0; this_thing->test_time = (time_t)0; this_thing->test_baseline_time = (time_t)0; this_thing->regression_test_time = (time_t)0; this_thing->architecture_times = (cstate_architecture_times_list_ty *)0; this_thing->development_directory = (string_ty *)0; this_thing->integration_directory = (string_ty *)0; this_thing->history = (cstate_history_list_ty *)0; this_thing->uuid = (string_ty *)0; this_thing->branch = (cstate_branch_ty *)0; this_thing->src = (cstate_src_list_ty *)0; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } cstate_ty * cstate_copy(cstate_ty *this_thing) { trace(("cstate_copy()\n{\n")); this_thing->reference_count++; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } cstate_ty * cstate_clone(cstate_ty *this_thing) { if (!this_thing) return 0; trace(("cstate_clone()\n{\n")); cstate_ty *result = (cstate_ty *)cstate_alloc(); result->brief_description = str_copy(this_thing->brief_description); result->description = str_copy(this_thing->description); result->cause = this_thing->cause; result->test_exempt = this_thing->test_exempt; result->test_baseline_exempt = this_thing->test_baseline_exempt; result->regression_test_exempt = this_thing->regression_test_exempt; result->architecture = cstate_architecture_list_clone(this_thing->architecture); result->copyright_years = cstate_copyright_years_list_clone(this_thing->copyright_years); result->version_previous = str_copy(this_thing->version_previous); result->attribute = attributes_list_clone(this_thing->attribute); result->state = this_thing->state; result->given_test_exemption = this_thing->given_test_exemption; result->given_regression_test_exemption = this_thing->given_regression_test_exemption; result->delta_number = this_thing->delta_number; result->delta_uuid = str_copy(this_thing->delta_uuid); result->minimum_integration = this_thing->minimum_integration; result->project_file_command_sync = this_thing->project_file_command_sync; result->build_time = this_thing->build_time; result->test_time = this_thing->test_time; result->test_baseline_time = this_thing->test_baseline_time; result->regression_test_time = this_thing->regression_test_time; result->architecture_times = cstate_architecture_times_list_clone(this_thing->architecture_times); result->development_directory = str_copy(this_thing->development_directory); result->integration_directory = str_copy(this_thing->integration_directory); result->history = cstate_history_list_clone(this_thing->history); result->uuid = str_copy(this_thing->uuid); result->branch = cstate_branch_clone(this_thing->branch); result->src = cstate_src_list_clone(this_thing->src); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } #ifdef DEBUG void cstate_trace_real(const char *name, const cstate_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("{\n"); trace_string_real("brief_description", value->brief_description); trace_string_real("description", value->description); trace_printf("cause = %s;\n", change_cause_ename(value->cause)); trace_bool_real("test_exempt", value->test_exempt); trace_bool_real("test_baseline_exempt", value->test_baseline_exempt); trace_bool_real("regression_test_exempt", value->regression_test_exempt); cstate_architecture_list_trace_real("architecture", value->architecture); cstate_copyright_years_list_trace_real("copyright_years", value->copyright_years); trace_string_real("version_previous", value->version_previous); attributes_list_trace_real("attribute", value->attribute); trace_printf("state = %s;\n", cstate_state_ename(value->state)); trace_bool_real("given_test_exemption", value->given_test_exemption); trace_bool_real("given_regression_test_exemption", value->given_regression_test_exemption); trace_long_real("delta_number", &value->delta_number); trace_string_real("delta_uuid", value->delta_uuid); trace_bool_real("minimum_integration", value->minimum_integration); trace_long_real("project_file_command_sync", &value->project_file_command_sync); trace_time_real("build_time", value->build_time); trace_time_real("test_time", value->test_time); trace_time_real("test_baseline_time", value->test_baseline_time); trace_time_real("regression_test_time", value->regression_test_time); cstate_architecture_times_list_trace_real("architecture_times", value->architecture_times); trace_string_real("development_directory", value->development_directory); trace_string_real("integration_directory", value->integration_directory); cstate_history_list_trace_real("history", value->history); trace_string_real("uuid", value->uuid); cstate_branch_trace_real("branch", value->branch); cstate_src_list_trace_real("src", value->src); trace_printf("}"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG static void cstate_free(void *that) { cstate_ty *this_thing; this_thing = (cstate_ty *)that; if (!this_thing) return; this_thing->reference_count--; assert(this_thing->reference_count >= 0); if (this_thing->reference_count > 0) return; trace(("cstate_free(this_thing = %08lX)\n{\n", (long)this_thing)); if (this_thing->errpos) { str_free(this_thing->errpos); this_thing->errpos = 0; } str_free(this_thing->brief_description); str_free(this_thing->description); cstate_architecture_list_free(this_thing->architecture); cstate_copyright_years_list_free(this_thing->copyright_years); str_free(this_thing->version_previous); attributes_list_type.free(this_thing->attribute); str_free(this_thing->delta_uuid); cstate_architecture_times_list_free(this_thing->architecture_times); str_free(this_thing->development_directory); str_free(this_thing->integration_directory); cstate_history_list_free(this_thing->history); str_free(this_thing->uuid); cstate_branch_free(this_thing->branch); cstate_src_list_free(this_thing->src); mem_free(this_thing); trace(("}\n")); } static type_table_ty cstate_table[] = { { "brief_description", offsetof(cstate_ty, brief_description), &string_type, cstate_brief_description_mask, 0, // redefinition not ok 0, // fast_name }, { "description", offsetof(cstate_ty, description), &string_type, cstate_description_mask, 0, // redefinition not ok 0, // fast_name }, { "cause", offsetof(cstate_ty, cause), &change_cause_type, cstate_cause_mask, 0, // redefinition not ok 0, // fast_name }, { "test_exempt", offsetof(cstate_ty, test_exempt), &boolean_type, cstate_test_exempt_mask, 0, // redefinition not ok 0, // fast_name }, { "test_baseline_exempt", offsetof(cstate_ty, test_baseline_exempt), &boolean_type, cstate_test_baseline_exempt_mask, 0, // redefinition not ok 0, // fast_name }, { "regression_test_exempt", offsetof(cstate_ty, regression_test_exempt), &boolean_type, cstate_regression_test_exempt_mask, 0, // redefinition not ok 0, // fast_name }, { "architecture", offsetof(cstate_ty, architecture), &cstate_architecture_list_type, cstate_architecture_mask, 0, // redefinition not ok 0, // fast_name }, { "copyright_years", offsetof(cstate_ty, copyright_years), &cstate_copyright_years_list_type, cstate_copyright_years_mask, 0, // redefinition not ok 0, // fast_name }, { "version_previous", offsetof(cstate_ty, version_previous), &string_type, cstate_version_previous_mask, 0, // redefinition not ok 0, // fast_name }, { "attribute", offsetof(cstate_ty, attribute), &attributes_list_type, cstate_attribute_mask, 0, // redefinition not ok 0, // fast_name }, { "state", offsetof(cstate_ty, state), &cstate_state_type, cstate_state_mask, 0, // redefinition not ok 0, // fast_name }, { "given_test_exemption", offsetof(cstate_ty, given_test_exemption), &boolean_type, cstate_given_test_exemption_mask, 0, // redefinition not ok 0, // fast_name }, { "given_regression_test_exemption", offsetof(cstate_ty, given_regression_test_exemption), &boolean_type, cstate_given_regression_test_exemption_mask, 0, // redefinition not ok 0, // fast_name }, { "delta_number", offsetof(cstate_ty, delta_number), &integer_type, cstate_delta_number_mask, 0, // redefinition not ok 0, // fast_name }, { "delta_uuid", offsetof(cstate_ty, delta_uuid), &string_type, cstate_delta_uuid_mask, 0, // redefinition not ok 0, // fast_name }, { "minimum_integration", offsetof(cstate_ty, minimum_integration), &boolean_type, cstate_minimum_integration_mask, 0, // redefinition not ok 0, // fast_name }, { "project_file_command_sync", offsetof(cstate_ty, project_file_command_sync), &integer_type, cstate_project_file_command_sync_mask, 0, // redefinition not ok 0, // fast_name }, { "build_time", offsetof(cstate_ty, build_time), &time_type, cstate_build_time_mask, 0, // redefinition not ok 0, // fast_name }, { "test_time", offsetof(cstate_ty, test_time), &time_type, cstate_test_time_mask, 0, // redefinition not ok 0, // fast_name }, { "test_baseline_time", offsetof(cstate_ty, test_baseline_time), &time_type, cstate_test_baseline_time_mask, 0, // redefinition not ok 0, // fast_name }, { "regression_test_time", offsetof(cstate_ty, regression_test_time), &time_type, cstate_regression_test_time_mask, 0, // redefinition not ok 0, // fast_name }, { "architecture_times", offsetof(cstate_ty, architecture_times), &cstate_architecture_times_list_type, cstate_architecture_times_mask, 0, // redefinition not ok 0, // fast_name }, { "development_directory", offsetof(cstate_ty, development_directory), &string_type, cstate_development_directory_mask, 0, // redefinition not ok 0, // fast_name }, { "integration_directory", offsetof(cstate_ty, integration_directory), &string_type, cstate_integration_directory_mask, 0, // redefinition not ok 0, // fast_name }, { "history", offsetof(cstate_ty, history), &cstate_history_list_type, cstate_history_mask, 0, // redefinition not ok 0, // fast_name }, { "uuid", offsetof(cstate_ty, uuid), &string_type, cstate_uuid_mask, 0, // redefinition not ok 0, // fast_name }, { "branch", offsetof(cstate_ty, branch), &cstate_branch_type, cstate_branch_mask, 0, // redefinition not ok 0, // fast_name }, { "src", offsetof(cstate_ty, src), &cstate_src_list_type, cstate_src_mask, 0, // redefinition not ok 0, // fast_name }, }; static void * cstate_parse(void *this_thing, string_ty *name, meta_type **type_pp, unsigned long *mask_p, int *redef_p) { void *addr; trace(("cstate_parse(this_thing = %08lX, name = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)name, (long)type_pp)); assert(((cstate_ty *)this_thing)->reference_count > 0); addr = generic_struct_parse ( this_thing, name, type_pp, mask_p, redef_p, cstate_table, SIZEOF(cstate_table) ); trace(("return %08lX;\n}\n", (long)addr)); return addr; } static string_ty * cstate_fuzzy(string_ty *name) { string_ty *result; trace(("cstate_fuzzy(name = %08lX)\n{\n", (long)name)); result = generic_struct_fuzzy ( name, cstate_table, SIZEOF(cstate_table) ); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static rpt_value::pointer cstate_convert(void *this_thing) { trace(("cstate_convert(name = %08lX)\n{\n", (long)this_thing)); assert(((cstate_ty *)this_thing)->reference_count > 0); rpt_value::pointer result = generic_struct_convert ( this_thing, cstate_table, SIZEOF(cstate_table) ); trace(("return %08lX;\n", (long)result.get())); trace(("}\n")); return result; } meta_type cstate_type = { "cstate", cstate_alloc, cstate_free, 0, // enum_parse 0, // list_parse cstate_parse, cstate_fuzzy, cstate_convert, generic_struct_is_set, }; cstate_ty * cstate_read_file(const nstring &filename) { return cstate_read_file(filename.get_ref()); } cstate_ty * cstate_read_file(string_ty *filename) { cstate_ty *result; trace(("cstate_read_file(filename = \"%s\")\n{\n", (filename ? filename->str_text : ""))); os_become_must_be_active(); result = (cstate_ty *)parse(filename, &cstate_type); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } void cstate_write_file(const nstring &filename, cstate_ty *value, bool comp) { cstate_write_file(filename.get_ref(), value, comp); } void cstate_write_file(string_ty *filename, cstate_ty *value, int needs_compression) { trace(("cstate_write_file(filename = \"%s\", value = %08lX)\n{\n", (filename ? filename->str_text : ""), (long)value)); if (filename) os_become_must_be_active(); output::pointer fp; if (needs_compression) { fp = output_file::binary_open(filename); fp = output_gzip::create(fp); } else { fp = output_file::text_open(filename); } fp = output_indent::create(fp); io_comment_emit(fp); cstate_write(fp, value); type_enum_option_clear(); trace(("}\n")); } void cstate__rpt_init(void) { trace(("cstate__rpt_init()\n{\n")); generic_enum__init(cstate_state_s, SIZEOF(cstate_state_s)); generic_enum__init(cstate_history_what_s, SIZEOF(cstate_history_what_s)); generic_enum__init(cstate_branch_develop_end_action_s, SIZEOF(cstate_branch_develop_end_action_s)); trace(("}\n")); }