File: sv_streq.c.inc

package info (click to toggle)
libsyntax-operator-equ-perl 0.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 172 kB
  • sloc: perl: 352; pascal: 34; makefile: 3
file content (31 lines) | stat: -rw-r--r-- 657 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* vi: set ft=c : */

#ifndef sv_streq_flags
#  define sv_streq_flags(lhs, rhs, flags)  S_sv_streq_flags(aTHX_ lhs, rhs, flags)
static bool S_sv_streq_flags(pTHX_ SV *lhs, SV *rhs, U32 flags)
{
  if(flags & SV_GMAGIC) {
    if(lhs)
      SvGETMAGIC(lhs);
    if(rhs)
      SvGETMAGIC(rhs);
  }

  if(!lhs)
    lhs = &PL_sv_undef;
  if(!rhs)
    rhs = &PL_sv_undef;

  if(!(flags & SV_SKIP_OVERLOAD) && (SvAMAGIC(lhs) || SvAMAGIC(rhs))) {
    SV *ret = amagic_call(lhs, rhs, seq_amg, 0);
    if(ret)
      return SvTRUE(ret);
  }

  return sv_eq_flags(lhs, rhs, 0);
}
#endif

#ifndef sv_streq
#  define sv_streq(lhs, rhs)  sv_streq_flags(lhs, rhs, 0)
#endif