~ubuntu-branches/debian/sid/libembperl-perl/sid

« back to all changes in this revision

Viewing changes to typemap

  • Committer: Bazaar Package Importer
  • Author(s): Angus Lees
  • Date: 2004-02-15 14:23:39 UTC
  • Revision ID: james.westby@ubuntu.com-20040215142339-n21gqf7mx9tmyb8d
Tags: upstream-2.0b10
ImportĀ upstreamĀ versionĀ 2.0b10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
TYPEMAP
 
2
tConf * T_PTROBJ_CONF
 
3
tReq *  T_PTROBJ_REQ
 
4
tFile * T_PTROBJ_FILE
 
5
tDomNode * T_PTROBJ_DOMNODE
 
6
tTokenTable * T_PTROBJ_SYNTAX
 
7
AV *    T_MYAVREF
 
8
HV *    T_MYHVREF
 
9
Apache::Server T_PTROBJ
 
10
 
 
11
 
 
12
INPUT
 
13
T_MYAVREF
 
14
    $var = (AV *)SvRV($arg);
 
15
 
 
16
T_MYHVREF
 
17
    $var = (HV *)SvRV($arg);
 
18
 
 
19
T_PTROBJ_CONF
 
20
    if (sv_derived_from ($arg, \"Embperl::Conf\"))
 
21
        $var = (tConf *)(SvIV((SV *)SvRV($arg))) ;
 
22
    else
 
23
        croak (\"$var is not of type Embperl::Conf\") ;
 
24
 
 
25
T_PTROBJ_REQ
 
26
    {
 
27
    MAGIC * mg ;
 
28
    if ((mg = mg_find (SvRV($arg), '~')))
 
29
        $var = *((tReq **)(mg -> mg_ptr)) ;
 
30
    else
 
31
        croak (\"$var is not of type Embperl::Req\") ;
 
32
    }
 
33
 
 
34
 
 
35
T_PTROBJ_FILE
 
36
    if (sv_derived_from ($arg, \"Embperl::File\"))
 
37
        $var = (tFile *)(SvIV((SV *)SvRV($arg))) ;
 
38
    else
 
39
        croak (\"$var is not of type Embperl::File\") ;
 
40
 
 
41
T_PTROBJ_DOMNODE
 
42
    {
 
43
    MAGIC * mg ;
 
44
    if ((mg = mg_find (SvRV($arg), '~')))
 
45
        $var = *((tDomNode **)(mg -> mg_ptr)) ;
 
46
    else
 
47
        croak (\"$var is not of type XML::Embperl::DOM::Node\") ;
 
48
    }
 
49
 
 
50
T_PTROBJ_SYNTAX
 
51
    {
 
52
    MAGIC * mg ;
 
53
    if (SvROK ($arg) && (mg = mg_find (SvRV($arg), '~')))
 
54
        $var = *((tTokenTable **)(mg -> mg_ptr)) ;
 
55
    else
 
56
        croak (\"$var is not of type Embperl::Syntax\") ;
 
57
    }
 
58
 
 
59
 
 
60
 
 
61
OUTPUT
 
62
T_PTROBJ_CONF
 
63
    sv_setref_pv ($arg, \"Embperl::Conf\", (void *)$var) ;
 
64
 
 
65
T_PTROBJ_REQ
 
66
    {
 
67
    SV * pSV = $var -> pReqSV ;
 
68
    if (pSV == NULL)
 
69
       $arg = &sv_undef ;
 
70
    else
 
71
        $arg = pSV ;
 
72
    }
 
73
 
 
74
T_PTROBJ_FILE
 
75
    sv_setref_pv ($arg, \"Embperl::File\", (void *)$var) ;
 
76
 
 
77
T_PTROBJ_DOMNODE
 
78
    {
 
79
    SV * pSV = $var -> pDomNodeSV ;
 
80
    if (pSV == NULL)
 
81
       $arg = &sv_undef ;
 
82
    else
 
83
        $arg = pSV ;
 
84
    }
 
85