X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=perl%2FIDZebra.i;h=f3e62766d95067d567388739ded5f03990b5027c;hb=cef013b96c9508d5fd8552e7fd05962029b37e6f;hp=c9294aef47d4721029a1563ccf7e0943c37cb2c5;hpb=2e4e9c6def27f1e1463dcb6f205fab6a98054f38;p=idzebra-moved-to-github.git diff --git a/perl/IDZebra.i b/perl/IDZebra.i index c9294ae..f3e6276 100644 --- a/perl/IDZebra.i +++ b/perl/IDZebra.i @@ -3,7 +3,7 @@ %{ -#include "zebraapi.h" +#include #include "zebra_perl.h" #include "data1.h" #include "yaz/odr.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 * { @@ -273,7 +287,8 @@ 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 { long long *sysno }; +%apply long long *INOUT { long long *sysno }; + %name(insert_record) int zebra_insert_record (ZebraHandle zh, const char *recordType, @@ -283,6 +298,10 @@ int zebra_insert_record (ZebraHandle zh, const char *buf, int buf_size, int force_update); +/* actually, susno 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, @@ -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)