1 /* $Id: pazpar2.c,v 1.82 2007-04-22 15:07:10 adam Exp $
2 Copyright (c) 2006-2007, Index Data.
4 This file is part of Pazpar2.
6 Pazpar2 is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
11 Pazpar2 is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with Pazpar2; see the file LICENSE. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
33 int main(int argc, char **argv)
38 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
39 yaz_log(YLOG_WARN|YLOG_ERRNO, "signal");
41 yaz_log_init(YLOG_DEFAULT_LEVEL, "pazpar2", 0);
43 while ((ret = options("t:f:x:h:p:z:s:d", argv, argc, &arg)) != -2)
47 if (!read_config(arg))
51 strcpy(global_parameters.listener_override, arg);
54 strcpy(global_parameters.proxy_override, arg);
57 strcpy(global_parameters.zproxy_override, arg);
60 strcpy(global_parameters.settings_path_override, arg);
63 global_parameters.dump_records = 1;
66 fprintf(stderr, "Usage: pazpar2\n"
68 " -h [host:]port (REST protocol listener)\n"
70 " -s simpletargetfile\n"
71 " -p hostname[:portno] (HTTP proxy)\n"
72 " -z hostname[:portno] (Z39.50 proxy)\n"
73 " -d (show internal records)\n");
80 yaz_log(YLOG_FATAL, "Load config with -f");
83 global_parameters.server = config->servers;
85 start_http_listener();
90 if (*global_parameters.settings_path_override)
91 settings_read(global_parameters.settings_path_override);
92 else if (global_parameters.server->settings)
93 settings_read(global_parameters.server->settings);
95 yaz_log(YLOG_WARN, "No settings-directory specified");
96 global_parameters.odr_in = odr_createmem(ODR_DECODE);
97 global_parameters.odr_out = odr_createmem(ODR_ENCODE);
107 * indent-tabs-mode: nil
109 * vim: shiftwidth=4 tabstop=8 expandtab