-/* $Id: t1.c,v 1.5 2004-06-14 21:43:44 adam Exp $
+/* $Id: t1.c,v 1.6 2004-06-14 23:43:32 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, 0, 0);
+}
+
int main(int argc, char **argv)
{
ZebraService zs;
yaz_log_init_file("t1.log");
nmem_init();
- zs = zebra_start("zebra.cfg", 0, 0);
+ zs = start_service();
zh = zebra_open (zs);
zebra_close (zh);
-/* $Id: t2.c,v 1.9 2004-06-14 21:43:44 adam Exp $
+/* $Id: t2.c,v 1.10 2004-06-14 23:43:32 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
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, 0, 0);
+}
+
int main(int argc, char **argv)
{
int exit_code = 0;
nmem_init ();
- zs = zebra_start("zebra.cfg", 0, 0);
+ zs = start_service();
zh = zebra_open (zs);
zebra_select_database(zh, "Default");
zebra_init(zh);
-/* $Id: t3.c,v 1.6 2004-06-14 21:43:44 adam Exp $
+/* $Id: t3.c,v 1.7 2004-06-14 23:43:32 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
#include <yaz/pquery.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, 0, 0);
+}
+
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);
-/* $Id: t4.c,v 1.6 2004-06-14 21:43:44 adam Exp $
+/* $Id: t4.c,v 1.7 2004-06-14 23:43:32 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
#include <yaz/pquery.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, 0, 0);
+}
+
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_init(zh);
zebra_select_database(zh, "Default");
zebra_close(zh);
zebra_stop(zs);
- zs = zebra_start("zebra.cfg", 0, 0);
+ zs = start_service();
zh = zebra_open (zs);
zebra_select_database(zh, "Default");
-/* $Id: t5.c,v 1.1 2004-06-14 21:43:44 adam Exp $
+/* $Id: t5.c,v 1.2 2004-06-14 23:43:32 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
#include <yaz/pquery.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, 0, 0);
+}
+
static void expect(ZebraHandle zh, const char *pqf, int hits_expect,
int *exit_code)
{
nmem_init ();
- zs = zebra_start("zebra.cfg", 0, 0);
+ zs = start_service();
zh = zebra_open (zs);
zebra_select_database(zh, "Default");
zebra_init(zh);
-# $Id: zebra.cfg,v 1.1 2004-06-14 21:43:44 adam Exp $
-profilepath: ../../tab
+# $Id: zebra.cfg,v 1.2 2004-06-14 23:43:32 adam Exp $
+profilepath: ../../tab:${srcdir}/../../tab
attset: bib1.att
recordType: grs.sgml
-isam: b
+isam: b