X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=perl%2FIDZebra.i;h=6a9c75dbaad42f37875d2852b8e1e1a18a158839;hb=7ec81d893efe0407cda28aeca3cb232266dd713f;hp=2031e8b3a163f3f74a0ce07b893afd52589e196c;hpb=619b7a25eae7bffe31395d103d8eb4c5d0a84581;p=idzebra-moved-to-github.git diff --git a/perl/IDZebra.i b/perl/IDZebra.i index 2031e8b..6a9c75d 100644 --- a/perl/IDZebra.i +++ b/perl/IDZebra.i @@ -1,9 +1,9 @@ %module "IDZebra" %include typemaps.i // Load the typemaps librayr + %{ #include "zebraapi.h" -#include "zebra_api_ext.h" #include "zebra_perl.h" #include "data1.h" #include "yaz/odr.h" @@ -12,8 +12,6 @@ /* == Typemaps ============================================================= */ -/* RetrievalRecordBuff is a special construct, to allow to map a char * buf - to non-null terminated perl string scalar value (SVpv). */ %typemap(in) int * { int i; if (!SvIOK($input)) @@ -28,6 +26,8 @@ argvi++; } +/* RetrievalRecordBuff is a special construct, to allow to map a char * buf + to non-null terminated perl string scalar value (SVpv). */ %typemap(out) RetrievalRecordBuf * { if ($1->len) { $result = newSVpv($1->buf,$1->len); @@ -86,7 +86,52 @@ /* == Structures for shadow classes ======================================= */ -%include "zebra_perl.h" + +/*%include "zebra_perl.h" */ +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; + +typedef struct { + int noOfRecords; + ZebraRetrievalRecord *records; +} RetrievalObj; + +typedef struct { + int errCode; /* non-zero if error when fetching this */ + char *errString; /* error string */ + int position; /* position of record in result set (1,2,..) */ + char *base; + int sysno; + int score; + char *format; /* record syntax */ + RetrievalRecordBuf *buf; +} RetrievalRecord; + +/* Scan Term Descriptor */ +typedef struct { + int occurrences; /* scan term occurrences */ + char *term; /* scan term string */ +} scanEntry; + +typedef struct { + int num_entries; + int position; + int is_partial; + scanEntry *entries; +} ScanObj; + typedef struct { int processed; @@ -97,7 +142,6 @@ typedef struct { long stime; } ZebraTransactionStatus; - /* == Module initialization and cleanup (zebra_perl.c) ===================== */ void init (void); @@ -188,7 +232,7 @@ int zebra_select_databases (ZebraHandle zh, int num_bases, /* begin transaction (add write lock) (zebraapi.c) */ %name(begin_trans) -void zebra_begin_trans (ZebraHandle zh); +int zebra_begin_trans (ZebraHandle zh, int rw); /* end transaction (remove write lock) (zebraapi.c) */ %name(end_trans) @@ -197,15 +241,6 @@ void zebra_end_transaction (ZebraHandle zh, ZebraTransactionStatus *stat); %name(trans_no) int zebra_trans_no (ZebraHandle zh); -%name(begin_read) -int zebra_begin_read (ZebraHandle zh); - -void zts_test (ZebraTransactionStatus *stat); - -/* end retrieval (remove read lock) (zebraapi.c) */ -%name(end_read) -void zebra_end_read (ZebraHandle zh); - /* commit changes from shadow (zebraapi.c) */ %name(commit) int zebra_commit (ZebraHandle zh); @@ -243,6 +278,17 @@ void zebra_repository_show (ZebraHandle zh); If not, and match_criteria is provided, then sysno is guessed If not, and a record is provided, then sysno is got from there */ +%name(insert_record) +int zebra_insert_record (ZebraHandle zh, + recordGroup *rGroup, + const char *recordType, + int sysno, + const char *match, + const char *fname, + const char *buf, + int buf_size, + int force_update); + %name(update_record) int zebra_update_record (ZebraHandle zh, recordGroup *rGroup, @@ -251,7 +297,8 @@ int zebra_update_record (ZebraHandle zh, const char *match, const char *fname, const char *buf, - int buf_size); + int buf_size, + int force_update); %name(delete_record) int zebra_delete_record (ZebraHandle zh, @@ -261,7 +308,9 @@ int zebra_delete_record (ZebraHandle zh, const char *match, const char *fname, const char *buf, - int buf_size); + int buf_size, + int force_update); + /* == Search (zebra_api_ext.c) ============================================= */