projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
MARC-8: allow all characters 0x01-0x20 YAZ-650
[yaz-moved-to-github.git]
/
src
/
cqltransform.c
diff --git
a/src/cqltransform.c
b/src/cqltransform.c
index
f17af20
..
90dcb37
100644
(file)
--- a/
src/cqltransform.c
+++ b/
src/cqltransform.c
@@
-1,5
+1,5
@@
/* This file is part of the YAZ toolkit.
/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2012 Index Data
+ * Copyright (C) 1995-2013 Index Data
* See the file LICENSE for details.
*/
/**
* See the file LICENSE for details.
*/
/**
@@
-586,7
+586,6
@@
static int has_modifier(struct cql_node *cn, const char *name) {
return 0;
}
return 0;
}
-
static void emit_term(cql_transform_t ct,
struct cql_node *cn,
const char *term, int length,
static void emit_term(cql_transform_t ct,
struct cql_node *cn,
const char *term, int length,
@@
-600,6
+599,8
@@
static void emit_term(cql_transform_t ct,
if (has_modifier(cn, "regexp"))
process_term = 0;
if (has_modifier(cn, "regexp"))
process_term = 0;
+ else if (has_modifier(cn, "unmasked"))
+ process_term = 0;
else if (cql_lookup_property(ct, "truncation", 0, "cql"))
{
process_term = 0;
else if (cql_lookup_property(ct, "truncation", 0, "cql"))
{
process_term = 0;
@@
-609,7
+610,7
@@
static void emit_term(cql_transform_t ct,
assert(cn->which == CQL_NODE_ST);
if (process_term)
assert(cn->which == CQL_NODE_ST);
if (process_term)
- {
+ { /* convert term via truncation.things */
unsigned anchor = 0;
unsigned trunc = 0;
for (i = 0; i < length; i++)
unsigned anchor = 0;
unsigned trunc = 0;
for (i = 0; i < length; i++)
@@
-761,29
+762,10
@@
static void emit_term(cql_transform_t ct,
static void emit_terms(cql_transform_t ct,
struct cql_node *cn,
void (*pr)(const char *buf, void *client_data),
static void emit_terms(cql_transform_t ct,
struct cql_node *cn,
void (*pr)(const char *buf, void *client_data),
- void *client_data,
- const char *op)
+ void *client_data)
{
{
- struct cql_node *ne = cn->u.st.extra_terms;
- if (ne)
- {
- (*pr)("@", client_data);
- (*pr)(op, client_data);
- (*pr)(" ", client_data);
- }
emit_term(ct, cn, cn->u.st.term, strlen(cn->u.st.term),
pr, client_data);
emit_term(ct, cn, cn->u.st.term, strlen(cn->u.st.term),
pr, client_data);
- for (; ne; ne = ne->u.st.extra_terms)
- {
- if (ne->u.st.extra_terms)
- {
- (*pr)("@", client_data);
- (*pr)(op, client_data);
- (*pr)(" ", client_data);
- }
- emit_term(ct, cn, ne->u.st.term, strlen(ne->u.st.term),
- pr, client_data);
- }
}
static void emit_wordlist(cql_transform_t ct,
}
static void emit_wordlist(cql_transform_t ct,
@@
-862,7
+844,7
@@
void cql_transform_r(cql_transform_t ct,
else if (cn->u.st.relation && !cql_strcmp(cn->u.st.relation, "any"))
emit_wordlist(ct, cn, pr, client_data, "or");
else
else if (cn->u.st.relation && !cql_strcmp(cn->u.st.relation, "any"))
emit_wordlist(ct, cn, pr, client_data, "or");
else
- emit_terms(ct, cn, pr, client_data, "and");
+ emit_terms(ct, cn, pr, client_data);
break;
case CQL_NODE_BOOL:
(*pr)("@", client_data);
break;
case CQL_NODE_BOOL:
(*pr)("@", client_data);