%module "IDZebra"
%include typemaps.i // Load the typemaps librayr
+
%{
#include "zebraapi.h"
#include "zebra_perl.h"
/* == 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))
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);
/* == 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;
long stime;
} ZebraTransactionStatus;
-
/* == Module initialization and cleanup (zebra_perl.c) ===================== */
void init (void);
/* 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)
%name(trans_no)
int zebra_trans_no (ZebraHandle zh);
-%name(begin_read)
-int zebra_begin_read (ZebraHandle zh);
-
-/* 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);