-/* $Id: zebraapi.c,v 1.76 2002-10-30 14:35:09 adam Exp $
+/* $Id: zebraapi.c,v 1.81 2003-01-15 07:26:40 oleg Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
reg->isamb = 0;
reg->zei = 0;
reg->matchDict = 0;
+ reg->key_file_no = 0;
zebraRankInstall (reg, rank1_class);
}
sp = &(*sp)->next;
}
-// if (!zs->sessions && zs->stop_flag)
-// zebra_register_deactivate(zs);
zebra_mutex_cond_unlock (&zs->session_lock);
xfree (zh->reg_name);
xfree (zh);
return ;
no--;
for (i = 0; i<p->num_bases; i++)
- if (p->basenames[i] && !strcmp (p->basenames[i], fromdb))
+ if (p->basenames[i] && !STRCASECMP (p->basenames[i], fromdb))
{
p->basenames[i] = 0;
for (i = 0; i < no; i++)
zebra_register_close (zh->service, zh->reg);
zh->reg = 0;
-
yaz_log (LOG_LOG, "Records: %7d i/u/d %d/%d/%d",
zh->records_processed, zh->records_inserted,
zh->records_updated, zh->records_deleted);
int zebra_record_encoding (ZebraHandle zh, const char *encoding)
{
xfree (zh->record_encoding);
+
+ /*
+ * Fixme!
+ */
+
+ if (zh->iconv_to_utf8 != 0)
+ yaz_iconv_close(zh->iconv_to_utf8);
+ if (zh->iconv_from_utf8 != 0)
+ yaz_iconv_close(zh->iconv_from_utf8);
+
zh->record_encoding = xstrdup (encoding);
+
+ logf(LOG_DEBUG, "Reset record encoding: %s", encoding);
+
+ zh->iconv_to_utf8 =
+ yaz_iconv_open ("UTF-8", encoding);
+ if (zh->iconv_to_utf8 == 0)
+ yaz_log (LOG_WARN, "iconv: %s to UTF-8 unsupported", encoding);
+ zh->iconv_from_utf8 =
+ yaz_iconv_open (encoding, "UTF-8");
+ if (zh->iconv_to_utf8 == 0)
+ yaz_log (LOG_WARN, "iconv: UTF-8 to %s unsupported", encoding);
+
return 0;
}