X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=ZOOM.xs;h=885db0e762dc45f400c0de7139e18ae68981e7b7;hb=e28476c2caddb588f2e2f038d0fcefaea2243421;hp=7e58189c61cc1d8c001619d9e9f6ce0489f234bc;hpb=9e1726a4461f86d43a11189809905f7d07b646db;p=ZOOM-Perl-moved-to-github.git diff --git a/ZOOM.xs b/ZOOM.xs index 7e58189..885db0e 100644 --- a/ZOOM.xs +++ b/ZOOM.xs @@ -1,10 +1,11 @@ -/* $Id: ZOOM.xs,v 1.46 2007-01-16 11:17:15 mike Exp $ */ +/* $Id: ZOOM.xs,v 1.48 2007-09-14 10:33:16 mike Exp $ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include +#include #include /* Used by the *_setl() functions */ @@ -204,6 +205,14 @@ const char * ZOOM_diag_str(error) int error +const char * +ZOOM_diag_srw_str(error) + int error + CODE: + RETVAL = yaz_diag_srw_str(error); + OUTPUT: + RETVAL + ZOOM_resultset ZOOM_connection_search(arg0, q) ZOOM_connection arg0 @@ -554,7 +563,7 @@ ZOOM_event(conns) SV *realconns; I32 n, i; int res; - ZOOM_connection cs[100]; + ZOOM_connection *cs; CODE: /*printf("* in ZOOM_event(%p)\n", conns);*/ if (!SvROK(conns)) { @@ -572,12 +581,14 @@ ZOOM_event(conns) if (n == 0) { /*printf("* No connections in referenced array\n");*/ XSRETURN_IV(-3); - } else if (n >= sizeof(cs)/sizeof(cs[0])) { + } + + /*printf("* n = %d\n", n);*/ + if ((cs = (ZOOM_connection*) malloc(n * sizeof *cs)) == 0) { /*printf("* Too many connections (%d)\n", (int) n);*/ XSRETURN_IV(-4); } - /*printf("* n = %d\n", n);*/ for (i = 0; i < n; i++) { SV **connp = av_fetch((AV*) realconns, i, (I32) 0); SV *conn, *sv; @@ -603,6 +614,7 @@ ZOOM_event(conns) /*printf("got cs[%d] of %d = %p\n", (int) i, (int) n, cs[i]);*/ } RETVAL = ZOOM_event((int) n, cs); + free(cs); OUTPUT: RETVAL