summaryrefslogtreecommitdiff
path: root/mathoms.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-09-20 12:13:16 +0000
committerNicholas Clark <nick@ccl4.org>2007-09-20 12:13:16 +0000
commit4c2df08ca7dcec8d9dadbf994c085e23d96957a3 (patch)
treec12c69e6cae735fc84bc1a5acadd1c971cc1ff23 /mathoms.c
parent6b4de9074f35c313f7b151542a4d1bbf6fd263a2 (diff)
downloadperl-4c2df08ca7dcec8d9dadbf994c085e23d96957a3.tar.gz
Convert hv_delete_ent(), hv_exists_ent(), hv_fetch_ent() and
hv_store_ent() to macros, and consign the function bodies to history. Er, mathoms.c p4raw-id: //depot/perl@31924
Diffstat (limited to 'mathoms.c')
-rw-r--r--mathoms.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/mathoms.c b/mathoms.c
index a8a28e626e..077bda6e21 100644
--- a/mathoms.c
+++ b/mathoms.c
@@ -1210,6 +1210,34 @@ Perl_pack_cat(pTHX_ SV *cat, const char *pat, const char *patend, register SV **
packlist(cat, pat, patend, beglist, endlist);
}
+
+HE *
+Perl_hv_store_ent(pTHX_ HV *hv, SV *keysv, SV *val, U32 hash)
+{
+ return hv_common(hv, keysv, NULL, 0, 0, HV_FETCH_ISSTORE, val, hash);
+}
+
+bool
+Perl_hv_exists_ent(pTHX_ HV *hv, SV *keysv, U32 hash)
+{
+ return hv_common(hv, keysv, NULL, 0, 0, HV_FETCH_ISEXISTS, 0, hash)
+ ? TRUE : FALSE;
+}
+
+HE *
+Perl_hv_fetch_ent(pTHX_ HV *hv, SV *keysv, I32 lval, U32 hash)
+{
+ return hv_common(hv, keysv, NULL, 0, 0,
+ (lval ? HV_FETCH_LVALUE : 0), NULL, hash);
+}
+
+SV *
+Perl_hv_delete_ent(pTHX_ HV *hv, SV *keysv, I32 flags, U32 hash)
+{
+ return (SV *) hv_common(hv, keysv, NULL, 0, 0, flags | HV_DELETE, NULL,
+ hash);
+}
+
#endif /* NO_MATHOMS */
/*