Lines Matching refs:offset

201     const struct buffer *b, size_t offset, int mode, int text,  in match()  argument
245 if (msetoffset(ms, m, &bb, b, offset, cont_level) == -1) in match()
251 bb.flen, offset, cont_level, in match()
337 if (msetoffset(ms, m, &bb, b, offset, cont_level) == -1) in match()
340 ms->offset += in match()
352 bb.fbuf), bb.flen, offset, in match()
583 t = ms->offset + sizeof(char); in mprint()
605 t = ms->offset + sizeof(short); in mprint()
628 t = ms->offset + sizeof(int32_t); in mprint()
650 t = ms->offset + sizeof(int64_t); in mprint()
662 t = ms->offset + m->vallen; in mprint()
668 t = ms->offset + strlen(str); in mprint()
703 t = ms->offset + sizeof(uint32_t); in mprint()
713 t = ms->offset + sizeof(uint32_t); in mprint()
722 t = ms->offset + sizeof(uint64_t); in mprint()
731 t = ms->offset + sizeof(uint64_t); in mprint()
740 t = ms->offset + sizeof(uint64_t); in mprint()
760 t = ms->offset + sizeof(float); in mprint()
780 t = ms->offset + sizeof(double); in mprint()
798 t = ms->search.offset; in mprint()
800 t = ms->search.offset + ms->search.rm_len; in mprint()
808 t = ms->offset; in mprint()
814 t = ms->offset; in mprint()
821 t = ms->offset; in mprint()
839 o = CAST(int32_t, (ms->offset + sizeof(char))); in moffset()
845 o = CAST(int32_t, (ms->offset + sizeof(short))); in moffset()
852 o = CAST(int32_t, (ms->offset + sizeof(int32_t))); in moffset()
858 o = CAST(int32_t, (ms->offset + sizeof(int64_t))); in moffset()
866 o = ms->offset + m->vallen; in moffset()
872 o = CAST(uint32_t, (ms->offset + strlen(p->s))); in moffset()
883 o = CAST(int32_t, (ms->offset + sizeof(uint32_t))); in moffset()
890 o = CAST(int32_t, (ms->offset + sizeof(uint32_t))); in moffset()
896 o = CAST(int32_t, (ms->offset + sizeof(uint64_t))); in moffset()
902 o = CAST(int32_t, (ms->offset + sizeof(uint64_t))); in moffset()
908 o = CAST(int32_t, (ms->offset + sizeof(float))); in moffset()
914 o = CAST(int32_t, (ms->offset + sizeof(double))); in moffset()
919 o = CAST(int32_t, ms->search.offset); in moffset()
922 (ms->search.offset + ms->search.rm_len)); in moffset()
927 o = CAST(int32_t, ms->search.offset); in moffset()
929 o = CAST(int32_t, (ms->search.offset + m->vallen)); in moffset()
935 o = ms->offset; in moffset()
1281 mdebug(uint32_t offset, const char *str, size_t len) in mdebug() argument
1283 (void) fprintf(stderr, "mget/%" SIZE_T_FORMAT "u @%d: ", len, offset); in mdebug()
1291 const unsigned char *s, uint32_t offset, size_t nbytes, struct magic *m) in mcopy() argument
1301 if (offset > nbytes) in mcopy()
1302 offset = CAST(uint32_t, nbytes); in mcopy()
1303 ms->search.s = RCAST(const char *, s) + offset; in mcopy()
1304 ms->search.s_len = nbytes - offset; in mcopy()
1305 ms->search.offset = offset; in mcopy()
1316 if (s == NULL || nbytes < offset) { in mcopy()
1330 if (bytecnt == 0 || bytecnt > nbytes - offset) in mcopy()
1331 bytecnt = nbytes - offset; in mcopy()
1335 buf = RCAST(const char *, s) + offset; in mcopy()
1336 end = last = RCAST(const char *, s) + bytecnt + offset; in mcopy()
1355 ms->search.offset = offset; in mcopy()
1361 const unsigned char *src = s + offset; in mcopy()
1370 if (offset >= nbytes) in mcopy()
1395 if (offset >= nbytes) { in mcopy()
1399 if (nbytes - offset < sizeof(*p)) in mcopy()
1400 nbytes = nbytes - offset; in mcopy()
1404 (void)memcpy(p, s + offset, nbytes); in mcopy()
1419 intmax_t offset; in do_ops() local
1423 offset = lhs & off; in do_ops()
1426 offset = lhs | off; in do_ops()
1429 offset = lhs ^ off; in do_ops()
1432 offset = lhs + off; in do_ops()
1435 offset = lhs - off; in do_ops()
1438 offset = lhs * off; in do_ops()
1441 offset = lhs / off; in do_ops()
1444 offset = lhs % off; in do_ops()
1448 offset = lhs; in do_ops()
1450 offset = ~offset; in do_ops()
1452 return CAST(uint32_t, offset); in do_ops()
1459 if (m->offset < 0) { in msetoffset()
1465 "level %u", m->offset, cont_level); in msetoffset()
1477 if (CAST(size_t, -m->offset) > b->elen) in msetoffset()
1480 ms->eoffset = ms->offset = CAST(int32_t, b->elen + m->offset); in msetoffset()
1486 ms->offset = m->offset; in msetoffset()
1489 ms->offset = ms->eoffset + m->offset; in msetoffset()
1495 bb->fbuf, bb->flen, ms->offset, b->fbuf, b->flen, in msetoffset()
1496 m->offset, cont_level); in msetoffset()
1508 uint32_t offset = ms->offset; in mget() local
1532 CAST(uint32_t, offset + o), CAST(uint32_t, nbytes), m) == -1) in mget()
1539 m->type, m->flag, offset, o, nbytes, in mget()
1541 mdebug(offset, RCAST(char *, RCAST(void *, p)), in mget()
1550 RCAST(const void *, s + offset + off)); in mget()
1553 if (OFFSET_OOB(nbytes, offset + off, 1)) in mget()
1558 if (OFFSET_OOB(nbytes, offset + off, 2)) in mget()
1563 if (OFFSET_OOB(nbytes, offset + off, 2)) in mget()
1568 if (OFFSET_OOB(nbytes, offset + off, 2)) in mget()
1573 if (OFFSET_OOB(nbytes, offset + off, 4)) in mget()
1579 if (OFFSET_OOB(nbytes, offset + off, 4)) in mget()
1585 if (OFFSET_OOB(nbytes, offset + off, 4)) in mget()
1590 if (OFFSET_OOB(nbytes, offset + off, 4)) in mget()
1595 if (OFFSET_OOB(nbytes, offset + off, 8)) in mget()
1600 if (OFFSET_OOB(nbytes, offset + off, 8)) in mget()
1612 if (OFFSET_OOB(nbytes, offset, 1)) in mget()
1614 offset = do_ops(m, SEXT(sgn,8,p->b), off); in mget()
1617 if (OFFSET_OOB(nbytes, offset, 2)) in mget()
1619 offset = do_ops(m, SEXT(sgn,16,BE16(p)), off); in mget()
1622 if (OFFSET_OOB(nbytes, offset, 2)) in mget()
1624 offset = do_ops(m, SEXT(sgn,16,LE16(p)), off); in mget()
1627 if (OFFSET_OOB(nbytes, offset, 2)) in mget()
1629 offset = do_ops(m, SEXT(sgn,16,p->h), off); in mget()
1633 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1638 offset = do_ops(m, SEXT(sgn,32,lhs), off); in mget()
1642 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1647 offset = do_ops(m, SEXT(sgn,32,lhs), off); in mget()
1650 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1652 offset = do_ops(m, SEXT(sgn,32,ME32(p)), off); in mget()
1655 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1657 offset = do_ops(m, SEXT(sgn,32,p->l), off); in mget()
1660 if (OFFSET_OOB(nbytes, offset, 8)) in mget()
1662 offset = do_ops(m, SEXT(sgn,64,LE64(p)), off); in mget()
1665 if (OFFSET_OOB(nbytes, offset, 8)) in mget()
1667 offset = do_ops(m, SEXT(sgn,64,BE64(p)), off); in mget()
1674 offset += ms->c.li[cont_level-1].off; in mget()
1675 if (offset == 0) { in mget()
1682 fprintf(stderr, "indirect +offs=%u\n", offset); in mget()
1684 if (mcopy(ms, p, m->type, 0, s, offset, nbytes, m) == -1) in mget()
1686 ms->offset = offset; in mget()
1689 mdebug(offset, RCAST(char *, RCAST(void *, p)), in mget()
1697 if (OFFSET_OOB(nbytes, offset, 1)) in mget()
1704 if (OFFSET_OOB(nbytes, offset, 2)) in mget()
1723 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1730 if (OFFSET_OOB(nbytes, offset, 8)) in mget()
1737 if (OFFSET_OOB(nbytes, offset, m->vallen)) in mget()
1742 if (nbytes < offset) in mget()
1748 offset += CAST(uint32_t, o); in mget()
1749 if (offset == 0) in mget()
1752 if (nbytes < offset) in mget()
1760 bb.fbuf = s + offset; in mget()
1761 bb.flen = nbytes - offset; in mget()
1766 fprintf(stderr, "indirect @offs=%u[%d]\n", offset, rv); in mget()
1774 file_printf(ms, F(ms, m->desc, "%u"), offset) == -1) { in mget()
1787 if (nbytes < offset) in mget()
1802 rv = match(ms, ml.magic, ml.nmagic, b, offset + o, in mget()
2119 ms->search.offset += idx; in magiccheck()
2132 ms->search.offset += idx; in magiccheck()
2186 zval *match, *offset; in magiccheck() local
2188 (offset = zend_hash_index_find(Z_ARRVAL_P(pzval), 1))) { in magiccheck()
2189 if (Z_TYPE_P(match) != IS_STRING && Z_TYPE_P(offset) != IS_LONG) { in magiccheck()
2192 ms->search.s += Z_LVAL_P(offset); /* this is where the match starts */ in magiccheck()
2193 ms->search.offset += Z_LVAL_P(offset); /* this is where the match starts as size_t */ in magiccheck()