Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perlapi: Combine sv_streq, _flags #22335

Merged
merged 1 commit into from
Jun 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions sv.c
Original file line number Diff line number Diff line change
Expand Up @@ -8128,21 +8128,27 @@ Perl_sv_eq_flags(pTHX_ SV *sv1, SV *sv2, const U32 flags)
}

/*
=for apidoc sv_streq_flags
=for apidoc sv_streq
=for apidoc_item sv_streq_flags

Returns a boolean indicating whether the strings in the two SVs are
identical. If the flags argument has the C<SV_GMAGIC> bit set, it handles
get-magic too. Will coerce its args to strings if necessary. Treats
C<NULL> as undef. Correctly handles the UTF8 flag.
These each return a boolean indicating whether the strings in the two SVs are
identical.

C<sv_streq_flags> is the more general form, having a C<flags> argument that
affects its behavior in two ways. It coerces its args to strings if necessary,
treating a C<NULL> argument as C<undef>. It correctly handles the UTF8 flag.

If C<flags> has the C<SV_GMAGIC> bit set, 'get' magic will be handled.

If flags does not have the C<SV_SKIP_OVERLOAD> bit set, an attempt to use
C<eq> overloading will be made. If such overloading does not exist or the
flag is set, then regular string comparison will be used instead.

=for apidoc sv_streq
C<sv_streq> merely calls C<sv_streq_flags> with C<flags> set to just
C<SV_GMAGIC>. This function basically behaves like the Perl code
S<C<$sv1 eq $sv2>>.

A convenient shortcut for calling C<sv_streq_flags> with the C<SV_GMAGIC>
flag. This function basically behaves like the Perl code C<$sv1 eq $sv2>.
=for apidoc Amnh||SV_SKIP_OVERLOAD

=cut
*/
Expand Down
Loading