# $Id: typemap,v 1.2 2004/06/17 23:41:26 sander Exp $
#
TYPEMAP
musicbrainz_t      O_OBJECT
intArray *  	   T_ARRAY

######################################################################
OUTPUT
# The Perl object is blessed into 'CLASS', which should be a
# char* having the name of the package for the blessing.
O_OBJECT
        sv_setref_pv( $arg, CLASS, (void*)$var );

T_ARRAY
	{
	  U32 ix_$var;
          EXTEND(SP,size_$var);
          for( ix_$var = 0; ix_$var < size_$var; ix_$var++) {
            ST(ix_$var) = sv_newmortal();
            DO_ARRAY_ELEM
          }
        }
######################################################################
INPUT
 
O_OBJECT
        if( sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVMG) ) {
                $var = INT2PTR($type,SvIV((SV*)SvRV( $arg )));
        } else {
                warn( \"${Package}::$func_name() -- $var is not a blessed SV reference\" );
                XSRETURN_UNDEF;
        }

T_ARRAY
	U32 ix_$var = $argoff;
        $var = $ntype(items -= $argoff);
        while(items--) {
          DO_ARRAY_ELEM;
          ix_$var++;
        }
        /* this is the number of elements in the array */
        ix_$var -= $argoff;
        
