-/* $Id: t1.c,v 1.4 2004-01-22 11:27:22 adam Exp $
+/* $Id: t1.c,v 1.7 2004-07-28 08:15:47 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
02111-1307, USA.
*/
+#include <stdlib.h>
#include <yaz/log.h>
#include <zebraapi.h>
+/* read zebra.cfg from env var srcdir if it exists; otherwise current dir */
+static ZebraService start_service()
+{
+ char cfg[256];
+ char *srcdir = getenv("srcdir");
+ sprintf(cfg, "%.200s%szebra.cfg", srcdir ? srcdir : "", srcdir ? "/" : "");
+ return zebra_start(cfg);
+}
+
int main(int argc, char **argv)
{
ZebraService zs;
yaz_log_init_file("t1.log");
nmem_init();
- zs = zebra_start("t1.cfg", 0, 0);
+ zs = start_service();
zh = zebra_open (zs);
zebra_close (zh);