More optimizations of the melm matching.
[idzebra-moved-to-github.git] / include / data1.h
index 0e335db..cce6457 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: data1.h,v 1.10 2004-08-04 08:35:23 adam Exp $
+/* $Id: data1.h,v 1.9.2.4 2006-09-29 10:02:43 adam Exp $
    Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
    Index Data Aps
 
@@ -15,15 +15,16 @@ 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
-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
 
 #define ENHANCED_XELM 1
+#define OPTIMIZE_MELM 1
 
 #include <stdio.h>
 
@@ -31,7 +32,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include <yaz/oid.h>
 #include <yaz/proto.h>
 
-#include <zebraver.h>
 #include <d1_attset.h>
 #include <d1_map.h>
 #include <yaz/yaz-util.h>
@@ -204,6 +204,11 @@ typedef struct data1_xpelement
     struct DFA *dfa;  
     data1_termlist *termlists;
     struct data1_xpelement *next;
+#if OPTIMIZE_MELM
+    const char *regexp;
+#endif
+    int match_state;
+    struct data1_xpelement *match_next;
 } data1_xpelement;
 
 typedef struct data1_xattr {
@@ -213,9 +218,6 @@ typedef struct 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;
@@ -233,7 +235,7 @@ typedef struct data1_absyn
     char *encoding;
     int  enable_xpath_indexing;
 } data1_absyn;
-#endif
+
 /*
  * record data node (tag/data/variant)
  */
@@ -360,7 +362,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,
-                                              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, 
@@ -424,9 +427,6 @@ YAZ_EXPORT data1_node *data1_mk_root (data1_handle dh, NMEM nmem,
 YAZ_EXPORT void data1_set_root(data1_handle dh, data1_node *res,
                                NMEM nmem, const char *name);
 
-YAZ_EXPORT data1_node *data1_mk_tag_data_zint (data1_handle dh, data1_node *at,
-                                              const char *tag, zint num,
-                                              NMEM nmem);
 YAZ_EXPORT data1_node *data1_mk_tag_data_int (data1_handle dh, data1_node *at,
                                               const char *tag, int num,
                                               NMEM nmem);