X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=ZOOM.xs;h=27721396efdeff9b30aa7c38e79532413cea54a0;hb=33ab99ed17f92d8c84e580f3708b9d6d27fa1bc7;hp=557e4eddf133c3df3573ea49e04c6d75d667e063;hpb=c79aab4ce5b9a90f8bd3ff1f6873b4023f41f600;p=ZOOM-Perl-moved-to-github.git diff --git a/ZOOM.xs b/ZOOM.xs index 557e4ed..2772139 100644 --- a/ZOOM.xs +++ b/ZOOM.xs @@ -1,4 +1,4 @@ -/* $Id: ZOOM.xs,v 1.20 2005-11-02 18:23:10 mike Exp $ */ +/* $Id: ZOOM.xs,v 1.24 2005-11-04 17:07:13 mike Exp $ */ #include "EXTERN.h" #include "perl.h" @@ -210,11 +210,6 @@ const char * ZOOM_diag_str(error) int error -# UNTESTED -int -ZOOM_connection_last_event(cs) - ZOOM_connection cs - # TESTED ZOOM_resultset ZOOM_connection_search(arg0, q) @@ -250,40 +245,29 @@ size_t ZOOM_resultset_size(r) ZOOM_resultset r -# TESTING +# TESTED SV * -ZOOM_resultset_records(r, start, count, return_values) +ZOOM_resultset_records(r, start, count, return_records) ZOOM_resultset r size_t start size_t count - int return_values + int return_records INIT: - ZOOM_record *recs; + ZOOM_record *recs = 0; CODE: - /*printf("*** ZOOM_resultset_records(r=0x%lx, start=%lu, count=%lx, return_values=%d)\n", (unsigned long) r, (unsigned long) start, (unsigned long) count, return_values);*/ - if (return_values) { - /*printf("*** generating space for %ld records\n", (unsigned long) count);*/ + if (return_records) recs = (ZOOM_record*) xmalloc(count * sizeof *recs); - } else { - /*printf("*** using null pointer for records array\n");*/ - recs = 0; - } ZOOM_resultset_records(r, recs, start, count); - /*printf("*** returned from ZOOM_resultset_records()\n");*/ - if (return_values) { + if (return_records) { AV *av = newAV(); int i; for (i = 0; i < count; i++) { - SV *tmp = sv_newmortal(); - printf("*** recs[%d] = %lu\n", i, (unsigned long) recs[i]); - /* ### Next line fails. Damn and blast Perl */ + SV *tmp = newSV(0); sv_setref_pv(tmp, "ZOOM_record", (void*) recs[i]); av_push(av, tmp); } RETVAL = newRV((SV*) av); - printf("*** returning array %lu\n", (unsigned long) RETVAL); } else { - /*printf("*** returning undef\n");*/ RETVAL = &PL_sv_undef; } OUTPUT: @@ -306,6 +290,13 @@ void ZOOM_resultset_cache_reset(r) ZOOM_resultset r +# TESTED +void +ZOOM_resultset_sort(r, sort_type, sort_spec) + ZOOM_resultset r + const char* sort_type + const char* sort_spec + # See "typemap" for discussion of the "const char *" return-type. # # TESTED @@ -431,13 +422,6 @@ ZOOM_package_option_set(p, key, val) const char * key const char * val -# UNTESTED -void -ZOOM_resultset_sort(r, sort_type, sort_spec) - ZOOM_resultset r - const char * sort_type - const char * sort_spec - # We ignore the return value of ZOOM_options_set_callback(), since it # is always just the address of the __ZOOM_option_callback() function. # The information that we actually want -- the address of the Perl @@ -548,3 +532,8 @@ ZOOM_event(no, cs) int no ZOOM_connection * cs +# UNTESTED +int +ZOOM_connection_last_event(cs) + ZOOM_connection cs +