-avhv_exists(av, key, klen)
-AV *av;
-char *key;
-U32 klen;
-{
- SV **keys;
-
- keys = av_fetch(av, 0, FALSE);
- if (!keys || !SvROK(*keys) || SvTYPE(SvRV(*keys)) != SVt_PVHV)
- croak("Can't coerce array into hash");
- return hv_exists((HV*)SvRV(*keys), key, klen);
-}
-
-/* avhv_delete leaks. Caller can re-index and compress if so desired. */
-SV *
-avhv_delete(av, key, klen, flags)
-AV *av;
-char *key;
-U32 klen;
-I32 flags;
-{
- SV **keys;
- SV *sv;
- SV **svp;
- I32 ind;
-
- keys = av_fetch(av, 0, FALSE);
- if (!keys || !SvROK(*keys) || SvTYPE(SvRV(*keys)) != SVt_PVHV)
- croak("Can't coerce array into hash");
- sv = hv_delete((HV*)SvRV(*keys), key, klen, 0);
- if (!sv)
- return Nullsv;
- ind = SvIV(sv);
- if (ind < 1)
- croak("Bad index while coercing array into hash");
- svp = av_fetch(av, ind, FALSE);
- if (!svp)
- return Nullsv;
- if (flags & G_DISCARD) {
- sv = Nullsv;
- SvREFCNT_dec(*svp);
- } else {
- sv = sv_2mortal(*svp);
- }
- *svp = &sv_undef;
- return sv;
-}
-
-/* avhv_delete_ent leaks. Caller can re-index and compress if so desired. */
-SV *
-avhv_delete_ent(av, keysv, flags, hash)
-AV *av;
-SV *keysv;
-I32 flags;
-U32 hash;