// // This file is generated by fmtgen from "libaegis/pconf.def". // If you want to change the contents of this file // you need to edit libaegis/pconf.def // or you need to enhance fmtgen. // #include #include #include #include #include #include #include #include #include #include #include #include void work_area_style_write(const output::pointer &fp, const char *name, work_area_style_ty *this_thing) { if (!this_thing) return; trace(("work_area_style_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(((work_area_style_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((work_area_style_ty *)this_thing)->reference_count)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } fp->fputs("{\n"); boolean_write(fp, "source_file_link", this_thing->source_file_link, 1); boolean_write(fp, "source_file_symlink", this_thing->source_file_symlink, 1); boolean_write(fp, "source_file_copy", this_thing->source_file_copy, 1); boolean_write(fp, "source_file_whiteout", this_thing->source_file_whiteout, 1); boolean_write(fp, "derived_file_link", this_thing->derived_file_link, 1); boolean_write(fp, "derived_file_symlink", this_thing->derived_file_symlink, 1); boolean_write(fp, "derived_file_copy", this_thing->derived_file_copy, 1); boolean_write(fp, "during_build_only", this_thing->during_build_only, 1); boolean_write(fp, "derived_at_start_only", this_thing->derived_at_start_only, 1); fp->fputs("}"); if (name) fp->fputs(";\n"); trace(("}\n")); } void work_area_style_write_xml(const output::pointer &fp, const char *name, work_area_style_ty *this_thing) { if (!this_thing) return; trace(("work_area_style_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); assert(((work_area_style_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((work_area_style_ty *)this_thing)->reference_count)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); boolean_write_xml(fp, "source_file_link", this_thing->source_file_link, 0); boolean_write_xml(fp, "source_file_symlink", this_thing->source_file_symlink, 0); boolean_write_xml(fp, "source_file_copy", this_thing->source_file_copy, 0); boolean_write_xml(fp, "source_file_whiteout", this_thing->source_file_whiteout, 0); boolean_write_xml(fp, "derived_file_link", this_thing->derived_file_link, 0); boolean_write_xml(fp, "derived_file_symlink", this_thing->derived_file_symlink, 0); boolean_write_xml(fp, "derived_file_copy", this_thing->derived_file_copy, 0); boolean_write_xml(fp, "during_build_only", this_thing->during_build_only, 0); boolean_write_xml(fp, "derived_at_start_only", this_thing->derived_at_start_only, 0); fp->fputs("fputs(name); fp->fputs(">\n"); } static void * work_area_style_alloc(void) { work_area_style_ty *this_thing; trace(("work_area_style_alloc()\n{\n")); this_thing = (work_area_style_ty *)mem_alloc(sizeof(work_area_style_ty)); this_thing->reference_count = 1; this_thing->mask = 0; this_thing->errpos = str_copy(lex_position()); this_thing->source_file_link = (bool)0; this_thing->source_file_symlink = (bool)0; this_thing->source_file_copy = (bool)0; this_thing->source_file_whiteout = (bool)0; this_thing->derived_file_link = (bool)0; this_thing->derived_file_symlink = (bool)0; this_thing->derived_file_copy = (bool)0; this_thing->during_build_only = (bool)0; this_thing->derived_at_start_only = (bool)0; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } work_area_style_ty * work_area_style_copy(work_area_style_ty *this_thing) { trace(("work_area_style_copy()\n{\n")); this_thing->reference_count++; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } work_area_style_ty * work_area_style_clone(work_area_style_ty *this_thing) { if (!this_thing) return 0; trace(("work_area_style_clone()\n{\n")); work_area_style_ty *result = (work_area_style_ty *)work_area_style_alloc(); result->source_file_link = this_thing->source_file_link; result->source_file_symlink = this_thing->source_file_symlink; result->source_file_copy = this_thing->source_file_copy; result->source_file_whiteout = this_thing->source_file_whiteout; result->derived_file_link = this_thing->derived_file_link; result->derived_file_symlink = this_thing->derived_file_symlink; result->derived_file_copy = this_thing->derived_file_copy; result->during_build_only = this_thing->during_build_only; result->derived_at_start_only = this_thing->derived_at_start_only; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } #ifdef DEBUG void work_area_style_trace_real(const char *name, const work_area_style_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("{\n"); trace_bool_real("source_file_link", value->source_file_link); trace_bool_real("source_file_symlink", value->source_file_symlink); trace_bool_real("source_file_copy", value->source_file_copy); trace_bool_real("source_file_whiteout", value->source_file_whiteout); trace_bool_real("derived_file_link", value->derived_file_link); trace_bool_real("derived_file_symlink", value->derived_file_symlink); trace_bool_real("derived_file_copy", value->derived_file_copy); trace_bool_real("during_build_only", value->during_build_only); trace_bool_real("derived_at_start_only", value->derived_at_start_only); trace_printf("}"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG static void work_area_style_free(void *that) { work_area_style_ty *this_thing; this_thing = (work_area_style_ty *)that; if (!this_thing) return; this_thing->reference_count--; assert(this_thing->reference_count >= 0); if (this_thing->reference_count > 0) return; trace(("work_area_style_free(this_thing = %08lX)\n{\n", (long)this_thing)); if (this_thing->errpos) { str_free(this_thing->errpos); this_thing->errpos = 0; } mem_free(this_thing); trace(("}\n")); } static type_table_ty work_area_style_table[] = { { "source_file_link", offsetof(work_area_style_ty, source_file_link), &boolean_type, work_area_style_source_file_link_mask, 0, // redefinition not ok 0, // fast_name }, { "source_file_symlink", offsetof(work_area_style_ty, source_file_symlink), &boolean_type, work_area_style_source_file_symlink_mask, 0, // redefinition not ok 0, // fast_name }, { "source_file_copy", offsetof(work_area_style_ty, source_file_copy), &boolean_type, work_area_style_source_file_copy_mask, 0, // redefinition not ok 0, // fast_name }, { "source_file_whiteout", offsetof(work_area_style_ty, source_file_whiteout), &boolean_type, work_area_style_source_file_whiteout_mask, 0, // redefinition not ok 0, // fast_name }, { "derived_file_link", offsetof(work_area_style_ty, derived_file_link), &boolean_type, work_area_style_derived_file_link_mask, 0, // redefinition not ok 0, // fast_name }, { "derived_file_symlink", offsetof(work_area_style_ty, derived_file_symlink), &boolean_type, work_area_style_derived_file_symlink_mask, 0, // redefinition not ok 0, // fast_name }, { "derived_file_copy", offsetof(work_area_style_ty, derived_file_copy), &boolean_type, work_area_style_derived_file_copy_mask, 0, // redefinition not ok 0, // fast_name }, { "during_build_only", offsetof(work_area_style_ty, during_build_only), &boolean_type, work_area_style_during_build_only_mask, 0, // redefinition not ok 0, // fast_name }, { "derived_at_start_only", offsetof(work_area_style_ty, derived_at_start_only), &boolean_type, work_area_style_derived_at_start_only_mask, 0, // redefinition not ok 0, // fast_name }, }; static void * work_area_style_parse(void *this_thing, string_ty *name, meta_type **type_pp, unsigned long *mask_p, int *redef_p) { void *addr; trace(("work_area_style_parse(this_thing = %08lX, name = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)name, (long)type_pp)); assert(((work_area_style_ty *)this_thing)->reference_count > 0); addr = generic_struct_parse ( this_thing, name, type_pp, mask_p, redef_p, work_area_style_table, SIZEOF(work_area_style_table) ); trace(("return %08lX;\n}\n", (long)addr)); return addr; } static string_ty * work_area_style_fuzzy(string_ty *name) { string_ty *result; trace(("work_area_style_fuzzy(name = %08lX)\n{\n", (long)name)); result = generic_struct_fuzzy ( name, work_area_style_table, SIZEOF(work_area_style_table) ); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static rpt_value::pointer work_area_style_convert(void *this_thing) { trace(("work_area_style_convert(name = %08lX)\n{\n", (long)this_thing)); assert(((work_area_style_ty *)this_thing)->reference_count > 0); rpt_value::pointer result = generic_struct_convert ( this_thing, work_area_style_table, SIZEOF(work_area_style_table) ); trace(("return %08lX;\n", (long)result.get())); trace(("}\n")); return result; } meta_type work_area_style_type = { "work_area_style", work_area_style_alloc, work_area_style_free, 0, // enum_parse 0, // list_parse work_area_style_parse, work_area_style_fuzzy, work_area_style_convert, generic_struct_is_set, }; #include void pconf_integrate_begin_exceptions_list_write(const output::pointer &fp, const char *name, pconf_integrate_begin_exceptions_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_integrate_begin_exceptions_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 pconf_integrate_begin_exceptions_list_write_xml(const output::pointer &fp, const char *name, pconf_integrate_begin_exceptions_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_integrate_begin_exceptions_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 * pconf_integrate_begin_exceptions_list_alloc(void) { pconf_integrate_begin_exceptions_list_ty *result; trace(("pconf_integrate_begin_exceptions_list_alloc()\n{\n")); result = (pconf_integrate_begin_exceptions_list_ty *)mem_alloc(sizeof(pconf_integrate_begin_exceptions_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void pconf_integrate_begin_exceptions_list_free(void *that) { pconf_integrate_begin_exceptions_list_ty *this_thing; size_t j; this_thing = (pconf_integrate_begin_exceptions_list_ty *)that; if (!this_thing) return; trace(("pconf_integrate_begin_exceptions_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 * pconf_integrate_begin_exceptions_list_parse(void *that, meta_type **type_pp) { pconf_integrate_begin_exceptions_list_ty *this_thing; void *addr; this_thing = (pconf_integrate_begin_exceptions_list_ty *)that; trace(("pconf_integrate_begin_exceptions_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 pconf_integrate_begin_exceptions_list_convert(void *that) { pconf_integrate_begin_exceptions_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(pconf_integrate_begin_exceptions_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("pconf_integrate_begin_exceptions_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; } pconf_integrate_begin_exceptions_list_ty * pconf_integrate_begin_exceptions_list_copy(pconf_integrate_begin_exceptions_list_ty *from) { size_t j; pconf_integrate_begin_exceptions_list_ty *result; if (!from) return 0; trace(("pconf_integrate_begin_exceptions_list_copy(from = %08lX)\n{\n", (long)from)); result = (pconf_integrate_begin_exceptions_list_ty *)pconf_integrate_begin_exceptions_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 **)pconf_integrate_begin_exceptions_list_parse(result, &bogus); *mpp = string_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } pconf_integrate_begin_exceptions_list_ty * pconf_integrate_begin_exceptions_list_clone(pconf_integrate_begin_exceptions_list_ty *from) { return pconf_integrate_begin_exceptions_list_copy(from); } #ifdef DEBUG void pconf_integrate_begin_exceptions_list_trace_real(const char *name, const pconf_integrate_begin_exceptions_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 pconf_integrate_begin_exceptions_list_type = { "pconf_integrate_begin_exceptions_list", pconf_integrate_begin_exceptions_list_alloc, pconf_integrate_begin_exceptions_list_free, 0, // enum_parse pconf_integrate_begin_exceptions_list_parse, 0, // struct_parse 0, // fuzzy pconf_integrate_begin_exceptions_list_convert, generic_struct_is_set, }; void pconf_symlink_exceptions_list_write(const output::pointer &fp, const char *name, pconf_symlink_exceptions_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_symlink_exceptions_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 pconf_symlink_exceptions_list_write_xml(const output::pointer &fp, const char *name, pconf_symlink_exceptions_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_symlink_exceptions_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 * pconf_symlink_exceptions_list_alloc(void) { pconf_symlink_exceptions_list_ty *result; trace(("pconf_symlink_exceptions_list_alloc()\n{\n")); result = (pconf_symlink_exceptions_list_ty *)mem_alloc(sizeof(pconf_symlink_exceptions_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void pconf_symlink_exceptions_list_free(void *that) { pconf_symlink_exceptions_list_ty *this_thing; size_t j; this_thing = (pconf_symlink_exceptions_list_ty *)that; if (!this_thing) return; trace(("pconf_symlink_exceptions_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 * pconf_symlink_exceptions_list_parse(void *that, meta_type **type_pp) { pconf_symlink_exceptions_list_ty *this_thing; void *addr; this_thing = (pconf_symlink_exceptions_list_ty *)that; trace(("pconf_symlink_exceptions_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 pconf_symlink_exceptions_list_convert(void *that) { pconf_symlink_exceptions_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(pconf_symlink_exceptions_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("pconf_symlink_exceptions_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; } pconf_symlink_exceptions_list_ty * pconf_symlink_exceptions_list_copy(pconf_symlink_exceptions_list_ty *from) { size_t j; pconf_symlink_exceptions_list_ty *result; if (!from) return 0; trace(("pconf_symlink_exceptions_list_copy(from = %08lX)\n{\n", (long)from)); result = (pconf_symlink_exceptions_list_ty *)pconf_symlink_exceptions_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 **)pconf_symlink_exceptions_list_parse(result, &bogus); *mpp = string_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } pconf_symlink_exceptions_list_ty * pconf_symlink_exceptions_list_clone(pconf_symlink_exceptions_list_ty *from) { return pconf_symlink_exceptions_list_copy(from); } #ifdef DEBUG void pconf_symlink_exceptions_list_trace_real(const char *name, const pconf_symlink_exceptions_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 pconf_symlink_exceptions_list_type = { "pconf_symlink_exceptions_list", pconf_symlink_exceptions_list_alloc, pconf_symlink_exceptions_list_free, 0, // enum_parse pconf_symlink_exceptions_list_parse, 0, // struct_parse 0, // fuzzy pconf_symlink_exceptions_list_convert, generic_struct_is_set, }; static const char *pconf_history_put_trashes_file_s[] = { "fatal", "warn", "ignore", }; static string_ty *pconf_history_put_trashes_file_f[SIZEOF(pconf_history_put_trashes_file_s)]; const char * pconf_history_put_trashes_file_ename(pconf_history_put_trashes_file_ty this_thing) { static char buffer[20]; if ((int)this_thing >= 0 && (int)this_thing < 3) return pconf_history_put_trashes_file_s[this_thing]; snprintf(buffer, sizeof(buffer), "%d", (int)this_thing); return buffer; } void pconf_history_put_trashes_file_write(const output::pointer &fp, const char *name, pconf_history_put_trashes_file_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(pconf_history_put_trashes_file_s[this_thing]); if (name) fp->fputs(";\n"); } void pconf_history_put_trashes_file_write_xml(const output::pointer &fp, const char *name, pconf_history_put_trashes_file_ty this_thing, bool show) { if (this_thing == 0) { if (!show || type_enum_option_query()) return; } assert(name); assert((size_t)this_thing < SIZEOF(pconf_history_put_trashes_file_s)); fp->fputc('<'); fp->fputs(name); fp->fputc('>'); fp->fputs(pconf_history_put_trashes_file_s[this_thing]); fp->fputs("fputs(name); fp->fputs(">\n"); } static bool pconf_history_put_trashes_file_parse(string_ty *name, void *ptr) { slow_to_fast(pconf_history_put_trashes_file_s, pconf_history_put_trashes_file_f, SIZEOF(pconf_history_put_trashes_file_s)); for (size_t j = 0; j < SIZEOF(pconf_history_put_trashes_file_f); ++j) { if (str_equal(name, pconf_history_put_trashes_file_f[j])) { *(pconf_history_put_trashes_file_ty *)ptr = (pconf_history_put_trashes_file_ty)j; return true; } } return false; } static string_ty * pconf_history_put_trashes_file_fuzzy(string_ty *name) { return generic_enum_fuzzy(name, pconf_history_put_trashes_file_f, SIZEOF(pconf_history_put_trashes_file_f)); } static rpt_value::pointer pconf_history_put_trashes_file_convert(void *this_thing) { if (!pconf_history_put_trashes_file_f[0]) slow_to_fast(pconf_history_put_trashes_file_s, pconf_history_put_trashes_file_f, SIZEOF(pconf_history_put_trashes_file_s)); return generic_enum_convert ( (int)*(pconf_history_put_trashes_file_ty *)this_thing, pconf_history_put_trashes_file_f, SIZEOF(pconf_history_put_trashes_file_f) ); } static bool pconf_history_put_trashes_file_is_set(void *this_thing) { return (*(pconf_history_put_trashes_file_ty *)this_thing != 0); } meta_type pconf_history_put_trashes_file_type = { "pconf_history_put_trashes_file", 0, // alloc 0, // free pconf_history_put_trashes_file_parse, 0, // list_parse 0, // struct_parse pconf_history_put_trashes_file_fuzzy, pconf_history_put_trashes_file_convert, pconf_history_put_trashes_file_is_set, }; static const char *pconf_history_content_limitation_s[] = { "ascii_text", "international_text", "binary_capable", }; static string_ty *pconf_history_content_limitation_f[SIZEOF(pconf_history_content_limitation_s)]; const char * pconf_history_content_limitation_ename(pconf_history_content_limitation_ty this_thing) { static char buffer[20]; if ((int)this_thing >= 0 && (int)this_thing < 3) return pconf_history_content_limitation_s[this_thing]; snprintf(buffer, sizeof(buffer), "%d", (int)this_thing); return buffer; } void pconf_history_content_limitation_write(const output::pointer &fp, const char *name, pconf_history_content_limitation_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(pconf_history_content_limitation_s[this_thing]); if (name) fp->fputs(";\n"); } void pconf_history_content_limitation_write_xml(const output::pointer &fp, const char *name, pconf_history_content_limitation_ty this_thing, bool show) { if (this_thing == 0) { if (!show || type_enum_option_query()) return; } assert(name); assert((size_t)this_thing < SIZEOF(pconf_history_content_limitation_s)); fp->fputc('<'); fp->fputs(name); fp->fputc('>'); fp->fputs(pconf_history_content_limitation_s[this_thing]); fp->fputs("fputs(name); fp->fputs(">\n"); } static bool pconf_history_content_limitation_parse(string_ty *name, void *ptr) { slow_to_fast(pconf_history_content_limitation_s, pconf_history_content_limitation_f, SIZEOF(pconf_history_content_limitation_s)); for (size_t j = 0; j < SIZEOF(pconf_history_content_limitation_f); ++j) { if (str_equal(name, pconf_history_content_limitation_f[j])) { *(pconf_history_content_limitation_ty *)ptr = (pconf_history_content_limitation_ty)j; return true; } } return false; } static string_ty * pconf_history_content_limitation_fuzzy(string_ty *name) { return generic_enum_fuzzy(name, pconf_history_content_limitation_f, SIZEOF(pconf_history_content_limitation_f)); } static rpt_value::pointer pconf_history_content_limitation_convert(void *this_thing) { if (!pconf_history_content_limitation_f[0]) slow_to_fast(pconf_history_content_limitation_s, pconf_history_content_limitation_f, SIZEOF(pconf_history_content_limitation_s)); return generic_enum_convert ( (int)*(pconf_history_content_limitation_ty *)this_thing, pconf_history_content_limitation_f, SIZEOF(pconf_history_content_limitation_f) ); } static bool pconf_history_content_limitation_is_set(void *this_thing) { return (*(pconf_history_content_limitation_ty *)this_thing != 0); } meta_type pconf_history_content_limitation_type = { "pconf_history_content_limitation", 0, // alloc 0, // free pconf_history_content_limitation_parse, 0, // list_parse 0, // struct_parse pconf_history_content_limitation_fuzzy, pconf_history_content_limitation_convert, pconf_history_content_limitation_is_set, }; static const char *pconf_architecture_mode_s[] = { "required", "optional", "forbidden", }; static string_ty *pconf_architecture_mode_f[SIZEOF(pconf_architecture_mode_s)]; const char * pconf_architecture_mode_ename(pconf_architecture_mode_ty this_thing) { static char buffer[20]; if ((int)this_thing >= 0 && (int)this_thing < 3) return pconf_architecture_mode_s[this_thing]; snprintf(buffer, sizeof(buffer), "%d", (int)this_thing); return buffer; } void pconf_architecture_mode_write(const output::pointer &fp, const char *name, pconf_architecture_mode_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(pconf_architecture_mode_s[this_thing]); if (name) fp->fputs(";\n"); } void pconf_architecture_mode_write_xml(const output::pointer &fp, const char *name, pconf_architecture_mode_ty this_thing, bool show) { if (this_thing == 0) { if (!show || type_enum_option_query()) return; } assert(name); assert((size_t)this_thing < SIZEOF(pconf_architecture_mode_s)); fp->fputc('<'); fp->fputs(name); fp->fputc('>'); fp->fputs(pconf_architecture_mode_s[this_thing]); fp->fputs("fputs(name); fp->fputs(">\n"); } static bool pconf_architecture_mode_parse(string_ty *name, void *ptr) { slow_to_fast(pconf_architecture_mode_s, pconf_architecture_mode_f, SIZEOF(pconf_architecture_mode_s)); for (size_t j = 0; j < SIZEOF(pconf_architecture_mode_f); ++j) { if (str_equal(name, pconf_architecture_mode_f[j])) { *(pconf_architecture_mode_ty *)ptr = (pconf_architecture_mode_ty)j; return true; } } return false; } static string_ty * pconf_architecture_mode_fuzzy(string_ty *name) { return generic_enum_fuzzy(name, pconf_architecture_mode_f, SIZEOF(pconf_architecture_mode_f)); } static rpt_value::pointer pconf_architecture_mode_convert(void *this_thing) { if (!pconf_architecture_mode_f[0]) slow_to_fast(pconf_architecture_mode_s, pconf_architecture_mode_f, SIZEOF(pconf_architecture_mode_s)); return generic_enum_convert ( (int)*(pconf_architecture_mode_ty *)this_thing, pconf_architecture_mode_f, SIZEOF(pconf_architecture_mode_f) ); } static bool pconf_architecture_mode_is_set(void *this_thing) { return (*(pconf_architecture_mode_ty *)this_thing != 0); } meta_type pconf_architecture_mode_type = { "pconf_architecture_mode", 0, // alloc 0, // free pconf_architecture_mode_parse, 0, // list_parse 0, // struct_parse pconf_architecture_mode_fuzzy, pconf_architecture_mode_convert, pconf_architecture_mode_is_set, }; void pconf_architecture_write(const output::pointer &fp, const char *name, pconf_architecture_ty *this_thing) { if (!this_thing) return; trace(("pconf_architecture_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(((pconf_architecture_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((pconf_architecture_ty *)this_thing)->reference_count)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } fp->fputs("{\n"); string_write(fp, "name", this_thing->name); string_write(fp, "pattern", this_thing->pattern); pconf_architecture_mode_write(fp, "mode", this_thing->mode, 1); fp->fputs("}"); if (name) fp->fputs(";\n"); trace(("}\n")); } void pconf_architecture_write_xml(const output::pointer &fp, const char *name, pconf_architecture_ty *this_thing) { if (!this_thing) return; trace(("pconf_architecture_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); assert(((pconf_architecture_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((pconf_architecture_ty *)this_thing)->reference_count)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); string_write_xml(fp, "name", this_thing->name); string_write_xml(fp, "pattern", this_thing->pattern); pconf_architecture_mode_write_xml(fp, "mode", this_thing->mode, 0); fp->fputs("fputs(name); fp->fputs(">\n"); } static void * pconf_architecture_alloc(void) { pconf_architecture_ty *this_thing; trace(("pconf_architecture_alloc()\n{\n")); this_thing = (pconf_architecture_ty *)mem_alloc(sizeof(pconf_architecture_ty)); this_thing->reference_count = 1; this_thing->mask = 0; this_thing->errpos = str_copy(lex_position()); this_thing->name = (string_ty *)0; this_thing->pattern = (string_ty *)0; this_thing->mode = (pconf_architecture_mode_ty)0; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } pconf_architecture_ty * pconf_architecture_copy(pconf_architecture_ty *this_thing) { trace(("pconf_architecture_copy()\n{\n")); this_thing->reference_count++; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } pconf_architecture_ty * pconf_architecture_clone(pconf_architecture_ty *this_thing) { if (!this_thing) return 0; trace(("pconf_architecture_clone()\n{\n")); pconf_architecture_ty *result = (pconf_architecture_ty *)pconf_architecture_alloc(); result->name = str_copy(this_thing->name); result->pattern = str_copy(this_thing->pattern); result->mode = this_thing->mode; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } #ifdef DEBUG void pconf_architecture_trace_real(const char *name, const pconf_architecture_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("{\n"); trace_string_real("name", value->name); trace_string_real("pattern", value->pattern); trace_printf("mode = %s;\n", pconf_architecture_mode_ename(value->mode)); trace_printf("}"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG static void pconf_architecture_free(void *that) { pconf_architecture_ty *this_thing; this_thing = (pconf_architecture_ty *)that; if (!this_thing) return; this_thing->reference_count--; assert(this_thing->reference_count >= 0); if (this_thing->reference_count > 0) return; trace(("pconf_architecture_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->name); str_free(this_thing->pattern); mem_free(this_thing); trace(("}\n")); } static type_table_ty pconf_architecture_table[] = { { "name", offsetof(pconf_architecture_ty, name), &string_type, pconf_architecture_name_mask, 0, // redefinition not ok 0, // fast_name }, { "pattern", offsetof(pconf_architecture_ty, pattern), &string_type, pconf_architecture_pattern_mask, 0, // redefinition not ok 0, // fast_name }, { "mode", offsetof(pconf_architecture_ty, mode), &pconf_architecture_mode_type, pconf_architecture_mode_mask, 0, // redefinition not ok 0, // fast_name }, }; static void * pconf_architecture_parse(void *this_thing, string_ty *name, meta_type **type_pp, unsigned long *mask_p, int *redef_p) { void *addr; trace(("pconf_architecture_parse(this_thing = %08lX, name = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)name, (long)type_pp)); assert(((pconf_architecture_ty *)this_thing)->reference_count > 0); addr = generic_struct_parse ( this_thing, name, type_pp, mask_p, redef_p, pconf_architecture_table, SIZEOF(pconf_architecture_table) ); trace(("return %08lX;\n}\n", (long)addr)); return addr; } static string_ty * pconf_architecture_fuzzy(string_ty *name) { string_ty *result; trace(("pconf_architecture_fuzzy(name = %08lX)\n{\n", (long)name)); result = generic_struct_fuzzy ( name, pconf_architecture_table, SIZEOF(pconf_architecture_table) ); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static rpt_value::pointer pconf_architecture_convert(void *this_thing) { trace(("pconf_architecture_convert(name = %08lX)\n{\n", (long)this_thing)); assert(((pconf_architecture_ty *)this_thing)->reference_count > 0); rpt_value::pointer result = generic_struct_convert ( this_thing, pconf_architecture_table, SIZEOF(pconf_architecture_table) ); trace(("return %08lX;\n", (long)result.get())); trace(("}\n")); return result; } meta_type pconf_architecture_type = { "pconf_architecture", pconf_architecture_alloc, pconf_architecture_free, 0, // enum_parse 0, // list_parse pconf_architecture_parse, pconf_architecture_fuzzy, pconf_architecture_convert, generic_struct_is_set, }; void pconf_architecture_list_write(const output::pointer &fp, const char *name, pconf_architecture_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_architecture_list_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); fp->fputs("[\n"); for (j = 0; j < this_thing->length; ++j) { pconf_architecture_write(fp, (const char *)0, this_thing->list[j]); fp->fputs(",\n"); } fp->fputs("]"); if (name) fp->fputs(";\n"); trace(("}\n")); } void pconf_architecture_list_write_xml(const output::pointer &fp, const char *name, pconf_architecture_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_architecture_list_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) { pconf_architecture_write_xml(fp, "pconf_architecture", this_thing->list[j]); } fp->fputs("fputs(name); fp->fputs(">\n"); trace(("}\n")); } static void * pconf_architecture_list_alloc(void) { pconf_architecture_list_ty *result; trace(("pconf_architecture_list_alloc()\n{\n")); result = (pconf_architecture_list_ty *)mem_alloc(sizeof(pconf_architecture_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void pconf_architecture_list_free(void *that) { pconf_architecture_list_ty *this_thing; size_t j; this_thing = (pconf_architecture_list_ty *)that; if (!this_thing) return; trace(("pconf_architecture_list_free(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); for (j = 0; j < this_thing->length; ++j) pconf_architecture_free(this_thing->list[j]); delete [] this_thing->list; mem_free(this_thing); trace(("}\n")); } static void * pconf_architecture_list_parse(void *that, meta_type **type_pp) { pconf_architecture_list_ty *this_thing; void *addr; this_thing = (pconf_architecture_list_ty *)that; trace(("pconf_architecture_list_parse(this_thing = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)type_pp)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); *type_pp = &pconf_architecture_type; trace_pointer(*type_pp); if (this_thing->length >= this_thing->maximum) { this_thing->maximum = this_thing->maximum * 2 + 16; pconf_architecture_ty * *new_list = new pconf_architecture_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 pconf_architecture_list_convert(void *that) { pconf_architecture_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(pconf_architecture_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("pconf_architecture_list_convert(this_thing = %08lX)\n{\n", (long)this_thing)); assert(this_thing->length <= this_thing->maximum); assert(!this_thing->list == !this_thing->maximum); rpt_value_list *p = new rpt_value_list(); rpt_value::pointer result(p); for (j = 0; j < this_thing->length; ++j) { vp = pconf_architecture_type.convert(&this_thing->list[j]); assert(vp); p->append(vp); } trace(("}\n")); trace(("return %08lX;\n", (long)result.get())); return result; } pconf_architecture_list_ty * pconf_architecture_list_copy(pconf_architecture_list_ty *from) { size_t j; pconf_architecture_list_ty *result; if (!from) return 0; trace(("pconf_architecture_list_copy(from = %08lX)\n{\n", (long)from)); result = (pconf_architecture_list_ty *)pconf_architecture_list_alloc(); assert(from->length <= from->maximum); assert(!from->list == !from->maximum); for (j = 0; j < from->length; ++j) { pconf_architecture_ty * mp; pconf_architecture_ty * *mpp; meta_type *bogus; mp = from->list[j]; mpp = (pconf_architecture_ty **)pconf_architecture_list_parse(result, &bogus); *mpp = pconf_architecture_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } pconf_architecture_list_ty * pconf_architecture_list_clone(pconf_architecture_list_ty *from) { return pconf_architecture_list_copy(from); } #ifdef DEBUG void pconf_architecture_list_trace_real(const char *name, const pconf_architecture_list_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("[\n"); trace_printf("// length = %ld\n", (long)value->length); trace_printf("// maximum = %ld\n", (long)value->maximum); assert(value->length <= value->maximum); assert(!value->list == !value->maximum); for (size_t j = 0; j < value->length; ++j) { pconf_architecture_ty * mp = value->list[j]; pconf_architecture_trace_real("", mp); } trace_printf("]"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG meta_type pconf_architecture_list_type = { "pconf_architecture_list", pconf_architecture_list_alloc, pconf_architecture_list_free, 0, // enum_parse pconf_architecture_list_parse, 0, // struct_parse 0, // fuzzy pconf_architecture_list_convert, generic_struct_is_set, }; void pconf_file_template_pattern_list_write(const output::pointer &fp, const char *name, pconf_file_template_pattern_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_file_template_pattern_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 pconf_file_template_pattern_list_write_xml(const output::pointer &fp, const char *name, pconf_file_template_pattern_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_file_template_pattern_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 * pconf_file_template_pattern_list_alloc(void) { pconf_file_template_pattern_list_ty *result; trace(("pconf_file_template_pattern_list_alloc()\n{\n")); result = (pconf_file_template_pattern_list_ty *)mem_alloc(sizeof(pconf_file_template_pattern_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void pconf_file_template_pattern_list_free(void *that) { pconf_file_template_pattern_list_ty *this_thing; size_t j; this_thing = (pconf_file_template_pattern_list_ty *)that; if (!this_thing) return; trace(("pconf_file_template_pattern_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 * pconf_file_template_pattern_list_parse(void *that, meta_type **type_pp) { pconf_file_template_pattern_list_ty *this_thing; void *addr; this_thing = (pconf_file_template_pattern_list_ty *)that; trace(("pconf_file_template_pattern_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 pconf_file_template_pattern_list_convert(void *that) { pconf_file_template_pattern_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(pconf_file_template_pattern_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("pconf_file_template_pattern_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; } pconf_file_template_pattern_list_ty * pconf_file_template_pattern_list_copy(pconf_file_template_pattern_list_ty *from) { size_t j; pconf_file_template_pattern_list_ty *result; if (!from) return 0; trace(("pconf_file_template_pattern_list_copy(from = %08lX)\n{\n", (long)from)); result = (pconf_file_template_pattern_list_ty *)pconf_file_template_pattern_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 **)pconf_file_template_pattern_list_parse(result, &bogus); *mpp = string_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } pconf_file_template_pattern_list_ty * pconf_file_template_pattern_list_clone(pconf_file_template_pattern_list_ty *from) { return pconf_file_template_pattern_list_copy(from); } #ifdef DEBUG void pconf_file_template_pattern_list_trace_real(const char *name, const pconf_file_template_pattern_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 pconf_file_template_pattern_list_type = { "pconf_file_template_pattern_list", pconf_file_template_pattern_list_alloc, pconf_file_template_pattern_list_free, 0, // enum_parse pconf_file_template_pattern_list_parse, 0, // struct_parse 0, // fuzzy pconf_file_template_pattern_list_convert, generic_struct_is_set, }; void pconf_file_template_write(const output::pointer &fp, const char *name, pconf_file_template_ty *this_thing) { if (!this_thing) return; trace(("pconf_file_template_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(((pconf_file_template_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((pconf_file_template_ty *)this_thing)->reference_count)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } fp->fputs("{\n"); pconf_file_template_pattern_list_write(fp, "pattern", this_thing->pattern); string_write(fp, "body", this_thing->body); string_write(fp, "body_command", this_thing->body_command); fp->fputs("}"); if (name) fp->fputs(";\n"); trace(("}\n")); } void pconf_file_template_write_xml(const output::pointer &fp, const char *name, pconf_file_template_ty *this_thing) { if (!this_thing) return; trace(("pconf_file_template_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); assert(((pconf_file_template_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((pconf_file_template_ty *)this_thing)->reference_count)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); pconf_file_template_pattern_list_write_xml(fp, "pattern", this_thing->pattern); string_write_xml(fp, "body", this_thing->body); string_write_xml(fp, "body_command", this_thing->body_command); fp->fputs("fputs(name); fp->fputs(">\n"); } static void * pconf_file_template_alloc(void) { pconf_file_template_ty *this_thing; trace(("pconf_file_template_alloc()\n{\n")); this_thing = (pconf_file_template_ty *)mem_alloc(sizeof(pconf_file_template_ty)); this_thing->reference_count = 1; this_thing->mask = 0; this_thing->errpos = str_copy(lex_position()); this_thing->pattern = (pconf_file_template_pattern_list_ty *)0; this_thing->body = (string_ty *)0; this_thing->body_command = (string_ty *)0; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } pconf_file_template_ty * pconf_file_template_copy(pconf_file_template_ty *this_thing) { trace(("pconf_file_template_copy()\n{\n")); this_thing->reference_count++; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } pconf_file_template_ty * pconf_file_template_clone(pconf_file_template_ty *this_thing) { if (!this_thing) return 0; trace(("pconf_file_template_clone()\n{\n")); pconf_file_template_ty *result = (pconf_file_template_ty *)pconf_file_template_alloc(); result->pattern = pconf_file_template_pattern_list_clone(this_thing->pattern); result->body = str_copy(this_thing->body); result->body_command = str_copy(this_thing->body_command); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } #ifdef DEBUG void pconf_file_template_trace_real(const char *name, const pconf_file_template_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("{\n"); pconf_file_template_pattern_list_trace_real("pattern", value->pattern); trace_string_real("body", value->body); trace_string_real("body_command", value->body_command); trace_printf("}"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG static void pconf_file_template_free(void *that) { pconf_file_template_ty *this_thing; this_thing = (pconf_file_template_ty *)that; if (!this_thing) return; this_thing->reference_count--; assert(this_thing->reference_count >= 0); if (this_thing->reference_count > 0) return; trace(("pconf_file_template_free(this_thing = %08lX)\n{\n", (long)this_thing)); if (this_thing->errpos) { str_free(this_thing->errpos); this_thing->errpos = 0; } pconf_file_template_pattern_list_free(this_thing->pattern); str_free(this_thing->body); str_free(this_thing->body_command); mem_free(this_thing); trace(("}\n")); } static type_table_ty pconf_file_template_table[] = { { "pattern", offsetof(pconf_file_template_ty, pattern), &pconf_file_template_pattern_list_type, pconf_file_template_pattern_mask, 0, // redefinition not ok 0, // fast_name }, { "body", offsetof(pconf_file_template_ty, body), &string_type, pconf_file_template_body_mask, 0, // redefinition not ok 0, // fast_name }, { "body_command", offsetof(pconf_file_template_ty, body_command), &string_type, pconf_file_template_body_command_mask, 0, // redefinition not ok 0, // fast_name }, }; static void * pconf_file_template_parse(void *this_thing, string_ty *name, meta_type **type_pp, unsigned long *mask_p, int *redef_p) { void *addr; trace(("pconf_file_template_parse(this_thing = %08lX, name = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)name, (long)type_pp)); assert(((pconf_file_template_ty *)this_thing)->reference_count > 0); addr = generic_struct_parse ( this_thing, name, type_pp, mask_p, redef_p, pconf_file_template_table, SIZEOF(pconf_file_template_table) ); trace(("return %08lX;\n}\n", (long)addr)); return addr; } static string_ty * pconf_file_template_fuzzy(string_ty *name) { string_ty *result; trace(("pconf_file_template_fuzzy(name = %08lX)\n{\n", (long)name)); result = generic_struct_fuzzy ( name, pconf_file_template_table, SIZEOF(pconf_file_template_table) ); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static rpt_value::pointer pconf_file_template_convert(void *this_thing) { trace(("pconf_file_template_convert(name = %08lX)\n{\n", (long)this_thing)); assert(((pconf_file_template_ty *)this_thing)->reference_count > 0); rpt_value::pointer result = generic_struct_convert ( this_thing, pconf_file_template_table, SIZEOF(pconf_file_template_table) ); trace(("return %08lX;\n", (long)result.get())); trace(("}\n")); return result; } meta_type pconf_file_template_type = { "pconf_file_template", pconf_file_template_alloc, pconf_file_template_free, 0, // enum_parse 0, // list_parse pconf_file_template_parse, pconf_file_template_fuzzy, pconf_file_template_convert, generic_struct_is_set, }; void pconf_file_template_list_write(const output::pointer &fp, const char *name, pconf_file_template_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_file_template_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) { pconf_file_template_write(fp, (const char *)0, this_thing->list[j]); fp->fputs(",\n"); } fp->fputs("]"); if (name) fp->fputs(";\n"); trace(("}\n")); } void pconf_file_template_list_write_xml(const output::pointer &fp, const char *name, pconf_file_template_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_file_template_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) { pconf_file_template_write_xml(fp, "pconf_file_template", this_thing->list[j]); } fp->fputs("fputs(name); fp->fputs(">\n"); trace(("}\n")); } static void * pconf_file_template_list_alloc(void) { pconf_file_template_list_ty *result; trace(("pconf_file_template_list_alloc()\n{\n")); result = (pconf_file_template_list_ty *)mem_alloc(sizeof(pconf_file_template_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void pconf_file_template_list_free(void *that) { pconf_file_template_list_ty *this_thing; size_t j; this_thing = (pconf_file_template_list_ty *)that; if (!this_thing) return; trace(("pconf_file_template_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) pconf_file_template_free(this_thing->list[j]); delete [] this_thing->list; mem_free(this_thing); trace(("}\n")); } static void * pconf_file_template_list_parse(void *that, meta_type **type_pp) { pconf_file_template_list_ty *this_thing; void *addr; this_thing = (pconf_file_template_list_ty *)that; trace(("pconf_file_template_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 = &pconf_file_template_type; trace_pointer(*type_pp); if (this_thing->length >= this_thing->maximum) { this_thing->maximum = this_thing->maximum * 2 + 16; pconf_file_template_ty * *new_list = new pconf_file_template_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 pconf_file_template_list_convert(void *that) { pconf_file_template_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(pconf_file_template_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("pconf_file_template_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 = pconf_file_template_type.convert(&this_thing->list[j]); assert(vp); p->append(vp); } trace(("}\n")); trace(("return %08lX;\n", (long)result.get())); return result; } pconf_file_template_list_ty * pconf_file_template_list_copy(pconf_file_template_list_ty *from) { size_t j; pconf_file_template_list_ty *result; if (!from) return 0; trace(("pconf_file_template_list_copy(from = %08lX)\n{\n", (long)from)); result = (pconf_file_template_list_ty *)pconf_file_template_list_alloc(); assert(from->length <= from->maximum); assert(!from->list == !from->maximum); for (j = 0; j < from->length; ++j) { pconf_file_template_ty * mp; pconf_file_template_ty * *mpp; meta_type *bogus; mp = from->list[j]; mpp = (pconf_file_template_ty **)pconf_file_template_list_parse(result, &bogus); *mpp = pconf_file_template_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } pconf_file_template_list_ty * pconf_file_template_list_clone(pconf_file_template_list_ty *from) { return pconf_file_template_list_copy(from); } #ifdef DEBUG void pconf_file_template_list_trace_real(const char *name, const pconf_file_template_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) { pconf_file_template_ty * mp = value->list[j]; pconf_file_template_trace_real("", mp); } trace_printf("]"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG meta_type pconf_file_template_list_type = { "pconf_file_template_list", pconf_file_template_list_alloc, pconf_file_template_list_free, 0, // enum_parse pconf_file_template_list_parse, 0, // struct_parse 0, // fuzzy pconf_file_template_list_convert, generic_struct_is_set, }; void pconf_whiteout_template_pattern_list_write(const output::pointer &fp, const char *name, pconf_whiteout_template_pattern_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_whiteout_template_pattern_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 pconf_whiteout_template_pattern_list_write_xml(const output::pointer &fp, const char *name, pconf_whiteout_template_pattern_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_whiteout_template_pattern_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 * pconf_whiteout_template_pattern_list_alloc(void) { pconf_whiteout_template_pattern_list_ty *result; trace(("pconf_whiteout_template_pattern_list_alloc()\n{\n")); result = (pconf_whiteout_template_pattern_list_ty *)mem_alloc(sizeof(pconf_whiteout_template_pattern_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void pconf_whiteout_template_pattern_list_free(void *that) { pconf_whiteout_template_pattern_list_ty *this_thing; size_t j; this_thing = (pconf_whiteout_template_pattern_list_ty *)that; if (!this_thing) return; trace(("pconf_whiteout_template_pattern_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 * pconf_whiteout_template_pattern_list_parse(void *that, meta_type **type_pp) { pconf_whiteout_template_pattern_list_ty *this_thing; void *addr; this_thing = (pconf_whiteout_template_pattern_list_ty *)that; trace(("pconf_whiteout_template_pattern_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 pconf_whiteout_template_pattern_list_convert(void *that) { pconf_whiteout_template_pattern_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(pconf_whiteout_template_pattern_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("pconf_whiteout_template_pattern_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; } pconf_whiteout_template_pattern_list_ty * pconf_whiteout_template_pattern_list_copy(pconf_whiteout_template_pattern_list_ty *from) { size_t j; pconf_whiteout_template_pattern_list_ty *result; if (!from) return 0; trace(("pconf_whiteout_template_pattern_list_copy(from = %08lX)\n{\n", (long)from)); result = (pconf_whiteout_template_pattern_list_ty *)pconf_whiteout_template_pattern_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 **)pconf_whiteout_template_pattern_list_parse(result, &bogus); *mpp = string_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } pconf_whiteout_template_pattern_list_ty * pconf_whiteout_template_pattern_list_clone(pconf_whiteout_template_pattern_list_ty *from) { return pconf_whiteout_template_pattern_list_copy(from); } #ifdef DEBUG void pconf_whiteout_template_pattern_list_trace_real(const char *name, const pconf_whiteout_template_pattern_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 pconf_whiteout_template_pattern_list_type = { "pconf_whiteout_template_pattern_list", pconf_whiteout_template_pattern_list_alloc, pconf_whiteout_template_pattern_list_free, 0, // enum_parse pconf_whiteout_template_pattern_list_parse, 0, // struct_parse 0, // fuzzy pconf_whiteout_template_pattern_list_convert, generic_struct_is_set, }; void pconf_whiteout_template_write(const output::pointer &fp, const char *name, pconf_whiteout_template_ty *this_thing) { if (!this_thing) return; trace(("pconf_whiteout_template_write(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(((pconf_whiteout_template_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((pconf_whiteout_template_ty *)this_thing)->reference_count)); if (name) { fp->fputs(name); fp->fputs(" =\n"); } fp->fputs("{\n"); pconf_whiteout_template_pattern_list_write(fp, "pattern", this_thing->pattern); string_write(fp, "body", this_thing->body); fp->fputs("}"); if (name) fp->fputs(";\n"); trace(("}\n")); } void pconf_whiteout_template_write_xml(const output::pointer &fp, const char *name, pconf_whiteout_template_ty *this_thing) { if (!this_thing) return; trace(("pconf_whiteout_template_write_xml(name = \"%s\", this_thing = %08lX)\n{\n", name, (long)this_thing)); assert(name); assert(((pconf_whiteout_template_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((pconf_whiteout_template_ty *)this_thing)->reference_count)); assert(name); fp->fputc('<'); fp->fputs(name); fp->fputs(">\n"); pconf_whiteout_template_pattern_list_write_xml(fp, "pattern", this_thing->pattern); string_write_xml(fp, "body", this_thing->body); fp->fputs("fputs(name); fp->fputs(">\n"); } static void * pconf_whiteout_template_alloc(void) { pconf_whiteout_template_ty *this_thing; trace(("pconf_whiteout_template_alloc()\n{\n")); this_thing = (pconf_whiteout_template_ty *)mem_alloc(sizeof(pconf_whiteout_template_ty)); this_thing->reference_count = 1; this_thing->mask = 0; this_thing->errpos = str_copy(lex_position()); this_thing->pattern = (pconf_whiteout_template_pattern_list_ty *)0; this_thing->body = (string_ty *)0; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } pconf_whiteout_template_ty * pconf_whiteout_template_copy(pconf_whiteout_template_ty *this_thing) { trace(("pconf_whiteout_template_copy()\n{\n")); this_thing->reference_count++; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } pconf_whiteout_template_ty * pconf_whiteout_template_clone(pconf_whiteout_template_ty *this_thing) { if (!this_thing) return 0; trace(("pconf_whiteout_template_clone()\n{\n")); pconf_whiteout_template_ty *result = (pconf_whiteout_template_ty *)pconf_whiteout_template_alloc(); result->pattern = pconf_whiteout_template_pattern_list_clone(this_thing->pattern); result->body = str_copy(this_thing->body); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } #ifdef DEBUG void pconf_whiteout_template_trace_real(const char *name, const pconf_whiteout_template_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("{\n"); pconf_whiteout_template_pattern_list_trace_real("pattern", value->pattern); trace_string_real("body", value->body); trace_printf("}"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG static void pconf_whiteout_template_free(void *that) { pconf_whiteout_template_ty *this_thing; this_thing = (pconf_whiteout_template_ty *)that; if (!this_thing) return; this_thing->reference_count--; assert(this_thing->reference_count >= 0); if (this_thing->reference_count > 0) return; trace(("pconf_whiteout_template_free(this_thing = %08lX)\n{\n", (long)this_thing)); if (this_thing->errpos) { str_free(this_thing->errpos); this_thing->errpos = 0; } pconf_whiteout_template_pattern_list_free(this_thing->pattern); str_free(this_thing->body); mem_free(this_thing); trace(("}\n")); } static type_table_ty pconf_whiteout_template_table[] = { { "pattern", offsetof(pconf_whiteout_template_ty, pattern), &pconf_whiteout_template_pattern_list_type, pconf_whiteout_template_pattern_mask, 0, // redefinition not ok 0, // fast_name }, { "body", offsetof(pconf_whiteout_template_ty, body), &string_type, pconf_whiteout_template_body_mask, 0, // redefinition not ok 0, // fast_name }, }; static void * pconf_whiteout_template_parse(void *this_thing, string_ty *name, meta_type **type_pp, unsigned long *mask_p, int *redef_p) { void *addr; trace(("pconf_whiteout_template_parse(this_thing = %08lX, name = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)name, (long)type_pp)); assert(((pconf_whiteout_template_ty *)this_thing)->reference_count > 0); addr = generic_struct_parse ( this_thing, name, type_pp, mask_p, redef_p, pconf_whiteout_template_table, SIZEOF(pconf_whiteout_template_table) ); trace(("return %08lX;\n}\n", (long)addr)); return addr; } static string_ty * pconf_whiteout_template_fuzzy(string_ty *name) { string_ty *result; trace(("pconf_whiteout_template_fuzzy(name = %08lX)\n{\n", (long)name)); result = generic_struct_fuzzy ( name, pconf_whiteout_template_table, SIZEOF(pconf_whiteout_template_table) ); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static rpt_value::pointer pconf_whiteout_template_convert(void *this_thing) { trace(("pconf_whiteout_template_convert(name = %08lX)\n{\n", (long)this_thing)); assert(((pconf_whiteout_template_ty *)this_thing)->reference_count > 0); rpt_value::pointer result = generic_struct_convert ( this_thing, pconf_whiteout_template_table, SIZEOF(pconf_whiteout_template_table) ); trace(("return %08lX;\n", (long)result.get())); trace(("}\n")); return result; } meta_type pconf_whiteout_template_type = { "pconf_whiteout_template", pconf_whiteout_template_alloc, pconf_whiteout_template_free, 0, // enum_parse 0, // list_parse pconf_whiteout_template_parse, pconf_whiteout_template_fuzzy, pconf_whiteout_template_convert, generic_struct_is_set, }; void pconf_whiteout_template_list_write(const output::pointer &fp, const char *name, pconf_whiteout_template_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_whiteout_template_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) { pconf_whiteout_template_write(fp, (const char *)0, this_thing->list[j]); fp->fputs(",\n"); } fp->fputs("]"); if (name) fp->fputs(";\n"); trace(("}\n")); } void pconf_whiteout_template_list_write_xml(const output::pointer &fp, const char *name, pconf_whiteout_template_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_whiteout_template_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) { pconf_whiteout_template_write_xml(fp, "pconf_whiteout_template", this_thing->list[j]); } fp->fputs("fputs(name); fp->fputs(">\n"); trace(("}\n")); } static void * pconf_whiteout_template_list_alloc(void) { pconf_whiteout_template_list_ty *result; trace(("pconf_whiteout_template_list_alloc()\n{\n")); result = (pconf_whiteout_template_list_ty *)mem_alloc(sizeof(pconf_whiteout_template_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void pconf_whiteout_template_list_free(void *that) { pconf_whiteout_template_list_ty *this_thing; size_t j; this_thing = (pconf_whiteout_template_list_ty *)that; if (!this_thing) return; trace(("pconf_whiteout_template_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) pconf_whiteout_template_free(this_thing->list[j]); delete [] this_thing->list; mem_free(this_thing); trace(("}\n")); } static void * pconf_whiteout_template_list_parse(void *that, meta_type **type_pp) { pconf_whiteout_template_list_ty *this_thing; void *addr; this_thing = (pconf_whiteout_template_list_ty *)that; trace(("pconf_whiteout_template_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 = &pconf_whiteout_template_type; trace_pointer(*type_pp); if (this_thing->length >= this_thing->maximum) { this_thing->maximum = this_thing->maximum * 2 + 16; pconf_whiteout_template_ty * *new_list = new pconf_whiteout_template_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 pconf_whiteout_template_list_convert(void *that) { pconf_whiteout_template_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(pconf_whiteout_template_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("pconf_whiteout_template_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 = pconf_whiteout_template_type.convert(&this_thing->list[j]); assert(vp); p->append(vp); } trace(("}\n")); trace(("return %08lX;\n", (long)result.get())); return result; } pconf_whiteout_template_list_ty * pconf_whiteout_template_list_copy(pconf_whiteout_template_list_ty *from) { size_t j; pconf_whiteout_template_list_ty *result; if (!from) return 0; trace(("pconf_whiteout_template_list_copy(from = %08lX)\n{\n", (long)from)); result = (pconf_whiteout_template_list_ty *)pconf_whiteout_template_list_alloc(); assert(from->length <= from->maximum); assert(!from->list == !from->maximum); for (j = 0; j < from->length; ++j) { pconf_whiteout_template_ty * mp; pconf_whiteout_template_ty * *mpp; meta_type *bogus; mp = from->list[j]; mpp = (pconf_whiteout_template_ty **)pconf_whiteout_template_list_parse(result, &bogus); *mpp = pconf_whiteout_template_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } pconf_whiteout_template_list_ty * pconf_whiteout_template_list_clone(pconf_whiteout_template_list_ty *from) { return pconf_whiteout_template_list_copy(from); } #ifdef DEBUG void pconf_whiteout_template_list_trace_real(const char *name, const pconf_whiteout_template_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) { pconf_whiteout_template_ty * mp = value->list[j]; pconf_whiteout_template_trace_real("", mp); } trace_printf("]"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG meta_type pconf_whiteout_template_list_type = { "pconf_whiteout_template_list", pconf_whiteout_template_list_alloc, pconf_whiteout_template_list_free, 0, // enum_parse pconf_whiteout_template_list_parse, 0, // struct_parse 0, // fuzzy pconf_whiteout_template_list_convert, generic_struct_is_set, }; void pconf_filename_pattern_accept_list_write(const output::pointer &fp, const char *name, pconf_filename_pattern_accept_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_filename_pattern_accept_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 pconf_filename_pattern_accept_list_write_xml(const output::pointer &fp, const char *name, pconf_filename_pattern_accept_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_filename_pattern_accept_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 * pconf_filename_pattern_accept_list_alloc(void) { pconf_filename_pattern_accept_list_ty *result; trace(("pconf_filename_pattern_accept_list_alloc()\n{\n")); result = (pconf_filename_pattern_accept_list_ty *)mem_alloc(sizeof(pconf_filename_pattern_accept_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void pconf_filename_pattern_accept_list_free(void *that) { pconf_filename_pattern_accept_list_ty *this_thing; size_t j; this_thing = (pconf_filename_pattern_accept_list_ty *)that; if (!this_thing) return; trace(("pconf_filename_pattern_accept_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 * pconf_filename_pattern_accept_list_parse(void *that, meta_type **type_pp) { pconf_filename_pattern_accept_list_ty *this_thing; void *addr; this_thing = (pconf_filename_pattern_accept_list_ty *)that; trace(("pconf_filename_pattern_accept_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 pconf_filename_pattern_accept_list_convert(void *that) { pconf_filename_pattern_accept_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(pconf_filename_pattern_accept_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("pconf_filename_pattern_accept_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; } pconf_filename_pattern_accept_list_ty * pconf_filename_pattern_accept_list_copy(pconf_filename_pattern_accept_list_ty *from) { size_t j; pconf_filename_pattern_accept_list_ty *result; if (!from) return 0; trace(("pconf_filename_pattern_accept_list_copy(from = %08lX)\n{\n", (long)from)); result = (pconf_filename_pattern_accept_list_ty *)pconf_filename_pattern_accept_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 **)pconf_filename_pattern_accept_list_parse(result, &bogus); *mpp = string_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } pconf_filename_pattern_accept_list_ty * pconf_filename_pattern_accept_list_clone(pconf_filename_pattern_accept_list_ty *from) { return pconf_filename_pattern_accept_list_copy(from); } #ifdef DEBUG void pconf_filename_pattern_accept_list_trace_real(const char *name, const pconf_filename_pattern_accept_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 pconf_filename_pattern_accept_list_type = { "pconf_filename_pattern_accept_list", pconf_filename_pattern_accept_list_alloc, pconf_filename_pattern_accept_list_free, 0, // enum_parse pconf_filename_pattern_accept_list_parse, 0, // struct_parse 0, // fuzzy pconf_filename_pattern_accept_list_convert, generic_struct_is_set, }; void pconf_filename_pattern_reject_list_write(const output::pointer &fp, const char *name, pconf_filename_pattern_reject_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_filename_pattern_reject_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 pconf_filename_pattern_reject_list_write_xml(const output::pointer &fp, const char *name, pconf_filename_pattern_reject_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_filename_pattern_reject_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 * pconf_filename_pattern_reject_list_alloc(void) { pconf_filename_pattern_reject_list_ty *result; trace(("pconf_filename_pattern_reject_list_alloc()\n{\n")); result = (pconf_filename_pattern_reject_list_ty *)mem_alloc(sizeof(pconf_filename_pattern_reject_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void pconf_filename_pattern_reject_list_free(void *that) { pconf_filename_pattern_reject_list_ty *this_thing; size_t j; this_thing = (pconf_filename_pattern_reject_list_ty *)that; if (!this_thing) return; trace(("pconf_filename_pattern_reject_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 * pconf_filename_pattern_reject_list_parse(void *that, meta_type **type_pp) { pconf_filename_pattern_reject_list_ty *this_thing; void *addr; this_thing = (pconf_filename_pattern_reject_list_ty *)that; trace(("pconf_filename_pattern_reject_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 pconf_filename_pattern_reject_list_convert(void *that) { pconf_filename_pattern_reject_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(pconf_filename_pattern_reject_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("pconf_filename_pattern_reject_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; } pconf_filename_pattern_reject_list_ty * pconf_filename_pattern_reject_list_copy(pconf_filename_pattern_reject_list_ty *from) { size_t j; pconf_filename_pattern_reject_list_ty *result; if (!from) return 0; trace(("pconf_filename_pattern_reject_list_copy(from = %08lX)\n{\n", (long)from)); result = (pconf_filename_pattern_reject_list_ty *)pconf_filename_pattern_reject_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 **)pconf_filename_pattern_reject_list_parse(result, &bogus); *mpp = string_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } pconf_filename_pattern_reject_list_ty * pconf_filename_pattern_reject_list_clone(pconf_filename_pattern_reject_list_ty *from) { return pconf_filename_pattern_reject_list_copy(from); } #ifdef DEBUG void pconf_filename_pattern_reject_list_trace_real(const char *name, const pconf_filename_pattern_reject_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 pconf_filename_pattern_reject_list_type = { "pconf_filename_pattern_reject_list", pconf_filename_pattern_reject_list_alloc, pconf_filename_pattern_reject_list_free, 0, // enum_parse pconf_filename_pattern_reject_list_parse, 0, // struct_parse 0, // fuzzy pconf_filename_pattern_reject_list_convert, generic_struct_is_set, }; void pconf_trojan_horse_suspect_list_write(const output::pointer &fp, const char *name, pconf_trojan_horse_suspect_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_trojan_horse_suspect_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 pconf_trojan_horse_suspect_list_write_xml(const output::pointer &fp, const char *name, pconf_trojan_horse_suspect_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_trojan_horse_suspect_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 * pconf_trojan_horse_suspect_list_alloc(void) { pconf_trojan_horse_suspect_list_ty *result; trace(("pconf_trojan_horse_suspect_list_alloc()\n{\n")); result = (pconf_trojan_horse_suspect_list_ty *)mem_alloc(sizeof(pconf_trojan_horse_suspect_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void pconf_trojan_horse_suspect_list_free(void *that) { pconf_trojan_horse_suspect_list_ty *this_thing; size_t j; this_thing = (pconf_trojan_horse_suspect_list_ty *)that; if (!this_thing) return; trace(("pconf_trojan_horse_suspect_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 * pconf_trojan_horse_suspect_list_parse(void *that, meta_type **type_pp) { pconf_trojan_horse_suspect_list_ty *this_thing; void *addr; this_thing = (pconf_trojan_horse_suspect_list_ty *)that; trace(("pconf_trojan_horse_suspect_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 pconf_trojan_horse_suspect_list_convert(void *that) { pconf_trojan_horse_suspect_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(pconf_trojan_horse_suspect_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("pconf_trojan_horse_suspect_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; } pconf_trojan_horse_suspect_list_ty * pconf_trojan_horse_suspect_list_copy(pconf_trojan_horse_suspect_list_ty *from) { size_t j; pconf_trojan_horse_suspect_list_ty *result; if (!from) return 0; trace(("pconf_trojan_horse_suspect_list_copy(from = %08lX)\n{\n", (long)from)); result = (pconf_trojan_horse_suspect_list_ty *)pconf_trojan_horse_suspect_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 **)pconf_trojan_horse_suspect_list_parse(result, &bogus); *mpp = string_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } pconf_trojan_horse_suspect_list_ty * pconf_trojan_horse_suspect_list_clone(pconf_trojan_horse_suspect_list_ty *from) { return pconf_trojan_horse_suspect_list_copy(from); } #ifdef DEBUG void pconf_trojan_horse_suspect_list_trace_real(const char *name, const pconf_trojan_horse_suspect_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 pconf_trojan_horse_suspect_list_type = { "pconf_trojan_horse_suspect_list", pconf_trojan_horse_suspect_list_alloc, pconf_trojan_horse_suspect_list_free, 0, // enum_parse pconf_trojan_horse_suspect_list_parse, 0, // struct_parse 0, // fuzzy pconf_trojan_horse_suspect_list_convert, generic_struct_is_set, }; static const char *pconf_build_time_adjust_s[] = { "adjust_and_sleep", "adjust_only", "dont_adjust", }; static string_ty *pconf_build_time_adjust_f[SIZEOF(pconf_build_time_adjust_s)]; const char * pconf_build_time_adjust_ename(pconf_build_time_adjust_ty this_thing) { static char buffer[20]; if ((int)this_thing >= 0 && (int)this_thing < 3) return pconf_build_time_adjust_s[this_thing]; snprintf(buffer, sizeof(buffer), "%d", (int)this_thing); return buffer; } void pconf_build_time_adjust_write(const output::pointer &fp, const char *name, pconf_build_time_adjust_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(pconf_build_time_adjust_s[this_thing]); if (name) fp->fputs(";\n"); } void pconf_build_time_adjust_write_xml(const output::pointer &fp, const char *name, pconf_build_time_adjust_ty this_thing, bool show) { if (this_thing == 0) { if (!show || type_enum_option_query()) return; } assert(name); assert((size_t)this_thing < SIZEOF(pconf_build_time_adjust_s)); fp->fputc('<'); fp->fputs(name); fp->fputc('>'); fp->fputs(pconf_build_time_adjust_s[this_thing]); fp->fputs("fputs(name); fp->fputs(">\n"); } static bool pconf_build_time_adjust_parse(string_ty *name, void *ptr) { slow_to_fast(pconf_build_time_adjust_s, pconf_build_time_adjust_f, SIZEOF(pconf_build_time_adjust_s)); for (size_t j = 0; j < SIZEOF(pconf_build_time_adjust_f); ++j) { if (str_equal(name, pconf_build_time_adjust_f[j])) { *(pconf_build_time_adjust_ty *)ptr = (pconf_build_time_adjust_ty)j; return true; } } return false; } static string_ty * pconf_build_time_adjust_fuzzy(string_ty *name) { return generic_enum_fuzzy(name, pconf_build_time_adjust_f, SIZEOF(pconf_build_time_adjust_f)); } static rpt_value::pointer pconf_build_time_adjust_convert(void *this_thing) { if (!pconf_build_time_adjust_f[0]) slow_to_fast(pconf_build_time_adjust_s, pconf_build_time_adjust_f, SIZEOF(pconf_build_time_adjust_s)); return generic_enum_convert ( (int)*(pconf_build_time_adjust_ty *)this_thing, pconf_build_time_adjust_f, SIZEOF(pconf_build_time_adjust_f) ); } static bool pconf_build_time_adjust_is_set(void *this_thing) { return (*(pconf_build_time_adjust_ty *)this_thing != 0); } meta_type pconf_build_time_adjust_type = { "pconf_build_time_adjust", 0, // alloc 0, // free pconf_build_time_adjust_parse, 0, // list_parse 0, // struct_parse pconf_build_time_adjust_fuzzy, pconf_build_time_adjust_convert, pconf_build_time_adjust_is_set, }; static const char *pconf_unchanged_file_develop_end_policy_s[] = { "ignore", "warning", "error", }; static string_ty *pconf_unchanged_file_develop_end_policy_f[SIZEOF(pconf_unchanged_file_develop_end_policy_s)]; const char * pconf_unchanged_file_develop_end_policy_ename(pconf_unchanged_file_develop_end_policy_ty this_thing) { static char buffer[20]; if ((int)this_thing >= 0 && (int)this_thing < 3) return pconf_unchanged_file_develop_end_policy_s[this_thing]; snprintf(buffer, sizeof(buffer), "%d", (int)this_thing); return buffer; } void pconf_unchanged_file_develop_end_policy_write(const output::pointer &fp, const char *name, pconf_unchanged_file_develop_end_policy_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(pconf_unchanged_file_develop_end_policy_s[this_thing]); if (name) fp->fputs(";\n"); } void pconf_unchanged_file_develop_end_policy_write_xml(const output::pointer &fp, const char *name, pconf_unchanged_file_develop_end_policy_ty this_thing, bool show) { if (this_thing == 0) { if (!show || type_enum_option_query()) return; } assert(name); assert((size_t)this_thing < SIZEOF(pconf_unchanged_file_develop_end_policy_s)); fp->fputc('<'); fp->fputs(name); fp->fputc('>'); fp->fputs(pconf_unchanged_file_develop_end_policy_s[this_thing]); fp->fputs("fputs(name); fp->fputs(">\n"); } static bool pconf_unchanged_file_develop_end_policy_parse(string_ty *name, void *ptr) { slow_to_fast(pconf_unchanged_file_develop_end_policy_s, pconf_unchanged_file_develop_end_policy_f, SIZEOF(pconf_unchanged_file_develop_end_policy_s)); for (size_t j = 0; j < SIZEOF(pconf_unchanged_file_develop_end_policy_f); ++j) { if (str_equal(name, pconf_unchanged_file_develop_end_policy_f[j])) { *(pconf_unchanged_file_develop_end_policy_ty *)ptr = (pconf_unchanged_file_develop_end_policy_ty)j; return true; } } return false; } static string_ty * pconf_unchanged_file_develop_end_policy_fuzzy(string_ty *name) { return generic_enum_fuzzy(name, pconf_unchanged_file_develop_end_policy_f, SIZEOF(pconf_unchanged_file_develop_end_policy_f)); } static rpt_value::pointer pconf_unchanged_file_develop_end_policy_convert(void *this_thing) { if (!pconf_unchanged_file_develop_end_policy_f[0]) slow_to_fast(pconf_unchanged_file_develop_end_policy_s, pconf_unchanged_file_develop_end_policy_f, SIZEOF(pconf_unchanged_file_develop_end_policy_s)); return generic_enum_convert ( (int)*(pconf_unchanged_file_develop_end_policy_ty *)this_thing, pconf_unchanged_file_develop_end_policy_f, SIZEOF(pconf_unchanged_file_develop_end_policy_f) ); } static bool pconf_unchanged_file_develop_end_policy_is_set(void *this_thing) { return (*(pconf_unchanged_file_develop_end_policy_ty *)this_thing != 0); } meta_type pconf_unchanged_file_develop_end_policy_type = { "pconf_unchanged_file_develop_end_policy", 0, // alloc 0, // free pconf_unchanged_file_develop_end_policy_parse, 0, // list_parse 0, // struct_parse pconf_unchanged_file_develop_end_policy_fuzzy, pconf_unchanged_file_develop_end_policy_convert, pconf_unchanged_file_develop_end_policy_is_set, }; static const char *pconf_unchanged_file_integrate_pass_policy_s[] = { "ignore", "warning", "remove", }; static string_ty *pconf_unchanged_file_integrate_pass_policy_f[SIZEOF(pconf_unchanged_file_integrate_pass_policy_s)]; const char * pconf_unchanged_file_integrate_pass_policy_ename(pconf_unchanged_file_integrate_pass_policy_ty this_thing) { static char buffer[20]; if ((int)this_thing >= 0 && (int)this_thing < 3) return pconf_unchanged_file_integrate_pass_policy_s[this_thing]; snprintf(buffer, sizeof(buffer), "%d", (int)this_thing); return buffer; } void pconf_unchanged_file_integrate_pass_policy_write(const output::pointer &fp, const char *name, pconf_unchanged_file_integrate_pass_policy_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(pconf_unchanged_file_integrate_pass_policy_s[this_thing]); if (name) fp->fputs(";\n"); } void pconf_unchanged_file_integrate_pass_policy_write_xml(const output::pointer &fp, const char *name, pconf_unchanged_file_integrate_pass_policy_ty this_thing, bool show) { if (this_thing == 0) { if (!show || type_enum_option_query()) return; } assert(name); assert((size_t)this_thing < SIZEOF(pconf_unchanged_file_integrate_pass_policy_s)); fp->fputc('<'); fp->fputs(name); fp->fputc('>'); fp->fputs(pconf_unchanged_file_integrate_pass_policy_s[this_thing]); fp->fputs("fputs(name); fp->fputs(">\n"); } static bool pconf_unchanged_file_integrate_pass_policy_parse(string_ty *name, void *ptr) { slow_to_fast(pconf_unchanged_file_integrate_pass_policy_s, pconf_unchanged_file_integrate_pass_policy_f, SIZEOF(pconf_unchanged_file_integrate_pass_policy_s)); for (size_t j = 0; j < SIZEOF(pconf_unchanged_file_integrate_pass_policy_f); ++j) { if (str_equal(name, pconf_unchanged_file_integrate_pass_policy_f[j])) { *(pconf_unchanged_file_integrate_pass_policy_ty *)ptr = (pconf_unchanged_file_integrate_pass_policy_ty)j; return true; } } return false; } static string_ty * pconf_unchanged_file_integrate_pass_policy_fuzzy(string_ty *name) { return generic_enum_fuzzy(name, pconf_unchanged_file_integrate_pass_policy_f, SIZEOF(pconf_unchanged_file_integrate_pass_policy_f)); } static rpt_value::pointer pconf_unchanged_file_integrate_pass_policy_convert(void *this_thing) { if (!pconf_unchanged_file_integrate_pass_policy_f[0]) slow_to_fast(pconf_unchanged_file_integrate_pass_policy_s, pconf_unchanged_file_integrate_pass_policy_f, SIZEOF(pconf_unchanged_file_integrate_pass_policy_s)); return generic_enum_convert ( (int)*(pconf_unchanged_file_integrate_pass_policy_ty *)this_thing, pconf_unchanged_file_integrate_pass_policy_f, SIZEOF(pconf_unchanged_file_integrate_pass_policy_f) ); } static bool pconf_unchanged_file_integrate_pass_policy_is_set(void *this_thing) { return (*(pconf_unchanged_file_integrate_pass_policy_ty *)this_thing != 0); } meta_type pconf_unchanged_file_integrate_pass_policy_type = { "pconf_unchanged_file_integrate_pass_policy", 0, // alloc 0, // free pconf_unchanged_file_integrate_pass_policy_parse, 0, // list_parse 0, // struct_parse pconf_unchanged_file_integrate_pass_policy_fuzzy, pconf_unchanged_file_integrate_pass_policy_convert, pconf_unchanged_file_integrate_pass_policy_is_set, }; void pconf_clean_exceptions_list_write(const output::pointer &fp, const char *name, pconf_clean_exceptions_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_clean_exceptions_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 pconf_clean_exceptions_list_write_xml(const output::pointer &fp, const char *name, pconf_clean_exceptions_list_ty *this_thing) { size_t j; if (!this_thing) return; trace(("pconf_clean_exceptions_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 * pconf_clean_exceptions_list_alloc(void) { pconf_clean_exceptions_list_ty *result; trace(("pconf_clean_exceptions_list_alloc()\n{\n")); result = (pconf_clean_exceptions_list_ty *)mem_alloc(sizeof(pconf_clean_exceptions_list_ty)); result->list = 0; result->length = 0; result->maximum = 0; trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static void pconf_clean_exceptions_list_free(void *that) { pconf_clean_exceptions_list_ty *this_thing; size_t j; this_thing = (pconf_clean_exceptions_list_ty *)that; if (!this_thing) return; trace(("pconf_clean_exceptions_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 * pconf_clean_exceptions_list_parse(void *that, meta_type **type_pp) { pconf_clean_exceptions_list_ty *this_thing; void *addr; this_thing = (pconf_clean_exceptions_list_ty *)that; trace(("pconf_clean_exceptions_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 pconf_clean_exceptions_list_convert(void *that) { pconf_clean_exceptions_list_ty *this_thing; size_t j; rpt_value::pointer vp; this_thing = *(pconf_clean_exceptions_list_ty **)that; if (!this_thing) return rpt_value::pointer(); trace(("pconf_clean_exceptions_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; } pconf_clean_exceptions_list_ty * pconf_clean_exceptions_list_copy(pconf_clean_exceptions_list_ty *from) { size_t j; pconf_clean_exceptions_list_ty *result; if (!from) return 0; trace(("pconf_clean_exceptions_list_copy(from = %08lX)\n{\n", (long)from)); result = (pconf_clean_exceptions_list_ty *)pconf_clean_exceptions_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 **)pconf_clean_exceptions_list_parse(result, &bogus); *mpp = string_copy(mp); } trace(("return %8.8lX\n", (long)result)); trace(("}\n")); return result; } pconf_clean_exceptions_list_ty * pconf_clean_exceptions_list_clone(pconf_clean_exceptions_list_ty *from) { return pconf_clean_exceptions_list_copy(from); } #ifdef DEBUG void pconf_clean_exceptions_list_trace_real(const char *name, const pconf_clean_exceptions_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 pconf_clean_exceptions_list_type = { "pconf_clean_exceptions_list", pconf_clean_exceptions_list_alloc, pconf_clean_exceptions_list_free, 0, // enum_parse pconf_clean_exceptions_list_parse, 0, // struct_parse 0, // fuzzy pconf_clean_exceptions_list_convert, generic_struct_is_set, }; void pconf_write(const output::pointer &fp, pconf_ty *this_thing) { if (!this_thing) return; trace(("pconf_write(this_thing = %08lX)\n{\n", (long)this_thing)); assert(((pconf_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((pconf_ty *)this_thing)->reference_count)); string_write(fp, "configuration_directory", this_thing->configuration_directory); string_write(fp, "build_command", this_thing->build_command); work_area_style_write(fp, "integration_directory_style", this_thing->integration_directory_style); work_area_style_write(fp, "development_directory_style", this_thing->development_directory_style); string_write(fp, "development_build_command", this_thing->development_build_command); string_write(fp, "build_time_adjust_notify_command", this_thing->build_time_adjust_notify_command); boolean_write(fp, "build_covers_all_architectures", this_thing->build_covers_all_architectures, 1); boolean_write(fp, "test_covers_all_architectures", this_thing->test_covers_all_architectures, 1); string_write(fp, "change_file_command", this_thing->change_file_command); string_write(fp, "new_file_command", this_thing->new_file_command); string_write(fp, "new_test_command", this_thing->new_test_command); string_write(fp, "copy_file_command", this_thing->copy_file_command); string_write(fp, "remove_file_command", this_thing->remove_file_command); string_write(fp, "change_file_undo_command", this_thing->change_file_undo_command); string_write(fp, "new_file_undo_command", this_thing->new_file_undo_command); string_write(fp, "new_test_undo_command", this_thing->new_test_undo_command); string_write(fp, "copy_file_undo_command", this_thing->copy_file_undo_command); string_write(fp, "remove_file_undo_command", this_thing->remove_file_undo_command); string_write(fp, "make_transparent_command", this_thing->make_transparent_command); string_write(fp, "make_transparent_undo_command", this_thing->make_transparent_undo_command); string_write(fp, "project_file_command", this_thing->project_file_command); string_write(fp, "develop_begin_command", this_thing->develop_begin_command); string_write(fp, "develop_begin_undo_command", this_thing->develop_begin_undo_command); string_write(fp, "integrate_begin_command", this_thing->integrate_begin_command); string_write(fp, "integrate_begin_undo_command", this_thing->integrate_begin_undo_command); boolean_write(fp, "link_integration_directory", this_thing->link_integration_directory, 1); pconf_integrate_begin_exceptions_list_write(fp, "integrate_begin_exceptions", this_thing->integrate_begin_exceptions); boolean_write(fp, "create_symlinks_before_build", this_thing->create_symlinks_before_build, 1); boolean_write(fp, "create_symlinks_before_integration_build", this_thing->create_symlinks_before_integration_build, 1); boolean_write(fp, "remove_symlinks_after_build", this_thing->remove_symlinks_after_build, 1); boolean_write(fp, "remove_symlinks_after_integration_build", this_thing->remove_symlinks_after_integration_build, 1); pconf_symlink_exceptions_list_write(fp, "symlink_exceptions", this_thing->symlink_exceptions); string_write(fp, "history_create_command", this_thing->history_create_command); string_write(fp, "history_get_command", this_thing->history_get_command); string_write(fp, "history_put_command", this_thing->history_put_command); string_write(fp, "history_query_command", this_thing->history_query_command); string_write(fp, "history_transaction_begin_command", this_thing->history_transaction_begin_command); string_write(fp, "history_transaction_end_command", this_thing->history_transaction_end_command); string_write(fp, "history_transaction_abort_command", this_thing->history_transaction_abort_command); pconf_history_put_trashes_file_write(fp, "history_put_trashes_file", this_thing->history_put_trashes_file, 1); pconf_history_content_limitation_write(fp, "history_content_limitation", this_thing->history_content_limitation, 1); string_write(fp, "history_label_command", this_thing->history_label_command); string_write(fp, "diff_command", this_thing->diff_command); string_write(fp, "diff3_command", this_thing->diff3_command); string_write(fp, "merge_command", this_thing->merge_command); string_write(fp, "patch_diff_command", this_thing->patch_diff_command); string_write(fp, "annotate_diff_command", this_thing->annotate_diff_command); string_write(fp, "test_command", this_thing->test_command); string_write(fp, "development_test_command", this_thing->development_test_command); string_write(fp, "batch_test_command", this_thing->batch_test_command); string_write(fp, "architecture_discriminator_command", this_thing->architecture_discriminator_command); pconf_architecture_list_write(fp, "architecture", this_thing->architecture); pconf_file_template_list_write(fp, "file_template", this_thing->file_template); pconf_whiteout_template_list_write(fp, "whiteout_template", this_thing->whiteout_template); integer_write(fp, "maximum_filename_length", this_thing->maximum_filename_length, 0); boolean_write(fp, "posix_filename_charset", this_thing->posix_filename_charset, 1); boolean_write(fp, "dos_filename_required", this_thing->dos_filename_required, 1); boolean_write(fp, "windows_filename_required", this_thing->windows_filename_required, 1); boolean_write(fp, "shell_safe_filenames", this_thing->shell_safe_filenames, 1); boolean_write(fp, "allow_white_space_in_filenames", this_thing->allow_white_space_in_filenames, 1); boolean_write(fp, "allow_non_ascii_filenames", this_thing->allow_non_ascii_filenames, 1); pconf_filename_pattern_accept_list_write(fp, "filename_pattern_accept", this_thing->filename_pattern_accept); pconf_filename_pattern_reject_list_write(fp, "filename_pattern_reject", this_thing->filename_pattern_reject); string_write(fp, "new_test_filename", this_thing->new_test_filename); string_write(fp, "development_directory_template", this_thing->development_directory_template); string_write(fp, "metrics_filename_pattern", this_thing->metrics_filename_pattern); pconf_trojan_horse_suspect_list_write(fp, "trojan_horse_suspect", this_thing->trojan_horse_suspect); attributes_list_write(fp, "project_specific", this_thing->project_specific); pconf_build_time_adjust_write(fp, "build_time_adjust", this_thing->build_time_adjust, 1); boolean_write(fp, "signed_off_by", this_thing->signed_off_by, 1); string_write(fp, "review_policy_command", this_thing->review_policy_command); string_write(fp, "develop_end_policy_command", this_thing->develop_end_policy_command); pconf_unchanged_file_develop_end_policy_write(fp, "unchanged_file_develop_end_policy", this_thing->unchanged_file_develop_end_policy, 1); pconf_unchanged_file_integrate_pass_policy_write(fp, "unchanged_file_integrate_pass_policy", this_thing->unchanged_file_integrate_pass_policy, 1); boolean_write(fp, "cache_project_file_list_for_each_delta", this_thing->cache_project_file_list_for_each_delta, 1); pconf_clean_exceptions_list_write(fp, "clean_exceptions", this_thing->clean_exceptions); trace(("}\n")); } void pconf_write_xml(const output::pointer &fp, pconf_ty *this_thing) { if (!this_thing) return; trace(("pconf_write_xml(this_thing = %08lX)\n{\n", (long)this_thing)); assert(((pconf_ty *)this_thing)->reference_count > 0); trace(("rc = %ld;\n", ((pconf_ty *)this_thing)->reference_count)); fp->fputs("\n"); string_write_xml(fp, "configuration_directory", this_thing->configuration_directory); string_write_xml(fp, "build_command", this_thing->build_command); work_area_style_write_xml(fp, "integration_directory_style", this_thing->integration_directory_style); work_area_style_write_xml(fp, "development_directory_style", this_thing->development_directory_style); string_write_xml(fp, "development_build_command", this_thing->development_build_command); string_write_xml(fp, "build_time_adjust_notify_command", this_thing->build_time_adjust_notify_command); boolean_write_xml(fp, "build_covers_all_architectures", this_thing->build_covers_all_architectures, 0); boolean_write_xml(fp, "test_covers_all_architectures", this_thing->test_covers_all_architectures, 0); string_write_xml(fp, "change_file_command", this_thing->change_file_command); string_write_xml(fp, "new_file_command", this_thing->new_file_command); string_write_xml(fp, "new_test_command", this_thing->new_test_command); string_write_xml(fp, "copy_file_command", this_thing->copy_file_command); string_write_xml(fp, "remove_file_command", this_thing->remove_file_command); string_write_xml(fp, "change_file_undo_command", this_thing->change_file_undo_command); string_write_xml(fp, "new_file_undo_command", this_thing->new_file_undo_command); string_write_xml(fp, "new_test_undo_command", this_thing->new_test_undo_command); string_write_xml(fp, "copy_file_undo_command", this_thing->copy_file_undo_command); string_write_xml(fp, "remove_file_undo_command", this_thing->remove_file_undo_command); string_write_xml(fp, "make_transparent_command", this_thing->make_transparent_command); string_write_xml(fp, "make_transparent_undo_command", this_thing->make_transparent_undo_command); string_write_xml(fp, "project_file_command", this_thing->project_file_command); string_write_xml(fp, "develop_begin_command", this_thing->develop_begin_command); string_write_xml(fp, "develop_begin_undo_command", this_thing->develop_begin_undo_command); string_write_xml(fp, "integrate_begin_command", this_thing->integrate_begin_command); string_write_xml(fp, "integrate_begin_undo_command", this_thing->integrate_begin_undo_command); boolean_write_xml(fp, "link_integration_directory", this_thing->link_integration_directory, 0); pconf_integrate_begin_exceptions_list_write_xml(fp, "integrate_begin_exceptions", this_thing->integrate_begin_exceptions); boolean_write_xml(fp, "create_symlinks_before_build", this_thing->create_symlinks_before_build, 0); boolean_write_xml(fp, "create_symlinks_before_integration_build", this_thing->create_symlinks_before_integration_build, 0); boolean_write_xml(fp, "remove_symlinks_after_build", this_thing->remove_symlinks_after_build, 0); boolean_write_xml(fp, "remove_symlinks_after_integration_build", this_thing->remove_symlinks_after_integration_build, 0); pconf_symlink_exceptions_list_write_xml(fp, "symlink_exceptions", this_thing->symlink_exceptions); string_write_xml(fp, "history_create_command", this_thing->history_create_command); string_write_xml(fp, "history_get_command", this_thing->history_get_command); string_write_xml(fp, "history_put_command", this_thing->history_put_command); string_write_xml(fp, "history_query_command", this_thing->history_query_command); string_write_xml(fp, "history_transaction_begin_command", this_thing->history_transaction_begin_command); string_write_xml(fp, "history_transaction_end_command", this_thing->history_transaction_end_command); string_write_xml(fp, "history_transaction_abort_command", this_thing->history_transaction_abort_command); pconf_history_put_trashes_file_write_xml(fp, "history_put_trashes_file", this_thing->history_put_trashes_file, 0); pconf_history_content_limitation_write_xml(fp, "history_content_limitation", this_thing->history_content_limitation, 0); string_write_xml(fp, "history_label_command", this_thing->history_label_command); string_write_xml(fp, "diff_command", this_thing->diff_command); string_write_xml(fp, "diff3_command", this_thing->diff3_command); string_write_xml(fp, "merge_command", this_thing->merge_command); string_write_xml(fp, "patch_diff_command", this_thing->patch_diff_command); string_write_xml(fp, "annotate_diff_command", this_thing->annotate_diff_command); string_write_xml(fp, "test_command", this_thing->test_command); string_write_xml(fp, "development_test_command", this_thing->development_test_command); string_write_xml(fp, "batch_test_command", this_thing->batch_test_command); string_write_xml(fp, "architecture_discriminator_command", this_thing->architecture_discriminator_command); pconf_architecture_list_write_xml(fp, "architecture", this_thing->architecture); pconf_file_template_list_write_xml(fp, "file_template", this_thing->file_template); pconf_whiteout_template_list_write_xml(fp, "whiteout_template", this_thing->whiteout_template); integer_write_xml(fp, "maximum_filename_length", this_thing->maximum_filename_length, 0); boolean_write_xml(fp, "posix_filename_charset", this_thing->posix_filename_charset, 0); boolean_write_xml(fp, "dos_filename_required", this_thing->dos_filename_required, 0); boolean_write_xml(fp, "windows_filename_required", this_thing->windows_filename_required, 0); boolean_write_xml(fp, "shell_safe_filenames", this_thing->shell_safe_filenames, 0); boolean_write_xml(fp, "allow_white_space_in_filenames", this_thing->allow_white_space_in_filenames, 0); boolean_write_xml(fp, "allow_non_ascii_filenames", this_thing->allow_non_ascii_filenames, 0); pconf_filename_pattern_accept_list_write_xml(fp, "filename_pattern_accept", this_thing->filename_pattern_accept); pconf_filename_pattern_reject_list_write_xml(fp, "filename_pattern_reject", this_thing->filename_pattern_reject); string_write_xml(fp, "new_test_filename", this_thing->new_test_filename); string_write_xml(fp, "development_directory_template", this_thing->development_directory_template); string_write_xml(fp, "metrics_filename_pattern", this_thing->metrics_filename_pattern); pconf_trojan_horse_suspect_list_write_xml(fp, "trojan_horse_suspect", this_thing->trojan_horse_suspect); attributes_list_write_xml(fp, "project_specific", this_thing->project_specific); pconf_build_time_adjust_write_xml(fp, "build_time_adjust", this_thing->build_time_adjust, 0); boolean_write_xml(fp, "signed_off_by", this_thing->signed_off_by, 0); string_write_xml(fp, "review_policy_command", this_thing->review_policy_command); string_write_xml(fp, "develop_end_policy_command", this_thing->develop_end_policy_command); pconf_unchanged_file_develop_end_policy_write_xml(fp, "unchanged_file_develop_end_policy", this_thing->unchanged_file_develop_end_policy, 0); pconf_unchanged_file_integrate_pass_policy_write_xml(fp, "unchanged_file_integrate_pass_policy", this_thing->unchanged_file_integrate_pass_policy, 0); boolean_write_xml(fp, "cache_project_file_list_for_each_delta", this_thing->cache_project_file_list_for_each_delta, 0); pconf_clean_exceptions_list_write_xml(fp, "clean_exceptions", this_thing->clean_exceptions); fp->fputs("\n"); } static void * pconf_alloc(void) { pconf_ty *this_thing; trace(("pconf_alloc()\n{\n")); this_thing = (pconf_ty *)mem_alloc(sizeof(pconf_ty)); this_thing->reference_count = 1; this_thing->mask = 0; this_thing->errpos = str_copy(lex_position()); this_thing->configuration_directory = (string_ty *)0; this_thing->build_command = (string_ty *)0; this_thing->integration_directory_style = (work_area_style_ty *)0; this_thing->development_directory_style = (work_area_style_ty *)0; this_thing->development_build_command = (string_ty *)0; this_thing->build_time_adjust_notify_command = (string_ty *)0; this_thing->build_covers_all_architectures = (bool)0; this_thing->test_covers_all_architectures = (bool)0; this_thing->change_file_command = (string_ty *)0; this_thing->new_file_command = (string_ty *)0; this_thing->new_test_command = (string_ty *)0; this_thing->copy_file_command = (string_ty *)0; this_thing->remove_file_command = (string_ty *)0; this_thing->change_file_undo_command = (string_ty *)0; this_thing->new_file_undo_command = (string_ty *)0; this_thing->new_test_undo_command = (string_ty *)0; this_thing->copy_file_undo_command = (string_ty *)0; this_thing->remove_file_undo_command = (string_ty *)0; this_thing->make_transparent_command = (string_ty *)0; this_thing->make_transparent_undo_command = (string_ty *)0; this_thing->project_file_command = (string_ty *)0; this_thing->develop_begin_command = (string_ty *)0; this_thing->develop_begin_undo_command = (string_ty *)0; this_thing->integrate_begin_command = (string_ty *)0; this_thing->integrate_begin_undo_command = (string_ty *)0; this_thing->link_integration_directory = (bool)0; this_thing->integrate_begin_exceptions = (pconf_integrate_begin_exceptions_list_ty *)0; this_thing->create_symlinks_before_build = (bool)0; this_thing->create_symlinks_before_integration_build = (bool)0; this_thing->remove_symlinks_after_build = (bool)0; this_thing->remove_symlinks_after_integration_build = (bool)0; this_thing->symlink_exceptions = (pconf_symlink_exceptions_list_ty *)0; this_thing->history_create_command = (string_ty *)0; this_thing->history_get_command = (string_ty *)0; this_thing->history_put_command = (string_ty *)0; this_thing->history_query_command = (string_ty *)0; this_thing->history_transaction_begin_command = (string_ty *)0; this_thing->history_transaction_end_command = (string_ty *)0; this_thing->history_transaction_abort_command = (string_ty *)0; this_thing->history_put_trashes_file = (pconf_history_put_trashes_file_ty)0; this_thing->history_content_limitation = (pconf_history_content_limitation_ty)0; this_thing->history_label_command = (string_ty *)0; this_thing->diff_command = (string_ty *)0; this_thing->diff3_command = (string_ty *)0; this_thing->merge_command = (string_ty *)0; this_thing->patch_diff_command = (string_ty *)0; this_thing->annotate_diff_command = (string_ty *)0; this_thing->test_command = (string_ty *)0; this_thing->development_test_command = (string_ty *)0; this_thing->batch_test_command = (string_ty *)0; this_thing->architecture_discriminator_command = (string_ty *)0; this_thing->architecture = (pconf_architecture_list_ty *)0; this_thing->file_template = (pconf_file_template_list_ty *)0; this_thing->whiteout_template = (pconf_whiteout_template_list_ty *)0; this_thing->maximum_filename_length = (long)0; this_thing->posix_filename_charset = (bool)0; this_thing->dos_filename_required = (bool)0; this_thing->windows_filename_required = (bool)0; this_thing->shell_safe_filenames = (bool)0; this_thing->allow_white_space_in_filenames = (bool)0; this_thing->allow_non_ascii_filenames = (bool)0; this_thing->filename_pattern_accept = (pconf_filename_pattern_accept_list_ty *)0; this_thing->filename_pattern_reject = (pconf_filename_pattern_reject_list_ty *)0; this_thing->new_test_filename = (string_ty *)0; this_thing->development_directory_template = (string_ty *)0; this_thing->metrics_filename_pattern = (string_ty *)0; this_thing->trojan_horse_suspect = (pconf_trojan_horse_suspect_list_ty *)0; this_thing->project_specific = (attributes_list_ty *)0; this_thing->build_time_adjust = (pconf_build_time_adjust_ty)0; this_thing->signed_off_by = (bool)0; this_thing->review_policy_command = (string_ty *)0; this_thing->develop_end_policy_command = (string_ty *)0; this_thing->unchanged_file_develop_end_policy = (pconf_unchanged_file_develop_end_policy_ty)0; this_thing->unchanged_file_integrate_pass_policy = (pconf_unchanged_file_integrate_pass_policy_ty)0; this_thing->cache_project_file_list_for_each_delta = (bool)0; this_thing->clean_exceptions = (pconf_clean_exceptions_list_ty *)0; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } pconf_ty * pconf_copy(pconf_ty *this_thing) { trace(("pconf_copy()\n{\n")); this_thing->reference_count++; trace(("return %08lX;\n", (long)this_thing)); trace(("}\n")); return this_thing; } pconf_ty * pconf_clone(pconf_ty *this_thing) { if (!this_thing) return 0; trace(("pconf_clone()\n{\n")); pconf_ty *result = (pconf_ty *)pconf_alloc(); result->configuration_directory = str_copy(this_thing->configuration_directory); result->build_command = str_copy(this_thing->build_command); result->integration_directory_style = work_area_style_clone(this_thing->integration_directory_style); result->development_directory_style = work_area_style_clone(this_thing->development_directory_style); result->development_build_command = str_copy(this_thing->development_build_command); result->build_time_adjust_notify_command = str_copy(this_thing->build_time_adjust_notify_command); result->build_covers_all_architectures = this_thing->build_covers_all_architectures; result->test_covers_all_architectures = this_thing->test_covers_all_architectures; result->change_file_command = str_copy(this_thing->change_file_command); result->new_file_command = str_copy(this_thing->new_file_command); result->new_test_command = str_copy(this_thing->new_test_command); result->copy_file_command = str_copy(this_thing->copy_file_command); result->remove_file_command = str_copy(this_thing->remove_file_command); result->change_file_undo_command = str_copy(this_thing->change_file_undo_command); result->new_file_undo_command = str_copy(this_thing->new_file_undo_command); result->new_test_undo_command = str_copy(this_thing->new_test_undo_command); result->copy_file_undo_command = str_copy(this_thing->copy_file_undo_command); result->remove_file_undo_command = str_copy(this_thing->remove_file_undo_command); result->make_transparent_command = str_copy(this_thing->make_transparent_command); result->make_transparent_undo_command = str_copy(this_thing->make_transparent_undo_command); result->project_file_command = str_copy(this_thing->project_file_command); result->develop_begin_command = str_copy(this_thing->develop_begin_command); result->develop_begin_undo_command = str_copy(this_thing->develop_begin_undo_command); result->integrate_begin_command = str_copy(this_thing->integrate_begin_command); result->integrate_begin_undo_command = str_copy(this_thing->integrate_begin_undo_command); result->link_integration_directory = this_thing->link_integration_directory; result->integrate_begin_exceptions = pconf_integrate_begin_exceptions_list_clone(this_thing->integrate_begin_exceptions); result->create_symlinks_before_build = this_thing->create_symlinks_before_build; result->create_symlinks_before_integration_build = this_thing->create_symlinks_before_integration_build; result->remove_symlinks_after_build = this_thing->remove_symlinks_after_build; result->remove_symlinks_after_integration_build = this_thing->remove_symlinks_after_integration_build; result->symlink_exceptions = pconf_symlink_exceptions_list_clone(this_thing->symlink_exceptions); result->history_create_command = str_copy(this_thing->history_create_command); result->history_get_command = str_copy(this_thing->history_get_command); result->history_put_command = str_copy(this_thing->history_put_command); result->history_query_command = str_copy(this_thing->history_query_command); result->history_transaction_begin_command = str_copy(this_thing->history_transaction_begin_command); result->history_transaction_end_command = str_copy(this_thing->history_transaction_end_command); result->history_transaction_abort_command = str_copy(this_thing->history_transaction_abort_command); result->history_put_trashes_file = this_thing->history_put_trashes_file; result->history_content_limitation = this_thing->history_content_limitation; result->history_label_command = str_copy(this_thing->history_label_command); result->diff_command = str_copy(this_thing->diff_command); result->diff3_command = str_copy(this_thing->diff3_command); result->merge_command = str_copy(this_thing->merge_command); result->patch_diff_command = str_copy(this_thing->patch_diff_command); result->annotate_diff_command = str_copy(this_thing->annotate_diff_command); result->test_command = str_copy(this_thing->test_command); result->development_test_command = str_copy(this_thing->development_test_command); result->batch_test_command = str_copy(this_thing->batch_test_command); result->architecture_discriminator_command = str_copy(this_thing->architecture_discriminator_command); result->architecture = pconf_architecture_list_clone(this_thing->architecture); result->file_template = pconf_file_template_list_clone(this_thing->file_template); result->whiteout_template = pconf_whiteout_template_list_clone(this_thing->whiteout_template); result->maximum_filename_length = this_thing->maximum_filename_length; result->posix_filename_charset = this_thing->posix_filename_charset; result->dos_filename_required = this_thing->dos_filename_required; result->windows_filename_required = this_thing->windows_filename_required; result->shell_safe_filenames = this_thing->shell_safe_filenames; result->allow_white_space_in_filenames = this_thing->allow_white_space_in_filenames; result->allow_non_ascii_filenames = this_thing->allow_non_ascii_filenames; result->filename_pattern_accept = pconf_filename_pattern_accept_list_clone(this_thing->filename_pattern_accept); result->filename_pattern_reject = pconf_filename_pattern_reject_list_clone(this_thing->filename_pattern_reject); result->new_test_filename = str_copy(this_thing->new_test_filename); result->development_directory_template = str_copy(this_thing->development_directory_template); result->metrics_filename_pattern = str_copy(this_thing->metrics_filename_pattern); result->trojan_horse_suspect = pconf_trojan_horse_suspect_list_clone(this_thing->trojan_horse_suspect); result->project_specific = attributes_list_clone(this_thing->project_specific); result->build_time_adjust = this_thing->build_time_adjust; result->signed_off_by = this_thing->signed_off_by; result->review_policy_command = str_copy(this_thing->review_policy_command); result->develop_end_policy_command = str_copy(this_thing->develop_end_policy_command); result->unchanged_file_develop_end_policy = this_thing->unchanged_file_develop_end_policy; result->unchanged_file_integrate_pass_policy = this_thing->unchanged_file_integrate_pass_policy; result->cache_project_file_list_for_each_delta = this_thing->cache_project_file_list_for_each_delta; result->clean_exceptions = pconf_clean_exceptions_list_clone(this_thing->clean_exceptions); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } #ifdef DEBUG void pconf_trace_real(const char *name, const pconf_ty *value) { if (name && *name) { trace_printf("%s = ", name); } if (!value) { trace_printf("NULL"); } else { trace_printf("{\n"); trace_string_real("configuration_directory", value->configuration_directory); trace_string_real("build_command", value->build_command); work_area_style_trace_real("integration_directory_style", value->integration_directory_style); work_area_style_trace_real("development_directory_style", value->development_directory_style); trace_string_real("development_build_command", value->development_build_command); trace_string_real("build_time_adjust_notify_command", value->build_time_adjust_notify_command); trace_bool_real("build_covers_all_architectures", value->build_covers_all_architectures); trace_bool_real("test_covers_all_architectures", value->test_covers_all_architectures); trace_string_real("change_file_command", value->change_file_command); trace_string_real("new_file_command", value->new_file_command); trace_string_real("new_test_command", value->new_test_command); trace_string_real("copy_file_command", value->copy_file_command); trace_string_real("remove_file_command", value->remove_file_command); trace_string_real("change_file_undo_command", value->change_file_undo_command); trace_string_real("new_file_undo_command", value->new_file_undo_command); trace_string_real("new_test_undo_command", value->new_test_undo_command); trace_string_real("copy_file_undo_command", value->copy_file_undo_command); trace_string_real("remove_file_undo_command", value->remove_file_undo_command); trace_string_real("make_transparent_command", value->make_transparent_command); trace_string_real("make_transparent_undo_command", value->make_transparent_undo_command); trace_string_real("project_file_command", value->project_file_command); trace_string_real("develop_begin_command", value->develop_begin_command); trace_string_real("develop_begin_undo_command", value->develop_begin_undo_command); trace_string_real("integrate_begin_command", value->integrate_begin_command); trace_string_real("integrate_begin_undo_command", value->integrate_begin_undo_command); trace_bool_real("link_integration_directory", value->link_integration_directory); pconf_integrate_begin_exceptions_list_trace_real("integrate_begin_exceptions", value->integrate_begin_exceptions); trace_bool_real("create_symlinks_before_build", value->create_symlinks_before_build); trace_bool_real("create_symlinks_before_integration_build", value->create_symlinks_before_integration_build); trace_bool_real("remove_symlinks_after_build", value->remove_symlinks_after_build); trace_bool_real("remove_symlinks_after_integration_build", value->remove_symlinks_after_integration_build); pconf_symlink_exceptions_list_trace_real("symlink_exceptions", value->symlink_exceptions); trace_string_real("history_create_command", value->history_create_command); trace_string_real("history_get_command", value->history_get_command); trace_string_real("history_put_command", value->history_put_command); trace_string_real("history_query_command", value->history_query_command); trace_string_real("history_transaction_begin_command", value->history_transaction_begin_command); trace_string_real("history_transaction_end_command", value->history_transaction_end_command); trace_string_real("history_transaction_abort_command", value->history_transaction_abort_command); trace_printf("history_put_trashes_file = %s;\n", pconf_history_put_trashes_file_ename(value->history_put_trashes_file)); trace_printf("history_content_limitation = %s;\n", pconf_history_content_limitation_ename(value->history_content_limitation)); trace_string_real("history_label_command", value->history_label_command); trace_string_real("diff_command", value->diff_command); trace_string_real("diff3_command", value->diff3_command); trace_string_real("merge_command", value->merge_command); trace_string_real("patch_diff_command", value->patch_diff_command); trace_string_real("annotate_diff_command", value->annotate_diff_command); trace_string_real("test_command", value->test_command); trace_string_real("development_test_command", value->development_test_command); trace_string_real("batch_test_command", value->batch_test_command); trace_string_real("architecture_discriminator_command", value->architecture_discriminator_command); pconf_architecture_list_trace_real("architecture", value->architecture); pconf_file_template_list_trace_real("file_template", value->file_template); pconf_whiteout_template_list_trace_real("whiteout_template", value->whiteout_template); trace_long_real("maximum_filename_length", &value->maximum_filename_length); trace_bool_real("posix_filename_charset", value->posix_filename_charset); trace_bool_real("dos_filename_required", value->dos_filename_required); trace_bool_real("windows_filename_required", value->windows_filename_required); trace_bool_real("shell_safe_filenames", value->shell_safe_filenames); trace_bool_real("allow_white_space_in_filenames", value->allow_white_space_in_filenames); trace_bool_real("allow_non_ascii_filenames", value->allow_non_ascii_filenames); pconf_filename_pattern_accept_list_trace_real("filename_pattern_accept", value->filename_pattern_accept); pconf_filename_pattern_reject_list_trace_real("filename_pattern_reject", value->filename_pattern_reject); trace_string_real("new_test_filename", value->new_test_filename); trace_string_real("development_directory_template", value->development_directory_template); trace_string_real("metrics_filename_pattern", value->metrics_filename_pattern); pconf_trojan_horse_suspect_list_trace_real("trojan_horse_suspect", value->trojan_horse_suspect); attributes_list_trace_real("project_specific", value->project_specific); trace_printf("build_time_adjust = %s;\n", pconf_build_time_adjust_ename(value->build_time_adjust)); trace_bool_real("signed_off_by", value->signed_off_by); trace_string_real("review_policy_command", value->review_policy_command); trace_string_real("develop_end_policy_command", value->develop_end_policy_command); trace_printf("unchanged_file_develop_end_policy = %s;\n", pconf_unchanged_file_develop_end_policy_ename(value->unchanged_file_develop_end_policy)); trace_printf("unchanged_file_integrate_pass_policy = %s;\n", pconf_unchanged_file_integrate_pass_policy_ename(value->unchanged_file_integrate_pass_policy)); trace_bool_real("cache_project_file_list_for_each_delta", value->cache_project_file_list_for_each_delta); pconf_clean_exceptions_list_trace_real("clean_exceptions", value->clean_exceptions); trace_printf("}"); } trace_printf((name && *name) ? ";\n" : ",\n"); } #endif // DEBUG static void pconf_free(void *that) { pconf_ty *this_thing; this_thing = (pconf_ty *)that; if (!this_thing) return; this_thing->reference_count--; assert(this_thing->reference_count >= 0); if (this_thing->reference_count > 0) return; trace(("pconf_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->configuration_directory); str_free(this_thing->build_command); work_area_style_free(this_thing->integration_directory_style); work_area_style_free(this_thing->development_directory_style); str_free(this_thing->development_build_command); str_free(this_thing->build_time_adjust_notify_command); str_free(this_thing->change_file_command); str_free(this_thing->new_file_command); str_free(this_thing->new_test_command); str_free(this_thing->copy_file_command); str_free(this_thing->remove_file_command); str_free(this_thing->change_file_undo_command); str_free(this_thing->new_file_undo_command); str_free(this_thing->new_test_undo_command); str_free(this_thing->copy_file_undo_command); str_free(this_thing->remove_file_undo_command); str_free(this_thing->make_transparent_command); str_free(this_thing->make_transparent_undo_command); str_free(this_thing->project_file_command); str_free(this_thing->develop_begin_command); str_free(this_thing->develop_begin_undo_command); str_free(this_thing->integrate_begin_command); str_free(this_thing->integrate_begin_undo_command); pconf_integrate_begin_exceptions_list_free(this_thing->integrate_begin_exceptions); pconf_symlink_exceptions_list_free(this_thing->symlink_exceptions); str_free(this_thing->history_create_command); str_free(this_thing->history_get_command); str_free(this_thing->history_put_command); str_free(this_thing->history_query_command); str_free(this_thing->history_transaction_begin_command); str_free(this_thing->history_transaction_end_command); str_free(this_thing->history_transaction_abort_command); str_free(this_thing->history_label_command); str_free(this_thing->diff_command); str_free(this_thing->diff3_command); str_free(this_thing->merge_command); str_free(this_thing->patch_diff_command); str_free(this_thing->annotate_diff_command); str_free(this_thing->test_command); str_free(this_thing->development_test_command); str_free(this_thing->batch_test_command); str_free(this_thing->architecture_discriminator_command); pconf_architecture_list_free(this_thing->architecture); pconf_file_template_list_free(this_thing->file_template); pconf_whiteout_template_list_free(this_thing->whiteout_template); pconf_filename_pattern_accept_list_free(this_thing->filename_pattern_accept); pconf_filename_pattern_reject_list_free(this_thing->filename_pattern_reject); str_free(this_thing->new_test_filename); str_free(this_thing->development_directory_template); str_free(this_thing->metrics_filename_pattern); pconf_trojan_horse_suspect_list_free(this_thing->trojan_horse_suspect); attributes_list_type.free(this_thing->project_specific); str_free(this_thing->review_policy_command); str_free(this_thing->develop_end_policy_command); pconf_clean_exceptions_list_free(this_thing->clean_exceptions); mem_free(this_thing); trace(("}\n")); } static type_table_ty pconf_table[] = { { "configuration_directory", offsetof(pconf_ty, configuration_directory), &string_type, pconf_configuration_directory_mask, 0, // redefinition not ok 0, // fast_name }, { "build_command", offsetof(pconf_ty, build_command), &string_type, pconf_build_command_mask, 0, // redefinition not ok 0, // fast_name }, { "integration_directory_style", offsetof(pconf_ty, integration_directory_style), &work_area_style_type, pconf_integration_directory_style_mask, 0, // redefinition not ok 0, // fast_name }, { "development_directory_style", offsetof(pconf_ty, development_directory_style), &work_area_style_type, pconf_development_directory_style_mask, 0, // redefinition not ok 0, // fast_name }, { "development_build_command", offsetof(pconf_ty, development_build_command), &string_type, pconf_development_build_command_mask, 0, // redefinition not ok 0, // fast_name }, { "build_time_adjust_notify_command", offsetof(pconf_ty, build_time_adjust_notify_command), &string_type, pconf_build_time_adjust_notify_command_mask, 0, // redefinition not ok 0, // fast_name }, { "build_covers_all_architectures", offsetof(pconf_ty, build_covers_all_architectures), &boolean_type, pconf_build_covers_all_architectures_mask, 0, // redefinition not ok 0, // fast_name }, { "test_covers_all_architectures", offsetof(pconf_ty, test_covers_all_architectures), &boolean_type, pconf_test_covers_all_architectures_mask, 0, // redefinition not ok 0, // fast_name }, { "change_file_command", offsetof(pconf_ty, change_file_command), &string_type, pconf_change_file_command_mask, 0, // redefinition not ok 0, // fast_name }, { "new_file_command", offsetof(pconf_ty, new_file_command), &string_type, pconf_new_file_command_mask, 0, // redefinition not ok 0, // fast_name }, { "new_test_command", offsetof(pconf_ty, new_test_command), &string_type, pconf_new_test_command_mask, 0, // redefinition not ok 0, // fast_name }, { "copy_file_command", offsetof(pconf_ty, copy_file_command), &string_type, pconf_copy_file_command_mask, 0, // redefinition not ok 0, // fast_name }, { "remove_file_command", offsetof(pconf_ty, remove_file_command), &string_type, pconf_remove_file_command_mask, 0, // redefinition not ok 0, // fast_name }, { "change_file_undo_command", offsetof(pconf_ty, change_file_undo_command), &string_type, pconf_change_file_undo_command_mask, 0, // redefinition not ok 0, // fast_name }, { "new_file_undo_command", offsetof(pconf_ty, new_file_undo_command), &string_type, pconf_new_file_undo_command_mask, 0, // redefinition not ok 0, // fast_name }, { "new_test_undo_command", offsetof(pconf_ty, new_test_undo_command), &string_type, pconf_new_test_undo_command_mask, 0, // redefinition not ok 0, // fast_name }, { "copy_file_undo_command", offsetof(pconf_ty, copy_file_undo_command), &string_type, pconf_copy_file_undo_command_mask, 0, // redefinition not ok 0, // fast_name }, { "remove_file_undo_command", offsetof(pconf_ty, remove_file_undo_command), &string_type, pconf_remove_file_undo_command_mask, 0, // redefinition not ok 0, // fast_name }, { "make_transparent_command", offsetof(pconf_ty, make_transparent_command), &string_type, pconf_make_transparent_command_mask, 0, // redefinition not ok 0, // fast_name }, { "make_transparent_undo_command", offsetof(pconf_ty, make_transparent_undo_command), &string_type, pconf_make_transparent_undo_command_mask, 0, // redefinition not ok 0, // fast_name }, { "project_file_command", offsetof(pconf_ty, project_file_command), &string_type, pconf_project_file_command_mask, 0, // redefinition not ok 0, // fast_name }, { "develop_begin_command", offsetof(pconf_ty, develop_begin_command), &string_type, pconf_develop_begin_command_mask, 0, // redefinition not ok 0, // fast_name }, { "develop_begin_undo_command", offsetof(pconf_ty, develop_begin_undo_command), &string_type, pconf_develop_begin_undo_command_mask, 0, // redefinition not ok 0, // fast_name }, { "integrate_begin_command", offsetof(pconf_ty, integrate_begin_command), &string_type, pconf_integrate_begin_command_mask, 0, // redefinition not ok 0, // fast_name }, { "integrate_begin_undo_command", offsetof(pconf_ty, integrate_begin_undo_command), &string_type, pconf_integrate_begin_undo_command_mask, 0, // redefinition not ok 0, // fast_name }, { "link_integration_directory", offsetof(pconf_ty, link_integration_directory), &boolean_type, pconf_link_integration_directory_mask, 0, // redefinition not ok 0, // fast_name }, { "integrate_begin_exceptions", offsetof(pconf_ty, integrate_begin_exceptions), &pconf_integrate_begin_exceptions_list_type, pconf_integrate_begin_exceptions_mask, 0, // redefinition not ok 0, // fast_name }, { "create_symlinks_before_build", offsetof(pconf_ty, create_symlinks_before_build), &boolean_type, pconf_create_symlinks_before_build_mask, 0, // redefinition not ok 0, // fast_name }, { "create_symlinks_before_integration_build", offsetof(pconf_ty, create_symlinks_before_integration_build), &boolean_type, pconf_create_symlinks_before_integration_build_mask, 0, // redefinition not ok 0, // fast_name }, { "remove_symlinks_after_build", offsetof(pconf_ty, remove_symlinks_after_build), &boolean_type, pconf_remove_symlinks_after_build_mask, 0, // redefinition not ok 0, // fast_name }, { "remove_symlinks_after_integration_build", offsetof(pconf_ty, remove_symlinks_after_integration_build), &boolean_type, pconf_remove_symlinks_after_integration_build_mask, 0, // redefinition not ok 0, // fast_name }, { "symlink_exceptions", offsetof(pconf_ty, symlink_exceptions), &pconf_symlink_exceptions_list_type, pconf_symlink_exceptions_mask, 0, // redefinition not ok 0, // fast_name }, { "history_create_command", offsetof(pconf_ty, history_create_command), &string_type, pconf_history_create_command_mask, 0, // redefinition not ok 0, // fast_name }, { "history_get_command", offsetof(pconf_ty, history_get_command), &string_type, pconf_history_get_command_mask, 0, // redefinition not ok 0, // fast_name }, { "history_put_command", offsetof(pconf_ty, history_put_command), &string_type, pconf_history_put_command_mask, 0, // redefinition not ok 0, // fast_name }, { "history_query_command", offsetof(pconf_ty, history_query_command), &string_type, pconf_history_query_command_mask, 0, // redefinition not ok 0, // fast_name }, { "history_transaction_begin_command", offsetof(pconf_ty, history_transaction_begin_command), &string_type, pconf_history_transaction_begin_command_mask, 0, // redefinition not ok 0, // fast_name }, { "history_transaction_end_command", offsetof(pconf_ty, history_transaction_end_command), &string_type, pconf_history_transaction_end_command_mask, 0, // redefinition not ok 0, // fast_name }, { "history_transaction_abort_command", offsetof(pconf_ty, history_transaction_abort_command), &string_type, pconf_history_transaction_abort_command_mask, 0, // redefinition not ok 0, // fast_name }, { "history_put_trashes_file", offsetof(pconf_ty, history_put_trashes_file), &pconf_history_put_trashes_file_type, pconf_history_put_trashes_file_mask, 0, // redefinition not ok 0, // fast_name }, { "history_content_limitation", offsetof(pconf_ty, history_content_limitation), &pconf_history_content_limitation_type, pconf_history_content_limitation_mask, 0, // redefinition not ok 0, // fast_name }, { "history_label_command", offsetof(pconf_ty, history_label_command), &string_type, pconf_history_label_command_mask, 0, // redefinition not ok 0, // fast_name }, { "diff_command", offsetof(pconf_ty, diff_command), &string_type, pconf_diff_command_mask, 0, // redefinition not ok 0, // fast_name }, { "diff3_command", offsetof(pconf_ty, diff3_command), &string_type, pconf_diff3_command_mask, 0, // redefinition not ok 0, // fast_name }, { "merge_command", offsetof(pconf_ty, merge_command), &string_type, pconf_merge_command_mask, 0, // redefinition not ok 0, // fast_name }, { "patch_diff_command", offsetof(pconf_ty, patch_diff_command), &string_type, pconf_patch_diff_command_mask, 0, // redefinition not ok 0, // fast_name }, { "annotate_diff_command", offsetof(pconf_ty, annotate_diff_command), &string_type, pconf_annotate_diff_command_mask, 0, // redefinition not ok 0, // fast_name }, { "test_command", offsetof(pconf_ty, test_command), &string_type, pconf_test_command_mask, 0, // redefinition not ok 0, // fast_name }, { "development_test_command", offsetof(pconf_ty, development_test_command), &string_type, pconf_development_test_command_mask, 0, // redefinition not ok 0, // fast_name }, { "batch_test_command", offsetof(pconf_ty, batch_test_command), &string_type, pconf_batch_test_command_mask, 0, // redefinition not ok 0, // fast_name }, { "architecture_discriminator_command", offsetof(pconf_ty, architecture_discriminator_command), &string_type, pconf_architecture_discriminator_command_mask, 0, // redefinition not ok 0, // fast_name }, { "architecture", offsetof(pconf_ty, architecture), &pconf_architecture_list_type, pconf_architecture_mask, 1, // redefinition is ok 0, // fast_name }, { "file_template", offsetof(pconf_ty, file_template), &pconf_file_template_list_type, pconf_file_template_mask, 1, // redefinition is ok 0, // fast_name }, { "whiteout_template", offsetof(pconf_ty, whiteout_template), &pconf_whiteout_template_list_type, pconf_whiteout_template_mask, 1, // redefinition is ok 0, // fast_name }, { "maximum_filename_length", offsetof(pconf_ty, maximum_filename_length), &integer_type, pconf_maximum_filename_length_mask, 0, // redefinition not ok 0, // fast_name }, { "posix_filename_charset", offsetof(pconf_ty, posix_filename_charset), &boolean_type, pconf_posix_filename_charset_mask, 0, // redefinition not ok 0, // fast_name }, { "dos_filename_required", offsetof(pconf_ty, dos_filename_required), &boolean_type, pconf_dos_filename_required_mask, 0, // redefinition not ok 0, // fast_name }, { "windows_filename_required", offsetof(pconf_ty, windows_filename_required), &boolean_type, pconf_windows_filename_required_mask, 0, // redefinition not ok 0, // fast_name }, { "shell_safe_filenames", offsetof(pconf_ty, shell_safe_filenames), &boolean_type, pconf_shell_safe_filenames_mask, 0, // redefinition not ok 0, // fast_name }, { "allow_white_space_in_filenames", offsetof(pconf_ty, allow_white_space_in_filenames), &boolean_type, pconf_allow_white_space_in_filenames_mask, 0, // redefinition not ok 0, // fast_name }, { "allow_non_ascii_filenames", offsetof(pconf_ty, allow_non_ascii_filenames), &boolean_type, pconf_allow_non_ascii_filenames_mask, 0, // redefinition not ok 0, // fast_name }, { "filename_pattern_accept", offsetof(pconf_ty, filename_pattern_accept), &pconf_filename_pattern_accept_list_type, pconf_filename_pattern_accept_mask, 0, // redefinition not ok 0, // fast_name }, { "filename_pattern_reject", offsetof(pconf_ty, filename_pattern_reject), &pconf_filename_pattern_reject_list_type, pconf_filename_pattern_reject_mask, 0, // redefinition not ok 0, // fast_name }, { "new_test_filename", offsetof(pconf_ty, new_test_filename), &string_type, pconf_new_test_filename_mask, 0, // redefinition not ok 0, // fast_name }, { "development_directory_template", offsetof(pconf_ty, development_directory_template), &string_type, pconf_development_directory_template_mask, 0, // redefinition not ok 0, // fast_name }, { "metrics_filename_pattern", offsetof(pconf_ty, metrics_filename_pattern), &string_type, pconf_metrics_filename_pattern_mask, 0, // redefinition not ok 0, // fast_name }, { "trojan_horse_suspect", offsetof(pconf_ty, trojan_horse_suspect), &pconf_trojan_horse_suspect_list_type, pconf_trojan_horse_suspect_mask, 0, // redefinition not ok 0, // fast_name }, { "project_specific", offsetof(pconf_ty, project_specific), &attributes_list_type, pconf_project_specific_mask, 1, // redefinition is ok 0, // fast_name }, { "build_time_adjust", offsetof(pconf_ty, build_time_adjust), &pconf_build_time_adjust_type, pconf_build_time_adjust_mask, 0, // redefinition not ok 0, // fast_name }, { "signed_off_by", offsetof(pconf_ty, signed_off_by), &boolean_type, pconf_signed_off_by_mask, 0, // redefinition not ok 0, // fast_name }, { "review_policy_command", offsetof(pconf_ty, review_policy_command), &string_type, pconf_review_policy_command_mask, 0, // redefinition not ok 0, // fast_name }, { "develop_end_policy_command", offsetof(pconf_ty, develop_end_policy_command), &string_type, pconf_develop_end_policy_command_mask, 0, // redefinition not ok 0, // fast_name }, { "unchanged_file_develop_end_policy", offsetof(pconf_ty, unchanged_file_develop_end_policy), &pconf_unchanged_file_develop_end_policy_type, pconf_unchanged_file_develop_end_policy_mask, 0, // redefinition not ok 0, // fast_name }, { "unchanged_file_integrate_pass_policy", offsetof(pconf_ty, unchanged_file_integrate_pass_policy), &pconf_unchanged_file_integrate_pass_policy_type, pconf_unchanged_file_integrate_pass_policy_mask, 0, // redefinition not ok 0, // fast_name }, { "cache_project_file_list_for_each_delta", offsetof(pconf_ty, cache_project_file_list_for_each_delta), &boolean_type, pconf_cache_project_file_list_for_each_delta_mask, 0, // redefinition not ok 0, // fast_name }, { "clean_exceptions", offsetof(pconf_ty, clean_exceptions), &pconf_clean_exceptions_list_type, pconf_clean_exceptions_mask, 0, // redefinition not ok 0, // fast_name }, }; static void * pconf_parse(void *this_thing, string_ty *name, meta_type **type_pp, unsigned long *mask_p, int *redef_p) { void *addr; trace(("pconf_parse(this_thing = %08lX, name = %08lX, type_pp = %08lX)\n{\n", (long)this_thing, (long)name, (long)type_pp)); assert(((pconf_ty *)this_thing)->reference_count > 0); addr = generic_struct_parse ( this_thing, name, type_pp, mask_p, redef_p, pconf_table, SIZEOF(pconf_table) ); trace(("return %08lX;\n}\n", (long)addr)); return addr; } static string_ty * pconf_fuzzy(string_ty *name) { string_ty *result; trace(("pconf_fuzzy(name = %08lX)\n{\n", (long)name)); result = generic_struct_fuzzy ( name, pconf_table, SIZEOF(pconf_table) ); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } static rpt_value::pointer pconf_convert(void *this_thing) { trace(("pconf_convert(name = %08lX)\n{\n", (long)this_thing)); assert(((pconf_ty *)this_thing)->reference_count > 0); rpt_value::pointer result = generic_struct_convert ( this_thing, pconf_table, SIZEOF(pconf_table) ); trace(("return %08lX;\n", (long)result.get())); trace(("}\n")); return result; } meta_type pconf_type = { "pconf", pconf_alloc, pconf_free, 0, // enum_parse 0, // list_parse pconf_parse, pconf_fuzzy, pconf_convert, generic_struct_is_set, }; pconf_ty * pconf_read_file(const nstring &filename) { return pconf_read_file(filename.get_ref()); } pconf_ty * pconf_read_file(string_ty *filename) { pconf_ty *result; trace(("pconf_read_file(filename = \"%s\")\n{\n", (filename ? filename->str_text : ""))); os_become_must_be_active(); result = (pconf_ty *)parse(filename, &pconf_type); trace(("return %08lX;\n", (long)result)); trace(("}\n")); return result; } void pconf_write_file(const nstring &filename, pconf_ty *value, bool comp) { pconf_write_file(filename.get_ref(), value, comp); } void pconf_write_file(string_ty *filename, pconf_ty *value, int needs_compression) { trace(("pconf_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); pconf_write(fp, value); type_enum_option_clear(); trace(("}\n")); } void pconf__rpt_init(void) { trace(("pconf__rpt_init()\n{\n")); generic_enum__init(pconf_history_put_trashes_file_s, SIZEOF(pconf_history_put_trashes_file_s)); generic_enum__init(pconf_history_content_limitation_s, SIZEOF(pconf_history_content_limitation_s)); generic_enum__init(pconf_architecture_mode_s, SIZEOF(pconf_architecture_mode_s)); generic_enum__init(pconf_build_time_adjust_s, SIZEOF(pconf_build_time_adjust_s)); generic_enum__init(pconf_unchanged_file_develop_end_policy_s, SIZEOF(pconf_unchanged_file_develop_end_policy_s)); generic_enum__init(pconf_unchanged_file_integrate_pass_policy_s, SIZEOF(pconf_unchanged_file_integrate_pass_policy_s)); trace(("}\n")); }