File: typemap

package info (click to toggle)
libhtml-embperl-perl 1.3.6-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,596 kB
  • ctags: 1,190
  • sloc: ansic: 8,985; perl: 4,584; makefile: 83
file content (88 lines) | stat: -rw-r--r-- 1,812 bytes parent folder | download | duplicates (3)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
TYPEMAP
tConf * T_PTROBJ_CONF
tReq *  T_PTROBJ_REQ
tFile * T_PTROBJ_FILE
tDomNode * T_PTROBJ_DOMNODE
tTokenTable * T_PTROBJ_SYNTAX
AV *    T_MYAVREF
HV *    T_MYHVREF

INPUT
T_MYAVREF
    $var = (AV *)SvRV($arg);

T_MYHVREF
    $var = (HV *)SvRV($arg);

T_PTROBJ_CONF
    if (sv_derived_from ($arg, \"HTML::Embperl::Conf\"))
        $var = (tConf *)(SvIV((SV *)SvRV($arg))) ;
    else
        croak (\"$var is not of type HTML::Embperl::Conf\") ;

T_PTROBJ_REQ
    {
    MAGIC * mg ;
    if (mg = mg_find (SvRV($arg), '~'))
        $var = *((tReq **)(mg -> mg_ptr)) ;
    else
        croak (\"$var is not of type HTML::Embperl::Req\") ;
    }


T_PTROBJ_FILE
    if (sv_derived_from ($arg, \"HTML::Embperl::File\"))
        $var = (tFile *)(SvIV((SV *)SvRV($arg))) ;
    else
        croak (\"$var is not of type HTML::Embperl::File\") ;

T_PTROBJ_DOMNODE
    {
    MAGIC * mg ;
    if (mg = mg_find (SvRV($arg), '~'))
        $var = *((tDomNode **)(mg -> mg_ptr)) ;
    else
        croak (\"$var is not of type XML::Embperl::DOM::Node\") ;
    }

T_PTROBJ_SYNTAX
    {
#ifdef EP2
#    MAGIC * mg ;
#    if (SvROK ($arg) && (mg = mg_find (SvRV($arg), '~')))
#        $var = *((tTokenTable **)(mg -> mg_ptr)) ;
#    else
#        croak (\"$var is not of type HTML::Embperl::Syntax\") ;
#else
    STRLEN l ;
    $var = (tTokenTable *)SvPV($arg,l) ;
#endif
    }



OUTPUT
T_PTROBJ_CONF
    sv_setref_pv ($arg, \"HTML::Embperl::Conf\", (void *)$var) ;

T_PTROBJ_REQ
    {
    SV * pSV = $var -> pReqSV ;
    if (pSV == NULL)
       $arg = &sv_undef ;
    else
        $arg = pSV ;
    }
 
T_PTROBJ_FILE
    sv_setref_pv ($arg, \"HTML::Embperl::File\", (void *)$var) ;

T_PTROBJ_DOMNODE
    {
    SV * pSV = $var -> pDomNodeSV ;
    if (pSV == NULL)
       $arg = &sv_undef ;
    else
        $arg = pSV ;
    }