Filter-Crypto
view release on metacpan or search on metacpan
CryptFile/CryptFile.xs view on Meta::CPAN
INCLUDE: const-xs.inc
INCLUDE: ../CryptoCommon-xs.inc
# Private function to expose the FILTER_CRYPTO_DEBUG_MODE constant.
void
_debug_mode();
PROTOTYPE:
PPCODE:
{
#ifdef FILTER_CRYPTO_DEBUG_MODE
XSRETURN_YES;
#else
XSRETURN_EMPTY;
#endif
}
# Private function to expose the FilterCrypto_CryptFh() function above, as
# called with one in-out filehandle.
void
_crypt_fh(fh, crypt_mode_ex, num_bytes);
PROTOTYPE: $$$
INPUT:
InOutStream fh;
FILTER_CRYPTO_MODE_EX crypt_mode_ex
SV* num_bytes
PPCODE:
{
if (FilterCrypto_CryptFh(aTHX_ fh, (PerlIO *)NULL, crypt_mode_ex,
num_bytes))
XSRETURN_YES;
else
XSRETURN_EMPTY;
}
# Private function to expose the FilterCrypto_CryptFh() function above, as
# called with one input filehandle and one output filehandle.
CryptFile/CryptFile.xs view on Meta::CPAN
void
_crypt_fhs(in_fh, out_fh, crypt_mode_ex, num_bytes);
PROTOTYPE: $$$$
INPUT:
InputStream in_fh;
OutputStream out_fh;
FILTER_CRYPTO_MODE_EX crypt_mode_ex;
SV* num_bytes;
PPCODE:
{
if (FilterCrypto_CryptFh(aTHX_ in_fh, out_fh, crypt_mode_ex, num_bytes))
XSRETURN_YES;
else
XSRETURN_EMPTY;
}
#===============================================================================
CryptFile/fallback/const-xs.inc view on Meta::CPAN
dTARGET;
#endif
STRLEN len;
int type;
IV iv;
/* NV nv; Uncomment this if you need to return NVs */
/* const char *pv; Uncomment this if you need to return PVs */
INPUT:
SV * sv;
const char * s = SvPV(sv, len);
PPCODE:
/* Change this to constant(aTHX_ s, len, &iv, &nv);
if you need to return both NVs and IVs */
type = constant(aTHX_ s, len, &iv);
/* Return 1 or 2 items. First is error message, or undef if no error.
Second, if present, is found value */
switch (type) {
case PERL_constant_NOTFOUND:
sv = sv_2mortal(newSVpvf("%s is not a valid Filter::Crypto::CryptFile macro", s));
PUSHs(sv);
break;
CryptoCommon-xs.inc view on Meta::CPAN
sv_bless(rv, stash);
}
void
DESTROY(self)
PROTOTYPE: $
INPUT:
SV *self;
PPCODE:
{
#ifdef FILTER_CRYPTO_DEBUG_MODE
warn("Destroying %s\n", sv_reftype(SvRV(self), TRUE));
#endif
/* Free the current thread's error queue and all previously loaded error
* strings. */
ERR_remove_state(0);
ERR_free_strings();
( run in 1.346 second using v1.01-cache-2.11-cpan-5511b514fd6 )