-// Initialize CCL map for a target
-// Note: This approach ignores user-specific CCL maps, for which I
-// don't presently see any application.
-static void prepare_cclmap(void *ignore, struct database *db)
-{
- struct setting *s;
-
- if (!db->settings)
- return;
- db->ccl_map = ccl_qual_mk();
- for (s = db->settings[PZ_CCLMAP]; s; s = s->next)
- if (!*s->user)
- {
- char *p = strchr(s->name + 3, ':');
- if (!p)
- {
- yaz_log(YLOG_FATAL, "Malformed cclmap name: %s", s->name);
- exit(1);
- }
- p++;
- ccl_qual_fitem(db->ccl_map, s->value, p);
- }
-}
-
-// Initialize YAZ Map structures for MARC-based targets
-static void prepare_yazmarc(void *ignore, struct database *db)
-{
- struct setting *s;
-
- if (!db->settings)
- return;
- for (s = db->settings[PZ_NATIVESYNTAX]; s; s = s->next)
- if (!*s->user && !strcmp(s->value, "iso2709"))
- {
- char *encoding = "marc-8s";
- yaz_iconv_t cm;
-
- db->yaz_marc = yaz_marc_create();
- yaz_marc_subfield_str(db->yaz_marc, "\t");
- // See if a native encoding is specified
- for (s = db->settings[PZ_ENCODING]; s; s = s->next)
- if (!*s->user)
- {
- encoding = s->value;
- break;
- }
- if (!(cm = yaz_iconv_open("utf-8", encoding)))
- {
- yaz_log(YLOG_FATAL, "Unable to map from %s to UTF-8", encoding);
- exit(1);
- }
- yaz_marc_iconv(db->yaz_marc, cm);
- break;
- }
-}
-
-// Prepare XSLT stylesheets for record normalization
-static void prepare_map(void *ignore, struct database *db)