X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=perl%2FIDZebra.i;h=8b5f86e7d272f31aaf8de839546ab1d17c629f51;hb=4cea1b9769079a2cdc143f4fe483e69d5b77a813;hp=c1f1ec2459376a293c1472db66aecf00ed894e88;hpb=4a3a97df9d47b8d099e403308f8015f130366994;p=idzebra-moved-to-github.git diff --git a/perl/IDZebra.i b/perl/IDZebra.i index c1f1ec2..8b5f86e 100644 --- a/perl/IDZebra.i +++ b/perl/IDZebra.i @@ -3,9 +3,9 @@ %{ -#include "zebraapi.h" +#include #include "zebra_perl.h" -#include "data1.h" +#include #include "yaz/odr.h" #include "yaz/cql.h" %} @@ -26,6 +26,20 @@ argvi++; } +/* * * * * * Fix for broken swig implementation */ +%typemap(argout) long long *INOUT { + char temp[256]; + if (argvi >= items) { + EXTEND(sp,1); + } + /* sprintf(temp,"%lld", $1); */ + sprintf(temp,"%lld", *$1); + $result = sv_newmortal(); + sv_setpv($result,temp); + 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 * { @@ -99,7 +113,7 @@ typedef struct { char *errString; /* error string */ int position; /* position of record in result set (1,2,..) */ char *base; - int sysno; + long long sysno; int score; char *format; /* record syntax */ RetrievalRecordBuf *buf; @@ -273,21 +287,26 @@ void zebra_repository_show (ZebraHandle zh, const char *path); If not, and match_criteria is provided, then sysno is guessed If not, and a record is provided, then sysno is got from there */ -%apply int *REFERENCE { int *sysno }; +%apply long long *INOUT { long long *sysno }; + %name(insert_record) int zebra_insert_record (ZebraHandle zh, const char *recordType, - int *sysno, + long long *sysno, const char *match, const char *fname, const char *buf, int buf_size, int force_update); +/* actually, sysno is only output param in insert_record, but kept */ +/* as inout for symmetry in the interface. The session class assures */ +/* that nothing goes in... */ + %name(update_record) int zebra_update_record (ZebraHandle zh, const char *recordType, - int *sysno, + long long *sysno, const char *match, const char *fname, const char *buf, @@ -297,7 +316,7 @@ int zebra_update_record (ZebraHandle zh, %name(delete_record) int zebra_delete_record (ZebraHandle zh, const char *recordType, - int *sysno, + long long *sysno, const char *match, const char *fname, const char *buf, @@ -354,10 +373,12 @@ int zebra_deleleResultSet(ZebraHandle zh, int function, /* Resultset terms */ +/* disabled %name(resultSetTerms) int zebra_resultSetTerms (ZebraHandle zh, const char *setname, int no, int *REFERENCE, int *REFERENCE, char *out, int *REFERENCE); +*/ /* == Sort ================================================================= */ %name(sort)