+// Initialize CCL map for a target
+static CCL_bibset prepare_cclmap(struct client *cl)
+{
+ struct session_database *sdb = cl->database;
+ struct setting *s;
+ CCL_bibset res;
+
+ if (!sdb->settings)
+ return 0;
+ res = ccl_qual_mk();
+ for (s = sdb->settings[PZ_CCLMAP]; s; s = s->next)
+ {
+ char *p = strchr(s->name + 3, ':');
+ if (!p)
+ {
+ yaz_log(YLOG_WARN, "Malformed cclmap name: %s", s->name);
+ ccl_qual_rm(&res);
+ return 0;
+ }
+ p++;
+ ccl_qual_fitem(res, s->value, p);
+ }
+ return res;
+}
+