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
Fixed bug #685: Optimize xelm/melm matching. Indexing the Koha collection
[idzebra-moved-to-github.git]
/
include
/
data1.h
diff --git
a/include/data1.h
b/include/data1.h
index
8b48a06
..
ff1cc1c
100644
(file)
--- a/
include/data1.h
+++ b/
include/data1.h
@@
-1,5
+1,5
@@
-/* $Id: data1.h,v 1.4 2002-12-16 20:27:18 adam Exp $
- Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
+/* $Id: data1.h,v 1.9.2.3 2006-09-28 18:38:42 adam Exp $
+ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
This file is part of the Zebra server.
Index Data Aps
This file is part of the Zebra server.
@@
-15,14
+15,17
@@
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
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
+
*/
#ifndef DATA1_H
#define DATA1_H
*/
#ifndef DATA1_H
#define DATA1_H
+#define ENHANCED_XELM 1
+#define OPTIMIZE_MELM 1
+
#include <stdio.h>
#include <yaz/nmem.h>
#include <stdio.h>
#include <yaz/nmem.h>
@@
-34,6
+37,7
@@
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include <yaz/yaz-util.h>
#include <yaz/wrbuf.h>
#include <dfa.h> /* pop */
#include <yaz/yaz-util.h>
#include <yaz/wrbuf.h>
#include <dfa.h> /* pop */
+#include <zebra_xpath.h> /* pop */
#define d1_isspace(c) strchr(" \r\n\t\f", c)
#define d1_isdigit(c) ((c) <= '9' && (c) >= '0')
#define d1_isspace(c) strchr(" \r\n\t\f", c)
#define d1_isdigit(c) ((c) <= '9' && (c) >= '0')
@@
-86,6
+90,7
@@
typedef struct data1_marctab
int force_indicator_length;
int force_identifier_length;
int force_indicator_length;
int force_identifier_length;
+ char leader[24]; /* Fixme! Need linear access to LEADER of MARC record */
struct data1_marctab *next;
} data1_marctab;
struct data1_marctab *next;
} data1_marctab;
@@
-192,9
+197,17
@@
typedef struct data1_sub_elements {
typedef struct data1_xpelement
{
char *xpath_expr;
typedef struct data1_xpelement
{
char *xpath_expr;
+#ifdef ENHANCED_XELM
+ struct xpath_location_step xpath[XPATH_STEP_COUNT];
+ int xpath_len;
+#endif
struct DFA *dfa;
data1_termlist *termlists;
struct data1_xpelement *next;
struct DFA *dfa;
data1_termlist *termlists;
struct data1_xpelement *next;
+#if OPTIMIZE_MELM
+ const char *regexp;
+#endif
+ int match_state;
} data1_xpelement;
typedef struct data1_xattr {
} data1_xpelement;
typedef struct data1_xattr {
@@
-204,9
+217,6
@@
typedef struct data1_xattr {
unsigned short what; /* DATA1I_text, .. see data1_node.u.data */
} data1_xattr;
unsigned short what; /* DATA1I_text, .. see data1_node.u.data */
} data1_xattr;
-#if 0
-typedef struct data1_absyn data1_absyn;
-#else
typedef struct data1_absyn
{
char *name;
typedef struct data1_absyn
{
char *name;
@@
-224,7
+234,7
@@
typedef struct data1_absyn
char *encoding;
int enable_xpath_indexing;
} data1_absyn;
char *encoding;
int enable_xpath_indexing;
} data1_absyn;
-#endif
+
/*
* record data node (tag/data/variant)
*/
/*
* record data node (tag/data/variant)
*/
@@
-351,7
+361,8
@@
YAZ_EXPORT data1_datatype data1_maptype(data1_handle dh, char *t);
YAZ_EXPORT data1_varset *data1_read_varset(data1_handle dh, const char *file);
YAZ_EXPORT data1_vartype *data1_getvartypebyct(data1_handle dh,
data1_varset *set,
YAZ_EXPORT data1_varset *data1_read_varset(data1_handle dh, const char *file);
YAZ_EXPORT data1_vartype *data1_getvartypebyct(data1_handle dh,
data1_varset *set,
- char *zclass, char *type);
+ const char *zclass,
+ const char *type);
YAZ_EXPORT Z_Espec1 *data1_read_espec1(data1_handle dh, const char *file);
YAZ_EXPORT int data1_doespec1(data1_handle dh, data1_node *n, Z_Espec1 *e);
YAZ_EXPORT data1_esetname *data1_getesetbyname(data1_handle dh,
YAZ_EXPORT Z_Espec1 *data1_read_espec1(data1_handle dh, const char *file);
YAZ_EXPORT int data1_doespec1(data1_handle dh, data1_node *n, Z_Espec1 *e);
YAZ_EXPORT data1_esetname *data1_getesetbyname(data1_handle dh,
@@
-399,6
+410,17
@@
YAZ_EXPORT data1_node *data1_mk_preprocess (data1_handle dh, NMEM nmem,
const char **attr,
data1_node *at);
const char **attr,
data1_node *at);
+YAZ_EXPORT data1_node *data1_insert_preprocess_n (data1_handle dh, NMEM nmem,
+ const char *target,
+ size_t len,
+ const char **attr,
+ data1_node *at);
+
+YAZ_EXPORT data1_node *data1_insert_preprocess (data1_handle dh, NMEM nmem,
+ const char *target,
+ const char **attr,
+ data1_node *at);
+
YAZ_EXPORT data1_node *data1_mk_root (data1_handle dh, NMEM nmem,
const char *name);
YAZ_EXPORT void data1_set_root(data1_handle dh, data1_node *res,
YAZ_EXPORT data1_node *data1_mk_root (data1_handle dh, NMEM nmem,
const char *name);
YAZ_EXPORT void data1_set_root(data1_handle dh, data1_node *res,
@@
-504,6
+526,10
@@
YAZ_EXPORT int data1_is_xmlmode(data1_handle dh);
YAZ_EXPORT const char *data1_systag_lookup(data1_absyn *absyn, const char *tag,
const char *default_value);
YAZ_EXPORT const char *data1_systag_lookup(data1_absyn *absyn, const char *tag,
const char *default_value);
+YAZ_EXPORT void data1_concat_text(data1_handle dh, NMEM m, data1_node *n);
+
+YAZ_EXPORT void data1_absyn_destroy(data1_handle dh);
+
YAZ_END_CDECL
#endif
YAZ_END_CDECL
#endif