Put local variables footer in all c, h files.
[idzebra-moved-to-github.git] / dict / lookgrep.c
index 4d1c3d0..2767ba8 100644 (file)
@@ -1,6 +1,6 @@
-/* $Id: lookgrep.c,v 1.26 2002-09-18 21:01:15 adam Exp $
-   Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
-   Index Data Aps
+/* $Id: lookgrep.c,v 1.31 2006-05-10 08:13:18 adam Exp $
+   Copyright (C) 1995-2005
+   Index Data ApS
 
 This file is part of the Zebra server.
 
@@ -28,12 +28,22 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include <assert.h>
 
 #include <dfa.h>
-#include <dict.h>
+#include "dict-p.h"
 
 typedef unsigned MatchWord;
 #define WORD_BITS 32
 #define MAX_LENGTH 1024
 
+/* This code is based 
+ * Sun Wu and Udi Manber: Fast Text Searching Allowing Errors.
+ *      Communications of the ACM, pp. 83-91, Vol. 35, No. 10, Oct. 1992, USA.
+ *      PostScript version of the paper in its submitted form: agrep1.ps)
+ *      recommended reading to understand AGREP ! 
+ *
+ * http://www.tgries.de/agrep/#AGREP1PS
+ * http://www.tgries.de/agrep/doc/agrep1ps.zip
+ */
+
 typedef struct {
   int n;                 /* no of MatchWord needed */
   int range;             /* max no. of errors */
@@ -373,10 +383,10 @@ int dict_lookup_grep (Dict dict, const char *pattern, int range, void *client,
     dfa_verbose = 1;
 #endif
 
-    logf (LOG_DEBUG, "dict_lookup_grep range=%d", range);
+    yaz_log (YLOG_DEBUG, "dict_lookup_grep range=%d", range);
     for (i = 0; pattern[i]; i++)
     {
-       logf (LOG_DEBUG, " %3d  %c", pattern[i],
+       yaz_log (YLOG_DEBUG, " %3d  %c", pattern[i],
              (pattern[i] > ' ' && pattern[i] < 127) ? pattern[i] : '?');
     }
    
@@ -385,7 +395,7 @@ int dict_lookup_grep (Dict dict, const char *pattern, int range, void *client,
     i = dfa_parse (dfa, &this_pattern);
     if (i || *this_pattern)
     {
-        yaz_log (LOG_WARN, "dfa_parse fail=%d", i);
+        yaz_log (YLOG_WARN, "dfa_parse fail=%d", i);
         dfa_delete (&dfa);
         return -1;
     }
@@ -418,7 +428,7 @@ int dict_lookup_grep (Dict dict, const char *pattern, int range, void *client,
                        dfa, max_pos, init_pos);
     else
         i = 0;
-    logf (LOG_DEBUG, "max_pos = %d", *max_pos);
+    yaz_log (YLOG_DEBUG, "max_pos = %d", *max_pos);
     dfa_delete (&dfa);
     xfree (Rj);
     rm_MatchContext (&mc);
@@ -431,3 +441,11 @@ void dict_grep_cmap (Dict dict, void *vp,
     dict->grep_cmap = cmap;
     dict->grep_cmap_data = vp;
 }
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+