#include #include #include #include #include #include #include #include #include #include #include #include static char *uconf_delete_file_preference_s[] = { "no_keep", "interactive", "keep", }; static string_ty *uconf_delete_file_preference_f[SIZEOF(uconf_delete_file_preference_s)]; char * uconf_delete_file_preference_ename(this) uconf_delete_file_preference_ty this; { static char buffer[20]; if ((int)this >= 0 && (int)this < 3) return uconf_delete_file_preference_s[this]; sprintf(buffer, "%d", (int)this); return buffer; } void uconf_delete_file_preference_write(fp, name, this) output_ty *fp; const char *name; uconf_delete_file_preference_ty this; { if (name) { if (this == 0 && type_enum_option_query()) return; output_fputs(fp, name); output_fputs(fp, " = "); } output_fputs(fp, uconf_delete_file_preference_s[this]); if (name) output_fputs(fp, ";\n"); } static int uconf_delete_file_preference_parse _((string_ty *)); static int uconf_delete_file_preference_parse(name) string_ty *name; { int j; slow_to_fast(uconf_delete_file_preference_s, uconf_delete_file_preference_f, SIZEOF(uconf_delete_file_preference_s)); for (j = 0; j < SIZEOF(uconf_delete_file_preference_f); ++j) { if (str_equal(name, uconf_delete_file_preference_f[j])) return j; } return -1; } static string_ty *uconf_delete_file_preference_fuzzy _((string_ty *)); static string_ty * uconf_delete_file_preference_fuzzy(name) string_ty *name; { return generic_enum_fuzzy ( name, uconf_delete_file_preference_f, SIZEOF(uconf_delete_file_preference_f) ); } static struct rpt_value_ty *uconf_delete_file_preference_convert _((void *)); static struct rpt_value_ty * uconf_delete_file_preference_convert(this) void *this; { if (!uconf_delete_file_preference_f[0]) slow_to_fast(uconf_delete_file_preference_s, uconf_delete_file_preference_f, SIZEOF(uconf_delete_file_preference_s)); return generic_enum_convert ( this, uconf_delete_file_preference_f, SIZEOF(uconf_delete_file_preference_f) ); } type_ty uconf_delete_file_preference_type = { "uconf_delete_file_preference", 0, /* alloc */ 0, /* free */ uconf_delete_file_preference_parse, 0, /* list_parse */ 0, /* struct_parse */ uconf_delete_file_preference_fuzzy, uconf_delete_file_preference_convert, generic_enum_is_set, }; static char *uconf_diff_preference_s[] = { "automatic_merge", "no_merge", "only_merge", }; static string_ty *uconf_diff_preference_f[SIZEOF(uconf_diff_preference_s)]; char * uconf_diff_preference_ename(this) uconf_diff_preference_ty this; { static char buffer[20]; if ((int)this >= 0 && (int)this < 3) return uconf_diff_preference_s[this]; sprintf(buffer, "%d", (int)this); return buffer; } void uconf_diff_preference_write(fp, name, this) output_ty *fp; const char *name; uconf_diff_preference_ty this; { if (name) { if (this == 0 && type_enum_option_query()) return; output_fputs(fp, name); output_fputs(fp, " = "); } output_fputs(fp, uconf_diff_preference_s[this]); if (name) output_fputs(fp, ";\n"); } static int uconf_diff_preference_parse _((string_ty *)); static int uconf_diff_preference_parse(name) string_ty *name; { int j; slow_to_fast(uconf_diff_preference_s, uconf_diff_preference_f, SIZEOF(uconf_diff_preference_s)); for (j = 0; j < SIZEOF(uconf_diff_preference_f); ++j) { if (str_equal(name, uconf_diff_preference_f[j])) return j; } return -1; } static string_ty *uconf_diff_preference_fuzzy _((string_ty *)); static string_ty * uconf_diff_preference_fuzzy(name) string_ty *name; { return generic_enum_fuzzy ( name, uconf_diff_preference_f, SIZEOF(uconf_diff_preference_f) ); } static struct rpt_value_ty *uconf_diff_preference_convert _((void *)); static struct rpt_value_ty * uconf_diff_preference_convert(this) void *this; { if (!uconf_diff_preference_f[0]) slow_to_fast(uconf_diff_preference_s, uconf_diff_preference_f, SIZEOF(uconf_diff_preference_s)); return generic_enum_convert ( this, uconf_diff_preference_f, SIZEOF(uconf_diff_preference_f) ); } type_ty uconf_diff_preference_type = { "uconf_diff_preference", 0, /* alloc */ 0, /* free */ uconf_diff_preference_parse, 0, /* list_parse */ 0, /* struct_parse */ uconf_diff_preference_fuzzy, uconf_diff_preference_convert, generic_enum_is_set, }; static char *uconf_pager_preference_s[] = { "foreground", "never", }; static string_ty *uconf_pager_preference_f[SIZEOF(uconf_pager_preference_s)]; char * uconf_pager_preference_ename(this) uconf_pager_preference_ty this; { static char buffer[20]; if ((int)this >= 0 && (int)this < 2) return uconf_pager_preference_s[this]; sprintf(buffer, "%d", (int)this); return buffer; } void uconf_pager_preference_write(fp, name, this) output_ty *fp; const char *name; uconf_pager_preference_ty this; { if (name) { if (this == 0 && type_enum_option_query()) return; output_fputs(fp, name); output_fputs(fp, " = "); } output_fputs(fp, uconf_pager_preference_s[this]); if (name) output_fputs(fp, ";\n"); } static int uconf_pager_preference_parse _((string_ty *)); static int uconf_pager_preference_parse(name) string_ty *name; { int j; slow_to_fast(uconf_pager_preference_s, uconf_pager_preference_f, SIZEOF(uconf_pager_preference_s)); for (j = 0; j < SIZEOF(uconf_pager_preference_f); ++j) { if (str_equal(name, uconf_pager_preference_f[j])) return j; } return -1; } static string_ty *uconf_pager_preference_fuzzy _((string_ty *)); static string_ty * uconf_pager_preference_fuzzy(name) string_ty *name; { return generic_enum_fuzzy ( name, uconf_pager_preference_f, SIZEOF(uconf_pager_preference_f) ); } static struct rpt_value_ty *uconf_pager_preference_convert _((void *)); static struct rpt_value_ty * uconf_pager_preference_convert(this) void *this; { if (!uconf_pager_preference_f[0]) slow_to_fast(uconf_pager_preference_s, uconf_pager_preference_f, SIZEOF(uconf_pager_preference_s)); return generic_enum_convert ( this, uconf_pager_preference_f, SIZEOF(uconf_pager_preference_f) ); } type_ty uconf_pager_preference_type = { "uconf_pager_preference", 0, /* alloc */ 0, /* free */ uconf_pager_preference_parse, 0, /* list_parse */ 0, /* struct_parse */ uconf_pager_preference_fuzzy, uconf_pager_preference_convert, generic_enum_is_set, }; static char *uconf_persevere_preference_s[] = { "all", "stop", }; static string_ty *uconf_persevere_preference_f[SIZEOF(uconf_persevere_preference_s)]; char * uconf_persevere_preference_ename(this) uconf_persevere_preference_ty this; { static char buffer[20]; if ((int)this >= 0 && (int)this < 2) return uconf_persevere_preference_s[this]; sprintf(buffer, "%d", (int)this); return buffer; } void uconf_persevere_preference_write(fp, name, this) output_ty *fp; const char *name; uconf_persevere_preference_ty this; { if (name) { if (this == 0 && type_enum_option_query()) return; output_fputs(fp, name); output_fputs(fp, " = "); } output_fputs(fp, uconf_persevere_preference_s[this]); if (name) output_fputs(fp, ";\n"); } static int uconf_persevere_preference_parse _((string_ty *)); static int uconf_persevere_preference_parse(name) string_ty *name; { int j; slow_to_fast(uconf_persevere_preference_s, uconf_persevere_preference_f, SIZEOF(uconf_persevere_preference_s)); for (j = 0; j < SIZEOF(uconf_persevere_preference_f); ++j) { if (str_equal(name, uconf_persevere_preference_f[j])) return j; } return -1; } static string_ty *uconf_persevere_preference_fuzzy _((string_ty *)); static string_ty * uconf_persevere_preference_fuzzy(name) string_ty *name; { return generic_enum_fuzzy ( name, uconf_persevere_preference_f, SIZEOF(uconf_persevere_preference_f) ); } static struct rpt_value_ty *uconf_persevere_preference_convert _((void *)); static struct rpt_value_ty * uconf_persevere_preference_convert(this) void *this; { if (!uconf_persevere_preference_f[0]) slow_to_fast(uconf_persevere_preference_s, uconf_persevere_preference_f, SIZEOF(uconf_persevere_preference_s)); return generic_enum_convert ( this, uconf_persevere_preference_f, SIZEOF(uconf_persevere_preference_f) ); } type_ty uconf_persevere_preference_type = { "uconf_persevere_preference", 0, /* alloc */ 0, /* free */ uconf_persevere_preference_parse, 0, /* list_parse */ 0, /* struct_parse */ uconf_persevere_preference_fuzzy, uconf_persevere_preference_convert, generic_enum_is_set, }; static char *uconf_log_file_preference_s[] = { "snuggle", "append", "replace", "never", }; static string_ty *uconf_log_file_preference_f[SIZEOF(uconf_log_file_preference_s)]; char * uconf_log_file_preference_ename(this) uconf_log_file_preference_ty this; { static char buffer[20]; if ((int)this >= 0 && (int)this < 4) return uconf_log_file_preference_s[this]; sprintf(buffer, "%d", (int)this); return buffer; } void uconf_log_file_preference_write(fp, name, this) output_ty *fp; const char *name; uconf_log_file_preference_ty this; { if (name) { if (this == 0 && type_enum_option_query()) return; output_fputs(fp, name); output_fputs(fp, " = "); } output_fputs(fp, uconf_log_file_preference_s[this]); if (name) output_fputs(fp, ";\n"); } static int uconf_log_file_preference_parse _((string_ty *)); static int uconf_log_file_preference_parse(name) string_ty *name; { int j; slow_to_fast(uconf_log_file_preference_s, uconf_log_file_preference_f, SIZEOF(uconf_log_file_preference_s)); for (j = 0; j < SIZEOF(uconf_log_file_preference_f); ++j) { if (str_equal(name, uconf_log_file_preference_f[j])) return j; } return -1; } static string_ty *uconf_log_file_preference_fuzzy _((string_ty *)); static string_ty * uconf_log_file_preference_fuzzy(name) string_ty *name; { return generic_enum_fuzzy ( name, uconf_log_file_preference_f, SIZEOF(uconf_log_file_preference_f) ); } static struct rpt_value_ty *uconf_log_file_preference_convert _((void *)); static struct rpt_value_ty * uconf_log_file_preference_convert(this) void *this; { if (!uconf_log_file_preference_f[0]) slow_to_fast(uconf_log_file_preference_s, uconf_log_file_preference_f, SIZEOF(uconf_log_file_preference_s)); return generic_enum_convert ( this, uconf_log_file_preference_f, SIZEOF(uconf_log_file_preference_f) ); } type_ty uconf_log_file_preference_type = { "uconf_log_file_preference", 0, /* alloc */ 0, /* free */ uconf_log_file_preference_parse, 0, /* list_parse */ 0, /* struct_parse */ uconf_log_file_preference_fuzzy, uconf_log_file_preference_convert, generic_enum_is_set, }; static char *uconf_lock_wait_preference_s[] = { "always", "background", "never", }; static string_ty *uconf_lock_wait_preference_f[SIZEOF(uconf_lock_wait_preference_s)]; char * uconf_lock_wait_preference_ename(this) uconf_lock_wait_preference_ty this; { static char buffer[20]; if ((int)this >= 0 && (int)this < 3) return uconf_lock_wait_preference_s[this]; sprintf(buffer, "%d", (int)this); return buffer; } void uconf_lock_wait_preference_write(fp, name, this) output_ty *fp; const char *name; uconf_lock_wait_preference_ty this; { if (name) { if (this == 0 && type_enum_option_query()) return; output_fputs(fp, name); output_fputs(fp, " = "); } output_fputs(fp, uconf_lock_wait_preference_s[this]); if (name) output_fputs(fp, ";\n"); } static int uconf_lock_wait_preference_parse _((string_ty *)); static int uconf_lock_wait_preference_parse(name) string_ty *name; { int j; slow_to_fast(uconf_lock_wait_preference_s, uconf_lock_wait_preference_f, SIZEOF(uconf_lock_wait_preference_s)); for (j = 0; j < SIZEOF(uconf_lock_wait_preference_f); ++j) { if (str_equal(name, uconf_lock_wait_preference_f[j])) return j; } return -1; } static string_ty *uconf_lock_wait_preference_fuzzy _((string_ty *)); static string_ty * uconf_lock_wait_preference_fuzzy(name) string_ty *name; { return generic_enum_fuzzy ( name, uconf_lock_wait_preference_f, SIZEOF(uconf_lock_wait_preference_f) ); } static struct rpt_value_ty *uconf_lock_wait_preference_convert _((void *)); static struct rpt_value_ty * uconf_lock_wait_preference_convert(this) void *this; { if (!uconf_lock_wait_preference_f[0]) slow_to_fast(uconf_lock_wait_preference_s, uconf_lock_wait_preference_f, SIZEOF(uconf_lock_wait_preference_s)); return generic_enum_convert ( this, uconf_lock_wait_preference_f, SIZEOF(uconf_lock_wait_preference_f) ); } type_ty uconf_lock_wait_preference_type = { "uconf_lock_wait_preference", 0, /* alloc */ 0, /* free */ uconf_lock_wait_preference_parse, 0, /* list_parse */ 0, /* struct_parse */ uconf_lock_wait_preference_fuzzy, uconf_lock_wait_preference_convert, generic_enum_is_set, }; static char *uconf_symbolic_link_preference_s[] = { "verify", "assume", }; static string_ty *uconf_symbolic_link_preference_f[SIZEOF(uconf_symbolic_link_preference_s)]; char * uconf_symbolic_link_preference_ename(this) uconf_symbolic_link_preference_ty this; { static char buffer[20]; if ((int)this >= 0 && (int)this < 2) return uconf_symbolic_link_preference_s[this]; sprintf(buffer, "%d", (int)this); return buffer; } void uconf_symbolic_link_preference_write(fp, name, this) output_ty *fp; const char *name; uconf_symbolic_link_preference_ty this; { if (name) { if (this == 0 && type_enum_option_query()) return; output_fputs(fp, name); output_fputs(fp, " = "); } output_fputs(fp, uconf_symbolic_link_preference_s[this]); if (name) output_fputs(fp, ";\n"); } static int uconf_symbolic_link_preference_parse _((string_ty *)); static int uconf_symbolic_link_preference_parse(name) string_ty *name; { int j; slow_to_fast(uconf_symbolic_link_preference_s, uconf_symbolic_link_preference_f, SIZEOF(uconf_symbolic_link_preference_s)); for (j = 0; j < SIZEOF(uconf_symbolic_link_preference_f); ++j) { if (str_equal(name, uconf_symbolic_link_preference_f[j])) return j; } return -1; } static string_ty *uconf_symbolic_link_preference_fuzzy _((string_ty *)); static string_ty * uconf_symbolic_link_preference_fuzzy(name) string_ty *name; { return generic_enum_fuzzy ( name, uconf_symbolic_link_preference_f, SIZEOF(uconf_symbolic_link_preference_f) ); } static struct rpt_value_ty *uconf_symbolic_link_preference_convert _((void *)); static struct rpt_value_ty * uconf_symbolic_link_preference_convert(this) void *this; { if (!uconf_symbolic_link_preference_f[0]) slow_to_fast(uconf_symbolic_link_preference_s, uconf_symbolic_link_preference_f, SIZEOF(uconf_symbolic_link_preference_s)); return generic_enum_convert ( this, uconf_symbolic_link_preference_f, SIZEOF(uconf_symbolic_link_preference_f) ); } type_ty uconf_symbolic_link_preference_type = { "uconf_symbolic_link_preference", 0, /* alloc */ 0, /* free */ uconf_symbolic_link_preference_parse, 0, /* list_parse */ 0, /* struct_parse */ uconf_symbolic_link_preference_fuzzy, uconf_symbolic_link_preference_convert, generic_enum_is_set, }; static char *uconf_relative_filename_preference_s[] = { "current", "base", }; static string_ty *uconf_relative_filename_preference_f[SIZEOF(uconf_relative_filename_preference_s)]; char * uconf_relative_filename_preference_ename(this) uconf_relative_filename_preference_ty this; { static char buffer[20]; if ((int)this >= 0 && (int)this < 2) return uconf_relative_filename_preference_s[this]; sprintf(buffer, "%d", (int)this); return buffer; } void uconf_relative_filename_preference_write(fp, name, this) output_ty *fp; const char *name; uconf_relative_filename_preference_ty this; { if (name) { if (this == 0 && type_enum_option_query()) return; output_fputs(fp, name); output_fputs(fp, " = "); } output_fputs(fp, uconf_relative_filename_preference_s[this]); if (name) output_fputs(fp, ";\n"); } static int uconf_relative_filename_preference_parse _((string_ty *)); static int uconf_relative_filename_preference_parse(name) string_ty *name; { int j; slow_to_fast(uconf_relative_filename_preference_s, uconf_relative_filename_preference_f, SIZEOF(uconf_relative_filename_preference_s)); for (j = 0; j < SIZEOF(uconf_relative_filename_preference_f); ++j) { if (str_equal(name, uconf_relative_filename_preference_f[j])) return j; } return -1; } static string_ty *uconf_relative_filename_preference_fuzzy _((string_ty *)); static string_ty * uconf_relative_filename_preference_fuzzy(name) string_ty *name; { return generic_enum_fuzzy ( name, uconf_relative_filename_preference_f, SIZEOF(uconf_relative_filename_preference_f) ); } static struct rpt_value_ty *uconf_relative_filename_preference_convert _((void *)); static struct rpt_value_ty * uconf_relative_filename_preference_convert(this) void *this; { if (!uconf_relative_filename_preference_f[0]) slow_to_fast(uconf_relative_filename_preference_s, uconf_relative_filename_preference_f, SIZEOF(uconf_relative_filename_preference_s)); return generic_enum_convert ( this, uconf_relative_filename_preference_f, SIZEOF(uconf_relative_filename_preference_f) ); } type_ty uconf_relative_filename_preference_type = { "uconf_relative_filename_preference", 0, /* alloc */ 0, /* free */ uconf_relative_filename_preference_parse, 0, /* list_parse */ 0, /* struct_parse */ uconf_relative_filename_preference_fuzzy, uconf_relative_filename_preference_convert, generic_enum_is_set, }; static char *uconf_whiteout_preference_s[] = { "always", "never", }; static string_ty *uconf_whiteout_preference_f[SIZEOF(uconf_whiteout_preference_s)]; char * uconf_whiteout_preference_ename(this) uconf_whiteout_preference_ty this; { static char buffer[20]; if ((int)this >= 0 && (int)this < 2) return uconf_whiteout_preference_s[this]; sprintf(buffer, "%d", (int)this); return buffer; } void uconf_whiteout_preference_write(fp, name, this) output_ty *fp; const char *name; uconf_whiteout_preference_ty this; { if (name) { if (this == 0 && type_enum_option_query()) return; output_fputs(fp, name); output_fputs(fp, " = "); } output_fputs(fp, uconf_whiteout_preference_s[this]); if (name) output_fputs(fp, ";\n"); } static int uconf_whiteout_preference_parse _((string_ty *)); static int uconf_whiteout_preference_parse(name) string_ty *name; { int j; slow_to_fast(uconf_whiteout_preference_s, uconf_whiteout_preference_f, SIZEOF(uconf_whiteout_preference_s)); for (j = 0; j < SIZEOF(uconf_whiteout_preference_f); ++j) { if (str_equal(name, uconf_whiteout_preference_f[j])) return j; } return -1; } static string_ty *uconf_whiteout_preference_fuzzy _((string_ty *)); static string_ty * uconf_whiteout_preference_fuzzy(name) string_ty *name; { return generic_enum_fuzzy ( name, uconf_whiteout_preference_f, SIZEOF(uconf_whiteout_preference_f) ); } static struct rpt_value_ty *uconf_whiteout_preference_convert _((void *)); static struct rpt_value_ty * uconf_whiteout_preference_convert(this) void *this; { if (!uconf_whiteout_preference_f[0]) slow_to_fast(uconf_whiteout_preference_s, uconf_whiteout_preference_f, SIZEOF(uconf_whiteout_preference_s)); return generic_enum_convert ( this, uconf_whiteout_preference_f, SIZEOF(uconf_whiteout_preference_f) ); } type_ty uconf_whiteout_preference_type = { "uconf_whiteout_preference", 0, /* alloc */ 0, /* free */ uconf_whiteout_preference_parse, 0, /* list_parse */ 0, /* struct_parse */ uconf_whiteout_preference_fuzzy, uconf_whiteout_preference_convert, generic_enum_is_set, }; void uconf_write(fp, this) output_ty *fp; uconf this; { if (!this) return; trace(("uconf_write(this = %08lX)\n{\n"/*}*/, this)); assert(((uconf)this)->reference_count > 0); trace(("rc = %d;\n", ((uconf)this)->reference_count)); string_write(fp, "default_project_name", this->default_project_name); integer_write(fp, "default_change_number", this->default_change_number); string_write(fp, "default_development_directory", this->default_development_directory); string_write(fp, "default_project_directory", this->default_project_directory); uconf_delete_file_preference_write(fp, "delete_file_preference", this->delete_file_preference); uconf_diff_preference_write(fp, "diff_preference", this->diff_preference); uconf_pager_preference_write(fp, "pager_preference", this->pager_preference); uconf_persevere_preference_write(fp, "persevere_preference", this->persevere_preference); uconf_log_file_preference_write(fp, "log_file_preference", this->log_file_preference); uconf_lock_wait_preference_write(fp, "lock_wait_preference", this->lock_wait_preference); uconf_symbolic_link_preference_write(fp, "symbolic_link_preference", this->symbolic_link_preference); uconf_relative_filename_preference_write(fp, "relative_filename_preference", this->relative_filename_preference); string_write(fp, "email_address", this->email_address); uconf_whiteout_preference_write(fp, "whiteout_preference", this->whiteout_preference); trace((/*{*/"}\n")); } static void *uconf_alloc _((void)); static void * uconf_alloc() { uconf this; trace(("uconf_alloc()\n{\n"/*}*/)); this = mem_alloc(sizeof(struct uconf)); this->reference_count = 1; this->mask = 0; this->default_project_name = 0; this->default_change_number = 0; this->default_development_directory = 0; this->default_project_directory = 0; this->delete_file_preference = 0; this->diff_preference = 0; this->pager_preference = 0; this->persevere_preference = 0; this->log_file_preference = 0; this->lock_wait_preference = 0; this->symbolic_link_preference = 0; this->relative_filename_preference = 0; this->email_address = 0; this->whiteout_preference = 0; trace(("return %08lX;\n", (long)this)); trace((/*{*/"}\n")); return this; } uconf uconf_copy(this) uconf this; { trace(("uconf_copy()\n{\n"/*}*/)); this->reference_count++; trace(("return %08lX;\n", (long)this)); trace((/*{*/"}\n")); return this; } static void uconf_free _((void *)); static void uconf_free(that) void *that; { uconf this = that; if (!this) return; this->reference_count--; assert(this->reference_count >= 0); if (this->reference_count > 0) return; trace(("uconf_free(this = %08lX)\n{\n"/*}*/, (long)this)); str_free(this->default_project_name); str_free(this->default_development_directory); str_free(this->default_project_directory); str_free(this->email_address); mem_free(this); trace((/*{*/"}\n")); } static type_table_ty uconf_table[] = { { "default_project_name", offsetof(struct uconf, default_project_name), &string_type, uconf_default_project_name_mask, }, { "default_change_number", offsetof(struct uconf, default_change_number), &integer_type, uconf_default_change_number_mask, }, { "default_development_directory", offsetof(struct uconf, default_development_directory), &string_type, uconf_default_development_directory_mask, }, { "default_project_directory", offsetof(struct uconf, default_project_directory), &string_type, uconf_default_project_directory_mask, }, { "delete_file_preference", offsetof(struct uconf, delete_file_preference), &uconf_delete_file_preference_type, uconf_delete_file_preference_mask, }, { "diff_preference", offsetof(struct uconf, diff_preference), &uconf_diff_preference_type, uconf_diff_preference_mask, }, { "pager_preference", offsetof(struct uconf, pager_preference), &uconf_pager_preference_type, uconf_pager_preference_mask, }, { "persevere_preference", offsetof(struct uconf, persevere_preference), &uconf_persevere_preference_type, uconf_persevere_preference_mask, }, { "log_file_preference", offsetof(struct uconf, log_file_preference), &uconf_log_file_preference_type, uconf_log_file_preference_mask, }, { "lock_wait_preference", offsetof(struct uconf, lock_wait_preference), &uconf_lock_wait_preference_type, uconf_lock_wait_preference_mask, }, { "symbolic_link_preference", offsetof(struct uconf, symbolic_link_preference), &uconf_symbolic_link_preference_type, uconf_symbolic_link_preference_mask, }, { "relative_filename_preference", offsetof(struct uconf, relative_filename_preference), &uconf_relative_filename_preference_type, uconf_relative_filename_preference_mask, }, { "email_address", offsetof(struct uconf, email_address), &string_type, uconf_email_address_mask, }, { "whiteout_preference", offsetof(struct uconf, whiteout_preference), &uconf_whiteout_preference_type, uconf_whiteout_preference_mask, }, }; static void *uconf_parse _((void *, string_ty *, type_ty **, unsigned long *)); static void * uconf_parse(this, name, type_pp, mask_p) void *this; string_ty *name; type_ty **type_pp; unsigned long *mask_p; { void *addr; trace(("uconf_parse(this = %08lX, name = %08lX, type_pp = %08lX)\n{\n"/*}*/, (long)this, (long)name, (long)type_pp)); assert(((uconf)this)->reference_count > 0); assert(sizeof(uconf) == sizeof(generic_struct_ty *)); addr = generic_struct_parse ( this, name, type_pp, mask_p, uconf_table, SIZEOF(uconf_table) ); trace((/*{*/"return %08lX;\n}\n", (long)addr)); return addr; } static string_ty *uconf_fuzzy _((string_ty *)); static string_ty * uconf_fuzzy(name) string_ty *name; { string_ty *result; trace(("uconf_fuzzy(name = %08lX)\n{\n"/*}*/, (long)name)); result = generic_struct_fuzzy ( name, uconf_table, SIZEOF(uconf_table) ); trace(("return %08lX;\n", (long)result)); trace((/*{*/"}\n")); return result; } static struct rpt_value_ty *uconf_convert _((void *)); static struct rpt_value_ty * uconf_convert(this) void *this; { struct rpt_value_ty *result; trace(("uconf_convert(name = %08lX)\n{\n"/*}*/, (long)this)); assert(((uconf)this)->reference_count > 0); result = generic_struct_convert ( this, uconf_table, SIZEOF(uconf_table) ); trace(("return %08lX;\n", (long)result)); trace((/*{*/"}\n")); return result; } type_ty uconf_type = { "uconf", uconf_alloc, uconf_free, 0, /* enum_parse */ 0, /* list_parse */ uconf_parse, uconf_fuzzy, uconf_convert, generic_struct_is_set, }; uconf uconf_read_file(filename) string_ty *filename; { uconf result; trace(("uconf_read_file(filename = \"%s\")\n{\n"/*}*/, (filename ? filename->str_text : ""))); os_become_must_be_active(); result = parse(filename, &uconf_type); trace(("return %08lX;\n", result)); trace((/*{*/"}\n")); return result; } void uconf_write_file(filename, value, compress) string_ty *filename; uconf value; int compress; { output_ty *fp; trace(("uconf_write_file(filename = \"%s\", value = %08lX)\n{\n"/*}*/, (filename ? filename->str_text : ""), (long)value)); if (filename) os_become_must_be_active(); if (compress) { fp = output_file_binary_open(filename); fp = output_gzip(fp); } else { fp = output_file_text_open(filename); } fp = output_indent(fp); io_comment_emit(fp); uconf_write(fp, value); type_enum_option_clear(); output_delete(fp); trace((/*{*/"}\n")); } void uconf__rpt_init() { trace(("uconf__rpt_init()\n{\n"/*}*/)); generic_enum__init(uconf_delete_file_preference_s, SIZEOF(uconf_delete_file_preference_s)); generic_enum__init(uconf_diff_preference_s, SIZEOF(uconf_diff_preference_s)); generic_enum__init(uconf_pager_preference_s, SIZEOF(uconf_pager_preference_s)); generic_enum__init(uconf_persevere_preference_s, SIZEOF(uconf_persevere_preference_s)); generic_enum__init(uconf_log_file_preference_s, SIZEOF(uconf_log_file_preference_s)); generic_enum__init(uconf_lock_wait_preference_s, SIZEOF(uconf_lock_wait_preference_s)); generic_enum__init(uconf_symbolic_link_preference_s, SIZEOF(uconf_symbolic_link_preference_s)); generic_enum__init(uconf_relative_filename_preference_s, SIZEOF(uconf_relative_filename_preference_s)); generic_enum__init(uconf_whiteout_preference_s, SIZEOF(uconf_whiteout_preference_s)); trace((/*{*/"}\n")); }