// // This file is generated by fmtgen from "libaegis/pstate.def". // If you want to change the contents of this file // you need to edit libaegis/pstate.def // or you need to enhance fmtgen. // #include #include #include #include #include #include #include #include #include #include #include #include #include void pstate_copyright_years_list_write(const output::pointer &fp, const char *name, pstate_copyright_years_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pstate_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 pstate_copyright_years_list_write_xml(const output::pointer &fp, const char *name, pstate_copyright_years_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pstate_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 * pstate_copyright_years_list_alloc(void) { pstate_copyright_years_list_ty *result; trace(("pstate_copyright_years_list_alloc()\n{\n")); result = (pstate_copyright_years_list_ty *)mem_alloc(sizeof(pstate_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 pstate_copyright_years_list_free(void *that) { pstate_copyright_years_list_ty *this_thing; size_t j; this_thing = (pstate_copyright_years_list_ty *)that; if (!this_thing) return; trace(("pstate_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 * pstate_copyright_years_list_parse(void *that, meta_type **type_pp) { pstate_copyright_years_list_ty *this_thing; void *addr; this_thing = (pstate_copyright_years_list_ty *)that; trace(("pstate_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 pstate_copyright_years_list_convert(void *that) { pstate_copyright_years_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(pstate_copyright_years_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("pstate_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; } pstate_copyright_years_list_ty * pstate_copyright_years_list_copy(pstate_copyright_years_list_ty *from) { size_t j; pstate_copyright_years_list_ty *result; if (!from) return 0; trace(("pstate_copyright_years_list_copy(from = %08lX)\n{\n", (long)from)); result = (pstate_copyright_years_list_ty *)pstate_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*)pstate_copyright_years_list_parse(result, &bogus); *mpp = integer_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } pstate_copyright_years_list_ty * pstate_copyright_years_list_clone(pstate_copyright_years_list_ty *from) { return pstate_copyright_years_list_copy(from); } #ifdef DEBUG void pstate_copyright_years_list_trace_real(const char *name, const pstate_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 pstate_copyright_years_list_type = { "pstate_copyright_years_list", pstate_copyright_years_list_alloc, pstate_copyright_years_list_free, 0, // enum_parse pstate_copyright_years_list_parse, 0, // struct_parse 0, // fuzzy pstate_copyright_years_list_convert, generic_struct_is_set, }; void pstate_src_write(const output::pointer &fp, const char *name, pstate_src_ty *this_thing) { if (!this_thing) return; trace(("pstate_src_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(((pstate_src_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((pstate_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); file_usage_write(fp, "usage", this_thing->usage, 1); string_write(fp, "edit_number", this_thing->edit_number); integer_write(fp, "locked_by", this_thing->locked_by, 0); integer_write(fp, "about_to_be_created_by", this_thing->about_to_be_created_by, 0); integer_write(fp, "deleted_by", this_thing->deleted_by, 0); fp->fputs("}"); if (name) fp->fputs(";\n"); trace(("}\n")); } void pstate_src_write_xml(const output::pointer &fp, const char *name, pstate_src_ty *this_thing) { if (!this_thing) return; trace(("pstate_src_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); assert(((pstate_src_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((pstate_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); file_usage_write_xml(fp, "usage", this_thing->usage, 0); string_write_xml(fp, "edit_number", this_thing->edit_number); integer_write_xml(fp, "locked_by", this_thing->locked_by, 0); integer_write_xml(fp, "about_to_be_created_by", this_thing->about_to_be_created_by, 0); integer_write_xml(fp, "deleted_by", this_thing->deleted_by, 0); fp->fputs("fputs(name); fp->fputs(">\n"); } static void * pstate_src_alloc(void) { pstate_src_ty *this_thing; trace(("pstate_src_alloc()\n{\n")); this_thing = (pstate_src_ty *)mem_alloc(sizeof(pstate_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->usage = (file_usage_ty)0; this_thing->edit_number = (string_ty *)0; this_thing->locked_by = (long)0; this_thing->about_to_be_created_by = (long)0; this_thing->deleted_by = (long)0; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } pstate_src_ty * pstate_src_copy(pstate_src_ty *this_thing) { trace(("pstate_src_copy()\n{\n")); this_thing->reference_count++; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } pstate_src_ty * pstate_src_clone(pstate_src_ty *this_thing) { if (!this_thing) return 0; trace(("pstate_src_clone()\n{\n")); pstate_src_ty *result = (pstate_src_ty *)pstate_src_alloc(); result->file_name = str_copy(this_thing->file_name); result->usage = this_thing->usage; result->edit_number = str_copy(this_thing->edit_number); result->locked_by = this_thing->locked_by; result->about_to_be_created_by = this_thing->about_to_be_created_by; result->deleted_by = this_thing->deleted_by; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } #ifdef DEBUG void pstate_src_trace_real(const char *name, const pstate_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_printf("usage = %s;\n", file_usage_ename(value->usage)); trace_string_real("edit_number", value->edit_number); trace_long_real("locked_by", &value->locked_by); trace_long_real("about_to_be_created_by", &value->about_to_be_created_by); trace_long_real("deleted_by", &value->deleted_by); trace_printf("}"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG static void pstate_src_free(void *that) { pstate_src_ty *this_thing; this_thing = (pstate_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(("pstate_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->edit_number); mem_free(this_thing); trace(("}\n")); } static type_table_ty pstate_src_table[] = { { "file_name", offsetof(pstate_src_ty, file_name), &string_type, pstate_src_file_name_mask, 0, // redefinition not ok 0, // fast_name }, { "usage", offsetof(pstate_src_ty, usage), &file_usage_type, pstate_src_usage_mask, 0, // redefinition not ok 0, // fast_name }, { "edit_number", offsetof(pstate_src_ty, edit_number), &string_type, pstate_src_edit_number_mask, 0, // redefinition not ok 0, // fast_name }, { "locked_by", offsetof(pstate_src_ty, locked_by), &integer_type, pstate_src_locked_by_mask, 0, // redefinition not ok 0, // fast_name }, { "about_to_be_created_by", offsetof(pstate_src_ty, about_to_be_created_by), &integer_type, pstate_src_about_to_be_created_by_mask, 0, // redefinition not ok 0, // fast_name }, { "deleted_by", offsetof(pstate_src_ty, deleted_by), &integer_type, pstate_src_deleted_by_mask, 0, // redefinition not ok 0, // fast_name }, }; static void * pstate_src_parse(void *this_thing, string_ty *name, meta_type **type_pp, unsigned long *mask_p, int *redef_p) { void *addr; trace(("pstate_src_parse(this_thing = %08lX, name = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)name, (long)type_pp)); assert(((pstate_src_ty *)this_thing)->reference_count > 0); addr = generic_struct_parse ( this_thing, name, type_pp, mask_p, redef_p, pstate_src_table, SIZEOF(pstate_src_table) ); trace(("return %08lX;\n}\n", (long)addr)); return addr; } static string_ty * pstate_src_fuzzy(string_ty *name) { string_ty *result; trace(("pstate_src_fuzzy(name = %08lX)\n{\n", (long)name)); result = generic_struct_fuzzy ( name, pstate_src_table, SIZEOF(pstate_src_table) ); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static rpt_value::pointer pstate_src_convert(void *this_thing) { trace(("pstate_src_convert(name = %08lX)\n{\n", (long)this_thing)); assert(((pstate_src_ty *)this_thing)->reference_count > 0); rpt_value::pointer result = generic_struct_convert ( this_thing, pstate_src_table, SIZEOF(pstate_src_table) ); trace(("return %08lX;\n", (long)result.get())); trace(("}\n")); return result; } meta_type pstate_src_type = { "pstate_src", pstate_src_alloc, pstate_src_free, 0, // enum_parse 0, // list_parse pstate_src_parse, pstate_src_fuzzy, pstate_src_convert, generic_struct_is_set, }; void pstate_src_list_write(const output::pointer &fp, const char *name, pstate_src_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pstate_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) { pstate_src_write(fp, (const char *)0, this_thing->list[j]); fp->fputs(",\n"); } fp->fputs("]"); if (name) fp->fputs(";\n"); trace(("}\n")); } void pstate_src_list_write_xml(const output::pointer &fp, const char *name, pstate_src_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pstate_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) { pstate_src_write_xml(fp, "pstate_src", this_thing->list[j]); } fp->fputs("fputs(name); fp->fputs(">\n"); trace(("}\n")); } static void * pstate_src_list_alloc(void) { pstate_src_list_ty *result; trace(("pstate_src_list_alloc()\n{\n")); result = (pstate_src_list_ty *)mem_alloc(sizeof(pstate_src_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void pstate_src_list_free(void *that) { pstate_src_list_ty *this_thing; size_t j; this_thing = (pstate_src_list_ty *)that; if (!this_thing) return; trace(("pstate_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) pstate_src_free(this_thing->list[j]); delete [] this_thing->list; mem_free(this_thing); trace(("}\n")); } static void * pstate_src_list_parse(void *that, meta_type **type_pp) { pstate_src_list_ty *this_thing; void *addr; this_thing = (pstate_src_list_ty *)that; trace(("pstate_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 = &pstate_src_type; trace_pointer(*type_pp); if (this_thing->length >= this_thing->maximum) { this_thing->maximum = this_thing->maximum * 2 + 16; pstate_src_ty * *new_list = new pstate_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 pstate_src_list_convert(void *that) { pstate_src_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(pstate_src_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("pstate_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 = pstate_src_type.convert(&this_thing->list[j]); assert(vp); p->append(vp); } trace(("}\n")); trace(("return %08lX;\n", (long)result.get())); return result; } pstate_src_list_ty * pstate_src_list_copy(pstate_src_list_ty *from) { size_t j; pstate_src_list_ty *result; if (!from) return 0; trace(("pstate_src_list_copy(from = %08lX)\n{\n", (long)from)); result = (pstate_src_list_ty *)pstate_src_list_alloc(); assert(from->length <= from->maximum); assert(!from->list == !from->maximum); for (j = 0; j < from->length; ++j) { pstate_src_ty * mp; pstate_src_ty * *mpp; meta_type *bogus; mp = from->list[j]; mpp = (pstate_src_ty **)pstate_src_list_parse(result, &bogus); *mpp = pstate_src_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } pstate_src_list_ty * pstate_src_list_clone(pstate_src_list_ty *from) { return pstate_src_list_copy(from); } #ifdef DEBUG void pstate_src_list_trace_real(const char *name, const pstate_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) { pstate_src_ty * mp = value->list[j]; pstate_src_trace_real("", mp); } trace_printf("]"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG meta_type pstate_src_list_type = { "pstate_src_list", pstate_src_list_alloc, pstate_src_list_free, 0, // enum_parse pstate_src_list_parse, 0, // struct_parse 0, // fuzzy pstate_src_list_convert, generic_struct_is_set, }; void pstate_history_name_list_write(const output::pointer &fp, const char *name, pstate_history_name_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pstate_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 pstate_history_name_list_write_xml(const output::pointer &fp, const char *name, pstate_history_name_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pstate_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 * pstate_history_name_list_alloc(void) { pstate_history_name_list_ty *result; trace(("pstate_history_name_list_alloc()\n{\n")); result = (pstate_history_name_list_ty *)mem_alloc(sizeof(pstate_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 pstate_history_name_list_free(void *that) { pstate_history_name_list_ty *this_thing; size_t j; this_thing = (pstate_history_name_list_ty *)that; if (!this_thing) return; trace(("pstate_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 * pstate_history_name_list_parse(void *that, meta_type **type_pp) { pstate_history_name_list_ty *this_thing; void *addr; this_thing = (pstate_history_name_list_ty *)that; trace(("pstate_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 pstate_history_name_list_convert(void *that) { pstate_history_name_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(pstate_history_name_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("pstate_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; } pstate_history_name_list_ty * pstate_history_name_list_copy(pstate_history_name_list_ty *from) { size_t j; pstate_history_name_list_ty *result; if (!from) return 0; trace(("pstate_history_name_list_copy(from = %08lX)\n{\n", (long)from)); result = (pstate_history_name_list_ty *)pstate_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 **)pstate_history_name_list_parse(result, &bogus); *mpp = string_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } pstate_history_name_list_ty * pstate_history_name_list_clone(pstate_history_name_list_ty *from) { return pstate_history_name_list_copy(from); } #ifdef DEBUG void pstate_history_name_list_trace_real(const char *name, const pstate_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 pstate_history_name_list_type = { "pstate_history_name_list", pstate_history_name_list_alloc, pstate_history_name_list_free, 0, // enum_parse pstate_history_name_list_parse, 0, // struct_parse 0, // fuzzy pstate_history_name_list_convert, generic_struct_is_set, }; void pstate_history_write(const output::pointer &fp, const char *name, pstate_history_ty *this_thing) { if (!this_thing) return; trace(("pstate_history_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(((pstate_history_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((pstate_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); pstate_history_name_list_write(fp, "name", this_thing->name); fp->fputs("}"); if (name) fp->fputs(";\n"); trace(("}\n")); } void pstate_history_write_xml(const output::pointer &fp, const char *name, pstate_history_ty *this_thing) { if (!this_thing) return; trace(("pstate_history_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); assert(((pstate_history_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((pstate_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); pstate_history_name_list_write_xml(fp, "name", this_thing->name); fp->fputs("fputs(name); fp->fputs(">\n"); } static void * pstate_history_alloc(void) { pstate_history_ty *this_thing; trace(("pstate_history_alloc()\n{\n")); this_thing = (pstate_history_ty *)mem_alloc(sizeof(pstate_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 = (pstate_history_name_list_ty *)0; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } pstate_history_ty * pstate_history_copy(pstate_history_ty *this_thing) { trace(("pstate_history_copy()\n{\n")); this_thing->reference_count++; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } pstate_history_ty * pstate_history_clone(pstate_history_ty *this_thing) { if (!this_thing) return 0; trace(("pstate_history_clone()\n{\n")); pstate_history_ty *result = (pstate_history_ty *)pstate_history_alloc(); result->delta_number = this_thing->delta_number; result->change_number = this_thing->change_number; result->name = pstate_history_name_list_clone(this_thing->name); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } #ifdef DEBUG void pstate_history_trace_real(const char *name, const pstate_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); pstate_history_name_list_trace_real("name", value->name); trace_printf("}"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG static void pstate_history_free(void *that) { pstate_history_ty *this_thing; this_thing = (pstate_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(("pstate_history_free(this_thing = %08lX)\n{\n", (long)this_thing)); if (this_thing->errpos) { str_free(this_thing->errpos); this_thing->errpos = 0; } pstate_history_name_list_free(this_thing->name); mem_free(this_thing); trace(("}\n")); } static type_table_ty pstate_history_table[] = { { "delta_number", offsetof(pstate_history_ty, delta_number), &integer_type, pstate_history_delta_number_mask, 0, // redefinition not ok 0, // fast_name }, { "change_number", offsetof(pstate_history_ty, change_number), &integer_type, pstate_history_change_number_mask, 0, // redefinition not ok 0, // fast_name }, { "name", offsetof(pstate_history_ty, name), &pstate_history_name_list_type, pstate_history_name_mask, 0, // redefinition not ok 0, // fast_name }, }; static void * pstate_history_parse(void *this_thing, string_ty *name, meta_type **type_pp, unsigned long *mask_p, int *redef_p) { void *addr; trace(("pstate_history_parse(this_thing = %08lX, name = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)name, (long)type_pp)); assert(((pstate_history_ty *)this_thing)->reference_count > 0); addr = generic_struct_parse ( this_thing, name, type_pp, mask_p, redef_p, pstate_history_table, SIZEOF(pstate_history_table) ); trace(("return %08lX;\n}\n", (long)addr)); return addr; } static string_ty * pstate_history_fuzzy(string_ty *name) { string_ty *result; trace(("pstate_history_fuzzy(name = %08lX)\n{\n", (long)name)); result = generic_struct_fuzzy ( name, pstate_history_table, SIZEOF(pstate_history_table) ); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static rpt_value::pointer pstate_history_convert(void *this_thing) { trace(("pstate_history_convert(name = %08lX)\n{\n", (long)this_thing)); assert(((pstate_history_ty *)this_thing)->reference_count > 0); rpt_value::pointer result = generic_struct_convert ( this_thing, pstate_history_table, SIZEOF(pstate_history_table) ); trace(("return %08lX;\n", (long)result.get())); trace(("}\n")); return result; } meta_type pstate_history_type = { "pstate_history", pstate_history_alloc, pstate_history_free, 0, // enum_parse 0, // list_parse pstate_history_parse, pstate_history_fuzzy, pstate_history_convert, generic_struct_is_set, }; void pstate_history_list_write(const output::pointer &fp, const char *name, pstate_history_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pstate_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) { pstate_history_write(fp, (const char *)0, this_thing->list[j]); fp->fputs(",\n"); } fp->fputs("]"); if (name) fp->fputs(";\n"); trace(("}\n")); } void pstate_history_list_write_xml(const output::pointer &fp, const char *name, pstate_history_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pstate_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) { pstate_history_write_xml(fp, "pstate_history", this_thing->list[j]); } fp->fputs("fputs(name); fp->fputs(">\n"); trace(("}\n")); } static void * pstate_history_list_alloc(void) { pstate_history_list_ty *result; trace(("pstate_history_list_alloc()\n{\n")); result = (pstate_history_list_ty *)mem_alloc(sizeof(pstate_history_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void pstate_history_list_free(void *that) { pstate_history_list_ty *this_thing; size_t j; this_thing = (pstate_history_list_ty *)that; if (!this_thing) return; trace(("pstate_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) pstate_history_free(this_thing->list[j]); delete [] this_thing->list; mem_free(this_thing); trace(("}\n")); } static void * pstate_history_list_parse(void *that, meta_type **type_pp) { pstate_history_list_ty *this_thing; void *addr; this_thing = (pstate_history_list_ty *)that; trace(("pstate_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 = &pstate_history_type; trace_pointer(*type_pp); if (this_thing->length >= this_thing->maximum) { this_thing->maximum = this_thing->maximum * 2 + 16; pstate_history_ty * *new_list = new pstate_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 pstate_history_list_convert(void *that) { pstate_history_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(pstate_history_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("pstate_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 = pstate_history_type.convert(&this_thing->list[j]); assert(vp); p->append(vp); } trace(("}\n")); trace(("return %08lX;\n", (long)result.get())); return result; } pstate_history_list_ty * pstate_history_list_copy(pstate_history_list_ty *from) { size_t j; pstate_history_list_ty *result; if (!from) return 0; trace(("pstate_history_list_copy(from = %08lX)\n{\n", (long)from)); result = (pstate_history_list_ty *)pstate_history_list_alloc(); assert(from->length <= from->maximum); assert(!from->list == !from->maximum); for (j = 0; j < from->length; ++j) { pstate_history_ty * mp; pstate_history_ty * *mpp; meta_type *bogus; mp = from->list[j]; mpp = (pstate_history_ty **)pstate_history_list_parse(result, &bogus); *mpp = pstate_history_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } pstate_history_list_ty * pstate_history_list_clone(pstate_history_list_ty *from) { return pstate_history_list_copy(from); } #ifdef DEBUG void pstate_history_list_trace_real(const char *name, const pstate_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) { pstate_history_ty * mp = value->list[j]; pstate_history_trace_real("", mp); } trace_printf("]"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG meta_type pstate_history_list_type = { "pstate_history_list", pstate_history_list_alloc, pstate_history_list_free, 0, // enum_parse pstate_history_list_parse, 0, // struct_parse 0, // fuzzy pstate_history_list_convert, generic_struct_is_set, }; void pstate_change_list_write(const output::pointer &fp, const char *name, pstate_change_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pstate_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 pstate_change_list_write_xml(const output::pointer &fp, const char *name, pstate_change_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pstate_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 * pstate_change_list_alloc(void) { pstate_change_list_ty *result; trace(("pstate_change_list_alloc()\n{\n")); result = (pstate_change_list_ty *)mem_alloc(sizeof(pstate_change_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void pstate_change_list_free(void *that) { pstate_change_list_ty *this_thing; size_t j; this_thing = (pstate_change_list_ty *)that; if (!this_thing) return; trace(("pstate_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 * pstate_change_list_parse(void *that, meta_type **type_pp) { pstate_change_list_ty *this_thing; void *addr; this_thing = (pstate_change_list_ty *)that; trace(("pstate_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 pstate_change_list_convert(void *that) { pstate_change_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(pstate_change_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("pstate_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; } pstate_change_list_ty * pstate_change_list_copy(pstate_change_list_ty *from) { size_t j; pstate_change_list_ty *result; if (!from) return 0; trace(("pstate_change_list_copy(from = %08lX)\n{\n", (long)from)); result = (pstate_change_list_ty *)pstate_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*)pstate_change_list_parse(result, &bogus); *mpp = integer_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } pstate_change_list_ty * pstate_change_list_clone(pstate_change_list_ty *from) { return pstate_change_list_copy(from); } #ifdef DEBUG void pstate_change_list_trace_real(const char *name, const pstate_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 pstate_change_list_type = { "pstate_change_list", pstate_change_list_alloc, pstate_change_list_free, 0, // enum_parse pstate_change_list_parse, 0, // struct_parse 0, // fuzzy pstate_change_list_convert, generic_struct_is_set, }; void pstate_administrator_list_write(const output::pointer &fp, const char *name, pstate_administrator_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pstate_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 pstate_administrator_list_write_xml(const output::pointer &fp, const char *name, pstate_administrator_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pstate_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 * pstate_administrator_list_alloc(void) { pstate_administrator_list_ty *result; trace(("pstate_administrator_list_alloc()\n{\n")); result = (pstate_administrator_list_ty *)mem_alloc(sizeof(pstate_administrator_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void pstate_administrator_list_free(void *that) { pstate_administrator_list_ty *this_thing; size_t j; this_thing = (pstate_administrator_list_ty *)that; if (!this_thing) return; trace(("pstate_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 * pstate_administrator_list_parse(void *that, meta_type **type_pp) { pstate_administrator_list_ty *this_thing; void *addr; this_thing = (pstate_administrator_list_ty *)that; trace(("pstate_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 pstate_administrator_list_convert(void *that) { pstate_administrator_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(pstate_administrator_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("pstate_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; } pstate_administrator_list_ty * pstate_administrator_list_copy(pstate_administrator_list_ty *from) { size_t j; pstate_administrator_list_ty *result; if (!from) return 0; trace(("pstate_administrator_list_copy(from = %08lX)\n{\n", (long)from)); result = (pstate_administrator_list_ty *)pstate_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 **)pstate_administrator_list_parse(result, &bogus); *mpp = string_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } pstate_administrator_list_ty * pstate_administrator_list_clone(pstate_administrator_list_ty *from) { return pstate_administrator_list_copy(from); } #ifdef DEBUG void pstate_administrator_list_trace_real(const char *name, const pstate_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 pstate_administrator_list_type = { "pstate_administrator_list", pstate_administrator_list_alloc, pstate_administrator_list_free, 0, // enum_parse pstate_administrator_list_parse, 0, // struct_parse 0, // fuzzy pstate_administrator_list_convert, generic_struct_is_set, }; void pstate_developer_list_write(const output::pointer &fp, const char *name, pstate_developer_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pstate_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 pstate_developer_list_write_xml(const output::pointer &fp, const char *name, pstate_developer_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pstate_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 * pstate_developer_list_alloc(void) { pstate_developer_list_ty *result; trace(("pstate_developer_list_alloc()\n{\n")); result = (pstate_developer_list_ty *)mem_alloc(sizeof(pstate_developer_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void pstate_developer_list_free(void *that) { pstate_developer_list_ty *this_thing; size_t j; this_thing = (pstate_developer_list_ty *)that; if (!this_thing) return; trace(("pstate_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 * pstate_developer_list_parse(void *that, meta_type **type_pp) { pstate_developer_list_ty *this_thing; void *addr; this_thing = (pstate_developer_list_ty *)that; trace(("pstate_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 pstate_developer_list_convert(void *that) { pstate_developer_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(pstate_developer_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("pstate_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; } pstate_developer_list_ty * pstate_developer_list_copy(pstate_developer_list_ty *from) { size_t j; pstate_developer_list_ty *result; if (!from) return 0; trace(("pstate_developer_list_copy(from = %08lX)\n{\n", (long)from)); result = (pstate_developer_list_ty *)pstate_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 **)pstate_developer_list_parse(result, &bogus); *mpp = string_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } pstate_developer_list_ty * pstate_developer_list_clone(pstate_developer_list_ty *from) { return pstate_developer_list_copy(from); } #ifdef DEBUG void pstate_developer_list_trace_real(const char *name, const pstate_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 pstate_developer_list_type = { "pstate_developer_list", pstate_developer_list_alloc, pstate_developer_list_free, 0, // enum_parse pstate_developer_list_parse, 0, // struct_parse 0, // fuzzy pstate_developer_list_convert, generic_struct_is_set, }; void pstate_reviewer_list_write(const output::pointer &fp, const char *name, pstate_reviewer_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pstate_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 pstate_reviewer_list_write_xml(const output::pointer &fp, const char *name, pstate_reviewer_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pstate_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 * pstate_reviewer_list_alloc(void) { pstate_reviewer_list_ty *result; trace(("pstate_reviewer_list_alloc()\n{\n")); result = (pstate_reviewer_list_ty *)mem_alloc(sizeof(pstate_reviewer_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void pstate_reviewer_list_free(void *that) { pstate_reviewer_list_ty *this_thing; size_t j; this_thing = (pstate_reviewer_list_ty *)that; if (!this_thing) return; trace(("pstate_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 * pstate_reviewer_list_parse(void *that, meta_type **type_pp) { pstate_reviewer_list_ty *this_thing; void *addr; this_thing = (pstate_reviewer_list_ty *)that; trace(("pstate_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 pstate_reviewer_list_convert(void *that) { pstate_reviewer_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(pstate_reviewer_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("pstate_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; } pstate_reviewer_list_ty * pstate_reviewer_list_copy(pstate_reviewer_list_ty *from) { size_t j; pstate_reviewer_list_ty *result; if (!from) return 0; trace(("pstate_reviewer_list_copy(from = %08lX)\n{\n", (long)from)); result = (pstate_reviewer_list_ty *)pstate_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 **)pstate_reviewer_list_parse(result, &bogus); *mpp = string_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } pstate_reviewer_list_ty * pstate_reviewer_list_clone(pstate_reviewer_list_ty *from) { return pstate_reviewer_list_copy(from); } #ifdef DEBUG void pstate_reviewer_list_trace_real(const char *name, const pstate_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 pstate_reviewer_list_type = { "pstate_reviewer_list", pstate_reviewer_list_alloc, pstate_reviewer_list_free, 0, // enum_parse pstate_reviewer_list_parse, 0, // struct_parse 0, // fuzzy pstate_reviewer_list_convert, generic_struct_is_set, }; void pstate_integrator_list_write(const output::pointer &fp, const char *name, pstate_integrator_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pstate_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 pstate_integrator_list_write_xml(const output::pointer &fp, const char *name, pstate_integrator_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pstate_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 * pstate_integrator_list_alloc(void) { pstate_integrator_list_ty *result; trace(("pstate_integrator_list_alloc()\n{\n")); result = (pstate_integrator_list_ty *)mem_alloc(sizeof(pstate_integrator_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void pstate_integrator_list_free(void *that) { pstate_integrator_list_ty *this_thing; size_t j; this_thing = (pstate_integrator_list_ty *)that; if (!this_thing) return; trace(("pstate_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 * pstate_integrator_list_parse(void *that, meta_type **type_pp) { pstate_integrator_list_ty *this_thing; void *addr; this_thing = (pstate_integrator_list_ty *)that; trace(("pstate_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 pstate_integrator_list_convert(void *that) { pstate_integrator_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(pstate_integrator_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("pstate_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; } pstate_integrator_list_ty * pstate_integrator_list_copy(pstate_integrator_list_ty *from) { size_t j; pstate_integrator_list_ty *result; if (!from) return 0; trace(("pstate_integrator_list_copy(from = %08lX)\n{\n", (long)from)); result = (pstate_integrator_list_ty *)pstate_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 **)pstate_integrator_list_parse(result, &bogus); *mpp = string_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } pstate_integrator_list_ty * pstate_integrator_list_clone(pstate_integrator_list_ty *from) { return pstate_integrator_list_copy(from); } #ifdef DEBUG void pstate_integrator_list_trace_real(const char *name, const pstate_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 pstate_integrator_list_type = { "pstate_integrator_list", pstate_integrator_list_alloc, pstate_integrator_list_free, 0, // enum_parse pstate_integrator_list_parse, 0, // struct_parse 0, // fuzzy pstate_integrator_list_convert, generic_struct_is_set, }; void pstate_write(const output::pointer &fp, pstate_ty *this_thing) { if (!this_thing) return; trace(("pstate_write(this_thing = %08lX)\n{\n", (long)this_thing)); assert(((pstate_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((pstate_ty *)this_thing)->reference_count)); integer_write(fp, "next_test_number", this_thing->next_test_number, 0); integer_write(fp, "umask", this_thing->umask, 0); string_write(fp, "description", this_thing->description); string_write(fp, "owner_name", this_thing->owner_name); string_write(fp, "group_name", this_thing->group_name); 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_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); string_write(fp, "default_development_directory", this_thing->default_development_directory); boolean_write(fp, "default_test_exemption", this_thing->default_test_exemption, 1); pstate_copyright_years_list_write(fp, "copyright_years", this_thing->copyright_years); integer_write(fp, "next_change_number", this_thing->next_change_number, 0); integer_write(fp, "next_delta_number", this_thing->next_delta_number, 0); pstate_src_list_write(fp, "src", this_thing->src); pstate_history_list_write(fp, "history", this_thing->history); pstate_change_list_write(fp, "change", this_thing->change); pstate_administrator_list_write(fp, "administrator", this_thing->administrator); pstate_developer_list_write(fp, "developer", this_thing->developer); pstate_reviewer_list_write(fp, "reviewer", this_thing->reviewer); pstate_integrator_list_write(fp, "integrator", this_thing->integrator); integer_write(fp, "currently_integrating_change", this_thing->currently_integrating_change, 0); integer_write(fp, "version_major", this_thing->version_major, 0); integer_write(fp, "version_minor", this_thing->version_minor, 0); string_write(fp, "version_previous", this_thing->version_previous); trace(("}\n")); } void pstate_write_xml(const output::pointer &fp, pstate_ty *this_thing) { if (!this_thing) return; trace(("pstate_write_xml(this_thing = %08lX)\n{\n", (long)this_thing)); assert(((pstate_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((pstate_ty *)this_thing)->reference_count)); fp->fputs("\n"); integer_write_xml(fp, "next_test_number", this_thing->next_test_number, 0); integer_write_xml(fp, "umask", this_thing->umask, 0); string_write_xml(fp, "description", this_thing->description); string_write_xml(fp, "owner_name", this_thing->owner_name); string_write_xml(fp, "group_name", this_thing->group_name); 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_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); string_write_xml(fp, "default_development_directory", this_thing->default_development_directory); boolean_write_xml(fp, "default_test_exemption", this_thing->default_test_exemption, 0); pstate_copyright_years_list_write_xml(fp, "copyright_years", this_thing->copyright_years); integer_write_xml(fp, "next_change_number", this_thing->next_change_number, 0); integer_write_xml(fp, "next_delta_number", this_thing->next_delta_number, 0); pstate_src_list_write_xml(fp, "src", this_thing->src); pstate_history_list_write_xml(fp, "history", this_thing->history); pstate_change_list_write_xml(fp, "change", this_thing->change); pstate_administrator_list_write_xml(fp, "administrator", this_thing->administrator); pstate_developer_list_write_xml(fp, "developer", this_thing->developer); pstate_reviewer_list_write_xml(fp, "reviewer", this_thing->reviewer); pstate_integrator_list_write_xml(fp, "integrator", this_thing->integrator); integer_write_xml(fp, "currently_integrating_change", this_thing->currently_integrating_change, 0); integer_write_xml(fp, "version_major", this_thing->version_major, 0); integer_write_xml(fp, "version_minor", this_thing->version_minor, 0); string_write_xml(fp, "version_previous", this_thing->version_previous); fp->fputs("\n"); } static void * pstate_alloc(void) { pstate_ty *this_thing; trace(("pstate_alloc()\n{\n")); this_thing = (pstate_ty *)mem_alloc(sizeof(pstate_ty)); this_thing->reference_count = 1; this_thing->mask = 0; this_thing->errpos = str_copy(lex_position()); this_thing->next_test_number = (long)0; this_thing->umask = (long)0; this_thing->description = (string_ty *)0; this_thing->owner_name = (string_ty *)0; this_thing->group_name = (string_ty *)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_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_development_directory = (string_ty *)0; this_thing->default_test_exemption = (bool)0; this_thing->copyright_years = (pstate_copyright_years_list_ty *)0; this_thing->next_change_number = (long)0; this_thing->next_delta_number = (long)0; this_thing->src = (pstate_src_list_ty *)0; this_thing->history = (pstate_history_list_ty *)0; this_thing->change = (pstate_change_list_ty *)0; this_thing->administrator = (pstate_administrator_list_ty *)0; this_thing->developer = (pstate_developer_list_ty *)0; this_thing->reviewer = (pstate_reviewer_list_ty *)0; this_thing->integrator = (pstate_integrator_list_ty *)0; this_thing->currently_integrating_change = (long)0; this_thing->version_major = (long)0; this_thing->version_minor = (long)0; this_thing->version_previous = (string_ty *)0; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } pstate_ty * pstate_copy(pstate_ty *this_thing) { trace(("pstate_copy()\n{\n")); this_thing->reference_count++; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } pstate_ty * pstate_clone(pstate_ty *this_thing) { if (!this_thing) return 0; trace(("pstate_clone()\n{\n")); pstate_ty *result = (pstate_ty *)pstate_alloc(); result->next_test_number = this_thing->next_test_number; result->umask = this_thing->umask; result->description = str_copy(this_thing->description); result->owner_name = str_copy(this_thing->owner_name); result->group_name = str_copy(this_thing->group_name); 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_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_development_directory = str_copy(this_thing->default_development_directory); result->default_test_exemption = this_thing->default_test_exemption; result->copyright_years = pstate_copyright_years_list_clone(this_thing->copyright_years); result->next_change_number = this_thing->next_change_number; result->next_delta_number = this_thing->next_delta_number; result->src = pstate_src_list_clone(this_thing->src); result->history = pstate_history_list_clone(this_thing->history); result->change = pstate_change_list_clone(this_thing->change); result->administrator = pstate_administrator_list_clone(this_thing->administrator); result->developer = pstate_developer_list_clone(this_thing->developer); result->reviewer = pstate_reviewer_list_clone(this_thing->reviewer); result->integrator = pstate_integrator_list_clone(this_thing->integrator); result->currently_integrating_change = this_thing->currently_integrating_change; result->version_major = this_thing->version_major; result->version_minor = this_thing->version_minor; result->version_previous = str_copy(this_thing->version_previous); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } #ifdef DEBUG void pstate_trace_real(const char *name, const pstate_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("{\n"); trace_long_real("next_test_number", &value->next_test_number); trace_long_real("umask", &value->umask); trace_string_real("description", value->description); trace_string_real("owner_name", value->owner_name); trace_string_real("group_name", value->group_name); 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_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_string_real("default_development_directory", value->default_development_directory); trace_bool_real("default_test_exemption", value->default_test_exemption); pstate_copyright_years_list_trace_real("copyright_years", value->copyright_years); trace_long_real("next_change_number", &value->next_change_number); trace_long_real("next_delta_number", &value->next_delta_number); pstate_src_list_trace_real("src", value->src); pstate_history_list_trace_real("history", value->history); pstate_change_list_trace_real("change", value->change); pstate_administrator_list_trace_real("administrator", value->administrator); pstate_developer_list_trace_real("developer", value->developer); pstate_reviewer_list_trace_real("reviewer", value->reviewer); pstate_integrator_list_trace_real("integrator", value->integrator); trace_long_real("currently_integrating_change", &value->currently_integrating_change); trace_long_real("version_major", &value->version_major); trace_long_real("version_minor", &value->version_minor); trace_string_real("version_previous", value->version_previous); trace_printf("}"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG static void pstate_free(void *that) { pstate_ty *this_thing; this_thing = (pstate_ty *)that; if (!this_thing) return; this_thing->reference_count--; assert(this_thing->reference_count >= 0); if (this_thing->reference_count > 0) return; trace(("pstate_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->description); str_free(this_thing->owner_name); str_free(this_thing->group_name); 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_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); str_free(this_thing->default_development_directory); pstate_copyright_years_list_free(this_thing->copyright_years); pstate_src_list_free(this_thing->src); pstate_history_list_free(this_thing->history); pstate_change_list_free(this_thing->change); pstate_administrator_list_free(this_thing->administrator); pstate_developer_list_free(this_thing->developer); pstate_reviewer_list_free(this_thing->reviewer); pstate_integrator_list_free(this_thing->integrator); str_free(this_thing->version_previous); mem_free(this_thing); trace(("}\n")); } static type_table_ty pstate_table[] = { { "next_test_number", offsetof(pstate_ty, next_test_number), &integer_type, pstate_next_test_number_mask, 0, // redefinition not ok 0, // fast_name }, { "umask", offsetof(pstate_ty, umask), &integer_type, pstate_umask_mask, 0, // redefinition not ok 0, // fast_name }, { "description", offsetof(pstate_ty, description), &string_type, pstate_description_mask, 0, // redefinition not ok 0, // fast_name }, { "owner_name", offsetof(pstate_ty, owner_name), &string_type, pstate_owner_name_mask, 0, // redefinition not ok 0, // fast_name }, { "group_name", offsetof(pstate_ty, group_name), &string_type, pstate_group_name_mask, 0, // redefinition not ok 0, // fast_name }, { "developer_may_review", offsetof(pstate_ty, developer_may_review), &boolean_type, pstate_developer_may_review_mask, 0, // redefinition not ok 0, // fast_name }, { "developer_may_integrate", offsetof(pstate_ty, developer_may_integrate), &boolean_type, pstate_developer_may_integrate_mask, 0, // redefinition not ok 0, // fast_name }, { "reviewer_may_integrate", offsetof(pstate_ty, reviewer_may_integrate), &boolean_type, pstate_reviewer_may_integrate_mask, 0, // redefinition not ok 0, // fast_name }, { "developers_may_create_changes", offsetof(pstate_ty, developers_may_create_changes), &boolean_type, pstate_developers_may_create_changes_mask, 0, // redefinition not ok 0, // fast_name }, { "forced_develop_begin_notify_command", offsetof(pstate_ty, forced_develop_begin_notify_command), &string_type, pstate_forced_develop_begin_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "develop_end_notify_command", offsetof(pstate_ty, develop_end_notify_command), &string_type, pstate_develop_end_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "develop_end_undo_notify_command", offsetof(pstate_ty, develop_end_undo_notify_command), &string_type, pstate_develop_end_undo_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "review_pass_notify_command", offsetof(pstate_ty, review_pass_notify_command), &string_type, pstate_review_pass_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "review_pass_undo_notify_command", offsetof(pstate_ty, review_pass_undo_notify_command), &string_type, pstate_review_pass_undo_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "review_fail_notify_command", offsetof(pstate_ty, review_fail_notify_command), &string_type, pstate_review_fail_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "integrate_pass_notify_command", offsetof(pstate_ty, integrate_pass_notify_command), &string_type, pstate_integrate_pass_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "integrate_fail_notify_command", offsetof(pstate_ty, integrate_fail_notify_command), &string_type, pstate_integrate_fail_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "default_development_directory", offsetof(pstate_ty, default_development_directory), &string_type, pstate_default_development_directory_mask, 0, // redefinition not ok 0, // fast_name }, { "default_test_exemption", offsetof(pstate_ty, default_test_exemption), &boolean_type, pstate_default_test_exemption_mask, 0, // redefinition not ok 0, // fast_name }, { "copyright_years", offsetof(pstate_ty, copyright_years), &pstate_copyright_years_list_type, pstate_copyright_years_mask, 0, // redefinition not ok 0, // fast_name }, { "next_change_number", offsetof(pstate_ty, next_change_number), &integer_type, pstate_next_change_number_mask, 0, // redefinition not ok 0, // fast_name }, { "next_delta_number", offsetof(pstate_ty, next_delta_number), &integer_type, pstate_next_delta_number_mask, 0, // redefinition not ok 0, // fast_name }, { "src", offsetof(pstate_ty, src), &pstate_src_list_type, pstate_src_mask, 0, // redefinition not ok 0, // fast_name }, { "history", offsetof(pstate_ty, history), &pstate_history_list_type, pstate_history_mask, 0, // redefinition not ok 0, // fast_name }, { "change", offsetof(pstate_ty, change), &pstate_change_list_type, pstate_change_mask, 0, // redefinition not ok 0, // fast_name }, { "administrator", offsetof(pstate_ty, administrator), &pstate_administrator_list_type, pstate_administrator_mask, 0, // redefinition not ok 0, // fast_name }, { "developer", offsetof(pstate_ty, developer), &pstate_developer_list_type, pstate_developer_mask, 0, // redefinition not ok 0, // fast_name }, { "reviewer", offsetof(pstate_ty, reviewer), &pstate_reviewer_list_type, pstate_reviewer_mask, 0, // redefinition not ok 0, // fast_name }, { "integrator", offsetof(pstate_ty, integrator), &pstate_integrator_list_type, pstate_integrator_mask, 0, // redefinition not ok 0, // fast_name }, { "currently_integrating_change", offsetof(pstate_ty, currently_integrating_change), &integer_type, pstate_currently_integrating_change_mask, 0, // redefinition not ok 0, // fast_name }, { "version_major", offsetof(pstate_ty, version_major), &integer_type, pstate_version_major_mask, 0, // redefinition not ok 0, // fast_name }, { "version_minor", offsetof(pstate_ty, version_minor), &integer_type, pstate_version_minor_mask, 0, // redefinition not ok 0, // fast_name }, { "version_previous", offsetof(pstate_ty, version_previous), &string_type, pstate_version_previous_mask, 0, // redefinition not ok 0, // fast_name }, }; static void * pstate_parse(void *this_thing, string_ty *name, meta_type **type_pp, unsigned long *mask_p, int *redef_p) { void *addr; trace(("pstate_parse(this_thing = %08lX, name = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)name, (long)type_pp)); assert(((pstate_ty *)this_thing)->reference_count > 0); addr = generic_struct_parse ( this_thing, name, type_pp, mask_p, redef_p, pstate_table, SIZEOF(pstate_table) ); trace(("return %08lX;\n}\n", (long)addr)); return addr; } static string_ty * pstate_fuzzy(string_ty *name) { string_ty *result; trace(("pstate_fuzzy(name = %08lX)\n{\n", (long)name)); result = generic_struct_fuzzy ( name, pstate_table, SIZEOF(pstate_table) ); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static rpt_value::pointer pstate_convert(void *this_thing) { trace(("pstate_convert(name = %08lX)\n{\n", (long)this_thing)); assert(((pstate_ty *)this_thing)->reference_count > 0); rpt_value::pointer result = generic_struct_convert ( this_thing, pstate_table, SIZEOF(pstate_table) ); trace(("return %08lX;\n", (long)result.get())); trace(("}\n")); return result; } meta_type pstate_type = { "pstate", pstate_alloc, pstate_free, 0, // enum_parse 0, // list_parse pstate_parse, pstate_fuzzy, pstate_convert, generic_struct_is_set, }; pstate_ty * pstate_read_file(const nstring &filename) { return pstate_read_file(filename.get_ref()); } pstate_ty * pstate_read_file(string_ty *filename) { pstate_ty *result; trace(("pstate_read_file(filename = \"%s\")\n{\n", (filename ? filename->str_text : ""))); os_become_must_be_active(); result = (pstate_ty *)parse(filename, &pstate_type); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } void pstate_write_file(const nstring &filename, pstate_ty *value, bool comp) { pstate_write_file(filename.get_ref(), value, comp); } void pstate_write_file(string_ty *filename, pstate_ty *value, int needs_compression) { trace(("pstate_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); pstate_write(fp, value); type_enum_option_clear(); trace(("}\n")); } void pstate__rpt_init(void) { trace(("pstate__rpt_init()\n{\n")); trace(("}\n")); }