X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=util%2Fxpath.c;h=ffb6eb0eca50ae3635cf1cd3ff18a08aab001423;hb=aeea139423b8eaf28a4de53b3d7b2ad1f22284e7;hp=67b63bfbfbb3e0754fbb9891d15020901558fa7b;hpb=4478d785b7769691261005c98063b98a5a5971b3;p=idzebra-moved-to-github.git diff --git a/util/xpath.c b/util/xpath.c index 67b63bf..ffb6eb0 100644 --- a/util/xpath.c +++ b/util/xpath.c @@ -1,8 +1,5 @@ -/* $Id: xpath.c,v 1.7 2006-08-14 10:40:34 adam Exp $ - Copyright (C) 1995-2006 - 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 @@ -21,6 +18,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#if HAVE_CONFIG_H +#include +#endif #include #include #include @@ -122,13 +122,13 @@ static struct xpath_predicate *get_xpath_boolean(char **pr, NMEM mem, char **look, int *literal) { struct xpath_predicate *left = 0; - + left = get_xpath_relation(pr, mem, look, literal); if (!left) return 0; - + while (*look && !*literal && - (!strcmp(*look, "and") || !strcmp(*look, "or") || + (!strcmp(*look, "and") || !strcmp(*look, "or") || !strcmp(*look, "not"))) { struct xpath_predicate *res, *right; @@ -164,13 +164,13 @@ int zebra_parse_xpath_str(const char *xpath_string, { const char *cp; char *a; - + int no = 0; - + if (!xpath_string || *xpath_string != '/') return -1; cp = xpath_string; - + while (*cp && no < max) { int i = 0; @@ -218,7 +218,7 @@ void dump_xp_predicate (struct xpath_predicate *p) if (p) { if (p->which == XPATH_PREDICATE_RELATION && p->u.relation.name[0]) { - fprintf (stderr, "%s,%s,%s", + fprintf (stderr, "%s,%s,%s", p->u.relation.name, p->u.relation.op, p->u.relation.value); @@ -245,6 +245,7 @@ void dump_xp_steps (struct xpath_location_step *xpath, int no) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab