X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=typemap;h=7bd56b6718e5826286c03fbad200a58b7a39959b;hb=19ea8ae4e2b514576f55ef0904d74eb036ccfa23;hp=237a6bf9617127e7a6168466864b2f2f74532eea;hpb=fc11c3c61b1b23962666e1acfeb46242d4836497;p=ZOOM-Perl-moved-to-github.git diff --git a/typemap b/typemap index 237a6bf..7bd56b6 100644 --- a/typemap +++ b/typemap @@ -1,5 +1,3 @@ -# $Id: typemap,v 1.2 2005-10-11 11:36:33 mike Exp $ - ZOOM_connection T_PTROBJ ZOOM_connection * T_PTROBJ ZOOM_options T_PTROBJ @@ -20,7 +18,15 @@ __extension__ extern unsigned long long int T_PTROBJ __locale_t T_PTROBJ char * __const * T_PTROBJ const __sigset_t * T_PTROBJ -const char * T_PTROBJ +# The next line was originally autogenerated by h2xs, which gave the +# type of "const char *" as T_PTROBJ -- a pointer to an opaque object. +# This prevented the return value of ZOOM_record_get() from being +# translated into a Perl string. Instead, I am using T_PV, which +# works properly. This also has the pleasant side-effect that I no +# longer have to discard the "const" qualfiers from the arguments to +# the functions in the .xs file. +const char * T_PV +opaquechar * T_OPAQUECHAR const char ** T_PTROBJ const struct timespec * T_PTROBJ div_t T_OPAQUE_STRUCT @@ -43,7 +49,8 @@ unsigned short int * T_PTROBJ void ( * __func ) ( int __status, void * __arg ) T_PTROBJ void ( * __func ) ( void ) T_PTROBJ void ** T_PTROBJ -############################################################################# +struct datachunk T_DATACHUNK +# --------------------------------------------------------------------------- INPUT T_OPAQUE_STRUCT if (sv_derived_from($arg, \"${ntype}\")) { @@ -57,7 +64,13 @@ T_OPAQUE_STRUCT } else croak(\"$var is not of type ${ntype}\") -############################################################################# +T_OPAQUECHAR + { STRLEN _unused_len; + $var = ($type) SvPV($arg, _unused_len); } + +# --------------------------------------------------------------------------- OUTPUT T_OPAQUE_STRUCT sv_setref_pvn($arg, \"${ntype}\", (char *)&$var, sizeof($var)); +T_DATACHUNK + sv_setpvn($arg, $var.data, $var.len);