| 1 | #include "EXTERN.h" | ||||||||||
| 2 | #include "perl.h" | ||||||||||
| 3 | #include "XSUB.h" | ||||||||||
| 4 | |||||||||||
| 5 | MODULE = Devel::Refcount PACKAGE = Devel::Refcount | ||||||||||
| 6 | |||||||||||
| 7 | int | ||||||||||
| 8 | refcount(ref) | ||||||||||
| 9 | SV *ref | ||||||||||
| 10 | |||||||||||
| 11 | CODE: | ||||||||||
| 12 | 29 | ▶ | if(!SvROK(ref)) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | 2 | croak("ref is not a reference"); | |||||||||
| 14 | } | ||||||||||
| 15 | 27 | ▶ | RETVAL = SvREFCNT(SvRV(ref)); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | OUTPUT: | ||||||||||
| 17 | RETVAL | ||||||||||