X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=typemap;h=85ae80db710fbe2d45cf21455de92baf37d99049;hb=642622d050330937ddd5261707dcc6ba9b039ee7;hp=4f005578648004f023fc98ae9906237a60f2ef86;hpb=7f5edf5f99cb9f1287b610ee76f54788a6f60275;p=ZOOM-Perl-moved-to-github.git diff --git a/typemap b/typemap index 4f00557..85ae80d 100644 --- a/typemap +++ b/typemap @@ -1,4 +1,4 @@ -# $Id: typemap,v 1.3 2005-10-11 15:40:14 mike Exp $ +# $Id: typemap,v 1.5 2005-10-17 13:48:08 mike Exp $ ZOOM_connection T_PTROBJ ZOOM_connection * T_PTROBJ @@ -24,8 +24,11 @@ const __sigset_t * T_PTROBJ # 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. +# 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 @@ -48,6 +51,7 @@ 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 @@ -62,7 +66,13 @@ T_OPAQUE_STRUCT } else croak(\"$var is not of type ${ntype}\") +T_OPAQUECHAR + int _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);