diff options
Diffstat (limited to 'ext/XS/APItest/APItest.xs')
-rw-r--r-- | ext/XS/APItest/APItest.xs | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/ext/XS/APItest/APItest.xs b/ext/XS/APItest/APItest.xs index da865e693d..96efd9bf77 100644 --- a/ext/XS/APItest/APItest.xs +++ b/ext/XS/APItest/APItest.xs @@ -195,8 +195,12 @@ rot13_key(pTHX_ IV action, SV *field) { return 0; } +#include "const-c.inc" + MODULE = XS::APItest:Hash PACKAGE = XS::APItest::Hash +INCLUDE: const-xs.inc + void rot13_hash(hash) HV *hash @@ -227,17 +231,31 @@ exists(hash, key_sv) RETVAL SV * -delete(hash, key_sv) +delete(hash, key_sv, flags = 0) PREINIT: STRLEN len; const char *key; INPUT: HV *hash SV *key_sv + I32 flags; CODE: key = SvPV(key_sv, len); /* It's already mortal, so need to increase reference count. */ - RETVAL = SvREFCNT_inc(hv_delete(hash, key, UTF8KLEN(key_sv, len), 0)); + RETVAL + = SvREFCNT_inc(hv_delete(hash, key, UTF8KLEN(key_sv, len), flags)); + OUTPUT: + RETVAL + +SV * +delete_ent(hash, key_sv, flags = 0) + INPUT: + HV *hash + SV *key_sv + I32 flags; + CODE: + /* It's already mortal, so need to increase reference count. */ + RETVAL = SvREFCNT_inc(hv_delete_ent(hash, key_sv, flags, 0)); OUTPUT: RETVAL |