@@ -588,54 +588,46 @@ string/length pair.
588
588
cophh_fetch_sv(CopHINTHASH_get(cop), key, hash, flags)
589
589
590
590
/*
591
- =for apidoc Am|bool|cop_hints_exists_pvn|const COP *cop|const char *keypv|STRLEN keylen|U32 hash|U32 flags
591
+ =for apidoc Am|bool|cop_hints_exists_pvn|const COP *cop|const char *key|STRLEN keylen|U32 hash|U32 flags
592
+ =for apidoc_item|bool|cop_hints_exists_pv |const COP *cop|const char *key |U32 hash|U32 flags
593
+ =for apidoc_item|bool|cop_hints_exists_pvs|const COP *cop| "key" |U32 flags
594
+ =for apidoc_item|bool|cop_hints_exists_sv |const COP *cop| SV *key |U32 hash|U32 flags
592
595
593
- Look up the hint entry in the cop C<cop> with the key specified by
594
- C<keypv> and C<keylen>. If C<flags> has the C<COPHH_KEY_UTF8> bit set,
595
- the key octets are interpreted as UTF-8, otherwise they are interpreted
596
- as Latin-1. C<hash> is a precomputed hash of the key string, or zero if
597
- it has not been precomputed. Returns true if a value exists, and false
598
- otherwise.
599
-
600
- =cut
601
- */
596
+ These look up the hint entry in the cop C<cop> with the key specified by
597
+ C<key> (and C<keylen> in the C<pvn> form), returning true if a value exists,
598
+ and false otherwise.
602
599
603
- #define cop_hints_exists_pvn (cop , keypv , keylen , hash , flags ) \
604
- cophh_exists_pvn(CopHINTHASH_get(cop), keypv, keylen, hash, flags)
600
+ The forms differ in how the key is specified. In all forms, the key is pointed
601
+ to by C<key>.
602
+ In the plain C<pv> form, the key is a C language NUL-terminated string.
603
+ In the C<pvs> form, the key is a C language string literal.
604
+ In the C<pvn> form, an additional parameter, C<keylen>, specifies the length of
605
+ the string, which hence, may contain embedded-NUL characters.
606
+ In the C<sv> form, C<*key> is an SV, and the key is the PV extracted from that.
607
+ using C<L</SvPV_const>>.
605
608
606
- /*
607
- =for apidoc Am|bool|cop_hints_exists_pvs|const COP *cop|"key"|U32 flags
609
+ C<hash> is a precomputed hash of the key string, or zero if it has not been
610
+ precomputed. This parameter is omitted from the C<pvs> form, as it is computed
611
+ automatically at compile time.
608
612
609
- Like L</cop_hints_exists_pvn>, but takes a literal string
610
- instead of a string/length pair, and no precomputed hash.
613
+ The only flag currently used from the C<flags> parameter is C<COPHH_KEY_UTF8>.
614
+ It is illegal to set this in the C<sv> form. In the C<pv*> forms, it specifies
615
+ whether the key octets are interpreted as UTF-8 (if set) or as Latin-1 (if
616
+ cleared). The C<sv> form uses the underlying SV to determine the UTF-8ness of
617
+ the octets.
611
618
612
619
=cut
613
620
*/
614
621
622
+ #define cop_hints_exists_pvn (cop , key , keylen , hash , flags ) \
623
+ cophh_exists_pvn(CopHINTHASH_get(cop), key, keylen, hash, flags)
624
+
615
625
#define cop_hints_exists_pvs (cop , key , flags ) \
616
626
cophh_exists_pvs(CopHINTHASH_get(cop), key, flags)
617
627
618
- /*
619
- =for apidoc Am|bool|cop_hints_exists_pv|const COP *cop|const char *key|U32 hash|U32 flags
620
-
621
- Like L</cop_hints_exists_pvn>, but takes a nul-terminated string instead
622
- of a string/length pair.
623
-
624
- =cut
625
- */
626
-
627
628
#define cop_hints_exists_pv (cop , key , hash , flags ) \
628
629
cophh_exists_pv(CopHINTHASH_get(cop), key, hash, flags)
629
630
630
- /*
631
- =for apidoc Am|bool|cop_hints_exists_sv|const COP *cop|SV *key|U32 hash|U32 flags
632
-
633
- Like L</cop_hints_exists_pvn>, but takes a Perl scalar instead of a
634
- string/length pair.
635
-
636
- =cut
637
- */
638
-
639
631
#define cop_hints_exists_sv (cop , key , hash , flags ) \
640
632
cophh_exists_sv(CopHINTHASH_get(cop), key, hash, flags)
641
633
0 commit comments