X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=index%2Fapitest.c;h=c9eac7f48d8687a8538f50ab748dde1d08e477da;hp=30470440582f5d9ebf4804c4e29e6a9ad518a63d;hb=d9c86c0fb916851a641fd17bda58a1fa3045d95e;hpb=a4672c6ad0168d8c39b6806e33b90cba4151ac0d diff --git a/index/apitest.c b/index/apitest.c index 3047044..c9eac7f 100644 --- a/index/apitest.c +++ b/index/apitest.c @@ -1,3 +1,9 @@ +/* + * Copyright (C) 1995-2000, Index Data + * All rights reserved. + * + * $Header: /home/cvsroot/idis/index/Attic/apitest.c,v 1.10 2000-09-06 08:59:36 adam Exp $ + */ #include @@ -100,7 +106,10 @@ int main (int argc, char **argv) various functions */ ODR odr_input, odr_output; - /* zh is our Zebra Handle - describes the server as a whole */ + /* zs is our Zebra Service - decribes whole server */ + ZebraService zs; + + /* zh is our Zebra Handle - describes database session */ ZebraHandle zh; /* the database we specify in our example */ @@ -114,19 +123,19 @@ int main (int argc, char **argv) odr_input = odr_createmem (ODR_DECODE); odr_output = odr_createmem (ODR_ENCODE); - /* open Zebra */ - zh = zebra_open ("zebra.cfg"); + zs = zebra_start ("zebra.cfg"); + if (!zs) + { + printf ("zebra_start failed; missing zebra.cfg?\n"); + exit (1); + } + /* open Zebra */ + zh = zebra_open (zs); if (!zh) { - printf ("Couldn't init zebra\n"); + printf ("zebras_open failed\n"); exit (1); } - - /* This call controls the logging facility in YAZ/Zebra */ -#if 0 - log_init(LOG_ALL, "", "out.log"); -#endif - /* Each argument to main will be a query */ for (argno = 1; argno < argc; argno++) { @@ -257,5 +266,6 @@ int main (int argc, char **argv) odr_destroy (odr_input); odr_destroy (odr_output); zebra_close (zh); + zebra_stop (zs); return 0; }