-/* $Id: yaz-proxy-main.cpp,v 1.16 2005-06-25 15:58:33 adam Exp $
- Copyright (c) 1998-2005, Index Data.
+/* $Id: yaz-proxy-main.cpp,v 1.20 2006-07-06 11:50:26 adam Exp $
+ Copyright (c) 1998-2006, Index Data.
-This file is part of the yaz-proxy.
+This file is part of the yazproxy.
YAZ proxy 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
#include <yaz/log.h>
#include <yaz/options.h>
-#include <yaz++/socket-manager.h>
-#include <yaz++/pdu-assoc.h>
+#include <yazpp/socket-manager.h>
+#include <yazpp/pdu-assoc.h>
#include <yazproxy/proxy.h>
-#if HAVE_XSLT
+#if YAZ_HAVE_XSLT
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxslt/xsltutils.h>
void usage(char *prog)
{
- fprintf (stderr, "%s: [-c config] [-l log] [-a log] [-v level] [-t target] "
- "[-u uid] [-p pidfile] @:port\n", prog);
+ fprintf (stderr, "%s: [-a log] [-c config]\n"
+ " [-i sec] [-l log] [-m num] [-n num] [-p pidfile]"
+ " [-t target] [-T sec] [-u uid]\n"
+ " [-v level] [-X] @:port\n", prog);
exit (1);
}
}
addr = arg;
break;
+ case 'a':
+ proxy->set_APDU_log(arg);
+ break;
case 'c':
err = proxy->set_config(arg);
if (err == -2)
exit(1);
}
break;
- case 'a':
- proxy->set_APDU_log(arg);
- break;
- case 't':
- proxy->set_default_target(arg);
- break;
- case 'o':
- proxy->option("optimize", arg);
- break;
- case 'v':
- yaz_log_init_level (yaz_log_mask_str(arg));
+ case 'i':
+ proxy->set_client_idletime(atoi(arg));
break;
case 'l':
yaz_log_init_file (arg);
case 'm':
proxy->set_max_clients(atoi(arg));
break;
- case 'i':
- proxy->set_client_idletime(atoi(arg));
- break;
- case 'T':
- proxy->set_target_idletime(atoi(arg));
- break;
case 'n':
no_limit_files = atoi(arg);
break;
- case 'X':
- proxy->set_debug_mode(1);
- debug = 1;
+ case 'o':
+ proxy->option("optimize", arg);
break;
case 'p':
if (!pid_fname)
pid_fname = xstrdup(arg);
break;
+ case 't':
+ proxy->set_default_target(arg);
+ break;
+ case 'T':
+ proxy->set_target_idletime(atoi(arg));
+ break;
case 'u':
if (!uid)
uid = xstrdup(arg);
break;
+ case 'v':
+ yaz_log_init_level (yaz_log_mask_str(arg));
+ break;
+ case 'X':
+ proxy->set_debug_mode(1);
+ debug = 1;
+ break;
default:
usage(prog);
return 1;
static_yaz_proxy->reconfig();
}
-#if HAVE_XSLT
+#if YAZ_HAVE_XSLT
static void proxy_xml_error_handler(void *ctx, const char *fmt, ...)
{
char buf[1024];
signal(SIGHUP, sighup_handler);
#endif
-#if HAVE_XSLT
+#if YAZ_HAVE_XSLT
xmlSetGenericErrorFunc((void *) "XML", proxy_xml_error_handler);
xsltSetGenericErrorFunc((void *) "XSLT", proxy_xml_error_handler);
#endif
int main(int argc, char **argv)
{
-#if HAVE_XSLT
+#if YAZ_HAVE_XSLT
xmlInitMemory();
LIBXML_TEST_VERSION