X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=dict%2Fdicttest.c;h=15c71a15cfe0579eef6cdb92f24660fe1f65109a;hp=053d58637a80f2f54506bd8ac00443f75b8ec6c5;hb=250de4ed23a44f5eb3552db317eef0d0fbe3265c;hpb=49d0ee122a9f86ec2967b577dcc297c501785edd diff --git a/dict/dicttest.c b/dict/dicttest.c index 053d586..15c71a1 100644 --- a/dict/dicttest.c +++ b/dict/dicttest.c @@ -1,8 +1,5 @@ -/* $Id: dicttest.c,v 1.34 2005-04-15 10:47:48 adam Exp $ - Copyright (C) 1995-2005 - Index Data ApS - -This file is part of the Zebra server. +/* This file is part of the Zebra server. + Copyright (C) 2004-2013 Index Data Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -15,11 +12,14 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with Zebra; see the file LICENSE.zebra. If not, write to the -Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#if HAVE_CONFIG_H +#include +#endif #include #include #include @@ -71,7 +71,7 @@ int main (int argc, char **argv) int no_of_new = 0, no_of_same = 0, no_of_change = 0; int no_of_hits = 0, no_of_misses = 0, no_not_found = 0, no_of_deleted = 0; int max_pos; - + prog = argv[0]; if (argc < 2) { @@ -160,12 +160,14 @@ int main (int argc, char **argv) yaz_log (YLOG_FATAL, "no config and/or dictionary specified"); exit (1); } - my_resource = res_open (config, 0, 0); + my_resource = res_open(0, 0); if (!my_resource) { yaz_log (YLOG_FATAL, "cannot open resource `%s'", config); exit (1); } + res_read_file(my_resource, config); + bfs = bfs_create (res_get(my_resource, "register"), 0); if (!bfs) { @@ -191,7 +193,7 @@ int main (int argc, char **argv) yaz_log (YLOG_FATAL|YLOG_ERRNO, "cannot open %s", inputfile); exit (1); } - + while (fgets (ipf_buf, 1023, ipf)) { char *ipf_ptr = ipf_buf; @@ -283,7 +285,7 @@ int main (int argc, char **argv) } if (rw) { - yaz_log (YLOG_LOG, "Iterations.... %d", no_of_iterations); + yaz_log (YLOG_LOG, "Iterations.... %d", no_of_iterations); if (do_delete) { yaz_log (YLOG_LOG, "No of deleted. %d", no_of_deleted); @@ -304,7 +306,7 @@ int main (int argc, char **argv) if (scan_the_thing) { char term_dict[1024]; - + int before = 1000000; int after = 1000000; yaz_log (YLOG_LOG, "dict_scan"); @@ -317,3 +319,12 @@ int main (int argc, char **argv) res_close (my_resource); return 0; } +/* + * Local variables: + * c-basic-offset: 4 + * c-file-style: "Stroustrup" + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +