X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=perl%2FIDZebra.i;h=88e6a7bbcdaf0c348837fbb6c0a6eb7d1386b6fd;hb=587c1d5cac956ec0cf482fc14ecea40240e85fd8;hp=1cab21f3a6797da8b7012e054972038644e8ceee;hpb=43d2ebb33d16b27b18e4fc5bc24a81e1be43aba3;p=idzebra-moved-to-github.git diff --git a/perl/IDZebra.i b/perl/IDZebra.i index 1cab21f..88e6a7b 100644 --- a/perl/IDZebra.i +++ b/perl/IDZebra.i @@ -1,4 +1,5 @@ %module "IDZebra" +%include typemaps.i // Load the typemaps librayr %{ #include "zebraapi.h" @@ -46,30 +47,28 @@ /* Creates a new Perl array and places a NULL-terminated char ** into it */ %typemap(out) char ** { - AV *myav; - SV **svs; - int i = 0,len = 0; - /* Figure out how many elements we have */ - while ($1[len]) - len++; - svs = (SV **) malloc(len*sizeof(SV *)); - for (i = 0; i < len ; i++) { - svs[i] = sv_newmortal(); - sv_setpv((SV*)svs[i],$1[i]); - }; - myav = av_make(len,svs); - free(svs); + AV *myav; + SV **svs; + int i = 0,len = 0; + /* Figure out how many elements we have */ + while ($1[len]) + len++; + svs = (SV **) malloc(len*sizeof(SV *)); + for (i = 0; i < len ; i++) { + svs[i] = sv_newmortal(); + sv_setpv((SV*)svs[i],$1[i]); + }; + myav = av_make(len,svs); + free(svs); $result = newRV((SV*)myav); sv_2mortal($result); argvi++; } - /* == Structures for shadow classes ======================================= */ %include "zebra_perl.h" - /* == Module initialization and cleanup (zebra_perl.c) ===================== */ void init (void); @@ -271,15 +270,28 @@ int sort (ZebraHandle zh, const char *output_setname, const char **input_setnames ); + +/* == Scan ================================================================= */ /* +%apply int *INOUT {int *position}; +%apply int *INOUT {int *num_entries}; +%apply int *INOUT {int *is_partial}; -void zebra_sort (ZebraHandle zh, ODR stream, - int num_input_setnames, - const char **input_setnames, - const char *output_setname, - Z_SortKeySpecList *sort_sequence, - int *sort_status); +%name(scan_PQF) +void zebra_scan_PQF (ZebraHandle zh, + ODR stream, + const char *pqf_query, + int *position, + int *num_entries, + int *is_partial); */ +%name(scan_PQF) +void zebra_scan_PQF (ZebraHandle zh, + ScanObj *so, + ODR stream, + const char *pqf_query); + +ScanEntry *getScanEntry(ScanObj *so, int pos); /* Admin functionality */ /* @@ -287,14 +299,6 @@ void zebra_sort (ZebraHandle zh, ODR stream, %name(admin_shutdown) void zebra_admin_shutdown (ZebraHandle zh); */ -/* Browse -void zebra_scan (ZebraHandle zh, ODR stream, - Z_AttributesPlusTerm *zapt, - oid_value attributeset, - int *position, int *num_entries, - ZebraScanEntry **list, - int *is_partial); -*/ /* Delete Result Set(s) */ /*