projects
/
idzebra-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added data1_chop_text which removes whitespace in cdata nodes
[idzebra-moved-to-github.git]
/
index
/
zebraapi.c
diff --git
a/index/zebraapi.c
b/index/zebraapi.c
index
a1bb61d
..
10a4954
100644
(file)
--- a/
index/zebraapi.c
+++ b/
index/zebraapi.c
@@
-1,4
+1,4
@@
-/* $Id: zebraapi.c,v 1.252 2007-03-19 21:50:39 adam Exp $
+/* $Id: zebraapi.c,v 1.256 2007-05-21 11:54:59 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
Copyright (C) 1995-2007
Index Data ApS
@@
-40,6
+40,7
@@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "orddict.h"
#include <charmap.h>
#include <idzebra/api.h>
#include "orddict.h"
#include <charmap.h>
#include <idzebra/api.h>
+#include <yaz/oid_db.h>
#define DEFAULT_APPROX_LIMIT 2000000000
#define DEFAULT_APPROX_LIMIT 2000000000
@@
-98,6
+99,12
@@
static struct zebra_register *zebra_register_open(ZebraService zs,
const char *reg_path);
static void zebra_register_close(ZebraService zs, struct zebra_register *reg);
const char *reg_path);
static void zebra_register_close(ZebraService zs, struct zebra_register *reg);
+const char *zebra_get_encoding(ZebraHandle zh)
+{
+ assert(zh && zh->session_res);
+ return res_get_def(zh->session_res, "encoding", "ISO-8859-1");
+}
+
ZebraHandle zebra_open(ZebraService zs, Res res)
{
ZebraHandle zh;
ZebraHandle zebra_open(ZebraService zs, Res res)
{
ZebraHandle zh;
@@
-146,7
+153,7
@@
ZebraHandle zebra_open(ZebraService zs, Res res)
zh->break_handler_func = 0;
zh->break_handler_data = 0;
zh->break_handler_func = 0;
zh->break_handler_data = 0;
- default_encoding = res_get_def(zh->session_res, "encoding", "ISO-8859-1");
+ default_encoding = zebra_get_encoding(zh);
zh->iconv_to_utf8 =
yaz_iconv_open ("UTF-8", default_encoding);
zh->iconv_to_utf8 =
yaz_iconv_open ("UTF-8", default_encoding);
@@
-1075,7
+1082,7
@@
ZEBRA_RES zebra_search_RPN(ZebraHandle zh, ODR o, Z_RPNQuery *query,
ZEBRA_RES zebra_records_retrieve(ZebraHandle zh, ODR stream,
const char *setname,
Z_RecordComposition *comp,
ZEBRA_RES zebra_records_retrieve(ZebraHandle zh, ODR stream,
const char *setname,
Z_RecordComposition *comp,
- oid_value input_format, int num_recs,
+ const Odr_oid *input_format, int num_recs,
ZebraRetrievalRecord *recs)
{
ZebraMetaRecord *poset;
ZebraRetrievalRecord *recs)
{
ZebraMetaRecord *poset;
@@
-1119,7
+1126,7
@@
ZEBRA_RES zebra_records_retrieve(ZebraHandle zh, ODR stream,
if (poset[i].term)
{
recs[i].errCode = 0;
if (poset[i].term)
{
recs[i].errCode = 0;
- recs[i].format = VAL_SUTRS;
+ recs[i].format = yaz_oid_recsyn_sutrs;
recs[i].len = strlen(poset[i].term);
recs[i].buf = poset[i].term;
recs[i].base = poset[i].db;
recs[i].len = strlen(poset[i].term);
recs[i].buf = poset[i].term;
recs[i].base = poset[i].db;
@@
-1169,7
+1176,7
@@
ZEBRA_RES zebra_records_retrieve(ZebraHandle zh, ODR stream,
recs[i].buf = 0; /* no record and no error issued */
recs[i].len = 0;
recs[i].errCode = 0;
recs[i].buf = 0; /* no record and no error issued */
recs[i].len = 0;
recs[i].errCode = 0;
- recs[i].format = VAL_NONE;
+ recs[i].format = 0;
recs[i].sysno = 0;
}
}
recs[i].sysno = 0;
}
}
@@
-1188,7
+1195,7
@@
ZEBRA_RES zebra_scan_PQF(ZebraHandle zh, ODR stream, const char *query,
{
YAZ_PQF_Parser pqf_parser = yaz_pqf_create ();
Z_AttributesPlusTerm *zapt;
{
YAZ_PQF_Parser pqf_parser = yaz_pqf_create ();
Z_AttributesPlusTerm *zapt;
- int *attributeSet;
+ Odr_oid *attributeSet;
ZEBRA_RES res;
if (!(zapt = yaz_pqf_scan(pqf_parser, stream, &attributeSet, query)))
ZEBRA_RES res;
if (!(zapt = yaz_pqf_scan(pqf_parser, stream, &attributeSet, query)))
@@
-1197,15
+1204,17
@@
ZEBRA_RES zebra_scan_PQF(ZebraHandle zh, ODR stream, const char *query,
zh->errCode = YAZ_BIB1_SCAN_MALFORMED_SCAN;
}
else
zh->errCode = YAZ_BIB1_SCAN_MALFORMED_SCAN;
}
else
- res = zebra_scan(zh, stream, zapt, VAL_BIB1,
+ {
+ res = zebra_scan(zh, stream, zapt, yaz_oid_attset_bib_1,
position, num_entries, entries, is_partial,
setname);
position, num_entries, entries, is_partial,
setname);
+ }
yaz_pqf_destroy (pqf_parser);
return res;
}
ZEBRA_RES zebra_scan(ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt,
yaz_pqf_destroy (pqf_parser);
return res;
}
ZEBRA_RES zebra_scan(ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt,
- oid_value attributeset,
+ const Odr_oid *attributeset,
int *position,
int *num_entries, ZebraScanEntry **entries,
int *is_partial,
int *position,
int *num_entries, ZebraScanEntry **entries,
int *is_partial,
@@
-2280,7
+2289,7
@@
ZEBRA_RES zebra_search_PQF(ZebraHandle zh, const char *pqf_query,
yaz_log(log_level, "zebra_search_PQF s=%s q=%s", setname, pqf_query);
yaz_log(log_level, "zebra_search_PQF s=%s q=%s", setname, pqf_query);
- query = p_query_rpn (odr, PROTO_Z3950, pqf_query);
+ query = p_query_rpn(odr, pqf_query);
if (!query)
{
if (!query)
{