-/* $Id: t3.c,v 1.6 2004-06-14 21:43:44 adam Exp $
+/* $Id: t3.c,v 1.9 2004-08-25 09:23:39 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
#include <yaz/log.h>
#include <yaz/pquery.h>
-#include <zebraapi.h>
+#include <idzebra/api.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)
{
int i;
nmem_init ();
- zs = zebra_start("zebra.cfg", 0, 0);
+ zs = start_service();
zh = zebra_open (zs);
zebra_select_database(zh, "Default");
zebra_init(zh);