Automaked pazpar2. Bug #799. Preprocessor defines are put in cconfig.h and
[pazpar2-moved-to-github.git] / src / pazpar2.c
index fa2d51f..18d0f0a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: pazpar2.c,v 1.16 2007-01-06 03:02:47 quinn Exp $ */;
+/* $Id: pazpar2.c,v 1.18 2007-01-08 12:43:41 adam Exp $ */;
 
 #include <stdlib.h>
 #include <stdio.h>
 #include <yaz/yaz-util.h>
 #include <yaz/nmem.h>
 
+#if HAVE_CONFIG_H
+#include "cconfig.h"
+#endif
+
 #define USE_TIMING 0
 #if USE_TIMING
 #include <yaz/timing.h>
 
 #include "pazpar2.h"
 #include "eventl.h"
-#include "command.h"
 #include "http.h"
 #include "termlists.h"
 #include "reclists.h"
 #include "relevance.h"
 #include "config.h"
 
-#define PAZPAR2_VERSION "0.1"
 #define MAX_CHUNK 15
 
 static void client_fatal(struct client *cl);
@@ -71,7 +73,7 @@ struct parameters global_parameters =
     30,
     "81",
     "Index Data PazPar2 (MasterKey)",
-    PAZPAR2_VERSION,
+    VERSION,
     600, // 10 minutes
     60,
     100,
@@ -1275,17 +1277,13 @@ int main(int argc, char **argv)
 
     yaz_log_init(YLOG_DEFAULT_LEVEL, "pazpar2", 0);
 
-    while ((ret = options("f:x:c:h:p:C:s:d", argv, argc, &arg)) != -2)
+    while ((ret = options("f:x:h:p:C:s:d", argv, argc, &arg)) != -2)
     {
        switch (ret) {
             case 'f':
                 if (!read_config(arg))
                     exit(1);
                 break;
-           case 'c':
-               command_init(atoi(arg));
-                setport++;
-               break;
             case 'h':
                 http_init(arg);
                 setport++;
@@ -1306,7 +1304,6 @@ int main(int argc, char **argv)
                fprintf(stderr, "Usage: pazpar2\n"
                         "    -f configfile\n"
                         "    -h [host:]port          (REST protocol listener)\n"
-                        "    -c cmdport              (telnet-style)\n"
                         "    -C cclconfig\n"
                         "    -s simpletargetfile\n"
                         "    -p hostname[:portno]    (HTTP proxy)\n");
@@ -1316,7 +1313,7 @@ int main(int argc, char **argv)
 
     if (!setport)
     {
-        fprintf(stderr, "Set command port with -h or -c\n");
+        fprintf(stderr, "Set command port with -h\n");
         exit(1);
     }