File: typemap

package info (click to toggle)
libmusicbrainz-client-perl 0.11-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 172 kB
  • ctags: 150
  • sloc: perl: 532; makefile: 57; pascal: 38
file content (43 lines) | stat: -rw-r--r-- 1,201 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# $Id: typemap 736 2004-06-17 23:41:26Z sander $
#
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;