Skip to content

Commit

Permalink
Add peek() helper to XS code
Browse files Browse the repository at this point in the history
  • Loading branch information
autarch committed Jan 7, 2015
1 parent a413483 commit 4bd3297
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions lib/Params/Validate/XS.xs
Expand Up @@ -74,6 +74,32 @@
} \
} STMT_END


static SV *module;
void peek(SV *thing)
{
if (NULL == module) {
module = newSVpv("Devel::Peek", 0);
load_module(PERL_LOADMOD_NOIMPORT, module, NULL);
}

dSP;
ENTER;
SAVETMPS;

PUSHMARK(SP);
XPUSHs(thing);
PUTBACK;

(void)call_pv("Devel::Peek::Dump", G_VOID);

SPAGAIN;

PUTBACK;
FREETMPS;
LEAVE;
}

INLINE static bool
no_validation() {
SV* no_v;
Expand Down

0 comments on commit 4bd3297

Please sign in to comment.