int xmdinit2(const char *project) { struct p2_options *p2opt = NULL; ce_xmd_pool = npool_init(); p2opt = p2_load(project, state, ce_xmd_pool); if (!xmd_fields) xmd_fields = (p2opt->catalog_fields ? p2opt->catalog_fields : default_fields); if (!xmd_widths) xmd_widths = (p2opt->catalog_widths ? p2opt->catalog_widths : default_widths); if (!xmd_labels) xmd_labels = (p2opt->catalog_labels ? p2opt->catalog_labels : default_labels); nfields = count_entries(xmd_fields, "catalog-fields"); nwidths = count_entries(xmd_widths, "catalog-widths"); nlabels = count_entries(xmd_labels, "catalog-widths"); if (nfields != nwidths) { fprintf(stderr, "ce_xmd2: %s/00lib/config.xml: `%s-catalog-fields' and `%s-catalog-widths' should have same number of entries\n", project, state, state); return 1; } if (xmd_labels && nfields != nlabels) { fprintf(stderr, "ce_xmd2: %s/00lib/config.xml: `%s-catalog-fields' and `%s-catalog-labels' should have same number of entries\n", project, state, state); return 1; } field_specs = malloc((nfields+1)*sizeof(const char *)); width_specs = malloc((nwidths+1)*sizeof(const char *)); label_specs = malloc((nlabels+1)*sizeof(const char *)); set_entries(field_specs, xmd_fields); set_entries(width_specs, xmd_widths); if (xmd_labels) set_entries(label_specs, xmd_labels); set_field_lists(field_specs); return 0; }
CaseInsensitiveHashTable<T>::CaseInsensitiveHashTable(const EntryVec& entries) { set_entries(entries); }