X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=dict%2Fscan.c;h=53ea9990db710434f0409c02c0627f4e31312d90;hb=8b2d919ca1ab2134c098057bb0965ec7dc42cd9d;hp=2e300b645f12142b44f35e6ab3ab281bcdc7847e;hpb=6c9fcd3b5d3108702fa1ffc92dab4ab6060f9a19;p=idzebra-moved-to-github.git diff --git a/dict/scan.c b/dict/scan.c index 2e300b6..53ea999 100644 --- a/dict/scan.c +++ b/dict/scan.c @@ -1,5 +1,5 @@ -/* $Id: scan.c,v 1.19 2005-01-15 19:38:24 adam Exp $ - Copyright (C) 1995-2005 +/* $Id: scan.c,v 1.23 2006-08-29 13:38:38 adam Exp $ + Copyright (C) 1995-2006 Index Data ApS This file is part of the Zebra server. @@ -15,9 +15,9 @@ 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 + */ @@ -28,10 +28,10 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "dict-p.h" -int dict_scan_trav (Dict dict, Dict_ptr ptr, int pos, Dict_char *str, - int start, int *count, void *client, - int (*userfunc)(char *, const char *, int, void *), - int dir) +int dict_scan_trav(Dict dict, Dict_ptr ptr, int pos, Dict_char *str, + int start, int *count, void *client, + int (*userfunc)(char *, const char *, int, void *), + int dir) { int lo, hi, j; void *p; @@ -179,14 +179,14 @@ int dict_scan_r (Dict dict, Dict_ptr ptr, int pos, Dict_char *str, } } if (*after && subptr) - if (dict_scan_trav (dict, subptr, pos+1, str, -1, - after, client, userfunc, 1)) + if (dict_scan_trav(dict, subptr, pos+1, str, -1, + after, client, userfunc, 1)) return 1; } else if (subptr) { - if (dict_scan_r (dict, subptr, pos+1, str, before, after, - client, userfunc)) + if (dict_scan_r(dict, subptr, pos+1, str, before, after, + client, userfunc)) return 1; } break; @@ -200,12 +200,12 @@ int dict_scan_r (Dict dict, Dict_ptr ptr, int pos, Dict_char *str, if (lo>hi && cmp < 0) ++mid; if (*after) - if (dict_scan_trav (dict, ptr, pos, str, cmp ? mid : mid+1, after, - client, userfunc, 1)) + if (dict_scan_trav(dict, ptr, pos, str, cmp ? mid : mid+1, after, + client, userfunc, 1)) return 1; if (*before && mid > 0) - if (dict_scan_trav (dict, ptr, pos, str, mid-1, before, - client, userfunc, -1)) + if (dict_scan_trav(dict, ptr, pos, str, mid-1, before, + client, userfunc, -1)) return 1; return 0; } @@ -215,14 +215,22 @@ int dict_scan (Dict dict, char *str, int *before, int *after, void *client, { int i; - yaz_log (YLOG_DEBUG, "dict_scan"); + yaz_log(YLOG_DEBUG, "dict_scan"); for (i = 0; str[i]; i++) { - yaz_log (YLOG_DEBUG, " %3d %c", str[i], - (str[i] > ' ' && str[i] < 127) ? str[i] : '?'); + yaz_log(YLOG_DEBUG, "start_term pos %d %3d %c", i, str[i], + (str[i] > ' ' && str[i] < 127) ? str[i] : '?'); } if (!dict->head.root) return 0; - return dict_scan_r (dict, dict->head.root, 0, (Dict_char *) str, - before, after, client, f); + return dict_scan_r(dict, dict->head.root, 0, (Dict_char *) str, + before, after, client, f); } +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +