Add support for centos6 and Ubuntu quantal
[idzebra-moved-to-github.git] / index / kdump.c
index 70662b9..8fa5549 100644 (file)
@@ -1,8 +1,5 @@
-/* $Id: kdump.c,v 1.22 2002-08-02 19:26:55 adam Exp $
-   Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
-   Index Data Aps
-
-This file is part of the Zebra server.
+/* This file is part of the Zebra server.
+   Copyright (C) 1994-2011 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,18 +12,22 @@ 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 <config.h>
+#endif
 #include <stdio.h>
 #include <string.h>
 #include <assert.h>
+#include <stdlib.h>
 #ifdef WIN32
 #include <io.h>
-#else
+#endif
+#if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 #include <assert.h>
@@ -36,13 +37,19 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 
 char *prog;
 
+int main(int argc, char **argv)
+{
+    exit(0);
+}
 
+#if 0
+/* old kdumper.. must be updated to use new codec .. */
 int key_file_decode (FILE *f)
 {
     int c, d;
 
     c = getc (f);
-    switch (c & 192) 
+    switch (c & 192)
     {
     case 0:
         d = c;
@@ -59,6 +66,9 @@ int key_file_decode (FILE *f)
         d = (d << 8) + (getc (f) & 0xff);
         d = (d << 8) + (getc (f) & 0xff);
         break;
+    default:
+        d = 0;
+        assert (0);
     }
     return d;
 }
@@ -94,6 +104,7 @@ static int read_one (FILE *inf, char *name, char *key, struct it_key *prevk)
     return 1;
 }
 
+
 int main (int argc, char **argv)
 {
     int ret;
@@ -122,15 +133,15 @@ int main (int argc, char **argv)
         }
        else if (ret == 'c')
        {
-           if (!(res = res_open (arg, 0)))
+           if (!(res = res_open (arg, 0, 0)))
             {
-               logf(LOG_FATAL, "Failed to open resource file %s", arg);
+               yaz_log(YLOG_FATAL, "Failed to open resource file %s", arg);
                exit (1);
            }
        }
         else
         {
-            logf (LOG_FATAL, "Unknown option '-%s'", arg);
+            yaz_log (YLOG_FATAL, "Unknown option '-%s'", arg);
             exit (1);
         }
     }
@@ -140,11 +151,11 @@ int main (int argc, char **argv)
         exit (1);
     }
     if (!res)
-        res = res_open ("zebra.cfg", 0);
+        res = res_open ("zebra.cfg", 0, 0);
     zm = zebra_maps_open (res, 0);
     if (!(inf = fopen (key_fname, "r")))
     {
-        logf (LOG_FATAL|LOG_ERRNO, "fopen %s", key_fname);
+        yaz_log (YLOG_FATAL|YLOG_ERRNO, "fopen %s", key_fname);
         exit (1);
     }
     printf ("t  rg op  sysno seqno txt\n");
@@ -161,7 +172,7 @@ int main (int argc, char **argv)
         op = key_info[0];
         memcpy (&k, 1+key_info, sizeof(k));
 
-       from += 2;  
+       from += 2;
        while (*from)
        {
            const char *res = zebra_maps_output (zm, reg_type, &from);
@@ -178,9 +189,18 @@ int main (int argc, char **argv)
     zebra_maps_close (zm);
     if (fclose (inf))
     {
-        logf (LOG_FATAL|LOG_ERRNO, "fclose %s", key_fname);
+        yaz_log (YLOG_FATAL|YLOG_ERRNO, "fclose %s", key_fname);
         exit (1);
     }
-    
     exit (0);
 }
+#endif
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+