X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fapi%2Ft3.c;h=864cad316e52aa06a2f39ec40e75ef982af3eed4;hb=2fefff35eeb40ba802bb3ee11674a6037b84659c;hp=b5b2c8d297a494c3a1d33928b677acf697848616;hpb=91cd9a822677f6ccaac0a5445d1781d10180460f;p=idzebra-moved-to-github.git diff --git a/test/api/t3.c b/test/api/t3.c index b5b2c8d..864cad3 100644 --- a/test/api/t3.c +++ b/test/api/t3.c @@ -1,4 +1,4 @@ -/* $Id: t3.c,v 1.6 2004-06-14 21:43:44 adam Exp $ +/* $Id: t3.c,v 1.10 2004-10-15 10:07:34 heikki Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -22,8 +22,17 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #include -#include +#include +/* 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; @@ -35,10 +44,11 @@ int main(int argc, char **argv) "\n"; yaz_log_init_file("t3.log"); + yaz_log_init_level(LOG_ALL); nmem_init (); - zs = zebra_start("zebra.cfg", 0, 0); + zs = start_service(); zh = zebra_open (zs); zebra_select_database(zh, "Default"); zebra_init(zh);