/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2010 Index Data
+ * Copyright (C) 1995-2012 Index Data
* See the file LICENSE for details.
*/
/**
#include <assert.h>
#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
#include <yaz/rpn2solr.h>
#include <yaz/xmalloc.h>
#include <yaz/diagsrw.h>
};
-/* TODO Utility functions, evt. split out int separate file */
+/* TODO Utility functions, split out into separate file */
int solr_strcmp(const char *s1, const char *s2) {
return cql_strcmp(s1, s2);
}
}
-/* Utillity functions end */
+/* Utility functions end */
solr_transform_t solr_transform_create(void)
{
break;
}
value_str = yaz_tok_parse_string(tp);
- if (isdigit(*value_str))
+ if (yaz_isdigit(*value_str))
{
elem->which = Z_AttributeValue_numeric;
elem->value.numeric =
void *client_data)
{
int exclusion = 0;
- int distance; /* to be filled in later depending on unit */
- int distance_defined = 0;
+ int distance = -1;
int ordered = 0;
int proxrel = 2; /* less than or equal */
int unit = 2; /* word */
if (!strcmp(name, "distance")) {
distance = strtol(term, (char**) 0, 0);
- distance_defined = 1;
if (!strcmp(relation, "="))
proxrel = 3;
else if (!strcmp(relation, ">"))
mods = mods->u.st.modifiers;
}
- if (!distance_defined)
+ if (distance == -1)
distance = (unit == 2) ? 1 : 0;
solr_pr_int(exclusion, pr, client_data);