This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to Devel::PPPort 3.18_01
[perl5.git] / ext / Devel-PPPort / parts / inc / gv
1 ################################################################################
2 ##
3 ##  $Revision: 1 $
4 ##  $Author: mhx $
5 ##  $Date: 2009/06/12 12:29:56 +0200 $
6 ##
7 ################################################################################
8 ##
9 ##  Version 3.x, Copyright (C) 2004-2009, Marcus Holland-Moritz.
10 ##  Version 2.x, Copyright (C) 2001, Paul Marquess.
11 ##  Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
12 ##
13 ##  This program is free software; you can redistribute it and/or
14 ##  modify it under the same terms as Perl itself.
15 ##
16 ################################################################################
17
18 =provides
19
20 __UNDEFINED__
21
22 =implementation
23
24 __UNDEFINED__ GvSVn(gv)        GvSV(gv)
25 __UNDEFINED__ isGV_with_GP(gv) isGV(gv)
26
27 =xsubs
28
29 int
30 GvSVn()
31         PREINIT:
32                 GV* gv;
33         CODE:
34                 RETVAL = 0;
35                 gv = gv_fetchpvs("Devel::PPPort::GvTest", GV_ADDMULTI, SVt_PVGV);
36                 if (GvSVn(gv) != NULL)
37                 {
38                   RETVAL++;
39                 }
40         OUTPUT:
41                 RETVAL
42
43 int
44 isGV_with_GP()
45         PREINIT:
46                 GV* gv;
47         CODE:
48                 RETVAL = 0;
49                 gv = gv_fetchpvs("Devel::PPPort::GvTest", GV_ADDMULTI, SVt_PVGV);
50                 if (isGV_with_GP(gv))
51                 {
52                   RETVAL++;
53                 }
54                 if (!isGV(&PL_sv_undef))
55                 {
56                   RETVAL++;
57                 }
58         OUTPUT:
59                 RETVAL
60
61
62 =tests plan => 2
63
64 ok(Devel::PPPort::GvSVn(), 1);
65
66 ok(Devel::PPPort::isGV_with_GP(), 2)