Bump year. Change Aps->ApS
[idzebra-moved-to-github.git] / test / api / safari1.c
1 /* $Id: safari1.c,v 1.3 2005-01-15 19:38:35 adam Exp $
2    Copyright (C) 1995-2005
3    Index Data ApS
4
5 This file is part of the Zebra server.
6
7 Zebra is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
11
12 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15 for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with Zebra; see the file LICENSE.zebra.  If not, write to the
19 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA.
21 */
22
23 /* safari1 - insert a few Safari records */
24
25 #include "testlib.h"
26
27 const char *myrec[] = {
28     "1234\n"  /* first record */
29     "00024338 125060 1 any the\n"
30     "00024338 125060 2 any art\n"
31     "00024338 125060 3 any of\n",
32
33     "5678\n"  /* other record */
34     "00024339 125060 1 any den\n"
35     "00024339 125060 2 any gamle\n"
36     "00024339 125060 3 any mand\n",
37
38     "5678\n"  /* same record identifier as before .. */
39     "00024339 125060 1 any the\n"
40     "00024339 125060 2 any gamle\n"
41     "00024339 125060 3 any mand\n",
42
43         0};
44         
45 int main(int argc, char **argv)
46 {
47     zint ids[2];
48     ZebraService zs = start_up("safari.cfg", argc, argv);
49     
50     ZebraHandle zh = zebra_open(zs);
51
52     init_data(zh, myrec);
53     do_query(__LINE__, zh, "@attr 1=1016 the", 1);
54     do_query(__LINE__, zh, "@attr 1=1016 {the art}", 1);
55     do_query(__LINE__, zh, "@attr 1=1016 {den gamle}", 1);
56     do_query(__LINE__, zh, "@attr 1=1016 {the of}", 0);
57
58     ids[0] = 24338;
59     meta_query(__LINE__, zh, "@attr 1=1016 the", 1, ids);
60         
61     return close_down(zh, zs, 0);
62 }