3 * Copyright (c) 1991-2000, Larry Wall
5 * You may distribute under the terms of either the GNU General Public
6 * License or the Artistic License, as specified in the README file.
11 * "'So that was the job I felt I had to do when I started,' thought Sam."
15 #define PERL_IN_DOOP_C
18 #if !defined(NSIG) || defined(M_UNIX) || defined(M_XENIX)
23 S_do_trans_CC_simple(pTHX_ SV *sv)
33 tbl = (short*)cPVOP->op_pv;
35 Perl_croak(aTHX_ "panic: do_trans");
37 s = (U8*)SvPV(sv, len);
41 if ((ch = tbl[*s]) >= 0) {
53 S_do_trans_CC_count(pTHX_ SV *sv)
62 tbl = (short*)cPVOP->op_pv;
64 Perl_croak(aTHX_ "panic: do_trans");
66 s = (U8*)SvPV(sv, len);
79 S_do_trans_CC_complex(pTHX_ SV *sv)
90 tbl = (short*)cPVOP->op_pv;
92 Perl_croak(aTHX_ "panic: do_trans");
94 s = (U8*)SvPV(sv, len);
98 if (PL_op->op_private & OPpTRANS_SQUASH) {
102 if ((ch = tbl[*s]) >= 0) {
105 if (p == d - 1 && *p == *d)
110 else if (ch == -1) /* -1 is unmapped character */
111 *d++ = *s; /* -2 is delete character */
117 if ((ch = tbl[*s]) >= 0) {
122 else if (ch == -1) /* -1 is unmapped character */
123 *d++ = *s; /* -2 is delete character */
127 matches += send - d; /* account for disappeared chars */
129 SvCUR_set(sv, d - (U8*)SvPVX(sv));
136 S_do_trans_UU_simple(pTHX_ SV *sv)
145 SV* rv = (SV*)cSVOP->op_sv;
146 HV* hv = (HV*)SvRV(rv);
147 SV** svp = hv_fetch(hv, "NONE", 4, FALSE);
148 UV none = svp ? SvUV(*svp) : 0x7fffffff;
153 s = (U8*)SvPV(sv, len);
156 svp = hv_fetch(hv, "FINAL", 5, FALSE);
162 if ((uv = swash_fetch(rv, s)) < none) {
165 d = uv_to_utf8(d, uv);
167 else if (uv == none) {
169 for (i = UTF8SKIP(s); i; i--)
172 else if (uv == extra) {
175 d = uv_to_utf8(d, final);
181 SvCUR_set(sv, d - (U8*)SvPVX(sv));
188 S_do_trans_UU_count(pTHX_ SV *sv)
196 SV* rv = (SV*)cSVOP->op_sv;
197 HV* hv = (HV*)SvRV(rv);
198 SV** svp = hv_fetch(hv, "NONE", 4, FALSE);
199 UV none = svp ? SvUV(*svp) : 0x7fffffff;
202 s = (U8*)SvPV(sv, len);
206 if ((uv = swash_fetch(rv, s)) < none)
215 S_do_trans_UC_simple(pTHX_ SV *sv)
224 SV* rv = (SV*)cSVOP->op_sv;
225 HV* hv = (HV*)SvRV(rv);
226 SV** svp = hv_fetch(hv, "NONE", 4, FALSE);
227 UV none = svp ? SvUV(*svp) : 0x7fffffff;
232 s = (U8*)SvPV(sv, len);
235 svp = hv_fetch(hv, "FINAL", 5, FALSE);
241 if ((uv = swash_fetch(rv, s)) < none) {
246 else if (uv == none) {
248 uv = utf8_to_uv(s, &ulen);
252 else if (uv == extra) {
261 SvCUR_set(sv, d - (U8*)SvPVX(sv));
268 S_do_trans_CU_simple(pTHX_ SV *sv)
278 SV* rv = (SV*)cSVOP->op_sv;
279 HV* hv = (HV*)SvRV(rv);
280 SV** svp = hv_fetch(hv, "NONE", 4, FALSE);
281 UV none = svp ? SvUV(*svp) : 0x7fffffff;
285 U8 tmpbuf[UTF8_MAXLEN];
288 s = (U8*)SvPV(sv, len);
291 svp = hv_fetch(hv, "BITS", 4, FALSE);
293 bits = (I32)SvIV(*svp);
295 svp = hv_fetch(hv, "FINAL", 5, FALSE);
299 Newz(801, d, len * (bits >> 3) + 1, U8);
307 tmpbuf[0] = (( uv >> 6) | 0xc0);
308 tmpbuf[1] = (( uv & 0x3f) | 0x80);
311 if ((uv = swash_fetch(rv, tmpbuf)) < none) {
313 d = uv_to_utf8(d, uv);
316 d = uv_to_utf8(d, s[-1]);
317 else if (uv == extra) {
319 d = uv_to_utf8(d, final);
323 sv_usepvn_mg(sv, (char*)dst, d - dst);
328 /* utf-8 to latin-1 */
331 S_do_trans_UC_trivial(pTHX_ SV *sv)
339 s = (U8*)SvPV(sv, len);
348 UV uv = utf8_to_uv(s, &ulen);
354 SvCUR_set(sv, d - (U8*)SvPVX(sv));
360 /* latin-1 to utf-8 */
363 S_do_trans_CU_trivial(pTHX_ SV *sv)
373 s = (U8*)SvPV(sv, len);
376 Newz(801, d, len * 2 + 1, U8);
386 *d++ = (( uv >> 6) | 0xc0);
387 *d++ = (( uv & 0x3f) | 0x80);
391 sv_usepvn_mg(sv, (char*)dst, d - dst);
397 S_do_trans_UU_complex(pTHX_ SV *sv)
404 I32 squash = PL_op->op_private & OPpTRANS_SQUASH;
405 I32 from_utf = PL_op->op_private & OPpTRANS_FROM_UTF;
406 I32 to_utf = PL_op->op_private & OPpTRANS_TO_UTF;
407 I32 del = PL_op->op_private & OPpTRANS_DELETE;
408 SV* rv = (SV*)cSVOP->op_sv;
409 HV* hv = (HV*)SvRV(rv);
410 SV** svp = hv_fetch(hv, "NONE", 4, FALSE);
411 UV none = svp ? SvUV(*svp) : 0x7fffffff;
418 s = (U8*)SvPV(sv, len);
421 svp = hv_fetch(hv, "FINAL", 5, FALSE);
425 if (PL_op->op_private & OPpTRANS_GROWS) {
428 svp = hv_fetch(hv, "BITS", 4, FALSE);
430 bits = (I32)SvIV(*svp);
432 Newz(801, d, len * (bits >> 3) + 1, U8);
444 uv = swash_fetch(rv, s);
452 tmpbuf[0] = (( uv >> 6) | 0xc0);
453 tmpbuf[1] = (( uv & 0x3f) | 0x80);
455 uv = swash_fetch(rv, tmpbuf);
460 if (uv >= 0x80 && to_utf)
461 d = uv_to_utf8(d, uv);
470 else if (uv == none) { /* "none" is unmapped character */
476 for (i = UTF8SKIP(s); i; --i)
481 *d++ = (U8)utf8_to_uv(s, &ulen);
485 else { /* must be to_utf only */
486 d = uv_to_utf8(d, s[-1]);
491 else if (uv == extra && !del) {
494 if (final >= 0x80 && to_utf)
495 d = uv_to_utf8(d, final);
504 matches++; /* "none+1" is delete character */
512 uv = swash_fetch(rv, s);
520 tmpbuf[0] = (( uv >> 6) | 0xc0);
521 tmpbuf[1] = (( uv & 0x3f) | 0x80);
523 uv = swash_fetch(rv, tmpbuf);
527 if (uv >= 0x80 && to_utf)
528 d = uv_to_utf8(d, uv);
535 else if (uv == none) { /* "none" is unmapped character */
541 for (i = UTF8SKIP(s); i; --i)
546 *d++ = (U8)utf8_to_uv(s, &ulen);
550 else { /* must be to_utf only */
551 d = uv_to_utf8(d, s[-1]);
555 else if (uv == extra && !del) {
557 if (final >= 0x80 && to_utf)
558 d = uv_to_utf8(d, final);
565 matches++; /* "none+1" is delete character */
571 sv_usepvn(sv, (char*)dst, d - dst);
574 SvCUR_set(sv, d - (U8*)SvPVX(sv));
582 Perl_do_trans(pTHX_ SV *sv)
587 if (SvREADONLY(sv) && !(PL_op->op_private & OPpTRANS_IDENTICAL))
588 Perl_croak(aTHX_ PL_no_modify);
594 (void)SvPV_force(sv, len);
595 (void)SvPOK_only(sv);
597 DEBUG_t( Perl_deb(aTHX_ "2.TBL\n"));
599 switch (PL_op->op_private & 63) {
601 return do_trans_CC_simple(sv);
603 case OPpTRANS_FROM_UTF:
604 return do_trans_UC_simple(sv);
606 case OPpTRANS_TO_UTF:
607 return do_trans_CU_simple(sv);
609 case OPpTRANS_FROM_UTF|OPpTRANS_TO_UTF:
610 return do_trans_UU_simple(sv);
612 case OPpTRANS_IDENTICAL:
613 return do_trans_CC_count(sv);
615 case OPpTRANS_FROM_UTF|OPpTRANS_IDENTICAL:
616 return do_trans_UC_trivial(sv);
618 case OPpTRANS_TO_UTF|OPpTRANS_IDENTICAL:
619 return do_trans_CU_trivial(sv);
621 case OPpTRANS_FROM_UTF|OPpTRANS_TO_UTF|OPpTRANS_IDENTICAL:
622 return do_trans_UU_count(sv);
625 if (PL_op->op_private & (OPpTRANS_FROM_UTF|OPpTRANS_TO_UTF))
626 return do_trans_UU_complex(sv); /* could be UC or CU too */
628 return do_trans_CC_complex(sv);
633 Perl_do_join(pTHX_ register SV *sv, SV *del, register SV **mark, register SV **sp)
636 register I32 items = sp - mark;
639 register char *delim = SvPV(del, delimlen);
643 len = (items > 0 ? (delimlen * (items - 1) ) : 0);
644 (void)SvUPGRADE(sv, SVt_PV);
645 if (SvLEN(sv) < len + items) { /* current length is way too short */
646 while (items-- > 0) {
647 if (*mark && !SvGMAGICAL(*mark) && SvOK(*mark)) {
653 SvGROW(sv, len + 1); /* so try to pre-extend */
664 s = SvPV(*mark, tmplen);
665 sv_setpvn(sv, s, tmplen);
675 for (; items > 0; items--,mark++) {
676 sv_catpvn(sv,delim,len);
681 for (; items > 0; items--,mark++)
688 Perl_do_sprintf(pTHX_ SV *sv, I32 len, SV **sarg)
691 char *pat = SvPV(*sarg, patlen);
692 bool do_taint = FALSE;
694 sv_vsetpvfn(sv, pat, patlen, Null(va_list*), sarg + 1, len - 1, &do_taint);
701 Perl_do_vecget(pTHX_ SV *sv, I32 offset, I32 size)
704 unsigned char *s = (unsigned char *) SvPV(sv, srclen);
709 if (size < 1 || (size & (size-1))) /* size < 1 or not a power of two */
710 Perl_croak(aTHX_ "Illegal number of bits in vec");
711 offset *= size; /* turn into bit offset */
712 len = (offset + size + 7) / 8; /* required number of bytes */
717 offset >>= 3; /* turn into byte offset */
719 if (offset >= srclen)
722 retnum = (UV) s[offset] << 8;
724 else if (size == 32) {
725 if (offset >= srclen)
727 else if (offset + 1 >= srclen)
729 ((UV) s[offset ] << 24);
730 else if (offset + 2 >= srclen)
732 ((UV) s[offset ] << 24) +
733 ((UV) s[offset + 1] << 16);
736 ((UV) s[offset ] << 24) +
737 ((UV) s[offset + 1] << 16) +
738 ( s[offset + 2] << 8);
741 else if (size == 64) {
743 if (ckWARN(WARN_PORTABLE))
744 Perl_warner(aTHX_ WARN_PORTABLE,
745 "Bit vector size > 32 non-portable");
746 if (offset >= srclen)
748 else if (offset + 1 >= srclen)
750 (UV) s[offset ] << 56;
751 else if (offset + 2 >= srclen)
753 ((UV) s[offset ] << 56) +
754 ((UV) s[offset + 1] << 48);
755 else if (offset + 3 >= srclen)
757 ((UV) s[offset ] << 56) +
758 ((UV) s[offset + 1] << 48) +
759 ((UV) s[offset + 2] << 40);
760 else if (offset + 4 >= srclen)
762 ((UV) s[offset ] << 56) +
763 ((UV) s[offset + 1] << 48) +
764 ((UV) s[offset + 2] << 40) +
765 ((UV) s[offset + 3] << 32);
766 else if (offset + 5 >= srclen)
768 ((UV) s[offset ] << 56) +
769 ((UV) s[offset + 1] << 48) +
770 ((UV) s[offset + 2] << 40) +
771 ((UV) s[offset + 3] << 32) +
772 ( s[offset + 4] << 24);
773 else if (offset + 6 >= srclen)
775 ((UV) s[offset ] << 56) +
776 ((UV) s[offset + 1] << 48) +
777 ((UV) s[offset + 2] << 40) +
778 ((UV) s[offset + 3] << 32) +
779 ((UV) s[offset + 4] << 24) +
780 ((UV) s[offset + 5] << 16);
783 ((UV) s[offset ] << 56) +
784 ((UV) s[offset + 1] << 48) +
785 ((UV) s[offset + 2] << 40) +
786 ((UV) s[offset + 3] << 32) +
787 ((UV) s[offset + 4] << 24) +
788 ((UV) s[offset + 5] << 16) +
789 ( s[offset + 6] << 8);
795 retnum = (s[offset >> 3] >> (offset & 7)) & ((1 << size) - 1);
797 offset >>= 3; /* turn into byte offset */
802 ((UV) s[offset] << 8) +
806 ((UV) s[offset ] << 24) +
807 ((UV) s[offset + 1] << 16) +
808 ( s[offset + 2] << 8) +
811 else if (size == 64) {
813 if (ckWARN(WARN_PORTABLE))
814 Perl_warner(aTHX_ WARN_PORTABLE,
815 "Bit vector size > 32 non-portable");
817 ((UV) s[offset ] << 56) +
818 ((UV) s[offset + 1] << 48) +
819 ((UV) s[offset + 2] << 40) +
820 ((UV) s[offset + 3] << 32) +
821 ((UV) s[offset + 4] << 24) +
822 ((UV) s[offset + 5] << 16) +
823 ( s[offset + 6] << 8) +
833 Perl_do_vecset(pTHX_ SV *sv)
835 SV *targ = LvTARG(sv);
838 register unsigned char *s;
846 s = (unsigned char*)SvPV_force(targ, targlen);
848 offset = LvTARGOFF(sv);
849 size = LvTARGLEN(sv);
850 if (size < 1 || (size & (size-1))) /* size < 1 or not a power of two */
851 Perl_croak(aTHX_ "Illegal number of bits in vec");
853 offset *= size; /* turn into bit offset */
854 len = (offset + size + 7) / 8; /* required number of bytes */
856 s = (unsigned char*)SvGROW(targ, len + 1);
857 (void)memzero(s + targlen, len - targlen + 1);
858 SvCUR_set(targ, len);
862 mask = (1 << size) - 1;
865 offset >>= 3; /* turn into byte offset */
866 s[offset] &= ~(mask << size);
867 s[offset] |= lval << size;
870 offset >>= 3; /* turn into byte offset */
872 s[offset ] = lval & 0xff;
873 else if (size == 16) {
874 s[offset ] = (lval >> 8) & 0xff;
875 s[offset+1] = lval & 0xff;
877 else if (size == 32) {
878 s[offset ] = (lval >> 24) & 0xff;
879 s[offset+1] = (lval >> 16) & 0xff;
880 s[offset+2] = (lval >> 8) & 0xff;
881 s[offset+3] = lval & 0xff;
884 else if (size == 64) {
886 if (ckWARN(WARN_PORTABLE))
887 Perl_warner(aTHX_ WARN_PORTABLE,
888 "Bit vector size > 32 non-portable");
889 s[offset ] = (lval >> 56) & 0xff;
890 s[offset+1] = (lval >> 48) & 0xff;
891 s[offset+2] = (lval >> 40) & 0xff;
892 s[offset+3] = (lval >> 32) & 0xff;
893 s[offset+4] = (lval >> 24) & 0xff;
894 s[offset+5] = (lval >> 16) & 0xff;
895 s[offset+6] = (lval >> 8) & 0xff;
896 s[offset+7] = lval & 0xff;
904 Perl_do_chop(pTHX_ register SV *astr, register SV *sv)
910 if (SvTYPE(sv) == SVt_PVAV) {
915 for (i = 0; i <= max; i++) {
916 sv = (SV*)av_fetch(av, i, FALSE);
917 if (sv && ((sv = *(SV**)sv), sv != &PL_sv_undef))
922 else if (SvTYPE(sv) == SVt_PVHV) {
925 (void)hv_iterinit(hv);
927 while (entry = hv_iternext(hv))
928 do_chop(astr,hv_iterval(hv,entry));
931 else if (SvREADONLY(sv))
932 Perl_croak(aTHX_ PL_no_modify);
934 if (len && !SvPOK(sv))
935 s = SvPV_force(sv, len);
938 char *send = s + len;
941 while ((*s & 0xc0) == 0x80)
943 if (UTF8SKIP(s) != send - s && ckWARN_d(WARN_UTF8))
944 Perl_warner(aTHX_ WARN_UTF8, "Malformed UTF-8 character");
945 sv_setpvn(astr, s, send - s);
947 SvCUR_set(sv, s - start);
952 sv_setpvn(astr, "", 0);
956 sv_setpvn(astr, s, 1);
963 sv_setpvn(astr, "", 0);
968 Perl_do_chomp(pTHX_ register SV *sv)
980 if (SvTYPE(sv) == SVt_PVAV) {
985 for (i = 0; i <= max; i++) {
986 sv = (SV*)av_fetch(av, i, FALSE);
987 if (sv && ((sv = *(SV**)sv), sv != &PL_sv_undef))
988 count += do_chomp(sv);
992 else if (SvTYPE(sv) == SVt_PVHV) {
995 (void)hv_iterinit(hv);
997 while (entry = hv_iternext(hv))
998 count += do_chomp(hv_iterval(hv,entry));
1001 else if (SvREADONLY(sv))
1002 Perl_croak(aTHX_ PL_no_modify);
1004 if (len && !SvPOKp(sv))
1005 s = SvPV_force(sv, len);
1008 if (RsPARA(PL_rs)) {
1012 while (len && s[-1] == '\n') {
1020 char *rsptr = SvPV(PL_rs, rslen);
1027 if (len < rslen - 1)
1031 if (memNE(s, rsptr, rslen))
1046 Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right)
1048 dTHR; /* just for taint */
1063 bool left_utf = DO_UTF8(left);
1064 bool right_utf = DO_UTF8(right);
1066 if (left_utf && !right_utf)
1067 sv_utf8_upgrade(right);
1068 if (!left_utf && right_utf)
1069 sv_utf8_upgrade(left);
1071 if (sv != left || (optype != OP_BIT_AND && !SvOK(sv) && !SvGMAGICAL(sv)))
1072 sv_setpvn(sv, "", 0); /* avoid undef warning on |= and ^= */
1073 lsave = lc = SvPV(left, leftlen);
1074 rsave = rc = SvPV(right, rightlen);
1075 len = leftlen < rightlen ? leftlen : rightlen;
1077 if (SvOK(sv) || SvTYPE(sv) > SVt_PVMG) {
1079 dc = SvPV_force(sv, n_a);
1080 if (SvCUR(sv) < len) {
1081 dc = SvGROW(sv, len + 1);
1082 (void)memzero(dc + SvCUR(sv), len - SvCUR(sv) + 1);
1086 I32 needlen = ((optype == OP_BIT_AND)
1087 ? len : (leftlen > rightlen ? leftlen : rightlen));
1088 Newz(801, dc, needlen + 1, char);
1089 (void)sv_usepvn(sv, dc, needlen);
1090 dc = SvPVX(sv); /* sv_usepvn() calls Renew() */
1093 (void)SvPOK_only(sv);
1094 if (left_utf || right_utf) {
1096 STRLEN lulen = leftlen;
1097 STRLEN rulen = rightlen;
1103 while (lulen && rulen) {
1104 luc = utf8_to_uv((U8*)lc, &ulen);
1107 ruc = utf8_to_uv((U8*)rc, &ulen);
1111 dc = (char*)uv_to_utf8((U8*)dc, duc);
1113 dulen = dc - SvPVX(sv);
1114 SvCUR_set(sv, dulen);
1117 while (lulen && rulen) {
1118 luc = utf8_to_uv((U8*)lc, &ulen);
1121 ruc = utf8_to_uv((U8*)rc, &ulen);
1125 dc = (char*)uv_to_utf8((U8*)dc, duc);
1129 while (lulen && rulen) {
1130 luc = utf8_to_uv((U8*)lc, &ulen);
1133 ruc = utf8_to_uv((U8*)rc, &ulen);
1137 dc = (char*)uv_to_utf8((U8*)dc, duc);
1140 dulen = dc - SvPVX(sv);
1141 SvCUR_set(sv, dulen);
1143 sv_catpvn(sv, rc, rulen);
1145 sv_catpvn(sv, lc, lulen);
1155 if (len >= sizeof(long)*4 &&
1156 !((long)dc % sizeof(long)) &&
1157 !((long)lc % sizeof(long)) &&
1158 !((long)rc % sizeof(long))) /* It's almost always aligned... */
1160 I32 remainder = len % (sizeof(long)*4);
1161 len /= (sizeof(long)*4);
1170 *dl++ = *ll++ & *rl++;
1171 *dl++ = *ll++ & *rl++;
1172 *dl++ = *ll++ & *rl++;
1173 *dl++ = *ll++ & *rl++;
1178 *dl++ = *ll++ ^ *rl++;
1179 *dl++ = *ll++ ^ *rl++;
1180 *dl++ = *ll++ ^ *rl++;
1181 *dl++ = *ll++ ^ *rl++;
1186 *dl++ = *ll++ | *rl++;
1187 *dl++ = *ll++ | *rl++;
1188 *dl++ = *ll++ | *rl++;
1189 *dl++ = *ll++ | *rl++;
1204 *dc++ = *lc++ & *rc++;
1208 *dc++ = *lc++ ^ *rc++;
1212 *dc++ = *lc++ | *rc++;
1216 sv_catpvn(sv, rsave + len, rightlen - len);
1217 else if (leftlen > len)
1218 sv_catpvn(sv, lsave + len, leftlen - len);
1236 I32 gimme = GIMME_V;
1237 I32 dokeys = (PL_op->op_type == OP_KEYS);
1238 I32 dovalues = (PL_op->op_type == OP_VALUES);
1239 I32 realhv = (SvTYPE(hv) == SVt_PVHV);
1241 if (PL_op->op_type == OP_RV2HV || PL_op->op_type == OP_PADHV)
1242 dokeys = dovalues = TRUE;
1245 if (PL_op->op_flags & OPf_MOD) { /* lvalue */
1246 dTARGET; /* make sure to clear its target here */
1247 if (SvTYPE(TARG) == SVt_PVLV)
1248 LvTARG(TARG) = Nullsv;
1254 keys = realhv ? hv : avhv_keys((AV*)hv);
1255 (void)hv_iterinit(keys); /* always reset iterator regardless */
1257 if (gimme == G_VOID)
1260 if (gimme == G_SCALAR) {
1264 if (PL_op->op_flags & OPf_MOD) { /* lvalue */
1265 if (SvTYPE(TARG) < SVt_PVLV) {
1266 sv_upgrade(TARG, SVt_PVLV);
1267 sv_magic(TARG, Nullsv, 'k', Nullch, 0);
1270 if (LvTARG(TARG) != (SV*)keys) {
1272 SvREFCNT_dec(LvTARG(TARG));
1273 LvTARG(TARG) = SvREFCNT_inc(keys);
1279 if (! SvTIED_mg((SV*)keys, 'P'))
1284 while (hv_iternext(keys)) i++;
1290 EXTEND(SP, HvKEYS(keys) * (dokeys + dovalues));
1292 PUTBACK; /* hv_iternext and hv_iterval might clobber stack_sp */
1293 while (entry = hv_iternext(keys)) {
1296 XPUSHs(hv_iterkeysv(entry)); /* won't clobber stack_sp */
1300 hv_iterval(hv,entry) : avhv_iterval((AV*)hv,entry);
1301 DEBUG_H(Perl_sv_setpvf(aTHX_ tmpstr, "%lu%%%d=%lu",
1302 (unsigned long)HeHASH(entry),
1304 (unsigned long)(HeHASH(entry) & HvMAX(keys))));