// // This file is generated by fmtgen from "libaegis/pattr.def". // If you want to change the contents of this file // you need to edit libaegis/pattr.def // or you need to enhance fmtgen. // #include #include #include #include #include #include #include #include #include #include #include #include #include void pattr_copyright_years_list_write(const output::pointer &fp, const char *name, pattr_copyright_years_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pattr_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 pattr_copyright_years_list_write_xml(const output::pointer &fp, const char *name, pattr_copyright_years_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pattr_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 * pattr_copyright_years_list_alloc(void) { pattr_copyright_years_list_ty *result; trace(("pattr_copyright_years_list_alloc()\n{\n")); result = (pattr_copyright_years_list_ty *)mem_alloc(sizeof(pattr_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 pattr_copyright_years_list_free(void *that) { pattr_copyright_years_list_ty *this_thing; size_t j; this_thing = (pattr_copyright_years_list_ty *)that; if (!this_thing) return; trace(("pattr_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 * pattr_copyright_years_list_parse(void *that, meta_type **type_pp) { pattr_copyright_years_list_ty *this_thing; void *addr; this_thing = (pattr_copyright_years_list_ty *)that; trace(("pattr_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 pattr_copyright_years_list_convert(void *that) { pattr_copyright_years_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(pattr_copyright_years_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("pattr_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; } pattr_copyright_years_list_ty * pattr_copyright_years_list_copy(pattr_copyright_years_list_ty *from) { size_t j; pattr_copyright_years_list_ty *result; if (!from) return 0; trace(("pattr_copyright_years_list_copy(from = %08lX)\n{\n", (long)from)); result = (pattr_copyright_years_list_ty *)pattr_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*)pattr_copyright_years_list_parse(result, &bogus); *mpp = integer_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } pattr_copyright_years_list_ty * pattr_copyright_years_list_clone(pattr_copyright_years_list_ty *from) { return pattr_copyright_years_list_copy(from); } #ifdef DEBUG void pattr_copyright_years_list_trace_real(const char *name, const pattr_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 pattr_copyright_years_list_type = { "pattr_copyright_years_list", pattr_copyright_years_list_alloc, pattr_copyright_years_list_free, 0, // enum_parse pattr_copyright_years_list_parse, 0, // struct_parse 0, // fuzzy pattr_copyright_years_list_convert, generic_struct_is_set, }; static const char *pattr_develop_end_action_s[] = { "goto_being_reviewed", "goto_awaiting_review", "goto_awaiting_integration", }; static string_ty *pattr_develop_end_action_f[SIZEOF(pattr_develop_end_action_s)]; const char * pattr_develop_end_action_ename(pattr_develop_end_action_ty this_thing) { static char buffer[20]; if ((int)this_thing >= 0 && (int)this_thing < 3) return pattr_develop_end_action_s[this_thing]; snprintf(buffer, sizeof(buffer), "%d", (int)this_thing); return buffer; } void pattr_develop_end_action_write(const output::pointer &fp, const char *name, pattr_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(pattr_develop_end_action_s[this_thing]); if (name) fp->fputs(";\n"); } void pattr_develop_end_action_write_xml(const output::pointer &fp, const char *name, pattr_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(pattr_develop_end_action_s)); fp->fputc('<'); fp->fputs(name); fp->fputc('>'); fp->fputs(pattr_develop_end_action_s[this_thing]); fp->fputs("fputs(name); fp->fputs(">\n"); } static bool pattr_develop_end_action_parse(string_ty *name, void *ptr) { slow_to_fast(pattr_develop_end_action_s, pattr_develop_end_action_f, SIZEOF(pattr_develop_end_action_s)); for (size_t j = 0; j < SIZEOF(pattr_develop_end_action_f); ++j) { if (str_equal(name, pattr_develop_end_action_f[j])) { *(pattr_develop_end_action_ty *)ptr = (pattr_develop_end_action_ty)j; return true; } } return false; } static string_ty * pattr_develop_end_action_fuzzy(string_ty *name) { return generic_enum_fuzzy(name, pattr_develop_end_action_f, SIZEOF(pattr_develop_end_action_f)); } static rpt_value::pointer pattr_develop_end_action_convert(void *this_thing) { if (!pattr_develop_end_action_f[0]) slow_to_fast(pattr_develop_end_action_s, pattr_develop_end_action_f, SIZEOF(pattr_develop_end_action_s)); return generic_enum_convert ( (int)*(pattr_develop_end_action_ty *)this_thing, pattr_develop_end_action_f, SIZEOF(pattr_develop_end_action_f) ); } static bool pattr_develop_end_action_is_set(void *this_thing) { return (*(pattr_develop_end_action_ty *)this_thing != 0); } meta_type pattr_develop_end_action_type = { "pattr_develop_end_action", 0, // alloc 0, // free pattr_develop_end_action_parse, 0, // list_parse 0, // struct_parse pattr_develop_end_action_fuzzy, pattr_develop_end_action_convert, pattr_develop_end_action_is_set, }; void pattr_write(const output::pointer &fp, pattr_ty *this_thing) { if (!this_thing) return; trace(("pattr_write(this_thing = %08lX)\n{\n", (long)this_thing)); assert(((pattr_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((pattr_ty *)this_thing)->reference_count)); string_write(fp, "description", this_thing->description); 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); string_write(fp, "default_development_directory", this_thing->default_development_directory); integer_write(fp, "umask", this_thing->umask, 0); 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); pattr_copyright_years_list_write(fp, "copyright_years", this_thing->copyright_years); 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, "skip_unlucky", this_thing->skip_unlucky, 1); boolean_write(fp, "compress_database", this_thing->compress_database, 1); pattr_develop_end_action_write(fp, "develop_end_action", this_thing->develop_end_action, 1); boolean_write(fp, "protect_development_directory", this_thing->protect_development_directory, 1); trace(("}\n")); } void pattr_write_xml(const output::pointer &fp, pattr_ty *this_thing) { if (!this_thing) return; trace(("pattr_write_xml(this_thing = %08lX)\n{\n", (long)this_thing)); assert(((pattr_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((pattr_ty *)this_thing)->reference_count)); fp->fputs("\n"); string_write_xml(fp, "description", this_thing->description); 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); string_write_xml(fp, "default_development_directory", this_thing->default_development_directory); integer_write_xml(fp, "umask", this_thing->umask, 0); 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, 0); pattr_copyright_years_list_write_xml(fp, "copyright_years", this_thing->copyright_years); 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, "skip_unlucky", this_thing->skip_unlucky, 0); boolean_write_xml(fp, "compress_database", this_thing->compress_database, 0); pattr_develop_end_action_write_xml(fp, "develop_end_action", this_thing->develop_end_action, 0); boolean_write_xml(fp, "protect_development_directory", this_thing->protect_development_directory, 0); fp->fputs("\n"); } static void * pattr_alloc(void) { pattr_ty *this_thing; trace(("pattr_alloc()\n{\n")); this_thing = (pattr_ty *)mem_alloc(sizeof(pattr_ty)); this_thing->reference_count = 1; this_thing->mask = 0; this_thing->errpos = str_copy(lex_position()); this_thing->description = (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_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_development_directory = (string_ty *)0; this_thing->umask = (long)0; this_thing->default_test_exemption = (bool)0; this_thing->default_test_regression_exemption = (bool)0; this_thing->copyright_years = (pattr_copyright_years_list_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->skip_unlucky = (bool)0; this_thing->compress_database = (bool)0; this_thing->develop_end_action = (pattr_develop_end_action_ty)0; this_thing->protect_development_directory = (bool)0; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } pattr_ty * pattr_copy(pattr_ty *this_thing) { trace(("pattr_copy()\n{\n")); this_thing->reference_count++; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } pattr_ty * pattr_clone(pattr_ty *this_thing) { if (!this_thing) return 0; trace(("pattr_clone()\n{\n")); pattr_ty *result = (pattr_ty *)pattr_alloc(); result->description = str_copy(this_thing->description); 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_development_directory = str_copy(this_thing->default_development_directory); result->umask = this_thing->umask; result->default_test_exemption = this_thing->default_test_exemption; result->default_test_regression_exemption = this_thing->default_test_regression_exemption; result->copyright_years = pattr_copyright_years_list_clone(this_thing->copyright_years); 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->skip_unlucky = this_thing->skip_unlucky; result->compress_database = this_thing->compress_database; result->develop_end_action = this_thing->develop_end_action; result->protect_development_directory = this_thing->protect_development_directory; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } #ifdef DEBUG void pattr_trace_real(const char *name, const pattr_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("{\n"); trace_string_real("description", value->description); 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_string_real("default_development_directory", value->default_development_directory); trace_long_real("umask", &value->umask); trace_bool_real("default_test_exemption", value->default_test_exemption); trace_bool_real("default_test_regression_exemption", value->default_test_regression_exemption); pattr_copyright_years_list_trace_real("copyright_years", value->copyright_years); 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("skip_unlucky", value->skip_unlucky); trace_bool_real("compress_database", value->compress_database); trace_printf("develop_end_action = %s;\n", pattr_develop_end_action_ename(value->develop_end_action)); trace_bool_real("protect_development_directory", value->protect_development_directory); trace_printf("}"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG static void pattr_free(void *that) { pattr_ty *this_thing; this_thing = (pattr_ty *)that; if (!this_thing) return; this_thing->reference_count--; assert(this_thing->reference_count >= 0); if (this_thing->reference_count > 0) return; trace(("pattr_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->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); str_free(this_thing->default_development_directory); pattr_copyright_years_list_free(this_thing->copyright_years); mem_free(this_thing); trace(("}\n")); } static type_table_ty pattr_table[] = { { "description", offsetof(pattr_ty, description), &string_type, pattr_description_mask, 0, // redefinition not ok 0, // fast_name }, { "developer_may_review", offsetof(pattr_ty, developer_may_review), &boolean_type, pattr_developer_may_review_mask, 0, // redefinition not ok 0, // fast_name }, { "developer_may_integrate", offsetof(pattr_ty, developer_may_integrate), &boolean_type, pattr_developer_may_integrate_mask, 0, // redefinition not ok 0, // fast_name }, { "reviewer_may_integrate", offsetof(pattr_ty, reviewer_may_integrate), &boolean_type, pattr_reviewer_may_integrate_mask, 0, // redefinition not ok 0, // fast_name }, { "developers_may_create_changes", offsetof(pattr_ty, developers_may_create_changes), &boolean_type, pattr_developers_may_create_changes_mask, 0, // redefinition not ok 0, // fast_name }, { "forced_develop_begin_notify_command", offsetof(pattr_ty, forced_develop_begin_notify_command), &string_type, pattr_forced_develop_begin_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "develop_end_notify_command", offsetof(pattr_ty, develop_end_notify_command), &string_type, pattr_develop_end_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "develop_end_undo_notify_command", offsetof(pattr_ty, develop_end_undo_notify_command), &string_type, pattr_develop_end_undo_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "review_begin_notify_command", offsetof(pattr_ty, review_begin_notify_command), &string_type, pattr_review_begin_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "review_begin_undo_notify_command", offsetof(pattr_ty, review_begin_undo_notify_command), &string_type, pattr_review_begin_undo_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "review_pass_notify_command", offsetof(pattr_ty, review_pass_notify_command), &string_type, pattr_review_pass_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "review_pass_undo_notify_command", offsetof(pattr_ty, review_pass_undo_notify_command), &string_type, pattr_review_pass_undo_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "review_fail_notify_command", offsetof(pattr_ty, review_fail_notify_command), &string_type, pattr_review_fail_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "integrate_pass_notify_command", offsetof(pattr_ty, integrate_pass_notify_command), &string_type, pattr_integrate_pass_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "integrate_fail_notify_command", offsetof(pattr_ty, integrate_fail_notify_command), &string_type, pattr_integrate_fail_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "default_development_directory", offsetof(pattr_ty, default_development_directory), &string_type, pattr_default_development_directory_mask, 0, // redefinition not ok 0, // fast_name }, { "umask", offsetof(pattr_ty, umask), &integer_type, pattr_umask_mask, 0, // redefinition not ok 0, // fast_name }, { "default_test_exemption", offsetof(pattr_ty, default_test_exemption), &boolean_type, pattr_default_test_exemption_mask, 0, // redefinition not ok 0, // fast_name }, { "default_test_regression_exemption", offsetof(pattr_ty, default_test_regression_exemption), &boolean_type, pattr_default_test_regression_exemption_mask, 0, // redefinition not ok 0, // fast_name }, { "copyright_years", offsetof(pattr_ty, copyright_years), &pattr_copyright_years_list_type, pattr_copyright_years_mask, 0, // redefinition not ok 0, // fast_name }, { "minimum_change_number", offsetof(pattr_ty, minimum_change_number), &integer_type, pattr_minimum_change_number_mask, 0, // redefinition not ok 0, // fast_name }, { "reuse_change_numbers", offsetof(pattr_ty, reuse_change_numbers), &boolean_type, pattr_reuse_change_numbers_mask, 0, // redefinition not ok 0, // fast_name }, { "minimum_branch_number", offsetof(pattr_ty, minimum_branch_number), &integer_type, pattr_minimum_branch_number_mask, 0, // redefinition not ok 0, // fast_name }, { "skip_unlucky", offsetof(pattr_ty, skip_unlucky), &boolean_type, pattr_skip_unlucky_mask, 0, // redefinition not ok 0, // fast_name }, { "compress_database", offsetof(pattr_ty, compress_database), &boolean_type, pattr_compress_database_mask, 0, // redefinition not ok 0, // fast_name }, { "develop_end_action", offsetof(pattr_ty, develop_end_action), &pattr_develop_end_action_type, pattr_develop_end_action_mask, 0, // redefinition not ok 0, // fast_name }, { "protect_development_directory", offsetof(pattr_ty, protect_development_directory), &boolean_type, pattr_protect_development_directory_mask, 0, // redefinition not ok 0, // fast_name }, }; static void * pattr_parse(void *this_thing, string_ty *name, meta_type **type_pp, unsigned long *mask_p, int *redef_p) { void *addr; trace(("pattr_parse(this_thing = %08lX, name = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)name, (long)type_pp)); assert(((pattr_ty *)this_thing)->reference_count > 0); addr = generic_struct_parse ( this_thing, name, type_pp, mask_p, redef_p, pattr_table, SIZEOF(pattr_table) ); trace(("return %08lX;\n}\n", (long)addr)); return addr; } static string_ty * pattr_fuzzy(string_ty *name) { string_ty *result; trace(("pattr_fuzzy(name = %08lX)\n{\n", (long)name)); result = generic_struct_fuzzy ( name, pattr_table, SIZEOF(pattr_table) ); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static rpt_value::pointer pattr_convert(void *this_thing) { trace(("pattr_convert(name = %08lX)\n{\n", (long)this_thing)); assert(((pattr_ty *)this_thing)->reference_count > 0); rpt_value::pointer result = generic_struct_convert ( this_thing, pattr_table, SIZEOF(pattr_table) ); trace(("return %08lX;\n", (long)result.get())); trace(("}\n")); return result; } meta_type pattr_type = { "pattr", pattr_alloc, pattr_free, 0, // enum_parse 0, // list_parse pattr_parse, pattr_fuzzy, pattr_convert, generic_struct_is_set, }; pattr_ty * pattr_read_file(const nstring &filename) { return pattr_read_file(filename.get_ref()); } pattr_ty * pattr_read_file(string_ty *filename) { pattr_ty *result; trace(("pattr_read_file(filename = \"%s\")\n{\n", (filename ? filename->str_text : ""))); os_become_must_be_active(); result = (pattr_ty *)parse(filename, &pattr_type); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } void pattr_write_file(const nstring &filename, pattr_ty *value, bool comp) { pattr_write_file(filename.get_ref(), value, comp); } void pattr_write_file(string_ty *filename, pattr_ty *value, int needs_compression) { trace(("pattr_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); pattr_write(fp, value); type_enum_option_clear(); trace(("}\n")); } void pattr__rpt_init(void) { trace(("pattr__rpt_init()\n{\n")); generic_enum__init(pattr_develop_end_action_s, SIZEOF(pattr_develop_end_action_s)); trace(("}\n")); }