Lines Matching refs:key

153 S_hv_notallowed(pTHX_ int flags, const char *key, I32 klen,
158 sv_setpvn(sv, key, klen);
163 sv_usepvn(sv, (char *) key, klen);
172 /* (klen == HEf_SVKEY) is special for MAGICAL hv entries, meaning key slot
183 Stores an SV in a hash. The hash key is specified as C<key> and C<klen> is
184 the length of the key. The C<hash> parameter is the precomputed hash
196 hv_store_ent, and does not create a temporary SV for the key, so if your
197 key data is not already in SV form then use hv_store in preference to
207 Perl_hv_store(pTHX_ HV *hv, const char *key, I32 klen_i32, SV *val, U32 hash)
220 hek = hv_fetch_common (hv, NULL, key, klen, flags,
226 Perl_hv_store_flags(pTHX_ HV *hv, const char *key, I32 klen, SV *val,
229 HE *hek = hv_fetch_common (hv, NULL, key, klen, flags,
237 Stores C<val> in a hash. The hash key is specified as C<key>. The C<hash>
250 anything further to tidy up. Note that hv_store_ent only reads the C<key>;
252 reference count on C<key> is entirely the caller's responsibility. hv_store
254 SV for the key, so if your key data is not already in SV form then use
272 Returns a boolean indicating whether the specified hash key exists. The
273 C<klen> is the length of the key.
279 Perl_hv_exists(pTHX_ HV *hv, const char *key, I32 klen_i32)
291 return hv_fetch_common(hv, NULL, key, klen, flags, HV_FETCH_ISEXISTS, 0, 0)
298 Returns the SV which corresponds to the specified key in the hash. The
299 C<klen> is the length of the key. If C<lval> is set then the fetch will be
310 Perl_hv_fetch(pTHX_ HV *hv, const char *key, I32 klen_i32, I32 lval)
323 hek = hv_fetch_common (hv, NULL, key, klen, flags,
332 Returns a boolean indicating whether the specified hash key exists. C<hash>
351 Returns the hash entry which corresponds to the specified key in the hash.
352 C<hash> must be a valid precomputed hash number for the given C<key>, or 0
373 S_hv_fetch_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
389 Safefree(key);
390 key = SvPV(keysv, klen);
408 keysv = newSVpvn(key, klen);
437 Safefree(key);
445 if (isLOWER(key[i])) {
448 char *nkey = strupr(savepvn(key,klen));
450 key) whereas the store is for key (the original) */
457 /* This call will free key if necessary.
460 entry = hv_fetch_common(hv, keysv, key, klen,
465 Safefree(key);
482 keysv = newSVpvn(key, klen);
489 mg_copy((SV*)hv, sv, key, klen);
492 Safefree(key);
502 const char *keysave = key;
504 key = savepvn(key,klen);
505 key = (const char*)strupr((char*)key);
524 keysv = newSVpvn(key, klen);
532 mg_copy((SV*)hv, val, key, klen);
538 Safefree(key);
544 const char *keysave = key;
546 key = savepvn(key,klen);
547 key = (const char*)strupr((char*)key);
579 Safefree(key);
586 const char *keysave = key;
587 key = (char*)bytes_from_utf8((U8*)key, &klen, &is_utf8);
592 if (key != keysave) {
600 PERL_HASH_INTERNAL(hash, key, klen);
608 /* Not enough shared hash key scalars around to make this worthwhile
615 PERL_HASH(hash, key, klen);
635 if (HeKEY(entry) != key && memNE(HeKEY(entry),key,klen)) /* is this it? */
642 /* We match if HVhek_UTF8 bit in our flags and hash key's
644 and key now doesn't (or vice versa) then we should change
645 the key's flag, as this is assignment. */
647 /* Need to swap the key we have for a key with the flags we
650 HEK *new_hek = share_hek_flags(key, klen, hash,
694 Safefree(key);
701 char *env = PerlEnv_ENVgetenv_len(key,&len);
705 return hv_fetch_common(hv,keysv,key,klen,flags,HV_FETCH_ISSTORE,sv,
712 S_hv_notallowed(aTHX_ flags, key, klen,
713 "access disallowed key '%"SVf"' in"
719 Safefree(key);
729 return hv_fetch_common(hv, keysv, key, klen, flags,
753 HeKEY_hek(entry) = share_hek_flags(key, klen, hash, flags);
755 HeKEY_hek(entry) = save_hek_flags(key, klen, hash, flags);
833 Deletes a key/value pair in the hash. The value SV is removed from the
834 hash and returned to the caller. The C<klen> is the length of the key.
842 Perl_hv_delete(pTHX_ HV *hv, const char *key, I32 klen_i32, I32 flags)
853 return hv_delete_common(hv, NULL, key, klen, k_flags, flags, 0);
859 Deletes a key/value pair in the hash. The value SV is removed from the
874 S_hv_delete_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
890 Safefree(key);
891 key = SvPV(keysv, klen);
904 entry = hv_fetch_common(hv, keysv, key, klen,
923 keysv = sv_2mortal(newSVpvn(key,klen));
925 Safefree(key);
927 key = strupr(SvPVX(keysv));
941 const char *keysave = key;
942 key = (char*)bytes_from_utf8((U8*)key, &klen, &is_utf8);
948 if (key != keysave) {
960 PERL_HASH_INTERNAL(hash, key, klen);
962 /* Not enough shared hash key scalars around to make this worthwhile
969 PERL_HASH(hash, key, klen);
984 if (HeKEY(entry) != key && memNE(HeKEY(entry),key,klen)) /* is this it? */
993 Safefree(key);
997 S_hv_notallowed(aTHX_ k_flags, key, klen,
998 "delete readonly key '%"SVf"' from"
1002 Safefree(key);
1013 * a placeholder there. This marks the key as being "approved", so
1014 * we can still access via not-really-existing key without raising
1038 S_hv_notallowed(aTHX_ k_flags, key, klen,
1039 "delete disallowed key '%"SVf"' from"
1044 Safefree(key);
1301 HvSHAREKEYS_on(hv); /* key-sharing on by default */
1342 char *key = HeKEY(oent);
1349 = shared ? share_hek_flags(key, len, hash, flags)
1350 : save_hek_flags(key, len, hash, flags);
1459 "Attempt to delete readonly key '%"SVf"' from a restricted hash",
1490 marked as readonly and the key is subsequently deleted, the key is not actually
1493 but will still allow the hash to have a value reaasigned to the key at some
1703 SV *key = sv_newmortal();
1705 sv_setsv(key, HeSVKEY_force(entry));
1706 SvREFCNT_dec(HeSVKEY(entry)); /* get rid of previous key */
1720 magic_nextpack((SV*) hv,mg,key);
1721 if (SvOK(key)) {
1722 /* force key to stay around until next time */
1723 HeSVKEY_set(entry, SvREFCNT_inc(key));
1794 Returns the key from the current position of the hash iterator. See
1815 /* unlike hv_iterval(), this always returns a mortal copy of the key */
1819 Returns the key as an C<SV*> from the current position of the hash
1820 iterator. The return value will always be a mortal copy of the key. Also
1898 Perl_hv_iternextsv(pTHX_ HV *hv, char **key, I32 *retlen)
1903 *key = hv_iterkey(he, retlen);
2049 in a key which only had chars 0-255, but was utf8 encoded. */