From af03c4a4f5320b52c7cc5f47bab7c9ad4b3e384d Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 15 Nov 2002 21:26:00 +0000 Subject: [PATCH] Perl Filter and Perl API --- CHANGELOG | 2 + configure.in | 82 +- index/extract.c | 114 +- index/index.h | 11 +- perl/IDZebra_wrap.c | 6526 ++++++++++++++++++++++++++++++++++++++++ perl/MANIFEST | 45 + perl/Makefile.PL.in | 11 + perl/README | 1 + perl/demo/filter_test.pl | 10 + perl/demo/index.sh | 4 + perl/demo/pod.pm | 65 + perl/demo/zebra.cfg | 28 + perl/doclean | 3 + perl/doswig | 3 + perl/lib/IDZebra.pm | 292 ++ perl/lib/IDZebra/Data1.pm | 245 ++ perl/lib/IDZebra/Filter.pm | 258 ++ perl/lib/IDZebra/Logger.pm | 104 + perl/lib/IDZebra/Repository.pm | 150 + perl/lib/IDZebra/Service.pm | 99 + perl/lib/IDZebra/Session.pm | 213 ++ perl/rg.h | 14 + perl/test.pl | 83 + perl/zebra_api_ext.c | 232 ++ perl/zebra_api_ext.h | 24 + perl/zebra_perl.c | 33 + perl/zebra_perl.h | 5 + recctrl/Makefile.am | 4 +- recctrl/grsread.h | 3 +- recctrl/perlread.c | 278 ++ recctrl/perlread.h.in | 8 + 31 files changed, 8919 insertions(+), 31 deletions(-) create mode 100644 perl/IDZebra_wrap.c create mode 100644 perl/MANIFEST create mode 100644 perl/Makefile.PL.in create mode 100644 perl/README create mode 100755 perl/demo/filter_test.pl create mode 100755 perl/demo/index.sh create mode 100644 perl/demo/pod.pm create mode 100644 perl/demo/zebra.cfg create mode 100755 perl/doclean create mode 100755 perl/doswig create mode 100644 perl/lib/IDZebra.pm create mode 100644 perl/lib/IDZebra/Data1.pm create mode 100644 perl/lib/IDZebra/Filter.pm create mode 100644 perl/lib/IDZebra/Logger.pm create mode 100644 perl/lib/IDZebra/Repository.pm create mode 100644 perl/lib/IDZebra/Service.pm create mode 100644 perl/lib/IDZebra/Session.pm create mode 100644 perl/rg.h create mode 100755 perl/test.pl create mode 100644 perl/zebra_api_ext.c create mode 100644 perl/zebra_api_ext.h create mode 100644 perl/zebra_perl.c create mode 100644 perl/zebra_perl.h create mode 100644 recctrl/perlread.c create mode 100644 recctrl/perlread.h.in diff --git a/CHANGELOG b/CHANGELOG index 569a76e..f68690a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,6 @@ +Perl Filter and Perl API. By Peter Popovics. + For zebra.cfg, if no profilePath is specified, directory (prefix)/share/idzebra/tab is used. diff --git a/configure.in b/configure.in index 58cd24b..071de3b 100644 --- a/configure.in +++ b/configure.in @@ -1,11 +1,18 @@ dnl Zebra, Index Data Aps, 1995-2002 -dnl $Id: configure.in,v 1.55 2002-11-09 22:26:19 adam Exp $ +dnl $Id: configure.in,v 1.56 2002-11-15 21:26:00 adam Exp $ dnl AC_INIT(include/zebraver.h) AM_INIT_AUTOMAKE(idzebra,1.3.3) dnl ------ Substitutions AC_SUBST(TCL_INCLUDE) AC_SUBST(TCL_LIB) +dnl ------ Perl substitutions +AC_SUBST(PERL_BINARY) +AC_SUBST(PERL_XS_INIT) +AC_SUBST(PERL_XS_INIT_INCLUDE) +AC_SUBST(PERL_LIBS) +AC_SUBST(PERL_CFLAGS) +AC_SUBST(ZPERL_LIBS) dnl dnl ------ Checking programs AC_PROG_CC @@ -186,6 +193,73 @@ if test "$expat" != "no"; then CFLAGS="$xCFLAGS" fi fi +dnl +dnl ------ PERL +perl=yes +PERL_XS_INIT="NULL" +PERL_XS_INIT_INCLUDE='' +PERL_BINARY="" +AC_ARG_WITH(perl, [ --with-perl[=FILE] perl binary location],[perl=$withval]) +if test "$perl" != "no"; then + AC_MSG_CHECKING(for perl binary) + if test "$perl" == "yes"; then + perlbin=`which perl` + else + perlbin="$perl" + fi + if test -x "$perlbin"; then + AC_MSG_RESULT($perlbin) + AC_MSG_CHECKING(perl core directory) + archdir=`$perlbin -MConfig -e 'print $Config{archlib}'`; + perlcore="$archdir/CORE"; + if test "$perlcore"; then + PERL_BINARY="$perlbin" + AC_MSG_RESULT($perlcore) + AC_DEFINE(HAVE_PERL,1) + else + AC_MSG_RESULT(Failed) + AC_DEFINE(HAVE_PERL,0) + fi + + AC_MSG_CHECKING("for ExtUtils::Embed to determine ccopts") + PERL_CFLAGS=`$perlbin -MExtUtils::Embed -e ccopts 2>/dev/null` + if test "$PERL_CFLAGS"; then + AC_MSG_RESULT(OK) + else + PERL_CFLAGS="-I$perlcore" + AC_MSG_RESULT(Using defaults) + fi + + AC_MSG_CHECKING("for ExtUtils::Embed to determine ldflags") + PERL_LIBS=`$perlbin -MExtUtils::Embed -e ldopts 2>/dev/null` + if test "$PERL_LIBS"; then + AC_MSG_RESULT(OK) + else + PERL_LIBS="-L$perlcore -lperl -lm" + AC_MSG_RESULT(Using defaults) + fi + + AC_MSG_CHECKING("for ExtUtils::Embed to create xs_init") + xsf="recctrl/xsinit.h" + `rm $xsf 2>/dev/null`; + + `$perlbin -MExtUtils::Embed -e xsinit -- -o $xsf 2>/dev/null` + if test -r "$xsf"; then + AC_MSG_RESULT(OK) + PERL_XS_INIT="xs_init" + PERL_XS_INIT_INCLUDE='#include "xsinit.h"' + else + AC_MSG_RESULT(XS libraries are not going to be available) + fi + + ZPERL_LIBS="$LIBS" + CFLAGS="$PERL_CFLAGS $CFLAGS" + LIBS="$PERL_LIBS $LIBS" + else + AC_DEFINE(HAVE_PERL,0) + AC_MSG_RESULT(Not found) + fi +fi dnl ------- 64 bit files AC_MSG_CHECKING(for LFS) AC_TRY_RUN([#define _FILE_OFFSET_BITS 64 @@ -246,6 +320,7 @@ AC_OUTPUT([ rset/Makefile data1/Makefile recctrl/Makefile + recctrl/perlread.h index/Makefile include/Makefile tab/Makefile @@ -256,6 +331,11 @@ AC_OUTPUT([ doc/zebraphp.dsl doc/tkl.xsl test/Makefile test/gils/Makefile test/usmarc/Makefile test/api/Makefile + perl/Makefile.PL test/dmoz/Makefile test/xpath/Makefile examples/Makefile examples/gils/Makefile ]) + +if test -x "$perlbin"; then + res=`cd perl ; $perlbin Makefile.PL ; cd .. ;`; +fi diff --git a/index/extract.c b/index/extract.c index cd3369d..7b3e108 100644 --- a/index/extract.c +++ b/index/extract.c @@ -1,4 +1,4 @@ -/* $Id: extract.c,v 1.130 2002-11-07 09:07:07 adam Exp $ +/* $Id: extract.c,v 1.131 2002-11-15 21:26:00 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -361,8 +361,9 @@ static char *fileMatchStr (ZebraHandle zh, spec_src = rGroup->groupName; else if (!strcmp (special, "database")) spec_src = rGroup->databaseName; - else if (!strcmp (special, "filename")) + else if (!strcmp (special, "filename")) { spec_src = fname; + } else if (!strcmp (special, "type")) spec_src = rGroup->recordType; else @@ -890,8 +891,6 @@ int fileExtract (ZebraHandle zh, SYSNO *sysno, const char *fname, close (fd); return r; } - - int extract_rec_in_mem (ZebraHandle zh, const char *recordType, const char *buf, size_t buf_size, const char *databaseName, int delete_flag, @@ -899,6 +898,44 @@ int extract_rec_in_mem (ZebraHandle zh, const char *recordType, int store_keys, int store_data, const char *match_criteria) { + struct recordGroup rGroup; + rGroup.groupName = NULL; + rGroup.databaseName = (char *)databaseName; + rGroup.path = NULL; + rGroup.recordId = NULL; + rGroup.recordType = (char *)recordType; + rGroup.flagStoreData = store_data; + rGroup.flagStoreKeys = store_keys; + rGroup.flagRw = 1; + rGroup.databaseNamePath = 0; + rGroup.explainDatabase = 0; + rGroup.fileVerboseLimit = 100000; + rGroup.followLinks = -1; + return (bufferExtractRecord (zh, + buf, buf_size, + &rGroup, + delete_flag, + test_mode, + sysno, + match_criteria, + "")); +} +/* + If sysno is provided, then it's used to identify the reocord. + If not, and match_criteria is provided, then sysno is guessed + If not, and a record is provided, then sysno is got from there + + */ +int bufferExtractRecord (ZebraHandle zh, + const char *buf, size_t buf_size, + struct recordGroup *rGroup, + int delete_flag, + int test_mode, + int *sysno, + const char *match_criteria, + const char *fname) + +{ RecordAttr *recordAttr; struct recExtractCtrl extractCtrl; int i, r; @@ -906,7 +943,8 @@ int extract_rec_in_mem (ZebraHandle zh, const char *recordType, RecType recType; char subType[1024]; void *clientData; - const char *fname = ""; + SYSNO sysnotmp; + // const char *fname = ""; Record rec; long recordOffset = 0; struct zebra_fetch_control fc; @@ -926,19 +964,24 @@ int extract_rec_in_mem (ZebraHandle zh, const char *recordType, extractCtrl.fh = &fc; /* announce database */ - if (zebraExplain_curDatabase (zh->reg->zei, databaseName)) + if (zebraExplain_curDatabase (zh->reg->zei, rGroup->databaseName)) { - if (zebraExplain_newDatabase (zh->reg->zei, databaseName, 0)) + if (zebraExplain_newDatabase (zh->reg->zei, rGroup->databaseName, 0)) return 0; } + + if (!(rGroup->recordType)) { + logf (LOG_WARN, "No such record type defined"); + return 0; + } + if (!(recType = - recType_byName (zh->reg->recTypes, recordType, subType, + recType_byName (zh->reg->recTypes, rGroup->recordType, subType, &clientData))) { - logf (LOG_WARN, "No such record type: %s", recordType); + logf (LOG_WARN, "No such record type: %s", rGroup->recordType); return 0; } - zh->reg->keys.buf_used = 0; zh->reg->keys.prevAttrUse = -1; zh->reg->keys.prevAttrSet = -1; @@ -990,18 +1033,40 @@ int extract_rec_in_mem (ZebraHandle zh, const char *recordType, return 1; } /* match criteria */ + matchStr = NULL; + + if (! *sysno) { + char *rinfo; + if (strlen(match_criteria) > 0) { + matchStr = (char *)match_criteria; + } else { + if (rGroup->recordId && *rGroup->recordId) { + matchStr = fileMatchStr (zh, &zh->reg->keys, rGroup, fname, + rGroup->recordId); + } + } + if (matchStr) { + rinfo = dict_lookup (zh->reg->matchDict, matchStr); + if (rinfo) + memcpy (sysno, rinfo+1, sizeof(*sysno)); + } else { + logf (LOG_WARN, "Bad match criteria (recordID)"); + return 0; + } + + } if (! *sysno) { /* new record */ if (delete_flag) { - logf (LOG_LOG, "delete %s %s %ld", recordType, + logf (LOG_LOG, "delete %s %s %ld", rGroup->recordType, fname, (long) recordOffset); logf (LOG_WARN, "cannot delete record above (seems new)"); return 1; } - logf (LOG_LOG, "add %s %s %ld", recordType, fname, + logf (LOG_LOG, "add %s %s %ld", rGroup->recordType, fname, (long) recordOffset); rec = rec_new (zh->reg->records); @@ -1033,7 +1098,7 @@ int extract_rec_in_mem (ZebraHandle zh, const char *recordType, if (recordAttr->runNumber == zebraExplain_runNumberIncrement (zh->reg->zei, 0)) { - logf (LOG_LOG, "skipped %s %s %ld", recordType, + logf (LOG_LOG, "skipped %s %s %ld", rGroup->recordType, fname, (long) recordOffset); extract_flushSortKeys (zh, *sysno, -1, &zh->reg->sortKeys); rec_rm (&rec); @@ -1053,19 +1118,17 @@ int extract_rec_in_mem (ZebraHandle zh, const char *recordType, /* record going to be deleted */ if (!delkeys.buf_used) { - logf (LOG_LOG, "delete %s %s %ld", recordType, + logf (LOG_LOG, "delete %s %s %ld", rGroup->recordType, fname, (long) recordOffset); logf (LOG_WARN, "cannot delete file above, storeKeys false"); } else { - logf (LOG_LOG, "delete %s %s %ld", recordType, + logf (LOG_LOG, "delete %s %s %ld", rGroup->recordType, fname, (long) recordOffset); zh->records_deleted++; -#if 0 if (matchStr) - dict_delete (matchDict, matchStr); -#endif + dict_delete (zh->reg->matchDict, matchStr); rec_del (zh->reg->records, &rec); } rec_rm (&rec); @@ -1077,13 +1140,13 @@ int extract_rec_in_mem (ZebraHandle zh, const char *recordType, /* record going to be updated */ if (!delkeys.buf_used) { - logf (LOG_LOG, "update %s %s %ld", recordType, + logf (LOG_LOG, "update %s %s %ld", rGroup->recordType, fname, (long) recordOffset); logf (LOG_WARN, "cannot update file above, storeKeys false"); } else { - logf (LOG_LOG, "update %s %s %ld", recordType, + logf (LOG_LOG, "update %s %s %ld", rGroup->recordType, fname, (long) recordOffset); extract_flushSortKeys (zh, *sysno, 1, &zh->reg->sortKeys); extract_flushRecordKeys (zh, *sysno, 1, &zh->reg->keys); @@ -1094,7 +1157,7 @@ int extract_rec_in_mem (ZebraHandle zh, const char *recordType, /* update file type */ xfree (rec->info[recInfo_fileType]); rec->info[recInfo_fileType] = - rec_strdup (recordType, &rec->size[recInfo_fileType]); + rec_strdup (rGroup->recordType, &rec->size[recInfo_fileType]); /* update filename */ xfree (rec->info[recInfo_filename]); @@ -1103,7 +1166,7 @@ int extract_rec_in_mem (ZebraHandle zh, const char *recordType, /* update delete keys */ xfree (rec->info[recInfo_delKeys]); - if (zh->reg->keys.buf_used > 0 && store_keys == 1) + if (zh->reg->keys.buf_used > 0 && rGroup->flagStoreKeys == 1) { rec->size[recInfo_delKeys] = zh->reg->keys.buf_used; rec->info[recInfo_delKeys] = zh->reg->keys.buf; @@ -1143,7 +1206,7 @@ int extract_rec_in_mem (ZebraHandle zh, const char *recordType, /* update store data */ xfree (rec->info[recInfo_storeData]); - if (store_data == 1) + if (rGroup->flagStoreData == 1) { rec->size[recInfo_storeData] = recordAttr->recordSize; rec->info[recInfo_storeData] = (char *) @@ -1174,18 +1237,19 @@ int extract_rec_in_mem (ZebraHandle zh, const char *recordType, /* update database name */ xfree (rec->info[recInfo_databaseName]); rec->info[recInfo_databaseName] = - rec_strdup (databaseName, &rec->size[recInfo_databaseName]); + rec_strdup (rGroup->databaseName, &rec->size[recInfo_databaseName]); /* update offset */ recordAttr->recordOffset = recordOffset; /* commit this record */ rec_put (zh->reg->records, &rec); - logRecord(zh); return 0; } + + int explain_extract (void *handle, Record rec, data1_node *n) { ZebraHandle zh = (ZebraHandle) handle; diff --git a/index/index.h b/index/index.h index fa3226d..90cdd02 100644 --- a/index/index.h +++ b/index/index.h @@ -1,4 +1,4 @@ -/* $Id: index.h,v 1.90 2002-10-23 14:28:20 adam Exp $ +/* $Id: index.h,v 1.91 2002-11-15 21:26:00 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -411,6 +411,14 @@ int zebra_record_fetch (ZebraHandle zh, int sysno, int score, ODR stream, void extract_get_fname_tmp (ZebraHandle zh, char *fname, int no); void zebra_index_merge (ZebraHandle zh); +int bufferExtractRecord (ZebraHandle zh, + const char *buf, size_t buf_size, + struct recordGroup *rGroup, + int delete_flag, + int test_mode, + int *sysno, + const char *match_criteria, + const char *fname); int extract_rec_in_mem (ZebraHandle zh, const char *recordType, const char *buf, size_t buf_size, @@ -418,7 +426,6 @@ int extract_rec_in_mem (ZebraHandle zh, const char *recordType, int test_mode, int *sysno, int store_keys, int store_data, const char *match_criteria); - void extract_flushWriteKeys (ZebraHandle zh); struct zebra_fetch_control { diff --git a/perl/IDZebra_wrap.c b/perl/IDZebra_wrap.c new file mode 100644 index 0000000..d5b5965 --- /dev/null +++ b/perl/IDZebra_wrap.c @@ -0,0 +1,6526 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 1.3.15u-20021003-1203 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +/*********************************************************************** + * common.swg + * + * This file contains generic SWIG runtime support for pointer + * type checking as well as a few commonly used macros to control + * external linkage. + * + * Author : David Beazley (beazley@cs.uchicago.edu) + * + * Copyright (c) 1999-2000, The University of Chicago + * + * This file may be freely redistributed without license or fee provided + * this copyright message remains intact. + ************************************************************************/ + +#include + +#if defined(_WIN32) || defined(__WIN32__) +# if defined(_MSC_VER) +# if defined(STATIC_LINKED) +# define SWIGEXPORT(a) a +# define SWIGIMPORT(a) extern a +# else +# define SWIGEXPORT(a) __declspec(dllexport) a +# define SWIGIMPORT(a) extern a +# endif +# else +# if defined(__BORLANDC__) +# define SWIGEXPORT(a) a _export +# define SWIGIMPORT(a) a _export +# else +# define SWIGEXPORT(a) a +# define SWIGIMPORT(a) a +# endif +# endif +#else +# define SWIGEXPORT(a) a +# define SWIGIMPORT(a) a +#endif + +#ifdef SWIG_GLOBAL +#define SWIGRUNTIME(a) SWIGEXPORT(a) +#else +#define SWIGRUNTIME(a) static a +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *(*swig_converter_func)(void *); +typedef struct swig_type_info *(*swig_dycast_func)(void **); + +typedef struct swig_type_info { + const char *name; + swig_converter_func converter; + const char *str; + void *clientdata; + swig_dycast_func dcast; + struct swig_type_info *next; + struct swig_type_info *prev; +} swig_type_info; + +#ifdef SWIG_NOINCLUDE + +SWIGIMPORT(swig_type_info *) SWIG_TypeRegister(swig_type_info *); +SWIGIMPORT(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *); +SWIGIMPORT(void *) SWIG_TypeCast(swig_type_info *, void *); +SWIGIMPORT(swig_type_info *) SWIG_TypeDynamicCast(swig_type_info *, void **); +SWIGIMPORT(swig_type_info *) SWIG_TypeQuery(const char *); +SWIGIMPORT(void) SWIG_TypeClientData(swig_type_info *, void *); + +#else + +static swig_type_info *swig_type_list = 0; + +/* Register a type mapping with the type-checking */ +SWIGRUNTIME(swig_type_info *) +SWIG_TypeRegister(swig_type_info *ti) +{ + swig_type_info *tc, *head, *ret, *next; + /* Check to see if this type has already been registered */ + tc = swig_type_list; + while (tc) { + if (strcmp(tc->name, ti->name) == 0) { + /* Already exists in the table. Just add additional types to the list */ + if (tc->clientdata) ti->clientdata = tc->clientdata; + head = tc; + next = tc->next; + goto l1; + } + tc = tc->prev; + } + head = ti; + next = 0; + + /* Place in list */ + ti->prev = swig_type_list; + swig_type_list = ti; + + /* Build linked lists */ + l1: + ret = head; + tc = ti + 1; + /* Patch up the rest of the links */ + while (tc->name) { + head->next = tc; + tc->prev = head; + head = tc; + tc++; + } + head->next = next; + return ret; +} + +/* Check the typename */ +SWIGRUNTIME(swig_type_info *) +SWIG_TypeCheck(char *c, swig_type_info *ty) +{ + swig_type_info *s; + if (!ty) return 0; /* Void pointer */ + s = ty->next; /* First element always just a name */ + do { + if (strcmp(s->name,c) == 0) { + if (s == ty->next) return s; + /* Move s to the top of the linked list */ + s->prev->next = s->next; + if (s->next) { + s->next->prev = s->prev; + } + /* Insert s as second element in the list */ + s->next = ty->next; + if (ty->next) ty->next->prev = s; + ty->next = s; + return s; + } + s = s->next; + } while (s && (s != ty->next)); + return 0; +} + +/* Cast a pointer up an inheritance hierarchy */ +SWIGRUNTIME(void *) +SWIG_TypeCast(swig_type_info *ty, void *ptr) +{ + if ((!ty) || (!ty->converter)) return ptr; + return (*ty->converter)(ptr); +} + +/* Dynamic pointer casting. Down an inheritance hierarchy */ +SWIGRUNTIME(swig_type_info *) +SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) +{ + swig_type_info *lastty = ty; + if (!ty || !ty->dcast) return ty; + while (ty && (ty->dcast)) { + ty = (*ty->dcast)(ptr); + if (ty) lastty = ty; + } + return lastty; +} + +/* Search for a swig_type_info structure */ +SWIGRUNTIME(swig_type_info *) +SWIG_TypeQuery(const char *name) { + swig_type_info *ty = swig_type_list; + while (ty) { + if (ty->str && (strcmp(name,ty->str) == 0)) return ty; + if (ty->name && (strcmp(name,ty->name) == 0)) return ty; + ty = ty->prev; + } + return 0; +} + +/* Set the clientdata field for a type */ +SWIGRUNTIME(void) +SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { + swig_type_info *tc, *equiv; + if (ti->clientdata) return; + ti->clientdata = clientdata; + equiv = ti->next; + while (equiv) { + if (!equiv->converter) { + tc = swig_type_list; + while (tc) { + if ((strcmp(tc->name, equiv->name) == 0)) + SWIG_TypeClientData(tc,clientdata); + tc = tc->prev; + } + } + equiv = equiv->next; + } +} +#endif + +#ifdef __cplusplus +} + +#endif + +/* ----------------------------------------------------------------------------- + * perl5.swg + * + * Perl5 runtime library + * $Header: /home/cvsroot/idis/perl/Attic/IDZebra_wrap.c,v 1.1 2002-11-15 21:26:00 adam Exp $ + * ----------------------------------------------------------------------------- */ + +#define SWIGPERL +#define SWIGPERL5 +#ifdef __cplusplus +/* Needed on some windows machines---since MS plays funny + games with the header files under C++ */ +#include +#include +extern "C" { +#endif +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +/* Get rid of free and malloc defined by perl */ +#undef free +#undef malloc + +#ifndef pTHX_ +#define pTHX_ +#endif + +#include +#ifdef __cplusplus +} +#endif + +/* Macro to call an XS function */ + +#ifdef PERL_OBJECT +#define SWIG_CALLXS(_name) _name(cv,pPerl) +#else +#ifndef MULTIPLICITY +#define SWIG_CALLXS(_name) _name(cv) +#else +#define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) +#endif +#endif + +/* Macros for low-level exception handling */ +#define SWIG_fail goto fail +#define SWIG_croak(x) while ((_swigerr = (const char *) x)) goto fail +#define SWIG_MAX_ERRMSG 256 + +/* Note: SwigMagicFuncHack is a typedef used to get the C++ + compiler to just shut up already */ + +#ifdef PERL_OBJECT +#define MAGIC_PPERL CPerlObj *pPerl = (CPerlObj *) this; +typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *); + +#ifdef __cplusplus +extern "C" { +#endif +typedef int (CPerlObj::*SwigMagicFuncHack)(SV *, MAGIC *); +#ifdef __cplusplus +} +#endif + +#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) +#define SWIGCLASS_STATIC +#else +#define MAGIC_PPERL +#define SWIGCLASS_STATIC static +#ifndef MULTIPLICITY +#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b) +typedef int (*SwigMagicFunc)(SV *, MAGIC *); + +#ifdef __cplusplus +extern "C" { +#endif +typedef int (*SwigMagicFuncHack)(SV *, MAGIC *); +#ifdef __cplusplus +} +#endif + + +#else +#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b) +typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *); +#ifdef __cplusplus +extern "C" { +#endif +typedef int (*SwigMagicFuncHack)(struct interpreter *, SV *, MAGIC *); +#ifdef __cplusplus +} +#endif + +#endif +#endif + +#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE) +#define PerlIO_exportFILE(fh,fl) (FILE*)(fh) +#endif + +/* Modifications for newer Perl 5.005 releases */ + +#if !defined(PERL_REVISION) || ((PERL_REVISION >= 5) && ((PERL_VERSION < 5) || ((PERL_VERSION == 5) && (PERL_SUBVERSION < 50)))) +#ifndef PL_sv_yes +#define PL_sv_yes sv_yes +#endif +#ifndef PL_sv_undef +#define PL_sv_undef sv_undef +#endif +#ifndef PL_na +#define PL_na na +#endif +#endif + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef SWIG_NOINCLUDE + +#ifndef PERL_OBJECT +extern int SWIG_ConvertPtr(SV *, void **, swig_type_info *, int flags); +extern void SWIG_MakePtr(SV *, void *, swig_type_info *, int flags); +#else +extern int _SWIG_ConvertPtr(CPerlObj *, SV *, void **, swig_type_info *,int flags); +extern void _SWIG_MakePtr(CPerlObj *, SV *, void *, swig_type_info *, int flags); +#define SWIG_ConvertPtr(a,b,c,d) _SWIG_ConvertPtr(pPerl,a,b,c,d) +#define SWIG_MakePtr(a,b,c,d) _SWIG_MakePtr(pPerl,a,b,c,d) +#endif + +#else + +/* Function for getting a pointer value */ + +#ifndef PERL_OBJECT +SWIGRUNTIME(int) +SWIG_ConvertPtr(SV *sv, void **ptr, swig_type_info *_t, int flags) +#else +#define SWIG_ConvertPtr(a,b,c,d) _SWIG_ConvertPtr(pPerl,a,b,c,d) +SWIGRUNTIME(int) +_SWIG_ConvertPtr(CPerlObj *pPerl, SV *sv, void **ptr, swig_type_info *_t, int flags) +#endif +{ + char *_c; + swig_type_info *tc; + IV tmp; + + /* If magical, apply more magic */ + if (SvGMAGICAL(sv)) + mg_get(sv); + + /* Check to see if this is an object */ + if (sv_isobject(sv)) { + SV *tsv = (SV*) SvRV(sv); + if ((SvTYPE(tsv) == SVt_PVHV)) { + MAGIC *mg; + if (SvMAGICAL(tsv)) { + mg = mg_find(tsv,'P'); + if (mg) { + SV *rsv = mg->mg_obj; + if (sv_isobject(rsv)) { + tmp = SvIV((SV*)SvRV(rsv)); + } + } + } else { + return -1; + } + } else { + tmp = SvIV((SV*)SvRV(sv)); + } + if (!_t) { + *(ptr) = (void *) tmp; + return 0; + } + } else if (! SvOK(sv)) { /* Check for undef */ + *(ptr) = (void *) 0; + return 0; + } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */ + *(ptr) = (void *) 0; + if (!SvROK(sv)) + return 0; + else + return -1; + } else { /* Don't know what it is */ + *(ptr) = (void *) 0; + return -1; + } + if (_t) { + /* Now see if the types match */ + _c = HvNAME(SvSTASH(SvRV(sv))); + tc = SWIG_TypeCheck(_c,_t); + if (!tc) { + *ptr = (void *) tmp; + return -1; + } + *ptr = SWIG_TypeCast(tc,(void *)tmp); + return 0; + } + *ptr = (void *) tmp; + return 0; +} +#ifndef PERL_OBJECT +SWIGRUNTIME(void) +SWIG_MakePtr(SV *sv, void *ptr, swig_type_info *t,int flags) +#else +#define SWIG_MakePtr(a,b,c,d) _SWIG_MakePtr(pPerl,a,b,c,d) +SWIGRUNTIME(void) +_SWIG_MakePtr(CPerlObj *pPerl, SV *sv, void *ptr, swig_type_info *t, int flags) +#endif +{ + sv_setref_pv(sv, (char *) t->name, ptr); +} + +#endif + +typedef XS(SwigPerlWrapper); +typedef SwigPerlWrapper *SwigPerlWrapperPtr; + +/* Structure for command table */ +typedef struct { + const char *name; + SwigPerlWrapperPtr wrapper; +} swig_command_info; + +/* Information for constant table */ + +#define SWIG_INT 1 +#define SWIG_FLOAT 2 +#define SWIG_STRING 3 +#define SWIG_POINTER 4 +#define SWIG_BINARY 5 + +/* Constant information structure */ +typedef struct swig_constant_info { + int type; + const char *name; + long lvalue; + double dvalue; + void *pvalue; + swig_type_info **ptype; +} swig_constant_info; + +#ifdef __cplusplus +} +#endif + +/* Structure for variable table */ +typedef struct { + const char *name; + SwigMagicFunc set; + SwigMagicFunc get; + swig_type_info **type; +} swig_variable_info; + +/* Magic variable code */ +#ifndef PERL_OBJECT +#define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c) + #ifndef MULTIPLICITY + static void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int \ +(*get)(SV *,MAGIC *)) { + #else + static void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*,\ + SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) { + #endif +#else +#define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c) +static void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) { +#endif + MAGIC *mg; + sv_magic(sv,sv,'U',(char *) name,strlen(name)); + mg = mg_find(sv,'U'); + mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL)); + mg->mg_virtual->svt_get = (SwigMagicFuncHack) get; + mg->mg_virtual->svt_set = (SwigMagicFuncHack) set; + mg->mg_virtual->svt_len = 0; + mg->mg_virtual->svt_clear = 0; + mg->mg_virtual->svt_free = 0; +} + + + + + + + +/* -------- TYPES TABLE (BEGIN) -------- */ + +#define SWIGTYPE_p_ZebraService swig_types[0] +#define SWIGTYPE_p_data1_esetname swig_types[1] +#define SWIGTYPE_p_data1_maptab swig_types[2] +#define SWIGTYPE_p_ODR swig_types[3] +#define SWIGTYPE_p_f_p_void__int swig_types[4] +#define SWIGTYPE_p_p_char swig_types[5] +#define SWIGTYPE_p_data1_absyn swig_types[6] +#define SWIGTYPE_p_ZebraHandle swig_types[7] +#define SWIGTYPE_p_void swig_types[8] +#define SWIGTYPE_p_data1_attset swig_types[9] +#define SWIGTYPE_p_size_t swig_types[10] +#define SWIGTYPE_p_WRBUF swig_types[11] +#define SWIGTYPE_p_f_data1_handle_p_void_p_data1_absyn__void swig_types[12] +#define SWIGTYPE_p_Z_Espec1 swig_types[13] +#define SWIGTYPE_p_off_t swig_types[14] +#define SWIGTYPE_p_Odr_oid swig_types[15] +#define SWIGTYPE_p_data1_varset swig_types[16] +#define SWIGTYPE_p_perl_context swig_types[17] +#define SWIGTYPE_p_data1_node swig_types[18] +#define SWIGTYPE_p_data1_tagset swig_types[19] +#define SWIGTYPE_p_data1_tag swig_types[20] +#define SWIGTYPE_p_Z_ExplainRecord swig_types[21] +#define SWIGTYPE_p_NMEM swig_types[22] +#define SWIGTYPE_p_data1_marctab swig_types[23] +#define SWIGTYPE_p_Z_BriefBib swig_types[24] +#define SWIGTYPE_p_FILE swig_types[25] +#define SWIGTYPE_p_f_p_void_p_char_size_t__int swig_types[26] +#define SWIGTYPE_p_data1_element swig_types[27] +#define SWIGTYPE_p_recordGroup swig_types[28] +#define SWIGTYPE_p_p_int swig_types[29] +#define SWIGTYPE_p_int swig_types[30] +#define SWIGTYPE_p_data1_handle swig_types[31] +#define SWIGTYPE_p_data1_attset_cache swig_types[32] +#define SWIGTYPE_p_data1_absyn_cache swig_types[33] +#define SWIGTYPE_p_Z_GenericRecord swig_types[34] +#define SWIGTYPE_p_data1_vartype swig_types[35] +static swig_type_info *swig_types[37]; + +/* -------- TYPES TABLE (END) -------- */ + +#define SWIG_init boot_IDZebra + +#define SWIG_name "IDZebrac::boot_IDZebra" +#define SWIG_prefix "IDZebrac::" + +#ifdef __cplusplus +extern "C" +#endif +#ifndef PERL_OBJECT +#ifndef MULTIPLICITY +SWIGEXPORT(void) SWIG_init (CV* cv); +#else +SWIGEXPORT(void) SWIG_init (pTHXo_ CV* cv); +#endif +#else +SWIGEXPORT(void) SWIG_init (CV *cv, CPerlObj *); +#endif + + +#include "zebraapi.h" +#include "rg.h" +#include "data1.h" +#include "yaz/odr.h" + +#ifdef PERL_OBJECT +#define MAGIC_CLASS _wrap_IDZebra_var:: +class _wrap_IDZebra_var : public CPerlObj { +public: +#else +#define MAGIC_CLASS +#endif +SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *sv, MAGIC *mg) { + MAGIC_PPERL + sv = sv; mg = mg; + croak("Value is read-only."); + return 0; +} + + +#ifdef PERL_OBJECT +}; +#endif + +#ifdef __cplusplus +extern "C" { +#endif +XS(_wrap_recordGroup_groupName_set) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + char *arg2 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: recordGroup_groupName_set(self,groupName);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_groupName_set. Expected _p_recordGroup"); + } + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + { + if (arg1->groupName) free((char*)arg1->groupName); + arg1->groupName = (char *) malloc(strlen(arg2)+1); + strcpy((char*)arg1->groupName,arg2); + } + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_groupName_get) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + char *result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: recordGroup_groupName_get(self);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_groupName_get. Expected _p_recordGroup"); + } + } + result = (char *) ((arg1)->groupName); + + ST(argvi) = sv_newmortal(); + if (result) { + sv_setpv((SV*)ST(argvi++), (char *) result); + }else { + sv_setsv((SV*)ST(argvi++), &PL_sv_undef); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_databaseName_set) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + char *arg2 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: recordGroup_databaseName_set(self,databaseName);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_databaseName_set. Expected _p_recordGroup"); + } + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + { + if (arg1->databaseName) free((char*)arg1->databaseName); + arg1->databaseName = (char *) malloc(strlen(arg2)+1); + strcpy((char*)arg1->databaseName,arg2); + } + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_databaseName_get) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + char *result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: recordGroup_databaseName_get(self);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_databaseName_get. Expected _p_recordGroup"); + } + } + result = (char *) ((arg1)->databaseName); + + ST(argvi) = sv_newmortal(); + if (result) { + sv_setpv((SV*)ST(argvi++), (char *) result); + }else { + sv_setsv((SV*)ST(argvi++), &PL_sv_undef); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_path_set) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + char *arg2 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: recordGroup_path_set(self,path);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_path_set. Expected _p_recordGroup"); + } + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + { + if (arg1->path) free((char*)arg1->path); + arg1->path = (char *) malloc(strlen(arg2)+1); + strcpy((char*)arg1->path,arg2); + } + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_path_get) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + char *result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: recordGroup_path_get(self);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_path_get. Expected _p_recordGroup"); + } + } + result = (char *) ((arg1)->path); + + ST(argvi) = sv_newmortal(); + if (result) { + sv_setpv((SV*)ST(argvi++), (char *) result); + }else { + sv_setsv((SV*)ST(argvi++), &PL_sv_undef); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_recordId_set) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + char *arg2 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: recordGroup_recordId_set(self,recordId);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_recordId_set. Expected _p_recordGroup"); + } + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + { + if (arg1->recordId) free((char*)arg1->recordId); + arg1->recordId = (char *) malloc(strlen(arg2)+1); + strcpy((char*)arg1->recordId,arg2); + } + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_recordId_get) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + char *result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: recordGroup_recordId_get(self);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_recordId_get. Expected _p_recordGroup"); + } + } + result = (char *) ((arg1)->recordId); + + ST(argvi) = sv_newmortal(); + if (result) { + sv_setpv((SV*)ST(argvi++), (char *) result); + }else { + sv_setsv((SV*)ST(argvi++), &PL_sv_undef); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_recordType_set) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + char *arg2 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: recordGroup_recordType_set(self,recordType);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_recordType_set. Expected _p_recordGroup"); + } + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + { + if (arg1->recordType) free((char*)arg1->recordType); + arg1->recordType = (char *) malloc(strlen(arg2)+1); + strcpy((char*)arg1->recordType,arg2); + } + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_recordType_get) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + char *result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: recordGroup_recordType_get(self);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_recordType_get. Expected _p_recordGroup"); + } + } + result = (char *) ((arg1)->recordType); + + ST(argvi) = sv_newmortal(); + if (result) { + sv_setpv((SV*)ST(argvi++), (char *) result); + }else { + sv_setsv((SV*)ST(argvi++), &PL_sv_undef); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_flagStoreData_set) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + int arg2 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: recordGroup_flagStoreData_set(self,flagStoreData);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_flagStoreData_set. Expected _p_recordGroup"); + } + } + arg2 = (int) SvIV(ST(1)); + if (arg1) (arg1)->flagStoreData = arg2; + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_flagStoreData_get) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: recordGroup_flagStoreData_get(self);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_flagStoreData_get. Expected _p_recordGroup"); + } + } + result = (int) ((arg1)->flagStoreData); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_flagStoreKeys_set) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + int arg2 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: recordGroup_flagStoreKeys_set(self,flagStoreKeys);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_flagStoreKeys_set. Expected _p_recordGroup"); + } + } + arg2 = (int) SvIV(ST(1)); + if (arg1) (arg1)->flagStoreKeys = arg2; + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_flagStoreKeys_get) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: recordGroup_flagStoreKeys_get(self);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_flagStoreKeys_get. Expected _p_recordGroup"); + } + } + result = (int) ((arg1)->flagStoreKeys); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_flagRw_set) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + int arg2 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: recordGroup_flagRw_set(self,flagRw);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_flagRw_set. Expected _p_recordGroup"); + } + } + arg2 = (int) SvIV(ST(1)); + if (arg1) (arg1)->flagRw = arg2; + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_flagRw_get) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: recordGroup_flagRw_get(self);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_flagRw_get. Expected _p_recordGroup"); + } + } + result = (int) ((arg1)->flagRw); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_fileVerboseLimit_set) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + int arg2 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: recordGroup_fileVerboseLimit_set(self,fileVerboseLimit);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_fileVerboseLimit_set. Expected _p_recordGroup"); + } + } + arg2 = (int) SvIV(ST(1)); + if (arg1) (arg1)->fileVerboseLimit = arg2; + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_fileVerboseLimit_get) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: recordGroup_fileVerboseLimit_get(self);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_fileVerboseLimit_get. Expected _p_recordGroup"); + } + } + result = (int) ((arg1)->fileVerboseLimit); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_databaseNamePath_set) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + int arg2 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: recordGroup_databaseNamePath_set(self,databaseNamePath);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_databaseNamePath_set. Expected _p_recordGroup"); + } + } + arg2 = (int) SvIV(ST(1)); + if (arg1) (arg1)->databaseNamePath = arg2; + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_databaseNamePath_get) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: recordGroup_databaseNamePath_get(self);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_databaseNamePath_get. Expected _p_recordGroup"); + } + } + result = (int) ((arg1)->databaseNamePath); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_explainDatabase_set) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + int arg2 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: recordGroup_explainDatabase_set(self,explainDatabase);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_explainDatabase_set. Expected _p_recordGroup"); + } + } + arg2 = (int) SvIV(ST(1)); + if (arg1) (arg1)->explainDatabase = arg2; + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_explainDatabase_get) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: recordGroup_explainDatabase_get(self);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_explainDatabase_get. Expected _p_recordGroup"); + } + } + result = (int) ((arg1)->explainDatabase); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_followLinks_set) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + int arg2 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: recordGroup_followLinks_set(self,followLinks);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_followLinks_set. Expected _p_recordGroup"); + } + } + arg2 = (int) SvIV(ST(1)); + if (arg1) (arg1)->followLinks = arg2; + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_recordGroup_followLinks_get) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: recordGroup_followLinks_get(self);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of recordGroup_followLinks_get. Expected _p_recordGroup"); + } + } + result = (int) ((arg1)->followLinks); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_new_recordGroup) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *result; + int argvi = 0; + dXSARGS; + + if ((items < 0) || (items > 0)) { + SWIG_croak("Usage: new_recordGroup();"); + } + result = (recordGroup *)(recordGroup *) calloc(1, sizeof(recordGroup)); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_recordGroup,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_delete_recordGroup) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: delete_recordGroup(self);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of delete_recordGroup. Expected _p_recordGroup"); + } + } + free((char *) arg1); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_init__SWIG_0) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + int argvi = 0; + dXSARGS; + + if ((items < 0) || (items > 0)) { + SWIG_croak("Usage: init();"); + } + init(); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_DESTROY) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + int argvi = 0; + dXSARGS; + + if ((items < 0) || (items > 0)) { + SWIG_croak("Usage: DESTROY();"); + } + DESTROY(); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_logLevel) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + int arg1 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: logLevel(level);"); + } + arg1 = (int) SvIV(ST(0)); + logLevel(arg1); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_logFile) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + char *arg1 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: logFile(fname);"); + } + if (!SvOK((SV*) ST(0))) arg1 = 0; + else arg1 = (char *) SvPV(ST(0), PL_na); + logFile((char const *)arg1); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_logMsg) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + int arg1 ; + char *arg2 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: logMsg(level,message);"); + } + arg1 = (int) SvIV(ST(0)); + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + logMsg(arg1,(char const *)arg2); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_odr_createmem) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + int arg1 ; + ODR result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: odr_createmem(direction);"); + } + arg1 = (int) SvIV(ST(0)); + result = odr_createmem(arg1); + + { + ODR * resultobj = (ODR *) malloc(sizeof(ODR)); + memmove(resultobj, &result, sizeof(ODR)); + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) resultobj, SWIGTYPE_p_ODR,0); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_odr_reset) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ODR arg1 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: odr_reset(o);"); + } + { + ODR * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ODR,0) < 0) { + SWIG_croak("Type error in argument 1 of odr_reset. Expected _p_ODR"); + } + arg1 = *argp; + } + odr_reset(arg1); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_odr_destroy) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ODR arg1 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: odr_destroy(o);"); + } + { + ODR * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ODR,0) < 0) { + SWIG_croak("Type error in argument 1 of odr_destroy. Expected _p_ODR"); + } + arg1 = *argp; + } + odr_destroy(arg1); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_odr_malloc) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ODR arg1 ; + int arg2 ; + void *result; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: odr_malloc(o,size);"); + } + { + ODR * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ODR,0) < 0) { + SWIG_croak("Type error in argument 1 of odr_malloc. Expected _p_ODR"); + } + arg1 = *argp; + } + arg2 = (int) SvIV(ST(1)); + result = (void *)odr_malloc(arg1,arg2); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_void,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_start) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + char *arg1 ; + ZebraService result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: start(configName);"); + } + if (!SvOK((SV*) ST(0))) arg1 = 0; + else arg1 = (char *) SvPV(ST(0), PL_na); + result = zebra_start((char const *)arg1); + + { + ZebraService * resultobj = (ZebraService *) malloc(sizeof(ZebraService)); + memmove(resultobj, &result, sizeof(ZebraService)); + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) resultobj, SWIGTYPE_p_ZebraService,0); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_open) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraService arg1 ; + ZebraHandle result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: open(zs);"); + } + { + ZebraService * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraService,0) < 0) { + SWIG_croak("Type error in argument 1 of open. Expected _p_ZebraService"); + } + arg1 = *argp; + } + result = zebra_open(arg1); + + { + ZebraHandle * resultobj = (ZebraHandle *) malloc(sizeof(ZebraHandle)); + memmove(resultobj, &result, sizeof(ZebraHandle)); + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) resultobj, SWIGTYPE_p_ZebraHandle,0); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_close) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: close(zh);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of close. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + zebra_close(arg1); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_stop) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraService arg1 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: stop(zs);"); + } + { + ZebraService * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraService,0) < 0) { + SWIG_croak("Type error in argument 1 of stop. Expected _p_ZebraService"); + } + arg1 = *argp; + } + zebra_stop(arg1); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_errCode) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: errCode(zh);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of errCode. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + result = (int)zebra_errCode(arg1); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_errString) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + char *result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: errString(zh);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of errString. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + result = (char *)zebra_errString(arg1); + + ST(argvi) = sv_newmortal(); + if (result) { + sv_setpv((SV*)ST(argvi++), (char *) result); + }else { + sv_setsv((SV*)ST(argvi++), &PL_sv_undef); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_errAdd) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + char *result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: errAdd(zh);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of errAdd. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + result = (char *)zebra_errAdd(arg1); + + ST(argvi) = sv_newmortal(); + if (result) { + sv_setpv((SV*)ST(argvi++), (char *) result); + }else { + sv_setsv((SV*)ST(argvi++), &PL_sv_undef); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_describe_recordGroup) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: describe_recordGroup(rg);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of describe_recordGroup. Expected _p_recordGroup"); + } + } + describe_recordGroup(arg1); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_init_recordGroup) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + recordGroup *arg1 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: init_recordGroup(rg);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 1 of init_recordGroup. Expected _p_recordGroup"); + } + } + init_recordGroup(arg1); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_res_get_recordGroup) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + recordGroup *arg2 ; + char *arg3 ; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: res_get_recordGroup(zh,rg,ext);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of res_get_recordGroup. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 2 of res_get_recordGroup. Expected _p_recordGroup"); + } + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + res_get_recordGroup(arg1,arg2,(char const *)arg3); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_set_group) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + struct recordGroup *arg2 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: set_group(zh,rg);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of set_group. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 2 of set_group. Expected _p_recordGroup"); + } + } + zebra_set_group(arg1,arg2); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_select_databases) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + int arg2 ; + char **arg3 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: select_databases(zh,num_bases,basenames);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of select_databases. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + arg2 = (int) SvIV(ST(1)); + { + AV *tempav; + I32 len; + int i; + SV **tv; + STRLEN na; + if (!SvROK(ST(2))) + croak("Argument 3 is not a reference."); + if (SvTYPE(SvRV(ST(2))) != SVt_PVAV) + croak("Argument 3 is not an array."); + tempav = (AV*)SvRV(ST(2)); + len = av_len(tempav); + arg3 = (char **) malloc((len+2)*sizeof(char *)); + for (i = 0; i <= len; i++) { + tv = av_fetch(tempav, i, 0); + arg3[i] = (char *) SvPV(*tv,na); + } + arg3[i] = NULL; + } + result = (int)zebra_select_databases(arg1,arg2,(char const **)arg3); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + { + free(arg3); + } + XSRETURN(argvi); + fail: + { + free(arg3); + } + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_select_database) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + char *arg2 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: select_database(zh,basename);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of select_database. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + result = (int)zebra_select_database(arg1,(char const *)arg2); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_begin_trans) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: begin_trans(zh);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of begin_trans. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + zebra_begin_trans(arg1); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_end_trans) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: end_trans(zh);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of end_trans. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + zebra_end_trans(arg1); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_commit) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: commit(zh);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of commit. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + result = (int)zebra_commit(arg1); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_get_shadow_enable) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: get_shadow_enable(zh);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of get_shadow_enable. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + result = (int)zebra_get_shadow_enable(arg1); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_set_shadow_enable) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + int arg2 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: set_shadow_enable(zh,value);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of set_shadow_enable. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + arg2 = (int) SvIV(ST(1)); + zebra_set_shadow_enable(arg1,arg2); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_init__SWIG_1) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: init(zh);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of init. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + result = (int)zebra_init(arg1); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_init) { + dXSARGS; + + if (items == 0) { + int _v; + (*PL_markstack_ptr++);SWIG_CALLXS(_wrap_init__SWIG_0); return; + } + if (items == 1) { + int _v; + { + void *tmp; + if (SWIG_ConvertPtr(ST(0), (void **) &tmp, SWIGTYPE_p_ZebraHandle, 0) == -1) { + _v = 0; + }else { + _v = 1; + } + } + if (_v) { + (*PL_markstack_ptr++);SWIG_CALLXS(_wrap_init__SWIG_1); return; + } + } + + croak("No matching function for overloaded 'init'"); + XSRETURN(0); +} + + +XS(_wrap_compact) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: compact(zh);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of compact. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + result = (int)zebra_compact(arg1); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_repository_update) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: repository_update(zh);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of repository_update. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + zebra_repository_update(arg1); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_repository_delete) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: repository_delete(zh);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of repository_delete. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + zebra_repository_delete(arg1); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_repository_show) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: repository_show(zh);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of repository_show. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + zebra_repository_show(arg1); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_update_record) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + recordGroup *arg2 ; + int arg3 ; + char *arg4 ; + char *arg5 ; + char *arg6 ; + int arg7 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 7) || (items > 7)) { + SWIG_croak("Usage: update_record(zh,rGroup,sysno,match,fname,buf,buf_size);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of update_record. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 2 of update_record. Expected _p_recordGroup"); + } + } + arg3 = (int) SvIV(ST(2)); + if (!SvOK((SV*) ST(3))) arg4 = 0; + else arg4 = (char *) SvPV(ST(3), PL_na); + if (!SvOK((SV*) ST(4))) arg5 = 0; + else arg5 = (char *) SvPV(ST(4), PL_na); + if (!SvOK((SV*) ST(5))) arg6 = 0; + else arg6 = (char *) SvPV(ST(5), PL_na); + arg7 = (int) SvIV(ST(6)); + result = (int)zebra_update_record(arg1,arg2,arg3,(char const *)arg4,(char const *)arg5,(char const *)arg6,arg7); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_delete_record) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + recordGroup *arg2 ; + int arg3 ; + char *arg4 ; + char *arg5 ; + char *arg6 ; + int arg7 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 7) || (items > 7)) { + SWIG_croak("Usage: delete_record(zh,rGroup,sysno,match,fname,buf,buf_size);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of delete_record. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_recordGroup,0) < 0) { + SWIG_croak("Type error in argument 2 of delete_record. Expected _p_recordGroup"); + } + } + arg3 = (int) SvIV(ST(2)); + if (!SvOK((SV*) ST(3))) arg4 = 0; + else arg4 = (char *) SvPV(ST(3), PL_na); + if (!SvOK((SV*) ST(4))) arg5 = 0; + else arg5 = (char *) SvPV(ST(4), PL_na); + if (!SvOK((SV*) ST(5))) arg6 = 0; + else arg6 = (char *) SvPV(ST(5), PL_na); + arg7 = (int) SvIV(ST(6)); + result = (int)zebra_delete_record(arg1,arg2,arg3,(char const *)arg4,(char const *)arg5,(char const *)arg6,arg7); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_begin_read) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: begin_read(zh);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of begin_read. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + result = (int)zebra_begin_read(arg1); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_end_read) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: end_read(zh);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of end_read. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + zebra_end_read(arg1); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_search_PQF) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + ODR arg2 ; + ODR arg3 ; + char *arg4 ; + char *arg5 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 5) || (items > 5)) { + SWIG_croak("Usage: search_PQF(zh,odr_input,odr_output,pqf_query,setname);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of search_PQF. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + { + ODR * argp; + if (SWIG_ConvertPtr(ST(1),(void **) &argp, SWIGTYPE_p_ODR,0) < 0) { + SWIG_croak("Type error in argument 2 of search_PQF. Expected _p_ODR"); + } + arg2 = *argp; + } + { + ODR * argp; + if (SWIG_ConvertPtr(ST(2),(void **) &argp, SWIGTYPE_p_ODR,0) < 0) { + SWIG_croak("Type error in argument 3 of search_PQF. Expected _p_ODR"); + } + arg3 = *argp; + } + if (!SvOK((SV*) ST(3))) arg4 = 0; + else arg4 = (char *) SvPV(ST(3), PL_na); + if (!SvOK((SV*) ST(4))) arg5 = 0; + else arg5 = (char *) SvPV(ST(4), PL_na); + result = (int)zebra_search_PQF(arg1,arg2,arg3,(char const *)arg4,(char const *)arg5); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_admin_start) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: admin_start(zh);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of admin_start. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + zebra_admin_start(arg1); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_admin_shutdown) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + ZebraHandle arg1 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: admin_shutdown(zh);"); + } + { + ZebraHandle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_ZebraHandle,0) < 0) { + SWIG_croak("Type error in argument 1 of admin_shutdown. Expected _p_ZebraHandle"); + } + arg1 = *argp; + } + zebra_admin_shutdown(arg1); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_nmem_create) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + NMEM result; + int argvi = 0; + dXSARGS; + + if ((items < 0) || (items > 0)) { + SWIG_croak("Usage: nmem_create();"); + } + result = nmem_create(); + + { + NMEM * resultobj = (NMEM *) malloc(sizeof(NMEM)); + memmove(resultobj, &result, sizeof(NMEM)); + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) resultobj, SWIGTYPE_p_NMEM,0); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_nmem_destroy) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + NMEM arg1 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: nmem_destroy(handle);"); + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 1 of nmem_destroy. Expected _p_NMEM"); + } + arg1 = *argp; + } + nmem_destroy(arg1); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_create) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle result; + int argvi = 0; + dXSARGS; + + if ((items < 0) || (items > 0)) { + SWIG_croak("Usage: data1_create();"); + } + result = data1_create(); + + { + data1_handle * resultobj = (data1_handle *) malloc(sizeof(data1_handle)); + memmove(resultobj, &result, sizeof(data1_handle)); + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) resultobj, SWIGTYPE_p_data1_handle,0); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_createx) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + int arg1 ; + data1_handle result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: data1_createx(flags);"); + } + arg1 = (int) SvIV(ST(0)); + result = data1_createx(arg1); + + { + data1_handle * resultobj = (data1_handle *) malloc(sizeof(data1_handle)); + memmove(resultobj, &result, sizeof(data1_handle)); + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) resultobj, SWIGTYPE_p_data1_handle,0); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_destroy) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: data1_destroy(dh);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_destroy. Expected _p_data1_handle"); + } + arg1 = *argp; + } + data1_destroy(arg1); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_get_parent_tag) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: get_parent_tag(dh,n);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of get_parent_tag. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of get_parent_tag. Expected _p_data1_node"); + } + } + result = (data1_node *)get_parent_tag(arg1,arg2); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_read_node) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + char **arg2 ; + NMEM arg3 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: data1_read_node(dh,buf,m);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_read_node. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + AV *tempav; + I32 len; + int i; + SV **tv; + STRLEN na; + if (!SvROK(ST(1))) + croak("Argument 2 is not a reference."); + if (SvTYPE(SvRV(ST(1))) != SVt_PVAV) + croak("Argument 2 is not an array."); + tempav = (AV*)SvRV(ST(1)); + len = av_len(tempav); + arg2 = (char **) malloc((len+2)*sizeof(char *)); + for (i = 0; i <= len; i++) { + tv = av_fetch(tempav, i, 0); + arg2[i] = (char *) SvPV(*tv,na); + } + arg2[i] = NULL; + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(2),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 3 of data1_read_node. Expected _p_NMEM"); + } + arg3 = *argp; + } + result = (data1_node *)data1_read_node(arg1,(char const **)arg2,arg3); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + { + free(arg2); + } + XSRETURN(argvi); + fail: + { + free(arg2); + } + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_read_nodex) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + NMEM arg2 ; + int (*arg3)(void *) ; + void *arg4 ; + WRBUF arg5 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 5) || (items > 5)) { + SWIG_croak("Usage: data1_read_nodex(dh,m,get_byte,fh,wrbuf);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_read_nodex. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(1),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_read_nodex. Expected _p_NMEM"); + } + arg2 = *argp; + } + { + if (SWIG_ConvertPtr(ST(2), (void **) &arg3, SWIGTYPE_p_f_p_void__int,0) < 0) { + SWIG_croak("Type error in argument 3 of data1_read_nodex. Expected _p_f_p_void__int"); + } + } + { + if (SWIG_ConvertPtr(ST(3), (void **) &arg4, 0,0) < 0) { + SWIG_croak("Type error in argument 4 of data1_read_nodex. Expected _p_void"); + } + } + { + WRBUF * argp; + if (SWIG_ConvertPtr(ST(4),(void **) &argp, SWIGTYPE_p_WRBUF,0) < 0) { + SWIG_croak("Type error in argument 5 of data1_read_nodex. Expected _p_WRBUF"); + } + arg5 = *argp; + } + result = (data1_node *)data1_read_nodex(arg1,arg2,arg3,arg4,arg5); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_read_record) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + int (*arg2)(void *,char *,size_t) ; + void *arg3 ; + NMEM arg4 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: data1_read_record(dh,rf,fh,m);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_read_record. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_f_p_void_p_char_size_t__int,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_read_record. Expected _p_f_p_void_p_char_size_t__int"); + } + } + { + if (SWIG_ConvertPtr(ST(2), (void **) &arg3, 0,0) < 0) { + SWIG_croak("Type error in argument 3 of data1_read_record. Expected _p_void"); + } + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(3),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 4 of data1_read_record. Expected _p_NMEM"); + } + arg4 = *argp; + } + result = (data1_node *)data1_read_record(arg1,arg2,arg3,arg4); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_read_absyn) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + char *arg2 ; + int arg3 ; + data1_absyn *result; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: data1_read_absyn(dh,file,file_must_exist);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_read_absyn. Expected _p_data1_handle"); + } + arg1 = *argp; + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + arg3 = (int) SvIV(ST(2)); + result = (data1_absyn *)data1_read_absyn(arg1,(char const *)arg2,arg3); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_absyn,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_gettagbynum) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_tagset *arg2 ; + int arg3 ; + int arg4 ; + data1_tag *result; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: data1_gettagbynum(dh,s,type,value);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_gettagbynum. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_tagset,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_gettagbynum. Expected _p_data1_tagset"); + } + } + arg3 = (int) SvIV(ST(2)); + arg4 = (int) SvIV(ST(3)); + result = (data1_tag *)data1_gettagbynum(arg1,arg2,arg3,arg4); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_tag,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_empty_tagset) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_tagset *result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: data1_empty_tagset(dh);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_empty_tagset. Expected _p_data1_handle"); + } + arg1 = *argp; + } + result = (data1_tagset *)data1_empty_tagset(arg1); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_tagset,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_read_tagset) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + char *arg2 ; + int arg3 ; + data1_tagset *result; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: data1_read_tagset(dh,file,type);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_read_tagset. Expected _p_data1_handle"); + } + arg1 = *argp; + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + arg3 = (int) SvIV(ST(2)); + result = (data1_tagset *)data1_read_tagset(arg1,(char const *)arg2,arg3); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_tagset,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_getelementbytagname) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_absyn *arg2 ; + data1_element *arg3 ; + char *arg4 ; + data1_element *result; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: data1_getelementbytagname(dh,abs,parent,tagname);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_getelementbytagname. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_absyn,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_getelementbytagname. Expected _p_data1_absyn"); + } + } + { + if (SWIG_ConvertPtr(ST(2), (void **) &arg3, SWIGTYPE_p_data1_element,0) < 0) { + SWIG_croak("Type error in argument 3 of data1_getelementbytagname. Expected _p_data1_element"); + } + } + if (!SvOK((SV*) ST(3))) arg4 = 0; + else arg4 = (char *) SvPV(ST(3), PL_na); + result = (data1_element *)data1_getelementbytagname(arg1,arg2,arg3,(char const *)arg4); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_element,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_nodetogr) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + int arg3 ; + ODR arg4 ; + int *arg5 ; + Z_GenericRecord *result; + int argvi = 0; + dXSARGS; + + if ((items < 5) || (items > 5)) { + SWIG_croak("Usage: data1_nodetogr(dh,n,select,o,len);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_nodetogr. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_nodetogr. Expected _p_data1_node"); + } + } + arg3 = (int) SvIV(ST(2)); + { + ODR * argp; + if (SWIG_ConvertPtr(ST(3),(void **) &argp, SWIGTYPE_p_ODR,0) < 0) { + SWIG_croak("Type error in argument 4 of data1_nodetogr. Expected _p_ODR"); + } + arg4 = *argp; + } + { + if (SWIG_ConvertPtr(ST(4), (void **) &arg5, SWIGTYPE_p_int,0) < 0) { + SWIG_croak("Type error in argument 5 of data1_nodetogr. Expected _p_int"); + } + } + result = (Z_GenericRecord *)data1_nodetogr(arg1,arg2,arg3,arg4,arg5); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_Z_GenericRecord,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_gettagbyname) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_tagset *arg2 ; + char *arg3 ; + data1_tag *result; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: data1_gettagbyname(dh,s,name);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_gettagbyname. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_tagset,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_gettagbyname. Expected _p_data1_tagset"); + } + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + result = (data1_tag *)data1_gettagbyname(arg1,arg2,(char const *)arg3); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_tag,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_free_tree) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: data1_free_tree(dh,t);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_free_tree. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_free_tree. Expected _p_data1_node"); + } + } + data1_free_tree(arg1,arg2); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_nodetobuf) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + int arg3 ; + int *arg4 ; + char *result; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: data1_nodetobuf(dh,n,select,len);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_nodetobuf. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_nodetobuf. Expected _p_data1_node"); + } + } + arg3 = (int) SvIV(ST(2)); + { + if (SWIG_ConvertPtr(ST(3), (void **) &arg4, SWIGTYPE_p_int,0) < 0) { + SWIG_croak("Type error in argument 4 of data1_nodetobuf. Expected _p_int"); + } + } + result = (char *)data1_nodetobuf(arg1,arg2,arg3,arg4); + + ST(argvi) = sv_newmortal(); + if (result) { + sv_setpv((SV*)ST(argvi++), (char *) result); + }else { + sv_setsv((SV*)ST(argvi++), &PL_sv_undef); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_mk_tag_data_wd) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + char *arg3 ; + NMEM arg4 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: data1_mk_tag_data_wd(dh,at,tagname,m);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_mk_tag_data_wd. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_mk_tag_data_wd. Expected _p_data1_node"); + } + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(3),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 4 of data1_mk_tag_data_wd. Expected _p_NMEM"); + } + arg4 = *argp; + } + result = (data1_node *)data1_mk_tag_data_wd(arg1,arg2,(char const *)arg3,arg4); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_mk_tag_data) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + char *arg3 ; + NMEM arg4 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: data1_mk_tag_data(dh,at,tagname,m);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_mk_tag_data. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_mk_tag_data. Expected _p_data1_node"); + } + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(3),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 4 of data1_mk_tag_data. Expected _p_NMEM"); + } + arg4 = *argp; + } + result = (data1_node *)data1_mk_tag_data(arg1,arg2,(char const *)arg3,arg4); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_maptype) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + char *arg2 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: data1_maptype(dh,t);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_maptype. Expected _p_data1_handle"); + } + arg1 = *argp; + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + result = (int)data1_maptype(arg1,arg2); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_read_varset) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + char *arg2 ; + data1_varset *result; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: data1_read_varset(dh,file);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_read_varset. Expected _p_data1_handle"); + } + arg1 = *argp; + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + result = (data1_varset *)data1_read_varset(arg1,(char const *)arg2); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_varset,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_getvartypebyct) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_varset *arg2 ; + char *arg3 ; + char *arg4 ; + data1_vartype *result; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: data1_getvartypebyct(dh,set,zclass,type);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_getvartypebyct. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_varset,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_getvartypebyct. Expected _p_data1_varset"); + } + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + if (!SvOK((SV*) ST(3))) arg4 = 0; + else arg4 = (char *) SvPV(ST(3), PL_na); + result = (data1_vartype *)data1_getvartypebyct(arg1,arg2,arg3,arg4); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_vartype,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_read_espec1) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + char *arg2 ; + Z_Espec1 *result; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: data1_read_espec1(dh,file);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_read_espec1. Expected _p_data1_handle"); + } + arg1 = *argp; + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + result = (Z_Espec1 *)data1_read_espec1(arg1,(char const *)arg2); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_Z_Espec1,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_doespec1) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + Z_Espec1 *arg3 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: data1_doespec1(dh,n,e);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_doespec1. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_doespec1. Expected _p_data1_node"); + } + } + { + if (SWIG_ConvertPtr(ST(2), (void **) &arg3, SWIGTYPE_p_Z_Espec1,0) < 0) { + SWIG_croak("Type error in argument 3 of data1_doespec1. Expected _p_Z_Espec1"); + } + } + result = (int)data1_doespec1(arg1,arg2,arg3); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_getesetbyname) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_absyn *arg2 ; + char *arg3 ; + data1_esetname *result; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: data1_getesetbyname(dh,a,name);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_getesetbyname. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_absyn,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_getesetbyname. Expected _p_data1_absyn"); + } + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + result = (data1_esetname *)data1_getesetbyname(arg1,arg2,(char const *)arg3); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_esetname,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_getelementbyname) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_absyn *arg2 ; + char *arg3 ; + data1_element *result; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: data1_getelementbyname(dh,absyn,name);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_getelementbyname. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_absyn,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_getelementbyname. Expected _p_data1_absyn"); + } + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + result = (data1_element *)data1_getelementbyname(arg1,arg2,(char const *)arg3); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_element,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_mk_node2) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + NMEM arg2 ; + int arg3 ; + data1_node *arg4 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: data1_mk_node2(dh,m,type,parent);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_mk_node2. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(1),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_mk_node2. Expected _p_NMEM"); + } + arg2 = *argp; + } + arg3 = (int) SvIV(ST(2)); + { + if (SWIG_ConvertPtr(ST(3), (void **) &arg4, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 4 of data1_mk_node2. Expected _p_data1_node"); + } + } + result = (data1_node *)data1_mk_node2(arg1,arg2,arg3,arg4); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_mk_tag) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + NMEM arg2 ; + char *arg3 ; + char **arg4 ; + data1_node *arg5 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 5) || (items > 5)) { + SWIG_croak("Usage: data1_mk_tag(dh,nmem,tag,attr,at);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_mk_tag. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(1),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_mk_tag. Expected _p_NMEM"); + } + arg2 = *argp; + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + { + AV *tempav; + I32 len; + int i; + SV **tv; + STRLEN na; + if (!SvROK(ST(3))) + croak("Argument 4 is not a reference."); + if (SvTYPE(SvRV(ST(3))) != SVt_PVAV) + croak("Argument 4 is not an array."); + tempav = (AV*)SvRV(ST(3)); + len = av_len(tempav); + arg4 = (char **) malloc((len+2)*sizeof(char *)); + for (i = 0; i <= len; i++) { + tv = av_fetch(tempav, i, 0); + arg4[i] = (char *) SvPV(*tv,na); + } + arg4[i] = NULL; + } + { + if (SWIG_ConvertPtr(ST(4), (void **) &arg5, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 5 of data1_mk_tag. Expected _p_data1_node"); + } + } + result = (data1_node *)data1_mk_tag(arg1,arg2,(char const *)arg3,(char const **)arg4,arg5); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + { + free(arg4); + } + XSRETURN(argvi); + fail: + { + free(arg4); + } + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_mk_tag_n) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + NMEM arg2 ; + char *arg3 ; + size_t arg4 ; + char **arg5 ; + data1_node *arg6 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 6) || (items > 6)) { + SWIG_croak("Usage: data1_mk_tag_n(dh,nmem,tag,len,attr,at);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_mk_tag_n. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(1),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_mk_tag_n. Expected _p_NMEM"); + } + arg2 = *argp; + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + arg4 = (size_t) SvUV(ST(3)); + { + AV *tempav; + I32 len; + int i; + SV **tv; + STRLEN na; + if (!SvROK(ST(4))) + croak("Argument 5 is not a reference."); + if (SvTYPE(SvRV(ST(4))) != SVt_PVAV) + croak("Argument 5 is not an array."); + tempav = (AV*)SvRV(ST(4)); + len = av_len(tempav); + arg5 = (char **) malloc((len+2)*sizeof(char *)); + for (i = 0; i <= len; i++) { + tv = av_fetch(tempav, i, 0); + arg5[i] = (char *) SvPV(*tv,na); + } + arg5[i] = NULL; + } + { + if (SWIG_ConvertPtr(ST(5), (void **) &arg6, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 6 of data1_mk_tag_n. Expected _p_data1_node"); + } + } + result = (data1_node *)data1_mk_tag_n(arg1,arg2,(char const *)arg3,arg4,(char const **)arg5,arg6); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + { + free(arg5); + } + XSRETURN(argvi); + fail: + { + free(arg5); + } + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_tag_add_attr) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + NMEM arg2 ; + data1_node *arg3 ; + char **arg4 ; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: data1_tag_add_attr(dh,nmem,res,attr);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_tag_add_attr. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(1),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_tag_add_attr. Expected _p_NMEM"); + } + arg2 = *argp; + } + { + if (SWIG_ConvertPtr(ST(2), (void **) &arg3, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 3 of data1_tag_add_attr. Expected _p_data1_node"); + } + } + { + AV *tempav; + I32 len; + int i; + SV **tv; + STRLEN na; + if (!SvROK(ST(3))) + croak("Argument 4 is not a reference."); + if (SvTYPE(SvRV(ST(3))) != SVt_PVAV) + croak("Argument 4 is not an array."); + tempav = (AV*)SvRV(ST(3)); + len = av_len(tempav); + arg4 = (char **) malloc((len+2)*sizeof(char *)); + for (i = 0; i <= len; i++) { + tv = av_fetch(tempav, i, 0); + arg4[i] = (char *) SvPV(*tv,na); + } + arg4[i] = NULL; + } + data1_tag_add_attr(arg1,arg2,arg3,(char const **)arg4); + + + { + free(arg4); + } + XSRETURN(argvi); + fail: + { + free(arg4); + } + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_mk_text_n) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + NMEM arg2 ; + char *arg3 ; + size_t arg4 ; + data1_node *arg5 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 5) || (items > 5)) { + SWIG_croak("Usage: data1_mk_text_n(dh,mem,buf,len,parent);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_mk_text_n. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(1),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_mk_text_n. Expected _p_NMEM"); + } + arg2 = *argp; + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + arg4 = (size_t) SvUV(ST(3)); + { + if (SWIG_ConvertPtr(ST(4), (void **) &arg5, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 5 of data1_mk_text_n. Expected _p_data1_node"); + } + } + result = (data1_node *)data1_mk_text_n(arg1,arg2,(char const *)arg3,arg4,arg5); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_mk_text_nf) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + NMEM arg2 ; + char *arg3 ; + size_t arg4 ; + data1_node *arg5 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 5) || (items > 5)) { + SWIG_croak("Usage: data1_mk_text_nf(dh,mem,buf,len,parent);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_mk_text_nf. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(1),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_mk_text_nf. Expected _p_NMEM"); + } + arg2 = *argp; + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + arg4 = (size_t) SvUV(ST(3)); + { + if (SWIG_ConvertPtr(ST(4), (void **) &arg5, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 5 of data1_mk_text_nf. Expected _p_data1_node"); + } + } + result = (data1_node *)data1_mk_text_nf(arg1,arg2,(char const *)arg3,arg4,arg5); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_mk_text) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + NMEM arg2 ; + char *arg3 ; + data1_node *arg4 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: data1_mk_text(dh,mem,buf,parent);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_mk_text. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(1),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_mk_text. Expected _p_NMEM"); + } + arg2 = *argp; + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + { + if (SWIG_ConvertPtr(ST(3), (void **) &arg4, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 4 of data1_mk_text. Expected _p_data1_node"); + } + } + result = (data1_node *)data1_mk_text(arg1,arg2,(char const *)arg3,arg4); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_mk_comment_n) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + NMEM arg2 ; + char *arg3 ; + size_t arg4 ; + data1_node *arg5 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 5) || (items > 5)) { + SWIG_croak("Usage: data1_mk_comment_n(dh,mem,buf,len,parent);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_mk_comment_n. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(1),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_mk_comment_n. Expected _p_NMEM"); + } + arg2 = *argp; + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + arg4 = (size_t) SvUV(ST(3)); + { + if (SWIG_ConvertPtr(ST(4), (void **) &arg5, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 5 of data1_mk_comment_n. Expected _p_data1_node"); + } + } + result = (data1_node *)data1_mk_comment_n(arg1,arg2,(char const *)arg3,arg4,arg5); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_mk_comment) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + NMEM arg2 ; + char *arg3 ; + data1_node *arg4 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: data1_mk_comment(dh,mem,buf,parent);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_mk_comment. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(1),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_mk_comment. Expected _p_NMEM"); + } + arg2 = *argp; + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + { + if (SWIG_ConvertPtr(ST(3), (void **) &arg4, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 4 of data1_mk_comment. Expected _p_data1_node"); + } + } + result = (data1_node *)data1_mk_comment(arg1,arg2,(char const *)arg3,arg4); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_mk_preprocess) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + NMEM arg2 ; + char *arg3 ; + char **arg4 ; + data1_node *arg5 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 5) || (items > 5)) { + SWIG_croak("Usage: data1_mk_preprocess(dh,nmem,target,attr,at);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_mk_preprocess. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(1),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_mk_preprocess. Expected _p_NMEM"); + } + arg2 = *argp; + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + { + AV *tempav; + I32 len; + int i; + SV **tv; + STRLEN na; + if (!SvROK(ST(3))) + croak("Argument 4 is not a reference."); + if (SvTYPE(SvRV(ST(3))) != SVt_PVAV) + croak("Argument 4 is not an array."); + tempav = (AV*)SvRV(ST(3)); + len = av_len(tempav); + arg4 = (char **) malloc((len+2)*sizeof(char *)); + for (i = 0; i <= len; i++) { + tv = av_fetch(tempav, i, 0); + arg4[i] = (char *) SvPV(*tv,na); + } + arg4[i] = NULL; + } + { + if (SWIG_ConvertPtr(ST(4), (void **) &arg5, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 5 of data1_mk_preprocess. Expected _p_data1_node"); + } + } + result = (data1_node *)data1_mk_preprocess(arg1,arg2,(char const *)arg3,(char const **)arg4,arg5); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + { + free(arg4); + } + XSRETURN(argvi); + fail: + { + free(arg4); + } + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_mk_root) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + NMEM arg2 ; + char *arg3 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: data1_mk_root(dh,nmem,name);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_mk_root. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(1),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_mk_root. Expected _p_NMEM"); + } + arg2 = *argp; + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + result = (data1_node *)data1_mk_root(arg1,arg2,(char const *)arg3); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_set_root) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + NMEM arg3 ; + char *arg4 ; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: data1_set_root(dh,res,nmem,name);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_set_root. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_set_root. Expected _p_data1_node"); + } + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(2),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 3 of data1_set_root. Expected _p_NMEM"); + } + arg3 = *argp; + } + if (!SvOK((SV*) ST(3))) arg4 = 0; + else arg4 = (char *) SvPV(ST(3), PL_na); + data1_set_root(arg1,arg2,arg3,(char const *)arg4); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_mk_tag_data_int) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + char *arg3 ; + int arg4 ; + NMEM arg5 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 5) || (items > 5)) { + SWIG_croak("Usage: data1_mk_tag_data_int(dh,at,tag,num,nmem);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_mk_tag_data_int. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_mk_tag_data_int. Expected _p_data1_node"); + } + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + arg4 = (int) SvIV(ST(3)); + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(4),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 5 of data1_mk_tag_data_int. Expected _p_NMEM"); + } + arg5 = *argp; + } + result = (data1_node *)data1_mk_tag_data_int(arg1,arg2,(char const *)arg3,arg4,arg5); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_mk_tag_data_oid) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + char *arg3 ; + Odr_oid *arg4 ; + NMEM arg5 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 5) || (items > 5)) { + SWIG_croak("Usage: data1_mk_tag_data_oid(dh,at,tag,oid,nmem);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_mk_tag_data_oid. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_mk_tag_data_oid. Expected _p_data1_node"); + } + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + { + if (SWIG_ConvertPtr(ST(3), (void **) &arg4, SWIGTYPE_p_Odr_oid,0) < 0) { + SWIG_croak("Type error in argument 4 of data1_mk_tag_data_oid. Expected _p_Odr_oid"); + } + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(4),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 5 of data1_mk_tag_data_oid. Expected _p_NMEM"); + } + arg5 = *argp; + } + result = (data1_node *)data1_mk_tag_data_oid(arg1,arg2,(char const *)arg3,arg4,arg5); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_mk_tag_data_text) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + char *arg3 ; + char *arg4 ; + NMEM arg5 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 5) || (items > 5)) { + SWIG_croak("Usage: data1_mk_tag_data_text(dh,at,tag,str,nmem);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_mk_tag_data_text. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_mk_tag_data_text. Expected _p_data1_node"); + } + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + if (!SvOK((SV*) ST(3))) arg4 = 0; + else arg4 = (char *) SvPV(ST(3), PL_na); + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(4),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 5 of data1_mk_tag_data_text. Expected _p_NMEM"); + } + arg5 = *argp; + } + result = (data1_node *)data1_mk_tag_data_text(arg1,arg2,(char const *)arg3,(char const *)arg4,arg5); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_mk_tag_data_text_uni) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + char *arg3 ; + char *arg4 ; + NMEM arg5 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 5) || (items > 5)) { + SWIG_croak("Usage: data1_mk_tag_data_text_uni(dh,at,tag,str,nmem);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_mk_tag_data_text_uni. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_mk_tag_data_text_uni. Expected _p_data1_node"); + } + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + if (!SvOK((SV*) ST(3))) arg4 = 0; + else arg4 = (char *) SvPV(ST(3), PL_na); + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(4),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 5 of data1_mk_tag_data_text_uni. Expected _p_NMEM"); + } + arg5 = *argp; + } + result = (data1_node *)data1_mk_tag_data_text_uni(arg1,arg2,(char const *)arg3,(char const *)arg4,arg5); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_get_absyn) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + char *arg2 ; + data1_absyn *result; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: data1_get_absyn(dh,name);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_get_absyn. Expected _p_data1_handle"); + } + arg1 = *argp; + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + result = (data1_absyn *)data1_get_absyn(arg1,(char const *)arg2); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_absyn,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_search_tag) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + char *arg3 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: data1_search_tag(dh,n,tag);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_search_tag. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_search_tag. Expected _p_data1_node"); + } + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + result = (data1_node *)data1_search_tag(arg1,arg2,(char const *)arg3); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_mk_tag_uni) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + NMEM arg2 ; + char *arg3 ; + data1_node *arg4 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: data1_mk_tag_uni(dh,nmem,tag,at);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_mk_tag_uni. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(1),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_mk_tag_uni. Expected _p_NMEM"); + } + arg2 = *argp; + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + { + if (SWIG_ConvertPtr(ST(3), (void **) &arg4, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 4 of data1_mk_tag_uni. Expected _p_data1_node"); + } + } + result = (data1_node *)data1_mk_tag_uni(arg1,arg2,(char const *)arg3,arg4); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_get_attset) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + char *arg2 ; + data1_attset *result; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: data1_get_attset(dh,name);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_get_attset. Expected _p_data1_handle"); + } + arg1 = *argp; + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + result = (data1_attset *)data1_get_attset(arg1,(char const *)arg2); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_attset,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_read_maptab) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + char *arg2 ; + data1_maptab *result; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: data1_read_maptab(dh,file);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_read_maptab. Expected _p_data1_handle"); + } + arg1 = *argp; + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + result = (data1_maptab *)data1_read_maptab(arg1,(char const *)arg2); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_maptab,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_map_record) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + data1_maptab *arg3 ; + NMEM arg4 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: data1_map_record(dh,n,map,m);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_map_record. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_map_record. Expected _p_data1_node"); + } + } + { + if (SWIG_ConvertPtr(ST(2), (void **) &arg3, SWIGTYPE_p_data1_maptab,0) < 0) { + SWIG_croak("Type error in argument 3 of data1_map_record. Expected _p_data1_maptab"); + } + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(3),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 4 of data1_map_record. Expected _p_NMEM"); + } + arg4 = *argp; + } + result = (data1_node *)data1_map_record(arg1,arg2,arg3,arg4); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_read_marctab) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + char *arg2 ; + data1_marctab *result; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: data1_read_marctab(dh,file);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_read_marctab. Expected _p_data1_handle"); + } + arg1 = *argp; + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + result = (data1_marctab *)data1_read_marctab(arg1,(char const *)arg2); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_marctab,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_nodetomarc) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_marctab *arg2 ; + data1_node *arg3 ; + int arg4 ; + int *arg5 ; + char *result; + int argvi = 0; + dXSARGS; + + if ((items < 5) || (items > 5)) { + SWIG_croak("Usage: data1_nodetomarc(dh,p,n,selected,len);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_nodetomarc. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_marctab,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_nodetomarc. Expected _p_data1_marctab"); + } + } + { + if (SWIG_ConvertPtr(ST(2), (void **) &arg3, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 3 of data1_nodetomarc. Expected _p_data1_node"); + } + } + arg4 = (int) SvIV(ST(3)); + { + if (SWIG_ConvertPtr(ST(4), (void **) &arg5, SWIGTYPE_p_int,0) < 0) { + SWIG_croak("Type error in argument 5 of data1_nodetomarc. Expected _p_int"); + } + } + result = (char *)data1_nodetomarc(arg1,arg2,arg3,arg4,arg5); + + ST(argvi) = sv_newmortal(); + if (result) { + sv_setpv((SV*)ST(argvi++), (char *) result); + }else { + sv_setsv((SV*)ST(argvi++), &PL_sv_undef); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_nodetoidsgml) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + int arg3 ; + int *arg4 ; + char *result; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: data1_nodetoidsgml(dh,n,select,len);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_nodetoidsgml. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_nodetoidsgml. Expected _p_data1_node"); + } + } + arg3 = (int) SvIV(ST(2)); + { + if (SWIG_ConvertPtr(ST(3), (void **) &arg4, SWIGTYPE_p_int,0) < 0) { + SWIG_croak("Type error in argument 4 of data1_nodetoidsgml. Expected _p_int"); + } + } + result = (char *)data1_nodetoidsgml(arg1,arg2,arg3,arg4); + + ST(argvi) = sv_newmortal(); + if (result) { + sv_setpv((SV*)ST(argvi++), (char *) result); + }else { + sv_setsv((SV*)ST(argvi++), &PL_sv_undef); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_nodetoexplain) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + int arg3 ; + ODR arg4 ; + Z_ExplainRecord *result; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: data1_nodetoexplain(dh,n,select,o);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_nodetoexplain. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_nodetoexplain. Expected _p_data1_node"); + } + } + arg3 = (int) SvIV(ST(2)); + { + ODR * argp; + if (SWIG_ConvertPtr(ST(3),(void **) &argp, SWIGTYPE_p_ODR,0) < 0) { + SWIG_croak("Type error in argument 4 of data1_nodetoexplain. Expected _p_ODR"); + } + arg4 = *argp; + } + result = (Z_ExplainRecord *)data1_nodetoexplain(arg1,arg2,arg3,arg4); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_Z_ExplainRecord,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_nodetosummary) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + int arg3 ; + ODR arg4 ; + Z_BriefBib *result; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: data1_nodetosummary(dh,n,select,o);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_nodetosummary. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_nodetosummary. Expected _p_data1_node"); + } + } + arg3 = (int) SvIV(ST(2)); + { + ODR * argp; + if (SWIG_ConvertPtr(ST(3),(void **) &argp, SWIGTYPE_p_ODR,0) < 0) { + SWIG_croak("Type error in argument 4 of data1_nodetosummary. Expected _p_ODR"); + } + arg4 = *argp; + } + result = (Z_BriefBib *)data1_nodetosummary(arg1,arg2,arg3,arg4); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_Z_BriefBib,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_nodetosoif) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + int arg3 ; + int *arg4 ; + char *result; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: data1_nodetosoif(dh,n,select,len);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_nodetosoif. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_nodetosoif. Expected _p_data1_node"); + } + } + arg3 = (int) SvIV(ST(2)); + { + if (SWIG_ConvertPtr(ST(3), (void **) &arg4, SWIGTYPE_p_int,0) < 0) { + SWIG_croak("Type error in argument 4 of data1_nodetosoif. Expected _p_int"); + } + } + result = (char *)data1_nodetosoif(arg1,arg2,arg3,arg4); + + ST(argvi) = sv_newmortal(); + if (result) { + sv_setpv((SV*)ST(argvi++), (char *) result); + }else { + sv_setsv((SV*)ST(argvi++), &PL_sv_undef); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_get_wrbuf) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + WRBUF result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: data1_get_wrbuf(dp);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_get_wrbuf. Expected _p_data1_handle"); + } + arg1 = *argp; + } + result = data1_get_wrbuf(arg1); + + { + WRBUF * resultobj = (WRBUF *) malloc(sizeof(WRBUF)); + memmove(resultobj, &result, sizeof(WRBUF)); + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) resultobj, SWIGTYPE_p_WRBUF,0); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_get_read_buf) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + int **arg2 ; + char **result; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: data1_get_read_buf(dp,lenp);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_get_read_buf. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_p_int,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_get_read_buf. Expected _p_p_int"); + } + } + result = (char **)data1_get_read_buf(arg1,arg2); + + { + AV *myav; + SV **svs; + int i = 0,len = 0; + /* Figure out how many elements we have */ + while (result[len]) + len++; + svs = (SV **) malloc(len*sizeof(SV *)); + for (i = 0; i < len ; i++) { + svs[i] = sv_newmortal(); + sv_setpv((SV*)svs[i],result[i]); + }; + myav = av_make(len,svs); + free(svs); + ST(argvi) = newRV((SV*)myav); + sv_2mortal(ST(argvi)); + argvi++; + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_get_map_buf) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + int **arg2 ; + char **result; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: data1_get_map_buf(dp,lenp);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_get_map_buf. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_p_int,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_get_map_buf. Expected _p_p_int"); + } + } + result = (char **)data1_get_map_buf(arg1,arg2); + + { + AV *myav; + SV **svs; + int i = 0,len = 0; + /* Figure out how many elements we have */ + while (result[len]) + len++; + svs = (SV **) malloc(len*sizeof(SV *)); + for (i = 0; i < len ; i++) { + svs[i] = sv_newmortal(); + sv_setpv((SV*)svs[i],result[i]); + }; + myav = av_make(len,svs); + free(svs); + ST(argvi) = newRV((SV*)myav); + sv_2mortal(ST(argvi)); + argvi++; + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_absyn_cache_get) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_absyn_cache *result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: data1_absyn_cache_get(dh);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_absyn_cache_get. Expected _p_data1_handle"); + } + arg1 = *argp; + } + result = (data1_absyn_cache *)data1_absyn_cache_get(arg1); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_absyn_cache,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_attset_cache_get) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_attset_cache *result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: data1_attset_cache_get(dh);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_attset_cache_get. Expected _p_data1_handle"); + } + arg1 = *argp; + } + result = (data1_attset_cache *)data1_attset_cache_get(arg1); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_attset_cache,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_nmem_get) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + NMEM result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: data1_nmem_get(dh);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_nmem_get. Expected _p_data1_handle"); + } + arg1 = *argp; + } + result = data1_nmem_get(arg1); + + { + NMEM * resultobj = (NMEM *) malloc(sizeof(NMEM)); + memmove(resultobj, &result, sizeof(NMEM)); + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) resultobj, SWIGTYPE_p_NMEM,0); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_pr_tree) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + FILE *arg3 ; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: data1_pr_tree(dh,n,out);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_pr_tree. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_pr_tree. Expected _p_data1_node"); + } + } + { + if (SWIG_ConvertPtr(ST(2), (void **) &arg3, SWIGTYPE_p_FILE,0) < 0) { + SWIG_croak("Type error in argument 3 of data1_pr_tree. Expected _p_FILE"); + } + } + data1_pr_tree(arg1,arg2,arg3); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_print_tree) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: data1_print_tree(dh,n);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_print_tree. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_print_tree. Expected _p_data1_node"); + } + } + data1_print_tree(arg1,arg2); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_insert_string) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + NMEM arg3 ; + char *arg4 ; + char *result; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: data1_insert_string(dh,res,m,str);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_insert_string. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_insert_string. Expected _p_data1_node"); + } + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(2),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 3 of data1_insert_string. Expected _p_NMEM"); + } + arg3 = *argp; + } + if (!SvOK((SV*) ST(3))) arg4 = 0; + else arg4 = (char *) SvPV(ST(3), PL_na); + result = (char *)data1_insert_string(arg1,arg2,arg3,(char const *)arg4); + + ST(argvi) = sv_newmortal(); + if (result) { + sv_setpv((SV*)ST(argvi++), (char *) result); + }else { + sv_setsv((SV*)ST(argvi++), &PL_sv_undef); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_insert_string_n) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + data1_node *arg2 ; + NMEM arg3 ; + char *arg4 ; + size_t arg5 ; + char *result; + int argvi = 0; + dXSARGS; + + if ((items < 5) || (items > 5)) { + SWIG_croak("Usage: data1_insert_string_n(dh,res,m,str,len);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_insert_string_n. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_insert_string_n. Expected _p_data1_node"); + } + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(2),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 3 of data1_insert_string_n. Expected _p_NMEM"); + } + arg3 = *argp; + } + if (!SvOK((SV*) ST(3))) arg4 = 0; + else arg4 = (char *) SvPV(ST(3), PL_na); + arg5 = (size_t) SvUV(ST(4)); + result = (char *)data1_insert_string_n(arg1,arg2,arg3,(char const *)arg4,arg5); + + ST(argvi) = sv_newmortal(); + if (result) { + sv_setpv((SV*)ST(argvi++), (char *) result); + }else { + sv_setsv((SV*)ST(argvi++), &PL_sv_undef); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_read_sgml) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + NMEM arg2 ; + char *arg3 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: data1_read_sgml(dh,m,buf);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_read_sgml. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + NMEM * argp; + if (SWIG_ConvertPtr(ST(1),(void **) &argp, SWIGTYPE_p_NMEM,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_read_sgml. Expected _p_NMEM"); + } + arg2 = *argp; + } + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + result = (data1_node *)data1_read_sgml(arg1,arg2,(char const *)arg3); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_absyn_trav) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + void *arg2 ; + void (*arg3)(data1_handle,void *,data1_absyn *) ; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: data1_absyn_trav(dh,handle,fh);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_absyn_trav. Expected _p_data1_handle"); + } + arg1 = *argp; + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, 0,0) < 0) { + SWIG_croak("Type error in argument 2 of data1_absyn_trav. Expected _p_void"); + } + } + { + if (SWIG_ConvertPtr(ST(2), (void **) &arg3, SWIGTYPE_p_f_data1_handle_p_void_p_data1_absyn__void,0) < 0) { + SWIG_croak("Type error in argument 3 of data1_absyn_trav. Expected _p_f_data1_handle_p_void_p_data1_absyn__void"); + } + } + data1_absyn_trav(arg1,arg2,arg3); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_attset_search_id) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + int arg2 ; + data1_attset *result; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: data1_attset_search_id(dh,id);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_attset_search_id. Expected _p_data1_handle"); + } + arg1 = *argp; + } + arg2 = (int) SvIV(ST(1)); + result = (data1_attset *)data1_attset_search_id(arg1,arg2); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_attset,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_getNodeValue) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_node *arg1 ; + char *arg2 ; + char *result; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: data1_getNodeValue(node,pTagPath);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_getNodeValue. Expected _p_data1_node"); + } + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + result = (char *)data1_getNodeValue(arg1,arg2); + + ST(argvi) = sv_newmortal(); + if (result) { + sv_setpv((SV*)ST(argvi++), (char *) result); + }else { + sv_setsv((SV*)ST(argvi++), &PL_sv_undef); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_LookupNode) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_node *arg1 ; + char *arg2 ; + data1_node *result; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: data1_LookupNode(node,pTagPath);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_LookupNode. Expected _p_data1_node"); + } + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + result = (data1_node *)data1_LookupNode(arg1,arg2); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_data1_node,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_CountOccurences) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_node *arg1 ; + char *arg2 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: data1_CountOccurences(node,pTagPath);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_CountOccurences. Expected _p_data1_node"); + } + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + result = (int)data1_CountOccurences(arg1,arg2); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_path_fopen) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + char *arg2 ; + char *arg3 ; + FILE *result; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: data1_path_fopen(dh,file,mode);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_path_fopen. Expected _p_data1_handle"); + } + arg1 = *argp; + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + if (!SvOK((SV*) ST(2))) arg3 = 0; + else arg3 = (char *) SvPV(ST(2), PL_na); + result = (FILE *)data1_path_fopen(arg1,(char const *)arg2,(char const *)arg3); + + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_FILE,0); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_set_tabpath) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + char *arg2 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: data1_set_tabpath(dh,path);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_set_tabpath. Expected _p_data1_handle"); + } + arg1 = *argp; + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + data1_set_tabpath(arg1,(char const *)arg2); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_set_tabroot) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + char *arg2 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: data1_set_tabroot(dp,p);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_set_tabroot. Expected _p_data1_handle"); + } + arg1 = *argp; + } + if (!SvOK((SV*) ST(1))) arg2 = 0; + else arg2 = (char *) SvPV(ST(1), PL_na); + data1_set_tabroot(arg1,(char const *)arg2); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_get_tabpath) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + char *result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: data1_get_tabpath(dh);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_get_tabpath. Expected _p_data1_handle"); + } + arg1 = *argp; + } + result = (char *)data1_get_tabpath(arg1); + + ST(argvi) = sv_newmortal(); + if (result) { + sv_setpv((SV*)ST(argvi++), (char *) result); + }else { + sv_setsv((SV*)ST(argvi++), &PL_sv_undef); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_data1_get_tabroot) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + data1_handle arg1 ; + char *result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: data1_get_tabroot(dh);"); + } + { + data1_handle * argp; + if (SWIG_ConvertPtr(ST(0),(void **) &argp, SWIGTYPE_p_data1_handle,0) < 0) { + SWIG_croak("Type error in argument 1 of data1_get_tabroot. Expected _p_data1_handle"); + } + arg1 = *argp; + } + result = (char *)data1_get_tabroot(arg1); + + ST(argvi) = sv_newmortal(); + if (result) { + sv_setpv((SV*)ST(argvi++), (char *) result); + }else { + sv_setsv((SV*)ST(argvi++), &PL_sv_undef); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_grs_perl_readf) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + struct perl_context *arg1 ; + size_t arg2 ; + int result; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: grs_perl_readf(context,len);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_perl_context,0) < 0) { + SWIG_croak("Type error in argument 1 of grs_perl_readf. Expected _p_perl_context"); + } + } + arg2 = (size_t) SvUV(ST(1)); + result = (int)grs_perl_readf(arg1,arg2); + + ST(argvi) = sv_newmortal(); + sv_setiv(ST(argvi++), (IV) result); + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_grs_perl_seekf) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + struct perl_context *arg1 ; + off_t arg2 ; + off_t result; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: grs_perl_seekf(context,offset);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_perl_context,0) < 0) { + SWIG_croak("Type error in argument 1 of grs_perl_seekf. Expected _p_perl_context"); + } + } + { + off_t * argp; + if (SWIG_ConvertPtr(ST(1),(void **) &argp, SWIGTYPE_p_off_t,0) < 0) { + SWIG_croak("Type error in argument 2 of grs_perl_seekf. Expected _p_off_t"); + } + arg2 = *argp; + } + result = grs_perl_seekf(arg1,arg2); + + { + off_t * resultobj = (off_t *) malloc(sizeof(off_t)); + memmove(resultobj, &result, sizeof(off_t)); + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) resultobj, SWIGTYPE_p_off_t,0); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_grs_perl_tellf) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + struct perl_context *arg1 ; + off_t result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: grs_perl_tellf(context);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_perl_context,0) < 0) { + SWIG_croak("Type error in argument 1 of grs_perl_tellf. Expected _p_perl_context"); + } + } + result = grs_perl_tellf(arg1); + + { + off_t * resultobj = (off_t *) malloc(sizeof(off_t)); + memmove(resultobj, &result, sizeof(off_t)); + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) resultobj, SWIGTYPE_p_off_t,0); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_grs_perl_endf) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + struct perl_context *arg1 ; + off_t arg2 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: grs_perl_endf(context,offset);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_perl_context,0) < 0) { + SWIG_croak("Type error in argument 1 of grs_perl_endf. Expected _p_perl_context"); + } + } + { + off_t * argp; + if (SWIG_ConvertPtr(ST(1),(void **) &argp, SWIGTYPE_p_off_t,0) < 0) { + SWIG_croak("Type error in argument 2 of grs_perl_endf. Expected _p_off_t"); + } + arg2 = *argp; + } + grs_perl_endf(arg1,arg2); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_grs_perl_get_dh) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + struct perl_context *arg1 ; + data1_handle result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: grs_perl_get_dh(context);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_perl_context,0) < 0) { + SWIG_croak("Type error in argument 1 of grs_perl_get_dh. Expected _p_perl_context"); + } + } + result = grs_perl_get_dh(arg1); + + { + data1_handle * resultobj = (data1_handle *) malloc(sizeof(data1_handle)); + memmove(resultobj, &result, sizeof(data1_handle)); + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) resultobj, SWIGTYPE_p_data1_handle,0); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_grs_perl_get_mem) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + struct perl_context *arg1 ; + NMEM result; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: grs_perl_get_mem(context);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_perl_context,0) < 0) { + SWIG_croak("Type error in argument 1 of grs_perl_get_mem. Expected _p_perl_context"); + } + } + result = grs_perl_get_mem(arg1); + + { + NMEM * resultobj = (NMEM *) malloc(sizeof(NMEM)); + memmove(resultobj, &result, sizeof(NMEM)); + ST(argvi) = sv_newmortal(); + SWIG_MakePtr(ST(argvi++), (void *) resultobj, SWIGTYPE_p_NMEM,0); + } + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + +XS(_wrap_grs_perl_set_res) { + char _swigmsg[SWIG_MAX_ERRMSG] = ""; + const char *_swigerr = _swigmsg; + { + struct perl_context *arg1 ; + data1_node *arg2 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: grs_perl_set_res(context,n);"); + } + { + if (SWIG_ConvertPtr(ST(0), (void **) &arg1, SWIGTYPE_p_perl_context,0) < 0) { + SWIG_croak("Type error in argument 1 of grs_perl_set_res. Expected _p_perl_context"); + } + } + { + if (SWIG_ConvertPtr(ST(1), (void **) &arg2, SWIGTYPE_p_data1_node,0) < 0) { + SWIG_croak("Type error in argument 2 of grs_perl_set_res. Expected _p_data1_node"); + } + } + grs_perl_set_res(arg1,arg2); + + + XSRETURN(argvi); + fail: + (void) _swigerr; + } + croak(_swigerr); +} + + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ + +static swig_type_info _swigt__p_ZebraService[] = {{"_p_ZebraService", 0, "ZebraService *", 0},{"_p_ZebraService"},{0}}; +static swig_type_info _swigt__p_data1_esetname[] = {{"_p_data1_esetname", 0, "data1_esetname *", 0},{"_p_data1_esetname"},{0}}; +static swig_type_info _swigt__p_data1_maptab[] = {{"_p_data1_maptab", 0, "data1_maptab *", 0},{"_p_data1_maptab"},{0}}; +static swig_type_info _swigt__p_ODR[] = {{"_p_ODR", 0, "ODR *", 0},{"_p_ODR"},{0}}; +static swig_type_info _swigt__p_f_p_void__int[] = {{"_p_f_p_void__int", 0, "int (*)(void *)", 0},{"_p_f_p_void__int"},{0}}; +static swig_type_info _swigt__p_p_char[] = {{"_p_p_char", 0, "char **", 0},{"_p_p_char"},{0}}; +static swig_type_info _swigt__p_data1_absyn[] = {{"_p_data1_absyn", 0, "data1_absyn *", 0},{"_p_data1_absyn"},{0}}; +static swig_type_info _swigt__p_ZebraHandle[] = {{"_p_ZebraHandle", 0, "ZebraHandle *", 0},{"_p_ZebraHandle"},{0}}; +static swig_type_info _swigt__p_void[] = {{"_p_void", 0, "void *", 0},{"_p_void"},{0}}; +static swig_type_info _swigt__p_data1_attset[] = {{"_p_data1_attset", 0, "data1_attset *", 0},{"_p_data1_attset"},{0}}; +static swig_type_info _swigt__p_size_t[] = {{"_p_size_t", 0, "size_t *", 0},{"_p_size_t"},{0}}; +static swig_type_info _swigt__p_WRBUF[] = {{"_p_WRBUF", 0, "WRBUF *", 0},{"_p_WRBUF"},{0}}; +static swig_type_info _swigt__p_f_data1_handle_p_void_p_data1_absyn__void[] = {{"_p_f_data1_handle_p_void_p_data1_absyn__void", 0, "void (*)(data1_handle,void *,data1_absyn *)", 0},{"_p_f_data1_handle_p_void_p_data1_absyn__void"},{0}}; +static swig_type_info _swigt__p_Z_Espec1[] = {{"_p_Z_Espec1", 0, "Z_Espec1 *", 0},{"_p_Z_Espec1"},{0}}; +static swig_type_info _swigt__p_off_t[] = {{"_p_off_t", 0, "off_t *", 0},{"_p_off_t"},{0}}; +static swig_type_info _swigt__p_Odr_oid[] = {{"_p_Odr_oid", 0, "Odr_oid *", 0},{"_p_Odr_oid"},{0}}; +static swig_type_info _swigt__p_data1_varset[] = {{"_p_data1_varset", 0, "data1_varset *", 0},{"_p_data1_varset"},{0}}; +static swig_type_info _swigt__p_perl_context[] = {{"_p_perl_context", 0, "struct perl_context *", 0},{"_p_perl_context"},{0}}; +static swig_type_info _swigt__p_data1_node[] = {{"_p_data1_node", 0, "data1_node *", 0},{"_p_data1_node"},{0}}; +static swig_type_info _swigt__p_data1_tagset[] = {{"_p_data1_tagset", 0, "data1_tagset *", 0},{"_p_data1_tagset"},{0}}; +static swig_type_info _swigt__p_data1_tag[] = {{"_p_data1_tag", 0, "data1_tag *", 0},{"_p_data1_tag"},{0}}; +static swig_type_info _swigt__p_Z_ExplainRecord[] = {{"_p_Z_ExplainRecord", 0, "Z_ExplainRecord *", 0},{"_p_Z_ExplainRecord"},{0}}; +static swig_type_info _swigt__p_NMEM[] = {{"_p_NMEM", 0, "NMEM *", 0},{"_p_NMEM"},{0}}; +static swig_type_info _swigt__p_data1_marctab[] = {{"_p_data1_marctab", 0, "data1_marctab *", 0},{"_p_data1_marctab"},{0}}; +static swig_type_info _swigt__p_Z_BriefBib[] = {{"_p_Z_BriefBib", 0, "Z_BriefBib *", 0},{"_p_Z_BriefBib"},{0}}; +static swig_type_info _swigt__p_FILE[] = {{"_p_FILE", 0, "FILE *", 0},{"_p_FILE"},{0}}; +static swig_type_info _swigt__p_f_p_void_p_char_size_t__int[] = {{"_p_f_p_void_p_char_size_t__int", 0, "int (*)(void *,char *,size_t)", 0},{"_p_f_p_void_p_char_size_t__int"},{0}}; +static swig_type_info _swigt__p_data1_element[] = {{"_p_data1_element", 0, "data1_element *", 0},{"_p_data1_element"},{0}}; +static swig_type_info _swigt__p_recordGroup[] = {{"IDZebra::recordGroup", 0, "recordGroup *", 0},{"IDZebra::recordGroup"},{0}}; +static swig_type_info _swigt__p_p_int[] = {{"_p_p_int", 0, "int **", 0},{"_p_p_int"},{0}}; +static swig_type_info _swigt__p_int[] = {{"_p_int", 0, "int *", 0},{"_p_int"},{0}}; +static swig_type_info _swigt__p_data1_handle[] = {{"_p_data1_handle", 0, "data1_handle *", 0},{"_p_data1_handle"},{0}}; +static swig_type_info _swigt__p_data1_attset_cache[] = {{"_p_data1_attset_cache", 0, "data1_attset_cache *", 0},{"_p_data1_attset_cache"},{0}}; +static swig_type_info _swigt__p_data1_absyn_cache[] = {{"_p_data1_absyn_cache", 0, "data1_absyn_cache *", 0},{"_p_data1_absyn_cache"},{0}}; +static swig_type_info _swigt__p_Z_GenericRecord[] = {{"_p_Z_GenericRecord", 0, "Z_GenericRecord *", 0},{"_p_Z_GenericRecord"},{0}}; +static swig_type_info _swigt__p_data1_vartype[] = {{"_p_data1_vartype", 0, "data1_vartype *", 0},{"_p_data1_vartype"},{0}}; + +static swig_type_info *swig_types_initial[] = { +_swigt__p_ZebraService, +_swigt__p_data1_esetname, +_swigt__p_data1_maptab, +_swigt__p_ODR, +_swigt__p_f_p_void__int, +_swigt__p_p_char, +_swigt__p_data1_absyn, +_swigt__p_ZebraHandle, +_swigt__p_void, +_swigt__p_data1_attset, +_swigt__p_size_t, +_swigt__p_WRBUF, +_swigt__p_f_data1_handle_p_void_p_data1_absyn__void, +_swigt__p_Z_Espec1, +_swigt__p_off_t, +_swigt__p_Odr_oid, +_swigt__p_data1_varset, +_swigt__p_perl_context, +_swigt__p_data1_node, +_swigt__p_data1_tagset, +_swigt__p_data1_tag, +_swigt__p_Z_ExplainRecord, +_swigt__p_NMEM, +_swigt__p_data1_marctab, +_swigt__p_Z_BriefBib, +_swigt__p_FILE, +_swigt__p_f_p_void_p_char_size_t__int, +_swigt__p_data1_element, +_swigt__p_recordGroup, +_swigt__p_p_int, +_swigt__p_int, +_swigt__p_data1_handle, +_swigt__p_data1_attset_cache, +_swigt__p_data1_absyn_cache, +_swigt__p_Z_GenericRecord, +_swigt__p_data1_vartype, +0 +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ + +static swig_constant_info swig_constants[] = { +{ SWIG_INT, (char *) SWIG_prefix "LOG_FATAL", (long) 0x0001, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "LOG_DEBUG", (long) 0x0002, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "LOG_WARN", (long) 0x0004, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "LOG_LOG", (long) 0x0008, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "LOG_ERRNO", (long) 0x0010, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "LOG_FILE", (long) 0x0020, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "LOG_APP", (long) 0x0040, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "LOG_MALLOC", (long) 0x0080, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "LOG_ALL", (long) 0xff7f, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "LOG_DEFAULT_LEVEL", (long) (0x0001|0x0010|0x0008|0x0004), 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "ODR_DECODE", (long) 0, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "ODR_ENCODE", (long) 1, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "ODR_PRINT", (long) 2, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1K_unknown", (long) DATA1K_unknown, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1K_structured", (long) DATA1K_structured, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1K_string", (long) DATA1K_string, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1K_numeric", (long) DATA1K_numeric, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1K_bool", (long) DATA1K_bool, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1K_oid", (long) DATA1K_oid, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1K_generalizedtime", (long) DATA1K_generalizedtime, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1K_intunit", (long) DATA1K_intunit, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1K_int", (long) DATA1K_int, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1K_octetstring", (long) DATA1K_octetstring, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1K_null", (long) DATA1K_null, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1T_numeric", (long) 1, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1T_string", (long) 2, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1N_root", (long) 1, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1N_tag", (long) 2, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1N_data", (long) 3, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1N_variant", (long) 4, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1N_comment", (long) 5, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1N_preprocess", (long) 6, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1I_inctxt", (long) 1, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1I_incbin", (long) 2, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1I_text", (long) 3, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1I_num", (long) 4, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1I_oid", (long) 5, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1_LOCALDATA", (long) 12, 0, 0, 0}, +{ SWIG_INT, (char *) SWIG_prefix "DATA1_FLAG_XML", (long) 1, 0, 0, 0}, +{0} +}; +#ifdef __cplusplus +} +#endif +static swig_variable_info swig_variables[] = { +{0} +}; +static swig_command_info swig_commands[] = { +{"IDZebrac::recordGroup_groupName_set", _wrap_recordGroup_groupName_set}, +{"IDZebrac::recordGroup_groupName_get", _wrap_recordGroup_groupName_get}, +{"IDZebrac::recordGroup_databaseName_set", _wrap_recordGroup_databaseName_set}, +{"IDZebrac::recordGroup_databaseName_get", _wrap_recordGroup_databaseName_get}, +{"IDZebrac::recordGroup_path_set", _wrap_recordGroup_path_set}, +{"IDZebrac::recordGroup_path_get", _wrap_recordGroup_path_get}, +{"IDZebrac::recordGroup_recordId_set", _wrap_recordGroup_recordId_set}, +{"IDZebrac::recordGroup_recordId_get", _wrap_recordGroup_recordId_get}, +{"IDZebrac::recordGroup_recordType_set", _wrap_recordGroup_recordType_set}, +{"IDZebrac::recordGroup_recordType_get", _wrap_recordGroup_recordType_get}, +{"IDZebrac::recordGroup_flagStoreData_set", _wrap_recordGroup_flagStoreData_set}, +{"IDZebrac::recordGroup_flagStoreData_get", _wrap_recordGroup_flagStoreData_get}, +{"IDZebrac::recordGroup_flagStoreKeys_set", _wrap_recordGroup_flagStoreKeys_set}, +{"IDZebrac::recordGroup_flagStoreKeys_get", _wrap_recordGroup_flagStoreKeys_get}, +{"IDZebrac::recordGroup_flagRw_set", _wrap_recordGroup_flagRw_set}, +{"IDZebrac::recordGroup_flagRw_get", _wrap_recordGroup_flagRw_get}, +{"IDZebrac::recordGroup_fileVerboseLimit_set", _wrap_recordGroup_fileVerboseLimit_set}, +{"IDZebrac::recordGroup_fileVerboseLimit_get", _wrap_recordGroup_fileVerboseLimit_get}, +{"IDZebrac::recordGroup_databaseNamePath_set", _wrap_recordGroup_databaseNamePath_set}, +{"IDZebrac::recordGroup_databaseNamePath_get", _wrap_recordGroup_databaseNamePath_get}, +{"IDZebrac::recordGroup_explainDatabase_set", _wrap_recordGroup_explainDatabase_set}, +{"IDZebrac::recordGroup_explainDatabase_get", _wrap_recordGroup_explainDatabase_get}, +{"IDZebrac::recordGroup_followLinks_set", _wrap_recordGroup_followLinks_set}, +{"IDZebrac::recordGroup_followLinks_get", _wrap_recordGroup_followLinks_get}, +{"IDZebrac::new_recordGroup", _wrap_new_recordGroup}, +{"IDZebrac::delete_recordGroup", _wrap_delete_recordGroup}, +{"IDZebrac::DESTROY", _wrap_DESTROY}, +{"IDZebrac::logLevel", _wrap_logLevel}, +{"IDZebrac::logFile", _wrap_logFile}, +{"IDZebrac::logMsg", _wrap_logMsg}, +{"IDZebrac::odr_createmem", _wrap_odr_createmem}, +{"IDZebrac::odr_reset", _wrap_odr_reset}, +{"IDZebrac::odr_destroy", _wrap_odr_destroy}, +{"IDZebrac::odr_malloc", _wrap_odr_malloc}, +{"IDZebrac::start", _wrap_start}, +{"IDZebrac::open", _wrap_open}, +{"IDZebrac::close", _wrap_close}, +{"IDZebrac::stop", _wrap_stop}, +{"IDZebrac::errCode", _wrap_errCode}, +{"IDZebrac::errString", _wrap_errString}, +{"IDZebrac::errAdd", _wrap_errAdd}, +{"IDZebrac::describe_recordGroup", _wrap_describe_recordGroup}, +{"IDZebrac::init_recordGroup", _wrap_init_recordGroup}, +{"IDZebrac::res_get_recordGroup", _wrap_res_get_recordGroup}, +{"IDZebrac::set_group", _wrap_set_group}, +{"IDZebrac::select_databases", _wrap_select_databases}, +{"IDZebrac::select_database", _wrap_select_database}, +{"IDZebrac::begin_trans", _wrap_begin_trans}, +{"IDZebrac::end_trans", _wrap_end_trans}, +{"IDZebrac::commit", _wrap_commit}, +{"IDZebrac::get_shadow_enable", _wrap_get_shadow_enable}, +{"IDZebrac::set_shadow_enable", _wrap_set_shadow_enable}, +{"IDZebrac::init", _wrap_init}, +{"IDZebrac::compact", _wrap_compact}, +{"IDZebrac::repository_update", _wrap_repository_update}, +{"IDZebrac::repository_delete", _wrap_repository_delete}, +{"IDZebrac::repository_show", _wrap_repository_show}, +{"IDZebrac::update_record", _wrap_update_record}, +{"IDZebrac::delete_record", _wrap_delete_record}, +{"IDZebrac::begin_read", _wrap_begin_read}, +{"IDZebrac::end_read", _wrap_end_read}, +{"IDZebrac::search_PQF", _wrap_search_PQF}, +{"IDZebrac::admin_start", _wrap_admin_start}, +{"IDZebrac::admin_shutdown", _wrap_admin_shutdown}, +{"IDZebrac::nmem_create", _wrap_nmem_create}, +{"IDZebrac::nmem_destroy", _wrap_nmem_destroy}, +{"IDZebrac::data1_create", _wrap_data1_create}, +{"IDZebrac::data1_createx", _wrap_data1_createx}, +{"IDZebrac::data1_destroy", _wrap_data1_destroy}, +{"IDZebrac::get_parent_tag", _wrap_get_parent_tag}, +{"IDZebrac::data1_read_node", _wrap_data1_read_node}, +{"IDZebrac::data1_read_nodex", _wrap_data1_read_nodex}, +{"IDZebrac::data1_read_record", _wrap_data1_read_record}, +{"IDZebrac::data1_read_absyn", _wrap_data1_read_absyn}, +{"IDZebrac::data1_gettagbynum", _wrap_data1_gettagbynum}, +{"IDZebrac::data1_empty_tagset", _wrap_data1_empty_tagset}, +{"IDZebrac::data1_read_tagset", _wrap_data1_read_tagset}, +{"IDZebrac::data1_getelementbytagname", _wrap_data1_getelementbytagname}, +{"IDZebrac::data1_nodetogr", _wrap_data1_nodetogr}, +{"IDZebrac::data1_gettagbyname", _wrap_data1_gettagbyname}, +{"IDZebrac::data1_free_tree", _wrap_data1_free_tree}, +{"IDZebrac::data1_nodetobuf", _wrap_data1_nodetobuf}, +{"IDZebrac::data1_mk_tag_data_wd", _wrap_data1_mk_tag_data_wd}, +{"IDZebrac::data1_mk_tag_data", _wrap_data1_mk_tag_data}, +{"IDZebrac::data1_maptype", _wrap_data1_maptype}, +{"IDZebrac::data1_read_varset", _wrap_data1_read_varset}, +{"IDZebrac::data1_getvartypebyct", _wrap_data1_getvartypebyct}, +{"IDZebrac::data1_read_espec1", _wrap_data1_read_espec1}, +{"IDZebrac::data1_doespec1", _wrap_data1_doespec1}, +{"IDZebrac::data1_getesetbyname", _wrap_data1_getesetbyname}, +{"IDZebrac::data1_getelementbyname", _wrap_data1_getelementbyname}, +{"IDZebrac::data1_mk_node2", _wrap_data1_mk_node2}, +{"IDZebrac::data1_mk_tag", _wrap_data1_mk_tag}, +{"IDZebrac::data1_mk_tag_n", _wrap_data1_mk_tag_n}, +{"IDZebrac::data1_tag_add_attr", _wrap_data1_tag_add_attr}, +{"IDZebrac::data1_mk_text_n", _wrap_data1_mk_text_n}, +{"IDZebrac::data1_mk_text_nf", _wrap_data1_mk_text_nf}, +{"IDZebrac::data1_mk_text", _wrap_data1_mk_text}, +{"IDZebrac::data1_mk_comment_n", _wrap_data1_mk_comment_n}, +{"IDZebrac::data1_mk_comment", _wrap_data1_mk_comment}, +{"IDZebrac::data1_mk_preprocess", _wrap_data1_mk_preprocess}, +{"IDZebrac::data1_mk_root", _wrap_data1_mk_root}, +{"IDZebrac::data1_set_root", _wrap_data1_set_root}, +{"IDZebrac::data1_mk_tag_data_int", _wrap_data1_mk_tag_data_int}, +{"IDZebrac::data1_mk_tag_data_oid", _wrap_data1_mk_tag_data_oid}, +{"IDZebrac::data1_mk_tag_data_text", _wrap_data1_mk_tag_data_text}, +{"IDZebrac::data1_mk_tag_data_text_uni", _wrap_data1_mk_tag_data_text_uni}, +{"IDZebrac::data1_get_absyn", _wrap_data1_get_absyn}, +{"IDZebrac::data1_search_tag", _wrap_data1_search_tag}, +{"IDZebrac::data1_mk_tag_uni", _wrap_data1_mk_tag_uni}, +{"IDZebrac::data1_get_attset", _wrap_data1_get_attset}, +{"IDZebrac::data1_read_maptab", _wrap_data1_read_maptab}, +{"IDZebrac::data1_map_record", _wrap_data1_map_record}, +{"IDZebrac::data1_read_marctab", _wrap_data1_read_marctab}, +{"IDZebrac::data1_nodetomarc", _wrap_data1_nodetomarc}, +{"IDZebrac::data1_nodetoidsgml", _wrap_data1_nodetoidsgml}, +{"IDZebrac::data1_nodetoexplain", _wrap_data1_nodetoexplain}, +{"IDZebrac::data1_nodetosummary", _wrap_data1_nodetosummary}, +{"IDZebrac::data1_nodetosoif", _wrap_data1_nodetosoif}, +{"IDZebrac::data1_get_wrbuf", _wrap_data1_get_wrbuf}, +{"IDZebrac::data1_get_read_buf", _wrap_data1_get_read_buf}, +{"IDZebrac::data1_get_map_buf", _wrap_data1_get_map_buf}, +{"IDZebrac::data1_absyn_cache_get", _wrap_data1_absyn_cache_get}, +{"IDZebrac::data1_attset_cache_get", _wrap_data1_attset_cache_get}, +{"IDZebrac::data1_nmem_get", _wrap_data1_nmem_get}, +{"IDZebrac::data1_pr_tree", _wrap_data1_pr_tree}, +{"IDZebrac::data1_print_tree", _wrap_data1_print_tree}, +{"IDZebrac::data1_insert_string", _wrap_data1_insert_string}, +{"IDZebrac::data1_insert_string_n", _wrap_data1_insert_string_n}, +{"IDZebrac::data1_read_sgml", _wrap_data1_read_sgml}, +{"IDZebrac::data1_absyn_trav", _wrap_data1_absyn_trav}, +{"IDZebrac::data1_attset_search_id", _wrap_data1_attset_search_id}, +{"IDZebrac::data1_getNodeValue", _wrap_data1_getNodeValue}, +{"IDZebrac::data1_LookupNode", _wrap_data1_LookupNode}, +{"IDZebrac::data1_CountOccurences", _wrap_data1_CountOccurences}, +{"IDZebrac::data1_path_fopen", _wrap_data1_path_fopen}, +{"IDZebrac::data1_set_tabpath", _wrap_data1_set_tabpath}, +{"IDZebrac::data1_set_tabroot", _wrap_data1_set_tabroot}, +{"IDZebrac::data1_get_tabpath", _wrap_data1_get_tabpath}, +{"IDZebrac::data1_get_tabroot", _wrap_data1_get_tabroot}, +{"IDZebrac::grs_perl_readf", _wrap_grs_perl_readf}, +{"IDZebrac::grs_perl_seekf", _wrap_grs_perl_seekf}, +{"IDZebrac::grs_perl_tellf", _wrap_grs_perl_tellf}, +{"IDZebrac::grs_perl_endf", _wrap_grs_perl_endf}, +{"IDZebrac::grs_perl_get_dh", _wrap_grs_perl_get_dh}, +{"IDZebrac::grs_perl_get_mem", _wrap_grs_perl_get_mem}, +{"IDZebrac::grs_perl_set_res", _wrap_grs_perl_set_res}, +{0,0} +}; + +#ifdef __cplusplus +extern "C" +#endif + +XS(SWIG_init) { + dXSARGS; + int i; + static int _init = 0; + if (!_init) { + for (i = 0; swig_types_initial[i]; i++) { + swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]); + } + _init = 1; + } + + /* Install commands */ + for (i = 0; swig_commands[i].name; i++) { + newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__); + } + + /* Install variables */ + for (i = 0; swig_variables[i].name; i++) { + SV *sv; + sv = perl_get_sv((char*) swig_variables[i].name, TRUE | 0x2); + if (swig_variables[i].type) { + SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0); + }else { + sv_setiv(sv,(IV) 0); + } + swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); + } + + /* Install constant */ + for (i = 0; swig_constants[i].type; i++) { + SV *sv; + sv = perl_get_sv((char*)swig_constants[i].name, TRUE | 0x2); + switch(swig_constants[i].type) { + case SWIG_INT: + sv_setiv(sv, (IV) swig_constants[i].lvalue); + break; + case SWIG_FLOAT: + sv_setnv(sv, (double) swig_constants[i].dvalue); + break; + case SWIG_STRING: + sv_setpv(sv, (char *) swig_constants[i].pvalue); + break; + case SWIG_POINTER: + SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0); + break; + case SWIG_BINARY: + /* obj = SWIG_NewPackedObj(swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype)); */ + break; + default: + break; + } + SvREADONLY_on(sv); + } + + SWIG_TypeClientData(SWIGTYPE_p_recordGroup, (void*) "IDZebra::recordGroup"); + ST(0) = &PL_sv_yes; + XSRETURN(1); +} + diff --git a/perl/MANIFEST b/perl/MANIFEST new file mode 100644 index 0000000..de8d4f6 --- /dev/null +++ b/perl/MANIFEST @@ -0,0 +1,45 @@ +IDZebra.i +IDZebra_wrap.c +MANIFEST +MANIFEST.bak +Makefile +Makefile.PL +Makefile.PL.in +Makefile.old +README +demo/filter_test.pl +demo/index.sh +demo/lock/norm..LCK +demo/lock/shadow..LCK +demo/lock/state..LCK +demo/pod.abs +demo/pod.pm +demo/register/dict-0.mf +demo/register/gmatch-0.mf +demo/register/isamcA-0.mf +demo/register/isamcB-0.mf +demo/register/isamcC-0.mf +demo/register/isamcD-0.mf +demo/register/isamcE-0.mf +demo/register/isamcF-0.mf +demo/register/recdA-0.mf +demo/register/recdB-0.mf +demo/register/reci-0.mf +demo/register/sort4-0.mf +demo/zebra.cfg +demo/zebra.cfg~ +doclean +doswig +lib/IDZebra.pm +lib/IDZebra/Data1.pm +lib/IDZebra/Filter.pm +lib/IDZebra/Logger.pm +lib/IDZebra/Repository.pm +lib/IDZebra/Service.pm +lib/IDZebra/Session.pm +rg.h +test.pl +zebra_api_ext.c +zebra_api_ext.h +zebra_perl.c +zebra_perl.h diff --git a/perl/Makefile.PL.in b/perl/Makefile.PL.in new file mode 100644 index 0000000..08b600a --- /dev/null +++ b/perl/Makefile.PL.in @@ -0,0 +1,11 @@ +use ExtUtils::MakeMaker; + +WriteMakefile( + 'NAME' => 'IDZebra', + 'OBJECT' => 'IDZebra_wrap.o zebra_api_ext.o zebra_perl.o' , + 'INC' => "-I../index -I../include @YAZINC@", + 'LIBS' => "-L../index -lzebra -L../data1 -ldata1 @ZPERL_LIBS@ @TCL_LIB@ @YAZLIB@", + 'OPTIMIZE' => '-g -O2' + + ); + diff --git a/perl/README b/perl/README new file mode 100644 index 0000000..9020c6f --- /dev/null +++ b/perl/README @@ -0,0 +1 @@ +Write this diff --git a/perl/demo/filter_test.pl b/perl/demo/filter_test.pl new file mode 100755 index 0000000..8a6a2e9 --- /dev/null +++ b/perl/demo/filter_test.pl @@ -0,0 +1,10 @@ +#!/usr/bin/perl + +BEGIN { + push (@INC,'../blib/lib','../blib/arch','../blib/lib'); +} + +use pod; + +$res =pod->test($ARGV[0], + (tabPath=>'../blib/lib:../blib/arch:../blib/lib:.:../../tab:../../../yaz/tab')); diff --git a/perl/demo/index.sh b/perl/demo/index.sh new file mode 100755 index 0000000..5b739a7 --- /dev/null +++ b/perl/demo/index.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +rm register/* lock/* +../../index/zebraidx update /usr/lib/perl5 diff --git a/perl/demo/pod.pm b/perl/demo/pod.pm new file mode 100644 index 0000000..e20e78d --- /dev/null +++ b/perl/demo/pod.pm @@ -0,0 +1,65 @@ +#!/usr/bin/perl +use strict; +# ---------------------------------------------------------------------------- +# A dummy example to demonstrate perl filters for zebra. This is going to +# extract information from the .pm perl module files. +# ---------------------------------------------------------------------------- +package pod; + +use IDZebra::Filter; +use IDZebra::Data1; +use Pod::Text; +our @ISA=qw(IDZebra::Filter); +1; + + +sub init { + # Initialization code may come here +} + +sub process { + my ($self, $d1) = @_; + + my $tempfile_in = "/tmp/strucc.in"; + my $tempfile_out = "/tmp/strucc.out"; + my $parser = Pod::Text->new (sentence => 0, width => 78); + + my $r1=$d1->mk_root('pod'); + my $root=$d1->mk_tag($r1,'pod'); + + # This is dirty... Pod::Parser doesn't seems to support + # parsing a string, so we have to write the whole thing out into a + # temporary file + open (TMP, ">$tempfile_in"); + print TMP $self->readall(10240); + close (TMP); + + $parser->parse_from_file ($tempfile_in, $tempfile_out); + + my $section; + my $data; + open (TMP, "$tempfile_out"); + while() { + chomp; + if (/^([A-Z]+)\s*$/) { + my $ss = $1; + if ($section) { + my $tag = $d1->mk_tag($root,$section); + $d1->mk_text($tag,$data) if ($data); + } + $section = $ss; + $data = ""; + next; + } + s/^\s+|\s+$//g; + $data.="$_\n"; + } + + if ($section) { + my $tag = $d1->mk_tag($root,$section); + $d1->mk_text($tag,$data) if ($data); + } + close (TMP); + + return ($r1); +} diff --git a/perl/demo/zebra.cfg b/perl/demo/zebra.cfg new file mode 100644 index 0000000..bc6b2bd --- /dev/null +++ b/perl/demo/zebra.cfg @@ -0,0 +1,28 @@ +# Simple zebra configuration file to demonstate the usage of the perl filters + +profilePath: ../blib/lib:../blib/arch:../blib/lib:.:../../tab:../../../yaz/tab + +# Files that describe the attribute sets supported. +attset: bib1.att +attset: explain.att + +register: register:1000M + +# Specify record type +recordType.pm: grs.perl.pod +recordId: $filename (bib1,Title) + +# Lock File Area +lockDir: lock + +# Temp File area for result sets +setTmpDir: tmp + +# Temp File area for index program +keyTmpDir: tmp + +# Approx. Memory usage during indexing +memMax: 4 + +storeKeys: 1 +storeData: 1 diff --git a/perl/doclean b/perl/doclean new file mode 100755 index 0000000..82fae83 --- /dev/null +++ b/perl/doclean @@ -0,0 +1,3 @@ +#!/bin/sh +rm *~* +rm *wrap* diff --git a/perl/doswig b/perl/doswig new file mode 100755 index 0000000..3f07737 --- /dev/null +++ b/perl/doswig @@ -0,0 +1,3 @@ +#!/bin/sh +swig -I../include -v -Wall -perl5 -proxy ./IDZebra.i +mv IDZebra.pm lib/ diff --git a/perl/lib/IDZebra.pm b/perl/lib/IDZebra.pm new file mode 100644 index 0000000..09065cd --- /dev/null +++ b/perl/lib/IDZebra.pm @@ -0,0 +1,292 @@ +# This file was automatically generated by SWIG +package IDZebra; +require Exporter; +require DynaLoader; +@ISA = qw(Exporter DynaLoader); +package IDZebrac; +bootstrap IDZebra; +package IDZebra; +@EXPORT = qw( ); + +# ---------- BASE METHODS ------------- + +package IDZebra; + +sub TIEHASH { + my ($classname,$obj) = @_; + return bless $obj, $classname; +} + +sub CLEAR { } + +sub FIRSTKEY { } + +sub NEXTKEY { } + +sub this { + my $ptr = shift; + return tied(%$ptr); +} + + +# ------- FUNCTION WRAPPERS -------- + +package IDZebra; + +*DESTROY = *IDZebrac::DESTROY; +*logLevel = *IDZebrac::logLevel; +*logFile = *IDZebrac::logFile; +*logMsg = *IDZebrac::logMsg; +*odr_createmem = *IDZebrac::odr_createmem; +*odr_reset = *IDZebrac::odr_reset; +*odr_destroy = *IDZebrac::odr_destroy; +*odr_malloc = *IDZebrac::odr_malloc; +*start = *IDZebrac::start; +*open = *IDZebrac::open; +*close = *IDZebrac::close; +*stop = *IDZebrac::stop; +*errCode = *IDZebrac::errCode; +*errString = *IDZebrac::errString; +*errAdd = *IDZebrac::errAdd; +*describe_recordGroup = *IDZebrac::describe_recordGroup; +*init_recordGroup = *IDZebrac::init_recordGroup; +*res_get_recordGroup = *IDZebrac::res_get_recordGroup; +*set_group = *IDZebrac::set_group; +*select_databases = *IDZebrac::select_databases; +*select_database = *IDZebrac::select_database; +*begin_trans = *IDZebrac::begin_trans; +*end_trans = *IDZebrac::end_trans; +*commit = *IDZebrac::commit; +*get_shadow_enable = *IDZebrac::get_shadow_enable; +*set_shadow_enable = *IDZebrac::set_shadow_enable; +*init = *IDZebrac::init; +*compact = *IDZebrac::compact; +*repository_update = *IDZebrac::repository_update; +*repository_delete = *IDZebrac::repository_delete; +*repository_show = *IDZebrac::repository_show; +*update_record = *IDZebrac::update_record; +*delete_record = *IDZebrac::delete_record; +*begin_read = *IDZebrac::begin_read; +*end_read = *IDZebrac::end_read; +*search_pqf = *IDZebrac::search_pqf; +*admin_start = *IDZebrac::admin_start; +*admin_shutdown = *IDZebrac::admin_shutdown; +*nmem_create = *IDZebrac::nmem_create; +*nmem_destroy = *IDZebrac::nmem_destroy; +*data1_create = *IDZebrac::data1_create; +*data1_createx = *IDZebrac::data1_createx; +*data1_destroy = *IDZebrac::data1_destroy; +*get_parent_tag = *IDZebrac::get_parent_tag; +*data1_read_node = *IDZebrac::data1_read_node; +*data1_read_nodex = *IDZebrac::data1_read_nodex; +*data1_read_record = *IDZebrac::data1_read_record; +*data1_read_absyn = *IDZebrac::data1_read_absyn; +*data1_gettagbynum = *IDZebrac::data1_gettagbynum; +*data1_empty_tagset = *IDZebrac::data1_empty_tagset; +*data1_read_tagset = *IDZebrac::data1_read_tagset; +*data1_getelementbytagname = *IDZebrac::data1_getelementbytagname; +*data1_nodetogr = *IDZebrac::data1_nodetogr; +*data1_gettagbyname = *IDZebrac::data1_gettagbyname; +*data1_free_tree = *IDZebrac::data1_free_tree; +*data1_nodetobuf = *IDZebrac::data1_nodetobuf; +*data1_mk_tag_data_wd = *IDZebrac::data1_mk_tag_data_wd; +*data1_mk_tag_data = *IDZebrac::data1_mk_tag_data; +*data1_maptype = *IDZebrac::data1_maptype; +*data1_read_varset = *IDZebrac::data1_read_varset; +*data1_getvartypebyct = *IDZebrac::data1_getvartypebyct; +*data1_read_espec1 = *IDZebrac::data1_read_espec1; +*data1_doespec1 = *IDZebrac::data1_doespec1; +*data1_getesetbyname = *IDZebrac::data1_getesetbyname; +*data1_getelementbyname = *IDZebrac::data1_getelementbyname; +*data1_mk_node2 = *IDZebrac::data1_mk_node2; +*data1_mk_tag = *IDZebrac::data1_mk_tag; +*data1_mk_tag_n = *IDZebrac::data1_mk_tag_n; +*data1_tag_add_attr = *IDZebrac::data1_tag_add_attr; +*data1_mk_text_n = *IDZebrac::data1_mk_text_n; +*data1_mk_text_nf = *IDZebrac::data1_mk_text_nf; +*data1_mk_text = *IDZebrac::data1_mk_text; +*data1_mk_comment_n = *IDZebrac::data1_mk_comment_n; +*data1_mk_comment = *IDZebrac::data1_mk_comment; +*data1_mk_preprocess = *IDZebrac::data1_mk_preprocess; +*data1_mk_root = *IDZebrac::data1_mk_root; +*data1_set_root = *IDZebrac::data1_set_root; +*data1_mk_tag_data_int = *IDZebrac::data1_mk_tag_data_int; +*data1_mk_tag_data_oid = *IDZebrac::data1_mk_tag_data_oid; +*data1_mk_tag_data_text = *IDZebrac::data1_mk_tag_data_text; +*data1_mk_tag_data_text_uni = *IDZebrac::data1_mk_tag_data_text_uni; +*data1_get_absyn = *IDZebrac::data1_get_absyn; +*data1_search_tag = *IDZebrac::data1_search_tag; +*data1_mk_tag_uni = *IDZebrac::data1_mk_tag_uni; +*data1_get_attset = *IDZebrac::data1_get_attset; +*data1_read_maptab = *IDZebrac::data1_read_maptab; +*data1_map_record = *IDZebrac::data1_map_record; +*data1_read_marctab = *IDZebrac::data1_read_marctab; +*data1_nodetomarc = *IDZebrac::data1_nodetomarc; +*data1_nodetoidsgml = *IDZebrac::data1_nodetoidsgml; +*data1_nodetoexplain = *IDZebrac::data1_nodetoexplain; +*data1_nodetosummary = *IDZebrac::data1_nodetosummary; +*data1_nodetosoif = *IDZebrac::data1_nodetosoif; +*data1_get_wrbuf = *IDZebrac::data1_get_wrbuf; +*data1_get_read_buf = *IDZebrac::data1_get_read_buf; +*data1_get_map_buf = *IDZebrac::data1_get_map_buf; +*data1_absyn_cache_get = *IDZebrac::data1_absyn_cache_get; +*data1_attset_cache_get = *IDZebrac::data1_attset_cache_get; +*data1_nmem_get = *IDZebrac::data1_nmem_get; +*data1_pr_tree = *IDZebrac::data1_pr_tree; +*data1_print_tree = *IDZebrac::data1_print_tree; +*data1_insert_string = *IDZebrac::data1_insert_string; +*data1_insert_string_n = *IDZebrac::data1_insert_string_n; +*data1_read_sgml = *IDZebrac::data1_read_sgml; +*data1_absyn_trav = *IDZebrac::data1_absyn_trav; +*data1_attset_search_id = *IDZebrac::data1_attset_search_id; +*data1_getNodeValue = *IDZebrac::data1_getNodeValue; +*data1_LookupNode = *IDZebrac::data1_LookupNode; +*data1_CountOccurences = *IDZebrac::data1_CountOccurences; +*data1_path_fopen = *IDZebrac::data1_path_fopen; +*data1_set_tabpath = *IDZebrac::data1_set_tabpath; +*data1_set_tabroot = *IDZebrac::data1_set_tabroot; +*data1_get_tabpath = *IDZebrac::data1_get_tabpath; +*data1_get_tabroot = *IDZebrac::data1_get_tabroot; +*grs_perl_readf = *IDZebrac::grs_perl_readf; +*grs_perl_seekf = *IDZebrac::grs_perl_seekf; +*grs_perl_tellf = *IDZebrac::grs_perl_tellf; +*grs_perl_endf = *IDZebrac::grs_perl_endf; +*grs_perl_get_dh = *IDZebrac::grs_perl_get_dh; +*grs_perl_get_mem = *IDZebrac::grs_perl_get_mem; +*grs_perl_set_res = *IDZebrac::grs_perl_set_res; + +############# Class : IDZebra::recordGroup ############## + +package IDZebra::recordGroup; +@ISA = qw( IDZebra ); +%OWNER = (); +%BLESSEDMEMBERS = ( +); + +%ITERATORS = (); +*swig_groupName_get = *IDZebrac::recordGroup_groupName_get; +*swig_groupName_set = *IDZebrac::recordGroup_groupName_set; +*swig_databaseName_get = *IDZebrac::recordGroup_databaseName_get; +*swig_databaseName_set = *IDZebrac::recordGroup_databaseName_set; +*swig_path_get = *IDZebrac::recordGroup_path_get; +*swig_path_set = *IDZebrac::recordGroup_path_set; +*swig_recordId_get = *IDZebrac::recordGroup_recordId_get; +*swig_recordId_set = *IDZebrac::recordGroup_recordId_set; +*swig_recordType_get = *IDZebrac::recordGroup_recordType_get; +*swig_recordType_set = *IDZebrac::recordGroup_recordType_set; +*swig_flagStoreData_get = *IDZebrac::recordGroup_flagStoreData_get; +*swig_flagStoreData_set = *IDZebrac::recordGroup_flagStoreData_set; +*swig_flagStoreKeys_get = *IDZebrac::recordGroup_flagStoreKeys_get; +*swig_flagStoreKeys_set = *IDZebrac::recordGroup_flagStoreKeys_set; +*swig_flagRw_get = *IDZebrac::recordGroup_flagRw_get; +*swig_flagRw_set = *IDZebrac::recordGroup_flagRw_set; +*swig_fileVerboseLimit_get = *IDZebrac::recordGroup_fileVerboseLimit_get; +*swig_fileVerboseLimit_set = *IDZebrac::recordGroup_fileVerboseLimit_set; +*swig_databaseNamePath_get = *IDZebrac::recordGroup_databaseNamePath_get; +*swig_databaseNamePath_set = *IDZebrac::recordGroup_databaseNamePath_set; +*swig_explainDatabase_get = *IDZebrac::recordGroup_explainDatabase_get; +*swig_explainDatabase_set = *IDZebrac::recordGroup_explainDatabase_set; +*swig_followLinks_get = *IDZebrac::recordGroup_followLinks_get; +*swig_followLinks_set = *IDZebrac::recordGroup_followLinks_set; +sub new { + my $pkg = shift; + my @args = @_; + my $self = IDZebrac::new_recordGroup(@args); + return undef if (!defined($self)); + $OWNER{$self} = 1; + my %retval; + tie %retval, "IDZebra::recordGroup", $self; + return bless \%retval, $pkg; +} + +sub DESTROY { + return unless $_[0]->isa('HASH'); + my $self = tied(%{$_[0]}); + return unless defined $self; + delete $ITERATORS{$self}; + if (exists $OWNER{$self}) { + IDZebrac::delete_recordGroup($self); + delete $OWNER{$self}; + } +} + +sub DISOWN { + my $self = shift; + my $ptr = tied(%$self); + delete $OWNER{$ptr}; + }; + +sub ACQUIRE { + my $self = shift; + my $ptr = tied(%$self); + $OWNER{$ptr} = 1; + }; + +sub FETCH { + my ($self,$field) = @_; + my $member_func = "swig_${field}_get"; + my $val = $self->$member_func(); + if (exists $BLESSEDMEMBERS{$field}) { + return undef if (!defined($val)); + my %retval; + tie %retval,$BLESSEDMEMBERS{$field},$val; + return bless \%retval, $BLESSEDMEMBERS{$field}; + } + return $val; +} + +sub STORE { + my ($self,$field,$newval) = @_; + my $member_func = "swig_${field}_set"; + if (exists $BLESSEDMEMBERS{$field}) { + $self->$member_func(tied(%{$newval})); + } else { + $self->$member_func($newval); + } +} + + +# ------- VARIABLE STUBS -------- + +package IDZebra; + +*LOG_FATAL = *IDZebrac::LOG_FATAL; +*LOG_DEBUG = *IDZebrac::LOG_DEBUG; +*LOG_WARN = *IDZebrac::LOG_WARN; +*LOG_LOG = *IDZebrac::LOG_LOG; +*LOG_ERRNO = *IDZebrac::LOG_ERRNO; +*LOG_FILE = *IDZebrac::LOG_FILE; +*LOG_APP = *IDZebrac::LOG_APP; +*LOG_MALLOC = *IDZebrac::LOG_MALLOC; +*LOG_ALL = *IDZebrac::LOG_ALL; +*LOG_DEFAULT_LEVEL = *IDZebrac::LOG_DEFAULT_LEVEL; +*ODR_DECODE = *IDZebrac::ODR_DECODE; +*ODR_ENCODE = *IDZebrac::ODR_ENCODE; +*ODR_PRINT = *IDZebrac::ODR_PRINT; +*DATA1K_unknown = *IDZebrac::DATA1K_unknown; +*DATA1K_structured = *IDZebrac::DATA1K_structured; +*DATA1K_string = *IDZebrac::DATA1K_string; +*DATA1K_numeric = *IDZebrac::DATA1K_numeric; +*DATA1K_bool = *IDZebrac::DATA1K_bool; +*DATA1K_oid = *IDZebrac::DATA1K_oid; +*DATA1K_generalizedtime = *IDZebrac::DATA1K_generalizedtime; +*DATA1K_intunit = *IDZebrac::DATA1K_intunit; +*DATA1K_int = *IDZebrac::DATA1K_int; +*DATA1K_octetstring = *IDZebrac::DATA1K_octetstring; +*DATA1K_null = *IDZebrac::DATA1K_null; +*DATA1T_numeric = *IDZebrac::DATA1T_numeric; +*DATA1T_string = *IDZebrac::DATA1T_string; +*DATA1N_root = *IDZebrac::DATA1N_root; +*DATA1N_tag = *IDZebrac::DATA1N_tag; +*DATA1N_data = *IDZebrac::DATA1N_data; +*DATA1N_variant = *IDZebrac::DATA1N_variant; +*DATA1N_comment = *IDZebrac::DATA1N_comment; +*DATA1N_preprocess = *IDZebrac::DATA1N_preprocess; +*DATA1I_inctxt = *IDZebrac::DATA1I_inctxt; +*DATA1I_incbin = *IDZebrac::DATA1I_incbin; +*DATA1I_text = *IDZebrac::DATA1I_text; +*DATA1I_num = *IDZebrac::DATA1I_num; +*DATA1I_oid = *IDZebrac::DATA1I_oid; +*DATA1_LOCALDATA = *IDZebrac::DATA1_LOCALDATA; +*DATA1_FLAG_XML = *IDZebrac::DATA1_FLAG_XML; +1; diff --git a/perl/lib/IDZebra/Data1.pm b/perl/lib/IDZebra/Data1.pm new file mode 100644 index 0000000..b617269 --- /dev/null +++ b/perl/lib/IDZebra/Data1.pm @@ -0,0 +1,245 @@ +#!/usr/bin/perl +# ============================================================================ +# Zebra perl API header +# ============================================================================= +use strict; +use Carp; +# ============================================================================= +package IDZebra::Data1; +use IDZebra; +1; + +# ----------------------------------------------------------------------------- +# Class constructors and destructor +# ----------------------------------------------------------------------------- +sub get { + my ($proto, $handle, $mem) = @_; + my $class = ref($proto) || $proto; + my $self = {}; + bless ($self,$class); + + $self->{dh} = $handle; + $self->{mem} = $mem; + # data1_destroy is not going to be called, when object is released + $self->{dflag} = 0; + + return ($self); +} + +sub new { + my ($proto, $mem, $flag) = @_; + my $class = ref($proto) || $proto; + my $self = {}; + + bless ($self,$class); + + unless ($self->{dh} = IDZebra::data1_createx($flag)) { + croak ("Cannot create data1 handle"); + } + + # data1_destroy going to be called, when object is released + $self->{dflag} = 1; + + unless ($self->{mem} = $mem) { + croak ("Missing NMEM handle"); + } + + return ($self); +} + +sub DESTROY { + my $self = shift; + if ($self->{dh}) { + if ($self->{dflag}) { IDZebra::data1_destroy($self->{dh}) } + $self->{dh} = undef; + } +} + +# ----------------------------------------------------------------------------- +# Profile information +# ----------------------------------------------------------------------------- +# Not usable... +sub path_fopen { + my ($self, $file, $mode) = @_; + return (IDZebra::data1_path_fopen ($self->{dh}, $file, $mode)); +} + +sub tabpath { + my ($self, $path) = @_; + if (defined($path)) { IDZebra::data1_set_tabpath($self->{dh}, $path); } + return (IDZebra::data1_get_tabpath($self->{dh})); +} + +sub tabroot { + my ($self, $path) = @_; + if (defined($path)) { IDZebra::data1_set_tabroot($self->{dh}, $path); } + return (IDZebra::data1_get_tabroot($self->{dh})); +} + +# ----------------------------------------------------------------------------- +# D1 Structure manipulation +# ----------------------------------------------------------------------------- +sub mk_root { + my ($self, $name) = @_; + return (IDZebra::data1_mk_root($self->{dh}, $self->{mem}, $name)); +} + +sub set_root { + my ($self, $node, $name) = @_; + IDZebra::data1_set_root($self->{dh}, $node, $self->{mem}, $name); +} + +sub mk_tag { + my ($self, $parent, $tag, @attributes) = @_; + return (IDZebra::data1_mk_tag($self->{dh}, $self->{mem}, + $tag, \@attributes, $parent)); +} + +sub tag_add_attr { + my ($self, $node, @attributes) = @_; + IDZebra::data1_tag_add_attr ($self->{dh}, $self->{mem}, + $node, \@attributes); +} + +sub mk_text { + my ($self, $parent, $text) = @_; + return (IDZebra::data1_mk_text($self->{dh}, $self->{mem}, + $text, $parent)); +} + +sub mk_comment { + my ($self, $parent, $text) = @_; + return (IDZebra::data1_mk_comment($self->{dh}, $self->{mem}, + $text, $parent)); +} + +sub mk_preprocess { + my ($self, $parent, $target, @attributes) = @_; + return (IDZebra::data1_mk_preprocess($self->{dh}, $self->{mem}, + $target, \@attributes, $parent)); +} + + +sub pr_tree { + my ($self, $node) = @_; + IDZebra::data1_print_tree($self->{dh}, $node); +} + +sub free_tree { + my ($self, $node) = @_; + IDZebra::data1_free_tree($self->{dh}, $node); +} + +# ============================================================================= + +__END__ + +=head1 NAME + +IDZebra::Data1 - OO Aproach interface for data1 structures + +=head1 SYNOPSIS + + use IDZebra::Data1; + + my $m = IDZebra::nmem_create(); + my $d1=IDZebra::Data1->new($m,$IDZebra::DATA1_FLAG_XML); + my $root = $d1->mk_root('ostriches'); + my $tag = $d1->mk_tag($root,'emu',('speed' => 120, + 'height' => 110)); + $d1->pr_tree($root); + +=head1 DESCRIPTION + +I never managed to understand data1 entirely. Probably Adam, or someone else from IndexData could write a more deep introduction here. However here are some ideas: + +Data1 structures are used in zebra to represent structured data. You can map an xml structure, a marc record, or anything in D1. These structures are built by different filters - this is called "extraction" in zebra's code. + +When zebra asks a filter to extract a file, it provides a data1 handle, which can be used to + + - reach profile information, provided in zebra.cfg, and other refered + configuration files, (like tab path). + + - build data1 structures + +In one word, a data1 handle is a kind of context in the d1 API. This handle is represented here as a IDZebra::Data1 object. When you implement a filter, you'll get this object ready for use, otherwise, you'll have to prepare an NMEM handle, and call the constructor: + + my $m = IDZebra::nmem_create(); + my $dh = IDZebra::Data1->new($m,$IDZebra::DATA1_FLAG_XML); + +What is FLAG_XML? I don't know exactly. You don't have to worry about it, it's already set, if you implement a filter. + +=head1 PROFILE INFORMATION + +=item $d1->tabpath([$path]) + +Set and/or get the tab path. This is a colon separated list of directories, where different configuration files can be found. + +=item $d1->tabroot([$path]) + +Set and/or get the tab root. + +=head1 BUILDING DATA STRUCTURES + +It's obvious, that first of all you have to create a root node: + + my $r1 = $d1->mk_root('pod'); + +This is going to initialize the abstract syntax "pod" (trying to open and parse pod.abs). I don't know why exactly, but then, you'll have to create a root tag as well, under the same name. + + my $root=$d1->mk_tag($r1,'pod'); + +Then just continue, to add child nodes, as tags, text nodes... to your structure. + +=item $d1->mk_root($name) + +Create a root node, with the given name. (name is type in d1 terminology?) + +=item $d1->set_root($node, $name) + +Makes an existing node into root node, under the given name + +=item $d1->mk_tag($parent, $name, [@attributes]) + +Add a tag to the parent node, with the given name and attributes. For example: + + my $tag = $d1->mk_tag($root,'emu',('speed' => 120, + 'height' => 110)); + +=item $d1->tag_add_attr($node, @attributes) + +Add attributes to an existing node + +=item $d1->mk_text($parent, $text) + +Add a text node to the given parent + +=item $d1->mk_comment($parent, $text) + +Add a comment node to the given parent + +=item $d1->mk_preprocess($parent, $target, $attributes) + +??? + +=item $d1->pr_tree($node) + +Prints data1 tree on STDOUT; + +=item $d1->free_tree($node) + +Destroys a data1 node structure; + +=head1 COPYRIGHT + +Fill in + +=head1 AUTHOR + +Peter Popovics, pop@technomat.hu + +=head1 SEE ALSO + +IDZebra, Zebra documentation + +=cut diff --git a/perl/lib/IDZebra/Filter.pm b/perl/lib/IDZebra/Filter.pm new file mode 100644 index 0000000..51adcc0 --- /dev/null +++ b/perl/lib/IDZebra/Filter.pm @@ -0,0 +1,258 @@ +#!/usr/bin/perl +# ============================================================================ +# Zebra perl API header +# ============================================================================= +use strict; +use Carp; +# ============================================================================ +package IDZebra::Filter; +use IDZebra; +use IDZebra::Data1; + +BEGIN { + IDZebra::init(); # ??? Do we need that at all (this is jus nmem init...) +} + +1; +# ----------------------------------------------------------------------------- +# Class constructor +# ----------------------------------------------------------------------------- +sub new { + my ($proto,$context) = @_; + my $class = ref($proto) || $proto; + my $self = {}; + $self->{context} = $context; + bless ($self, $class); + return ($self); +} + +# ----------------------------------------------------------------------------- +# Callbacks +# ----------------------------------------------------------------------------- +sub _process { + my ($self) = @_; + # This is ugly... could be passed as parameters... but didn't work. + # I don't know why... + my $dh = IDZebra::grs_perl_get_dh($self->{context}); + my $mem = IDZebra::grs_perl_get_mem($self->{context}); + my $d1 = IDZebra::Data1->get($dh,$mem); + + my $rootnode = $self->process($d1); + IDZebra::grs_perl_set_res($self->{context},$rootnode); + return (0); +} + +sub _store_buff { + my ($self, $buff) = @_; + $self->{_buff} = $buff; +} + +# ----------------------------------------------------------------------------- +# API Template - These methods should be overriden by the implementing class. +# ----------------------------------------------------------------------------- +sub init { + # This one is called once, when the module is loaded. Not in + # object context yet!!! +} + +sub process { + my ($self, $d1) = @_; + # Just going to return a root node. + return ($d1->mk_root('empty')); +} + +# ----------------------------------------------------------------------------- +# Testing +# ----------------------------------------------------------------------------- +sub test { + my ($proto, $file, %args) = @_; + +# print "Proto:$proto\n"; + + my $class = ref($proto) || $proto; + my $self = {}; + bless ($self, $class); + + my $th; + open ($th, $file) || croak ("Cannot open $file"); + + $self->{testh} = $th; + + my $m = IDZebra::nmem_create(); + my $d1=IDZebra::Data1->new($m,$IDZebra::DATA1_FLAG_XML); + if ($args{tabPath}) { $d1->tabpath($args{tabPath}); } + if ($args{tabRoot}) { $d1->tabroot($args{tabRoot}); } + + my $rootnode = $self->process($d1); + $d1->pr_tree($rootnode); + $d1->free_tree($rootnode); + $d1 = undef; + + close ($th); + $self->{testh} = undef; + +} + +# ----------------------------------------------------------------------------- +# Utility calls +# ----------------------------------------------------------------------------- +sub readf { + my ($self, $buff, $len, $offset) = @_; + $buff = ""; + if ($self->{testh}) { + return (read($self->{testh},$_[1],$len,$offset)); + } else { + my $r = IDZebra::grs_perl_readf($self->{context},$len); + if ($r > 0) { + $buff = $self->{_buff}; + $self->{_buff} = undef; + } + return ($r); + } +} + +sub readall { + my ($self, $buffsize) = @_; + my $r; + my $res = ""; + + do { + if ($self->{testh}) { + $r = read($self->{testh}, $self->{_buff}, $buffsize); + } else { + $r = IDZebra::grs_perl_readf($self->{context},$buffsize); + } + if ($r > 0) { + $res .= $self->{_buff}; + $self->{_buff} = undef; + } + } until ($r <= 0); + + return ($res); +} + +sub seekf { + my ($self, $offset) = @_; + if ($self->{testh}) { + # I'm not sure if offset is absolute or relative here... + return (seek ($self->{testh}, $offset, $0)); + } else { + return (IDZebra::grs_perl_seekf($self->{context},$offset)) ; + } +} + +sub tellf { + my ($self) = @_; + if ($self->{testh}) { + # Not implemented + } else { + return (IDZebra::grs_perl_seekf($self->{context})); + } +} + +sub endf { + my ($self, $offset) = @_; + if ($self->{testh}) { + # Not implemented + } else { + IDZebra::grs_perl_endf($self->{context},$offset); + } +} + +__END__ + +=head1 NAME + +IDZebra::Filter - A superclass of perl filters for Zebra + +=head1 SYNOPSIS + + package MyFilter; + + use IDZebra::Filter; + our @ISA=qw(IDZebra::Filter); + + ... + + sub init { + + } + + sub process { + my ($self,$d1) = @_; + my $rootnode=$d1->mk_root('meta'); + ... + return ($rootnode) + } + +=head1 DESCRIPTION + +When Zebra is trying to index/present a record, needs to extract information from it's source. For some types of input, "hardcoded" procedures are defined, but you have the opportunity to write your own filter code in Tcl or in perl. + +The perl implementation is nothing but a package, deployed in some available location for Zebra (in I, or in PERL_INCLUDE (@INC)). This package is interpreted once needed, a filter object is created, armored with knowledge enough, to read data from the source, and to generate data1 structures as result. For each individual source "files" the process method is called. + +This class is supposed to be inherited in all perl filter classes, as it is providing a way of communication between the filter code and the indexing/retrieval process. + +=head1 IMPLEMENTING FILTERS IN PERL + +All you have to do is to create a perl package, using and inheriting this one (IDZebra::Filter), and implement the "process" method. The parameter of this call is an IDZebra::Data1 object, representing a data1 handle. You can use this, to reach the configuration information and to build your data structure. What you have to return is a data1 root node. To create it: + + my $rootnode=$d1->mk_root('meta'); + +where 'meta' is the abstract syntax identifier (in this case Zebra will try to locate meta.abs, and apply it). Then just continue to build the structure. See i for details. + +In order to get the input stream, you can use "virtual" file operators (as the source is not necessairly a file): + +=item readf($buf,$len,$offset) + +Going to read $len bytes of data from offset $offset into $buff + +=item readall($bufflen) + +Read the entire stream, by reading $bufflen bytes at once + +=item seekf($offset) + +Position to $offset + +=item tellf + +Tells the current offset (?) + +=item endf($offset) + +??? + +Optionally, you can implement an init call for your class. This call is not going to be called in object, but in class context. Stupid, eh? + +=head1 TEST YOUR PERL FILTER + +You can check the functionality of your filter code, by writing a small test program like + + + use pod; + $res =pod->test($ARGV[0], + (tabPath=>'.:../../tab:../../../yaz/tab')); + +This will try to apply the filter on the file provided as argument, and display the generated data1 structure. However, there are some differences, when running a filter in test mode: + - The include path is not applied from tabPath + - the tellf, and endf functions are not implemented (just ignored) + +=head1 CONFIGURE ZEBRA TO USE A PERL FILTER + +This is quite simple. Read the Zebra manual, and follow the instructions to create your zebra.cfg. For your I choose 'grs.perl.'. +Copy your filter module (YourFilterClass.pm) to a directory listed in I. i is added to @INC, when interpreting your package: so if you need to load modules from different locations than the default perl include path, just add these directories. + +=head1 COPYRIGHT + +Fill in + +=head1 AUTHOR + +Peter Popovics, pop@technomat.hu + +=head1 SEE ALSO + +IDZebra, IDZebra::Data1, Zebra documentation + +=cut diff --git a/perl/lib/IDZebra/Logger.pm b/perl/lib/IDZebra/Logger.pm new file mode 100644 index 0000000..07c9013 --- /dev/null +++ b/perl/lib/IDZebra/Logger.pm @@ -0,0 +1,104 @@ +#!/usr/bin/perl +# ============================================================================ +# Zebra perl API header +# ============================================================================= +use strict; +use Carp; +# ============================================================================ +package IDZebra::Logger; +use IDZebra; +require Exporter; +our @ISA = qw(Exporter); + +our @EXPORT_OK = qw + (LOG_FATAL + LOG_DEBUG + LOG_WARN + LOG_LOG + LOG_ERRNO + LOG_FILE + LOG_APP + LOG_MALLOC + LOG_ALL + + logf + logm + ); + +our %EXPORT_TAGS = ('flags' => [qw + (LOG_FATAL + LOG_DEBUG + LOG_WARN + LOG_LOG + LOG_ERRNO + LOG_FILE + LOG_APP + LOG_MALLOC + LOG_ALL) ], + 'calls' => [qw(logf logm)] + ); + +use constant LOG_FATAL => $IDZebra::LOG_FATAL; +use constant LOG_DEBUG => $IDZebra::LOG_DEBUG; +use constant LOG_WARN => $IDZebra::LOG_WARN; +use constant LOG_LOG => $IDZebra::LOG_LOG; +use constant LOG_ERRNO => $IDZebra::LOG_ERRNO; +use constant LOG_FILE => $IDZebra::LOG_FILE; +use constant LOG_APP => $IDZebra::LOG_APP; +use constant LOG_MALLOC => $IDZebra::LOG_MALLOC; +use constant LOG_ALL => $IDZebra::LOG_ALL; + +1; + +sub logm { + if (ref ($_[0])) { + &_log($_[1],"%s",$_[2]); + } + elsif ($_[0] =~ /^IDZebra::/) { + &_log($_[1],"%s",$_[2]); + } else { + &_log($_[0],"%s",$_[1]); + } +} + +sub logf { + if (ref ($_[0])) { + shift(@_); + &_log(@_); + } + elsif ($_[0] =~ /^IDZebra::/) { + shift(@_); + &_log(@_); + } else { + &_log(@_); + } +} + +sub _log { + my ($level, $format, @args) = @_; + IDZebra::logMsg($level, sprintf($format, @args)); +} + +__END__ + +=head1 NAME + +IDZebra::Service - + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +=head1 COPYRIGHT + +Fill in + +=head1 AUTHOR + +Peter Popovics, pop@technomat.hu + +=head1 SEE ALSO + +IDZebra, IDZebra::Data1, Zebra documentation + +=cut diff --git a/perl/lib/IDZebra/Repository.pm b/perl/lib/IDZebra/Repository.pm new file mode 100644 index 0000000..0c6e442 --- /dev/null +++ b/perl/lib/IDZebra/Repository.pm @@ -0,0 +1,150 @@ +#!/usr/bin/perl +# ============================================================================ +# Zebra perl API header +# ============================================================================= +use strict; +# ============================================================================ +package IDZebra::Repository; +use IDZebra; +use IDZebra::Logger qw(:flags :calls); +use Carp; +use Scalar::Util qw(weaken); +1; + + +# ----------------------------------------------------------------------------- +# Repository stuff +# ----------------------------------------------------------------------------- + +sub new { + my ($proto,$session,%args) = @_; + my $class = ref($proto) || $proto; + my $self = {}; + $self->{session} = $session; + weaken ($self->{session}); + $self->{rg} = IDZebra::recordGroup->new(); + IDZebra::init_recordGroup($self->{rg}); + bless ($self, $class); + unless ($self->_set_options(%args)) { + $self->_prepare; + } + return ($self); +} + +sub modify { + my ($self,%args) = @_; + $self->_set_options(%args); +} + +sub readConfig { + my ($self, $groupName, $ext) = @_; + if ($#_ > 0) { $self->{rg}{groupName} = $groupName; } + $ext = "" unless ($ext); + IDZebra::res_get_recordGroup($self->{session}{zh}, $self->{rg}, $ext); + $self->_prepare(); + print "recordType:",$self->{rg}{recordType},"\n"; +} + +sub _set_options { + my ($self, %args) = @_; + my $i = 0; + foreach my $key (keys(%args)) { + $self->{rg}{$key} = $args{$key}; + $i++; + } + if ($i > 0) { + $self->_prepare(); + } + return ($i); +} + +sub _prepare { + my ($self) = @_; + + IDZebra::set_group($self->{session}{zh}, $self->{rg}); + + my $dbName; + unless ($dbName = $self->{rg}{databaseName}) { + $dbName = 'Default'; + } + if (my $res = IDZebra::select_database($self->{session}{zh}, $dbName)) { + logf(LOG_FATAL, + "Could not select database %s errCode=%d", + $self->{rg}{databaseName}, + $self->{session}->errCode()); + croak("Fatal error selecting database"); + } +} + +sub update { + my ($self, %args) = @_; + $self->_set_options(%args); + IDZebra::repository_update($self->{session}{zh}); +} + +sub delete { + my ($self, %args) = @_; + $self->_set_options(%args); + IDZebra::repository_delete($self->{session}{zh}); +} + +sub show { + my ($self, %args) = @_; + $self->_set_options(%args); + IDZebra::repository_show($self->{session}{zh}); +} + +sub update_record { + my ($self, $buf, $sysno, $match, $fname) = @_; + + $sysno = 0 unless ($sysno > 0); + $match = "" unless ($match); + $fname = "" unless ($fname); + + return(IDZebra::update_record($self->{session}{zh}, + $self->{rg}, + $sysno,$match,$fname, + $buf, -1)); +} + +sub delete_record { + my ($self, $buf, $sysno, $match, $fname) = @_; + + $sysno = 0 unless ($sysno > 0); + $match = "" unless ($match); + $fname = "" unless ($fname); + + return(IDZebra::delete_record($self->{session}{zh}, + $self->{rg}, + $sysno,$match,$fname, + $buf, -1)); +} + +sub DESTROY { + my ($self) = @_; + print STDERR "Destroy repository\n"; +} + +__END__ + +=head1 NAME + +IDZebra::Repository - + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +=head1 COPYRIGHT + +Fill in + +=head1 AUTHOR + +Peter Popovics, pop@technomat.hu + +=head1 SEE ALSO + +IDZebra, IDZebra::Data1, Zebra documentation + +=cut diff --git a/perl/lib/IDZebra/Service.pm b/perl/lib/IDZebra/Service.pm new file mode 100644 index 0000000..4ac41a8 --- /dev/null +++ b/perl/lib/IDZebra/Service.pm @@ -0,0 +1,99 @@ +#!/usr/bin/perl +# ============================================================================ +# Zebra perl API header +# ============================================================================= +use strict; +use Carp; +# ============================================================================ +package IDZebra::Service; +use IDZebra; +use IDZebra::Session; +use IDZebra::Logger qw(:flags :calls); +use Scalar::Util qw(weaken); + +our @ISA = qw(IDZebra::Logger); + +1; +# ----------------------------------------------------------------------------- +# Class constructors, destructor +# ----------------------------------------------------------------------------- +sub new { + my ($proto,$configName) = @_; + my $class = ref($proto) || $proto; + my $self = {}; + $self->{configName} = $configName; + $self->{sessions} = {}; + $self->{sessc} = 0; + bless ($self, $class); + return ($self); +} + +sub start { + my ($proto,$configName) = @_; + my $self = {}; + if (ref($proto)) { $self = $proto; } else { + $self = $proto->new($configName); + } + unless (defined($self->{zs})) { + $self->{zs} = IDZebra::start($self->{configName}); + } + return ($self); +} + +sub stop { + my ($self) = @_; + foreach my $sess (values(%{$self->{sessions}})) { + $sess->close; + } + IDZebra::stop($self->{zs}) if ($self->{zs}); + $self->{zs} = undef; +} + +sub DESTROY { + my ($self) = @_; + $self->stop; +} +# ----------------------------------------------------------------------------- +# Session management +# ----------------------------------------------------------------------------- +sub createSession { + my ($self) = @_; + my $session = IDZebra::Session->new($self); + $self->{sessions}{$self->{sessc}} = $session; + weaken ($self->{sessions}{$self->{sessc}}); + $self->{sessc}++; + return($session); +} + +sub openSession { + my ($self) = @_; + my $session = IDZebra::Session->open($self); + $self->{sessions}{$self->{sessc}} = $session; + weaken ($self->{sessions}{$self->{sessc}}); + $self->{sessc}++; + return($session); +} + +__END__ + +=head1 NAME + +IDZebra::Service - + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +=head1 COPYRIGHT + +Fill in + +=head1 AUTHOR + +Peter Popovics, pop@technomat.hu + +=head1 SEE ALSO + +IDZebra, IDZebra::Data1, Zebra documentation + +=cut diff --git a/perl/lib/IDZebra/Session.pm b/perl/lib/IDZebra/Session.pm new file mode 100644 index 0000000..d53bb7f --- /dev/null +++ b/perl/lib/IDZebra/Session.pm @@ -0,0 +1,213 @@ +#!/usr/bin/perl +# ============================================================================ +# Zebra perl API header +# ============================================================================= +use strict; +use Carp; +# ============================================================================ +package IDZebra::Session; +use IDZebra; +use IDZebra::Logger qw(:flags :calls); +use IDZebra::Repository; +use Scalar::Util; + +our @ISA = qw(IDZebra::Logger); + +1; +# ----------------------------------------------------------------------------- +# Class constructors, destructor +# ----------------------------------------------------------------------------- +sub new { + my ($proto,$service) = @_; + my $class = ref($proto) || $proto; + my $self = {}; + $self->{service} = $service; + $self->{sessionID} = $service->{sessc}; + bless ($self, $class); + return ($self); +} + +sub open { + my ($proto,$service) = @_; + my $self = {}; + if (ref($proto)) { $self = $proto; } else { + $self = $proto->new($service); + } + unless (defined($self->{zh})) { + $self->{zh}=IDZebra::open($self->{service}{zs}) if ($self->{service}); + } + $self->Repository(); # Make a dummy record group + + $self->{odr_input} = IDZebra::odr_createmem($IDZebra::ODR_DECODE); + $self->{odr_output} = IDZebra::odr_createmem($IDZebra::ODR_ENCODE); + + return ($self); +} + +sub close { + my ($self) = @_; + + if ($self->{zh}) { + IDZebra::close($self->{zh}); + $self->{zh} = undef; + } + + if ($self->{odr_input}) { + IDZebra::odr_destroy($self->{odr_input}); + $self->{odr_input} = undef; + } + + if ($self->{odr_output}) { + IDZebra::odr_destroy($self->{odr_output}); + $self->{odr_output} = undef; + } + + delete($self->{service}{sessions}{$self->{sessionID}}); + delete($self->{service}); +} + +sub DESTROY { + my ($self) = @_; + print STDERR "Destroy_session\n"; + $self->close; +} +# ----------------------------------------------------------------------------- +# Error handling +# ----------------------------------------------------------------------------- +sub errCode { + my ($self) = @_; + return(IDZebra::errCode($self->{zh})); +} + +sub errString { + my ($self) = @_; + return(IDZebra::errString($self->{zh})); +} + +sub errAdd { + my ($self) = @_; + return(IDZebra::errAdd($self->{zh})); +} + +# ----------------------------------------------------------------------------- +# Transaction stuff +# ----------------------------------------------------------------------------- +sub begin_trans { + my ($self) = @_; + unless ($self->{trans_started}) { + $self->{trans_started} = 1; + IDZebra::begin_trans($self->{zh}); + } +} + +sub end_trans { + my ($self) = @_; + if ($self->{trans_started}) { + $self->{trans_started} = 0; + IDZebra::end_trans($self->{zh}); + } +} + +sub shadow_enable { + my ($self, $value) = @_; + if ($#_ > 0) { IDZebra::set_shadow_enable($self->{zh},$value); } + return (IDZebra::get_shadow_enable($self->{zh})); +} + +sub commit { + my ($self) = @_; + if ($self->shadow_enable) { + return(IDZebra::commit($self->{zh})); + } +} + +# ----------------------------------------------------------------------------- +# We don't really need that... +# ----------------------------------------------------------------------------- +sub odr_reset { + my ($self, $name) = @_; + if ($name !~/^(input|output)$/) { + croak("Undefined ODR '$name'"); + } + IDZebra::odr_reset($self->{"odr_$name"}); +} + +# ----------------------------------------------------------------------------- +# Init/compact +# ----------------------------------------------------------------------------- +sub init { + my ($self) = @_; + return(IDZebra::init($self->{zh})); +} + +sub compact { + my ($self) = @_; + return(IDZebra::compact($self->{zh})); +} + +# ----------------------------------------------------------------------------- +# Repository stuff +# ----------------------------------------------------------------------------- +sub Repository { + my ($self, %args) = @_; + if (!$self->{rep}) { + $self->{rep} = IDZebra::Repository->new($self, %args); + } else { + $self->{rep}->modify(%args); + } + + return ($self->{rep}); +} + +# ----------------------------------------------------------------------------- +# Search and retrieval +# ----------------------------------------------------------------------------- +sub select_databases { + my ($self, @databases) = @_; + return (IDZebra::select_databases($self->{zh}, + ($#databases + 1), + \@databases)); +} + +sub begin_read { + my ($self) =@_; + return(IDZebra::begin_read($self->{zh})); +} + +sub end_read { + my ($self) =@_; + IDZebra::end_read($self->{zh}); +} + +sub search_pqf { + my ($self, $query, $setname) = @_; + return (IDZebra::search_PQF($self->{zh}, + $self->{odr_input}, + $self->{odr_output}, + $query, + $setname)); +} + +__END__ + +=head1 NAME + +IDZebra::Session - + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +=head1 COPYRIGHT + +Fill in + +=head1 AUTHOR + +Peter Popovics, pop@technomat.hu + +=head1 SEE ALSO + +IDZebra, IDZebra::Data1, Zebra documentation + +=cut diff --git a/perl/rg.h b/perl/rg.h new file mode 100644 index 0000000..ff04642 --- /dev/null +++ b/perl/rg.h @@ -0,0 +1,14 @@ +typedef struct { + char *groupName; + char *databaseName; + char *path; + char *recordId; + char *recordType; + int flagStoreData; + int flagStoreKeys; + int flagRw; + int fileVerboseLimit; + int databaseNamePath; + int explainDatabase; + int followLinks; +} recordGroup; diff --git a/perl/test.pl b/perl/test.pl new file mode 100755 index 0000000..07d8324 --- /dev/null +++ b/perl/test.pl @@ -0,0 +1,83 @@ +#!/usr/bin/perl + +BEGIN { + push (@INC,'demo','blib/lib','blib/arch'); +} +use Test::More tests => 3; +use Data::Dumper; +use IDZebra::Logger qw(:flags :calls); +use IDZebra::Repository; +use pod; + +BEGIN { + use_ok('IDZebra'); + use_ok('IDZebra::Service'); + use_ok('IDZebra::Data1'); +} + +#Zebra::API::LogFile("a.log"); + + +IDZebra::init(); + +chdir('demo'); + +my $service = IDZebra::Service->start('zebra.cfg'); +my $sess = $service->openSession; +#my $sess = $service->createSession; +#$sess->open; +#my $session = IDZebra::open($service); +#IDZebra::close($session); +#IDZebra::stop($service); +#$sess->close; + +my $rec1=`cat ../lib/IDZebra/Data1.pm`; +my $rec2=`cat ../lib/IDZebra/Filter.pm`; + +#$sess->Repository->readConfig; +$sess->Repository->readConfig("","pm"); + +$sess->begin_trans; + +#$sess->Repository->update(databaseName => 'Default', +# path => '/usr/local/work/cvs/zebra/perl/lib'); +my $s1 = $sess->Repository->update_record($rec1,0,"","Data1.pm"); +my $s2 = $sess->Repository->update_record($rec2,0,"","Filter.pm"); +print STDERR "s1:$s1, s2:$s2\n"; + +$sess->end_trans; +#$sess->begin_trans; +#$sess->Repository->delete_record($rec1,0,"","Data1.pm"); +#$sess->end_trans; + +$sess->select_databases('Default'); +#$sess->begin_read; +print STDERR "Hits:", $sess->search_pqf('@or @attr 1=4 Filter @attr 1=4 Data1','test_1'), "\n"; +print STDERR "Hits:", $sess->search_pqf('@or @attr 1=4 Filter @attr 1=4 Data1','test_1'), "\n"; +print STDERR "Hits:", $sess->search_pqf('@or @attr 1=4 Filter @attr 1=4 Data1','test_1'), "\n"; +#$sess->end_read; + +#$sess->commit; +#IDZebra::describe_recordGroup($rep->{rg}); +#$rep->update; +# print "HOW did we got back???\n"; +$sess->close; +$service->stop; + + +#$rep->{groupName} = "Strucc"; +#$rep->describe(); + +sub test_data1 { + $m = IDZebra::nmem_create(); + my $d1=IDZebra::Data1->new($m,$IDZebra::DATA1_FLAG_XML); + my $root=$d1->mk_root('strucc'); + my $tag1 = $d1->mk_tag($root,'emu',('asd' => 1, + 'bsd' => 2)); + my $tag2 = $d1->mk_tag($root,'emu'); + $d1->pr_tree($root); + IDZebra::nmem_destroy($m); + $d1->DESTROY(); +} + +IDZebra::DESTROY; diff --git a/perl/zebra_api_ext.c b/perl/zebra_api_ext.c new file mode 100644 index 0000000..90e40c4 --- /dev/null +++ b/perl/zebra_api_ext.c @@ -0,0 +1,232 @@ +#include +#include +#ifdef WIN32 +#include +#include +#include +#else +#include +#endif + +#include +#include "index.h" +#include +#include +#include "rg.h" +#include "yaz/log.h" +#include + +void data1_print_tree(data1_handle dh, data1_node *n, FILE *out) { + data1_pr_tree(dh, n, stdout); +} + +int zebra_get_shadow_enable (ZebraHandle zh) { + return (zh->shadow_enable); +} + +void zebra_set_shadow_enable (ZebraHandle zh, int value) { + zh->shadow_enable = value; +} +/* recordGroup stuff */ +void describe_recordGroup (recordGroup *rg) { + printf ("name:%s\ndatabaseName%s\npath:%s\n", + rg->groupName, + rg->databaseName, + rg->path); +} + +void init_recordGroup (recordGroup *rg) { + rg->groupName = NULL; + rg->databaseName = NULL; + rg->path = NULL; + rg->recordId = NULL; + rg->recordType = NULL; + rg->flagStoreData = -1; + rg->flagStoreKeys = -1; + rg->flagRw = 1; + rg->databaseNamePath = 0; + rg->explainDatabase = 0; + rg->fileVerboseLimit = 100000; + rg->followLinks = -1; +} + + +/* This is from extract.c... it seems useful, when extract_rec_in mem is + called... and in general... Should be moved to somewhere else */ +void res_get_recordGroup (ZebraHandle zh, + recordGroup *rGroup, + const char *ext) { + char gprefix[128]; + char ext_res[128]; + + if (!rGroup->groupName || !*rGroup->groupName) + *gprefix = '\0'; + else + sprintf (gprefix, "%s.", rGroup->groupName); + + /* determine file type - depending on extension */ + if (!rGroup->recordType) { + sprintf (ext_res, "%srecordType.%s", gprefix, ext); + if (!(rGroup->recordType = res_get (zh->res, ext_res))) { + sprintf (ext_res, "%srecordType", gprefix); + rGroup->recordType = res_get (zh->res, ext_res); + } + } + /* determine match criteria */ + if (!rGroup->recordId) { + sprintf (ext_res, "%srecordId.%s", gprefix, ext); + if (!(rGroup->recordId = res_get (zh->res, ext_res))) { + sprintf (ext_res, "%srecordId", gprefix); + rGroup->recordId = res_get (zh->res, ext_res); + } + } + + /* determine database name */ + if (!rGroup->databaseName) { + sprintf (ext_res, "%sdatabase.%s", gprefix, ext); + if (!(rGroup->databaseName = res_get (zh->res, ext_res))) { + sprintf (ext_res, "%sdatabase", gprefix); + rGroup->databaseName = res_get (zh->res, ext_res); + } + } + if (!rGroup->databaseName) + rGroup->databaseName = "Default"; + + /* determine if explain database */ + sprintf (ext_res, "%sexplainDatabase", gprefix); + rGroup->explainDatabase = + atoi (res_get_def (zh->res, ext_res, "0")); + + /* storeData */ + if (rGroup->flagStoreData == -1) { + const char *sval; + sprintf (ext_res, "%sstoreData.%s", gprefix, ext); + if (!(sval = res_get (zh->res, ext_res))) { + sprintf (ext_res, "%sstoreData", gprefix); + sval = res_get (zh->res, ext_res); + } + if (sval) + rGroup->flagStoreData = atoi (sval); + } + if (rGroup->flagStoreData == -1) rGroup->flagStoreData = 0; + + /* storeKeys */ + if (rGroup->flagStoreKeys == -1) { + const char *sval; + + sprintf (ext_res, "%sstoreKeys.%s", gprefix, ext); + sval = res_get (zh->res, ext_res); + if (!sval) { + sprintf (ext_res, "%sstoreKeys", gprefix); + sval = res_get (zh->res, ext_res); + } + if (!sval) sval = res_get (zh->res, "storeKeys"); + if (sval) rGroup->flagStoreKeys = atoi (sval); + } + if (rGroup->flagStoreKeys == -1) rGroup->flagStoreKeys = 0; + +} + +/* --------------------------------------------------------------------------- + Record insert(=update), delete + + If sysno is provided, then it's used to identify the reocord. + If not, and match_criteria is provided, then sysno is guessed + If not, and a record is provided, then sysno is got from there + +*/ + +int zebra_update_record (ZebraHandle zh, + struct recordGroup *rGroup, + int sysno, const char *match, const char *fname, + const char *buf, int buf_size) + +{ + int res; + + if (buf_size < 1) buf_size = strlen(buf); + + res=bufferExtractRecord (zh, buf, buf_size, rGroup, + 0, // delete_flag + 0, // test_mode, + &sysno, + match, fname); + + return sysno; +} + +int zebra_delete_record (ZebraHandle zh, + struct recordGroup *rGroup, + int sysno, const char *match, const char *fname, + const char *buf, int buf_size) +{ + int res; + + if (buf_size < 1) buf_size = strlen(buf); + + res=bufferExtractRecord (zh, buf, buf_size, rGroup, + 1, // delete_flag + 0, // test_mode, + &sysno, + match,fname); + return sysno; +} +void zebra_search_RPN (ZebraHandle zh, ODR decode, ODR stream, + Z_RPNQuery *query, const char *setname, int *hits) +{ + zh->hits = 0; + *hits = 0; + + if (zebra_begin_read (zh)) + return; + resultSetAddRPN (zh, decode, stream, query, + zh->num_basenames, zh->basenames, setname); + + zebra_end_read (zh); + + *hits = zh->hits; +} + +void zebra_retrieve_sysnos (ZebraHandle zh, + const char *setname, + int num_recs) +{ + if (!zh->res) { + zh->errCode = 30; + /* zh->errString = odr_strdup (stream, setname); */ + logf(LOG_FATAL,"No resources open"); + return; + } + + zh->errCode = 0; + if (zebra_begin_read (zh)) + return; + + zebra_end_read (zh); + +} + +int zebra_search_PQF (ZebraHandle zh, + ODR odr_input, ODR odr_output, + const char *pqf_query, + const char *setname) + +{ + int hits; + Z_RPNQuery *query; + logf (LOG_LOG, "11"); + query = p_query_rpn (odr_input, PROTO_Z3950, pqf_query); + logf (LOG_LOG, "22"); + + if (!query) { + logf (LOG_WARN, "bad query %s\n", pqf_query); + odr_reset (odr_input); + return(0); + } + zebra_search_RPN (zh, odr_input, odr_output, query, setname, &hits); + + odr_reset (odr_input); + odr_reset (odr_output); + + return(hits); +} diff --git a/perl/zebra_api_ext.h b/perl/zebra_api_ext.h new file mode 100644 index 0000000..aef0398 --- /dev/null +++ b/perl/zebra_api_ext.h @@ -0,0 +1,24 @@ +int zebra_insert_record (ZebraHandle zh, + const char *database, + const char *buf, int len, + char *match); + + +int zebra_delete_record_by_sysno (ZebraHandle zh, + const char *database, + int sysno); + +int zebra_delete_records_by_match (ZebraHandle zh, + const char *database, + char *match); + +int zebra_update_record_by_sysno (ZebraHandle zh, + const char *database, + const char *buf, int len, + int sysno); + +int zebra_update_records_by_match (ZebraHandle zh, + const char *database, + const char *buf, int len, + char *match); + diff --git a/perl/zebra_perl.c b/perl/zebra_perl.c new file mode 100644 index 0000000..a0f29d7 --- /dev/null +++ b/perl/zebra_perl.c @@ -0,0 +1,33 @@ +//#include "zebraapi.h" +#include "zebra_perl.h" +#include +#include +#include "rg.h" + +NMEM handles; + +void init (void) { + nmem_init (); + yaz_log_init_prefix ("ZebraPerl"); + yaz_log (LOG_LOG, "Zebra::API initialized"); +} + +void DESTROY (void) { + nmem_exit (); + yaz_log (LOG_LOG, "Zebra::API destroyed"); +} + +/* Logging facilities from yaz */ +void logLevel (int level) { + yaz_log_init_level(level); +} + +void logFile (const char *fname) { + yaz_log_init_file(fname); +} + +void logMsg (int level, const char *message) { + logf(level, "%s", message); +} + + diff --git a/perl/zebra_perl.h b/perl/zebra_perl.h new file mode 100644 index 0000000..40ba726 --- /dev/null +++ b/perl/zebra_perl.h @@ -0,0 +1,5 @@ + +#include +#include +#include "zebra_api_ext.h" + diff --git a/recctrl/Makefile.am b/recctrl/Makefile.am index fb376a6..5c93407 100644 --- a/recctrl/Makefile.am +++ b/recctrl/Makefile.am @@ -1,7 +1,7 @@ -## $Id: Makefile.am,v 1.4 2002-07-08 08:43:23 adam Exp $ +## $Id: Makefile.am,v 1.5 2002-11-15 21:26:01 adam Exp $ noinst_LIBRARIES = librecctrl.a librecctrl_a_SOURCES = recctrl.c recgrs.c sgmlread.c regxread.c \ - marcread.c rectext.c grsread.h recgrs.h rectext.h xmlread.c + marcread.c rectext.c grsread.h recgrs.h rectext.h xmlread.c perlread.c INCLUDES = -I$(srcdir)/../include @YAZINC@ $(TCL_INCLUDE) diff --git a/recctrl/grsread.h b/recctrl/grsread.h index f1ea420..381cb63 100644 --- a/recctrl/grsread.h +++ b/recctrl/grsread.h @@ -1,4 +1,4 @@ -/* $Id: grsread.h,v 1.11 2002-10-22 12:51:09 adam Exp $ +/* $Id: grsread.h,v 1.12 2002-11-15 21:26:01 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data Aps @@ -56,6 +56,7 @@ extern RecTypeGrs recTypeGrs_regx; extern RecTypeGrs recTypeGrs_tcl; extern RecTypeGrs recTypeGrs_marc; extern RecTypeGrs recTypeGrs_xml; +extern RecTypeGrs recTypeGrs_perl; #ifdef __cplusplus } diff --git a/recctrl/perlread.c b/recctrl/perlread.c new file mode 100644 index 0000000..e1cdef3 --- /dev/null +++ b/recctrl/perlread.c @@ -0,0 +1,278 @@ +/* $Id: perlread.c,v 1.1 2002-11-15 21:26:01 adam Exp $ */ + +#if HAVE_PERL +#define PERL_IMPLICIT_CONTEXT +#include "perlread.h" +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +#include +#include +#include +#include + +#include +#include +#include +#include "grsread.h" + + +#define GRS_PERL_MODULE_NAME_MAXLEN 255 + +// Context information for the filter +struct perl_context { + PerlInterpreter *perli; + PerlInterpreter *origi; + int perli_ready; + char filterClass[GRS_PERL_MODULE_NAME_MAXLEN]; + SV *filterRef; + + int (*readf)(void *, char *, size_t); + off_t (*seekf)(void *, off_t); + off_t (*tellf)(void *); + void (*endf)(void *, off_t); + + void *fh; + data1_handle dh; + NMEM mem; + data1_node *res; +}; + +// Constructor call for the filter object +void Filter_create (struct perl_context *context) +{ + dSP; + SV *msv; + + PUSHMARK(SP) ; + XPUSHs(sv_2mortal(newSVpv(context->filterClass, + strlen(context->filterClass)))) ; + msv = sv_newmortal(); + sv_setref_pv(msv, "_p_perl_context", (void*)context); + XPUSHs(msv) ; + PUTBACK ; + call_method("new", 0); + + SPAGAIN ; + context->filterRef = POPs; + PUTBACK ; +} + +/* + Execute the process call on the filter. This is a bit dirty. + The perl code is going to get dh and nmem from the context trough callbacks, + then call readf, to get the stream, and then set the res (d1 node) + in the context. However, it's safer, to let swig do as much of wrapping + as possible. + */ +int Filter_process (struct perl_context *context) + +{ + + int res; + + dSP; + + PUSHMARK(SP) ; + XPUSHs(context->filterRef); + PUTBACK ; + call_method("_process", 0); + SPAGAIN ; + res = POPi; + PUTBACK ; + return (res); +} + +/* + This one is called to transfer the results of a readf. It's going to create + a temporary variable there... + + So the call stack is something like: + + + ->Filter_process(context) [C] + -> _process($context) [Perl] + -> grs_perl_get_dh($context) [Perl] + -> grs_perl_get_dh(context) [C] + -> grs_perl_get_mem($context) [Perl] + -> grs_perl_get_mem(context) [C] + -> process() [Perl] + ... + -> grs_perl_readf($context,$len) [Perl] + -> grs_perl_readf(context, len) [C] + ->(*context->readf)(context->fh, buf, len) [C] + -> Filter_store_buff(context, buf, r) [C] + -> _store_buff($buff) [Perl] + [... returns buff and length ...] + ... + [... returns d1 node ...] + -> grs_perl_set_res($context, $node) [Perl] + -> grs_perl_set_res(context, node) [C] + + [... The result is in context->res ...] + + Dirty, isn't it? It may become nicer, if I'll have some more time to work on + it. However, these changes are not going to hurt the filter api, as + Filter.pm, which is inherited into all specific filter implementations + can hide this whole compexity behind. + +*/ +void Filter_store_buff (struct perl_context *context, char *buff, size_t len) { + dSP; + PUSHMARK(SP) ; + XPUSHs(context->filterRef); + XPUSHs(sv_2mortal(newSVpv(buff, len))); + PUTBACK ; + call_method("_store_buff", 0); + SPAGAIN ; + PUTBACK ; +} +/* The "file" manipulation function wrappers */ +int grs_perl_readf(struct perl_context *context, size_t len) { + int r; + char *buf = (char *) xmalloc (len+1); + r = (*context->readf)(context->fh, buf, len); + if (r > 0) Filter_store_buff (context, buf, r); + xfree (buf); + return (r); +} + +off_t grs_perl_seekf(struct perl_context *context, off_t offset) { + return ((*context->seekf)(context->fh, offset)); +} + +off_t grs_perl_tellf(struct perl_context *context) { + return ((*context->tellf)(context->fh)); +} + +void grs_perl_endf(struct perl_context *context, off_t offset) { + (*context->endf)(context->fh, offset); +} + +/* Get pointers from the context. Easyer to wrap this by SWIG */ +data1_handle grs_perl_get_dh(struct perl_context *context) { + return(context->dh); +} + +NMEM grs_perl_get_mem(struct perl_context *context) { + return(context->mem); +} + +/* Set the result in the context */ +void grs_perl_set_res(struct perl_context *context, data1_node *n) { + context->res = n; +} + +/* The filter handlers (init, destroy, read) */ +static void *grs_init_perl(void) +{ + struct perl_context *context = + (struct perl_context *) xmalloc (sizeof(*context)); + + // If there is an interpreter (context) running, - we are calling + // indexing and retrieval from the perl API - we don't create a new one. + context->origi = PERL_GET_CONTEXT; + if (context->origi == NULL) { + context->perli = perl_alloc(); + PERL_SET_CONTEXT(context->perli); + logf (LOG_LOG, "Initializing new perl interpreter context (%p)",context->perli); + } else { + logf (LOG_LOG, "Using existing perl interpreter context (%p)",context->origi); + } + context->perli_ready = 0; + strcpy(context->filterClass, ""); + return (context); +} + +void grs_destroy_perl(void *clientData) +{ + struct perl_context *context = (struct perl_context *) clientData; + + logf (LOG_LOG, "Destroying perl interpreter context"); + if (context->perli_ready) { + FREETMPS; + LEAVE; + if (context->origi == NULL) perl_destruct(context->perli); + } + if (context->origi == NULL) perl_free(context->perli); + xfree (context); +} + +static data1_node *grs_read_perl (struct grs_read_info *p) +{ + struct perl_context *context = (struct perl_context *) p->clientData; + char *filterClass = p->type; + + // The "file" manipulation function wrappers + context->readf = p->readf; + context->seekf = p->seekf; + context->tellf = p->tellf; + context->endf = p->endf; + + // The "file", data1 and NMEM handles + context->fh = p->fh; + context->dh = p->dh; + context->mem = p->mem; + + // If the class was not interpreted before... + // This is not too efficient, when indexing with many different filters... + if (strcmp(context->filterClass,filterClass)) { + + char modarg[GRS_PERL_MODULE_NAME_MAXLEN + 2]; + char initarg[GRS_PERL_MODULE_NAME_MAXLEN + 2]; + char *arglist[6] = { "", "-I", "", "-M", "-e", "" }; + + if (context->perli_ready) { + FREETMPS; + LEAVE; + if (context->origi == NULL) perl_destruct(context->perli); + } + if (context->origi == NULL) perl_construct(context->perli); + ENTER; + SAVETMPS; + context->perli_ready = 1; + + // parse, and run the init call + if (context->origi == NULL) { + logf (LOG_LOG, "Interpreting filter class:%s", filterClass); + + arglist[2] = (char *) data1_get_tabpath(p->dh); + sprintf(modarg,"-M%s",filterClass); + arglist[3] = (char *) &modarg; + sprintf(initarg,"%s->init;",filterClass); + arglist[5] = (char *) &initarg; + + perl_parse(context->perli, PERL_XS_INIT, 6, arglist, NULL); + perl_run(context->perli); + } + + strcpy(context->filterClass, filterClass); + + // create the filter object as a filterClass blessed reference + Filter_create(context); + } + + // Wow... if calling with individual update_record calls from perl, + // the filter object reference may go out of scope... + if (!SvOK(context->filterRef)) Filter_create(context); + + + // call the process method + Filter_process(context); + + // return the created data1 node + return (context->res); +} + +static struct recTypeGrs perl_type = { + "perl", + grs_init_perl, + grs_destroy_perl, + grs_read_perl +}; + +RecTypeGrs recTypeGrs_perl = &perl_type; + +/* HAVE_PERL */ +#endif diff --git a/recctrl/perlread.h.in b/recctrl/perlread.h.in new file mode 100644 index 0000000..2a5c606 --- /dev/null +++ b/recctrl/perlread.h.in @@ -0,0 +1,8 @@ +/* Perl configuration */ +#include +#include + +#define PERL_BINARY @PERL_BINARY@ +#define PERL_XS_INIT @PERL_XS_INIT@ + +@PERL_XS_INIT_INCLUDE@ -- 1.7.10.4