X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=ZOOM.xs;h=673b02580912a3e7b2349a7cf6b29e6b3aba27d9;hb=c8fb970de6273fa0cb034cd6cb706734d5a7dafd;hp=7f02c013df6619340b0c5a4b58fee2c576768e9e;hpb=692fb30bc0ab6d6e1536405ed7040ecd2b7c94ce;p=ZOOM-Perl-moved-to-github.git diff --git a/ZOOM.xs b/ZOOM.xs index 7f02c01..673b025 100644 --- a/ZOOM.xs +++ b/ZOOM.xs @@ -1,4 +1,4 @@ -/* $Id: ZOOM.xs,v 1.42 2006-06-15 15:43:13 mike Exp $ */ +/* $Id: ZOOM.xs,v 1.47 2007-02-22 20:37:47 mike Exp $ */ #include "EXTERN.h" #include "perl.h" @@ -288,6 +288,27 @@ ZOOM_resultset_sort1(r, sort_type, sort_spec) const char* sort_type const char* sort_spec +# See comments for ZOOM_connection_error() above +int +ZOOM_record_error(rec, cp, addinfo, diagset) + ZOOM_record rec + const char* &cp + const char* &addinfo + const char* &diagset + CODE: + { + const char *ccp = "", *caddinfo = "", *cdset = ""; + RETVAL = ZOOM_record_error(rec, &ccp, &caddinfo, &cdset); + cp = (char*) ccp; + addinfo = (char*) caddinfo; + diagset = (char*) cdset; + } + OUTPUT: + RETVAL + cp + addinfo + diagset + # See "typemap" for discussion of the "const char *" return-type. # ### but should use datachunk for in some (not all!) cases. @@ -520,8 +541,6 @@ ZOOM_package_option_set(p, key, val) const char * key const char * val -# UNTESTED -# # This has to be called with a single argument which is a _reference_ # to an array -- rather than directly with an array, which is of # course identical to passing arbitrarily many arguments. This is @@ -535,7 +554,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)) { @@ -553,12 +572,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; @@ -584,14 +605,23 @@ 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 -# UNTESTED int ZOOM_connection_last_event(cs) ZOOM_connection cs +int +ZOOM_connection_is_idle(cs) + ZOOM_connection cs + +int +ZOOM_connection_peek_event(cs) + ZOOM_connection cs + + # ---------------------------------------------------------------------------- # What follows is the YAZ logging API. This is not strictly part of # ZOOM, but it's so useful that it would be silly to omit.