- read_settings(path, prepare_dictionary);
- read_settings(path, update_databases);
+ int i;
+
+ for (i = 0; i < service->num_metadata; i++)
+ {
+ struct setting set;
+ struct conf_metadata *md = &service->metadata[i];
+
+ if (md->setting == Metadata_setting_no)
+ continue;
+
+ set.precedence = 0;
+ set.target = "";
+ set.name = md->name;
+ set.value = "";
+ set.next = 0;
+ prepare_dictionary(service, &set);
+ }
+}
+
+static void prepare_target_dictionary(struct conf_service *service,
+ struct setting *set)
+{
+ struct setting_dictionary *dictionary = service->dictionary;
+
+ int i;
+ char *p;
+
+ // If target address is not wildcard, add the database
+ if (*set->target && !zurl_wildcard(set->target))
+ find_database(set->target, 0, service);
+
+ // Determine if we already have a dictionary entry
+ if (!strncmp(set->name, "pz:", 3) && (p = strchr(set->name + 3, ':')))
+ *(p + 1) = '\0';
+ for (i = 0; i < dictionary->num; i++)
+ if (!strcmp(dictionary->dict[i], set->name))
+ return;
+ yaz_log(YLOG_WARN, "Setting '%s' not configured as metadata", set->name);