Lines Matching refs:offset

176     const struct buffer *b, size_t offset, int mode, int text,  in match()  argument
212 if (msetoffset(ms, m, &bb, b, offset, cont_level) == -1) in match()
217 switch (mget(ms, m, b, bb.fbuf, bb.flen, offset, cont_level, in match()
296 if (msetoffset(ms, m, &bb, b, offset, cont_level) == -1) in match()
299 ms->offset += in match()
310 switch (mget(ms, m, b, bb.fbuf, bb.flen, offset, in match()
536 t = ms->offset + sizeof(char); in mprint()
558 t = ms->offset + sizeof(short); in mprint()
579 t = ms->offset + sizeof(int32_t); in mprint()
601 t = ms->offset + sizeof(int64_t); in mprint()
613 t = ms->offset + m->vallen; in mprint()
619 t = ms->offset + strlen(str); in mprint()
653 t = ms->offset + sizeof(uint32_t); in mprint()
663 t = ms->offset + sizeof(uint32_t); in mprint()
672 t = ms->offset + sizeof(uint64_t); in mprint()
681 t = ms->offset + sizeof(uint64_t); in mprint()
690 t = ms->offset + sizeof(uint64_t); in mprint()
710 t = ms->offset + sizeof(float); in mprint()
730 t = ms->offset + sizeof(double); in mprint()
747 t = ms->search.offset; in mprint()
749 t = ms->search.offset + ms->search.rm_len; in mprint()
757 t = ms->offset; in mprint()
763 t = ms->offset; in mprint()
769 t = ms->offset; in mprint()
787 o = CAST(int32_t, (ms->offset + sizeof(char))); in moffset()
793 o = CAST(int32_t, (ms->offset + sizeof(short))); in moffset()
800 o = CAST(int32_t, (ms->offset + sizeof(int32_t))); in moffset()
806 o = CAST(int32_t, (ms->offset + sizeof(int64_t))); in moffset()
814 o = ms->offset + m->vallen; in moffset()
820 o = CAST(uint32_t, (ms->offset + strlen(p->s))); in moffset()
830 o = CAST(int32_t, (ms->offset + sizeof(uint32_t))); in moffset()
837 o = CAST(int32_t, (ms->offset + sizeof(uint32_t))); in moffset()
843 o = CAST(int32_t, (ms->offset + sizeof(uint64_t))); in moffset()
849 o = CAST(int32_t, (ms->offset + sizeof(uint64_t))); in moffset()
855 o = CAST(int32_t, (ms->offset + sizeof(float))); in moffset()
861 o = CAST(int32_t, (ms->offset + sizeof(double))); in moffset()
866 o = CAST(int32_t, ms->search.offset); in moffset()
869 (ms->search.offset + ms->search.rm_len)); in moffset()
874 o = CAST(int32_t, ms->search.offset); in moffset()
876 o = CAST(int32_t, (ms->search.offset + m->vallen)); in moffset()
882 o = ms->offset; in moffset()
1228 mdebug(uint32_t offset, const char *str, size_t len) in mdebug() argument
1230 (void) fprintf(stderr, "mget/%" SIZE_T_FORMAT "u @%d: ", len, offset); in mdebug()
1238 const unsigned char *s, uint32_t offset, size_t nbytes, struct magic *m) in mcopy() argument
1248 if (offset > nbytes) in mcopy()
1249 offset = CAST(uint32_t, nbytes); in mcopy()
1250 ms->search.s = RCAST(const char *, s) + offset; in mcopy()
1251 ms->search.s_len = nbytes - offset; in mcopy()
1252 ms->search.offset = offset; in mcopy()
1263 if (s == NULL || nbytes < offset) { in mcopy()
1277 if (bytecnt == 0 || bytecnt > nbytes - offset) in mcopy()
1278 bytecnt = nbytes - offset; in mcopy()
1282 buf = RCAST(const char *, s) + offset; in mcopy()
1283 end = last = RCAST(const char *, s) + bytecnt + offset; in mcopy()
1300 ms->search.offset = offset; in mcopy()
1306 const unsigned char *src = s + offset; in mcopy()
1315 if (offset >= nbytes) in mcopy()
1340 if (offset >= nbytes) { in mcopy()
1344 if (nbytes - offset < sizeof(*p)) in mcopy()
1345 nbytes = nbytes - offset; in mcopy()
1349 (void)memcpy(p, s + offset, nbytes); in mcopy()
1364 intmax_t offset; in do_ops() local
1368 offset = lhs & off; in do_ops()
1371 offset = lhs | off; in do_ops()
1374 offset = lhs ^ off; in do_ops()
1377 offset = lhs + off; in do_ops()
1380 offset = lhs - off; in do_ops()
1383 offset = lhs * off; in do_ops()
1386 offset = lhs / off; in do_ops()
1389 offset = lhs % off; in do_ops()
1393 offset = lhs; in do_ops()
1395 offset = ~offset; in do_ops()
1397 return (uint32_t)offset; in do_ops()
1404 if (m->offset < 0) { in msetoffset()
1410 "level %u", m->offset, cont_level); in msetoffset()
1422 if ((size_t)-m->offset > b->elen) in msetoffset()
1425 ms->eoffset = ms->offset = b->elen + m->offset; in msetoffset()
1431 ms->offset = m->offset; in msetoffset()
1434 ms->offset = ms->eoffset + m->offset; in msetoffset()
1439 bb->fbuf, bb->flen, ms->offset, b->fbuf, b->flen, in msetoffset()
1440 m->offset, cont_level); in msetoffset()
1451 uint32_t offset = ms->offset; in mget() local
1472 if (mcopy(ms, p, m->type, m->flag & INDIR, s, (uint32_t)(offset + o), in mget()
1480 m->type, m->flag, offset, o, nbytes, in mget()
1482 mdebug(offset, (char *)(void *)p, sizeof(union VALUETYPE)); in mget()
1490 ((const void *)(s + offset + off))); in mget()
1491 if (OFFSET_OOB(nbytes, offset + off, sizeof(*q))) in mget()
1526 if (OFFSET_OOB(nbytes, offset, 1)) in mget()
1528 offset = do_ops(m, SEXT(sgn,8,p->b), off); in mget()
1531 if (OFFSET_OOB(nbytes, offset, 2)) in mget()
1533 offset = do_ops(m, SEXT(sgn,16,BE16(p)), off); in mget()
1536 if (OFFSET_OOB(nbytes, offset, 2)) in mget()
1538 offset = do_ops(m, SEXT(sgn,16,LE16(p)), off); in mget()
1541 if (OFFSET_OOB(nbytes, offset, 2)) in mget()
1543 offset = do_ops(m, SEXT(sgn,16,p->h), off); in mget()
1547 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1552 offset = do_ops(m, SEXT(sgn,32,lhs), off); in mget()
1556 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1561 offset = do_ops(m, SEXT(sgn,32,lhs), off); in mget()
1564 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1566 offset = do_ops(m, SEXT(sgn,32,ME32(p)), off); in mget()
1569 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1571 offset = do_ops(m, SEXT(sgn,32,p->l), off); in mget()
1578 offset += ms->c.li[cont_level-1].off; in mget()
1579 if (offset == 0) { in mget()
1586 fprintf(stderr, "indirect +offs=%u\n", offset); in mget()
1588 if (mcopy(ms, p, m->type, 0, s, offset, nbytes, m) == -1) in mget()
1590 ms->offset = offset; in mget()
1593 mdebug(offset, (char *)(void *)p, in mget()
1601 if (OFFSET_OOB(nbytes, offset, 1)) in mget()
1608 if (OFFSET_OOB(nbytes, offset, 2)) in mget()
1627 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1634 if (OFFSET_OOB(nbytes, offset, 8)) in mget()
1641 if (OFFSET_OOB(nbytes, offset, m->vallen)) in mget()
1646 if (nbytes < offset) in mget()
1652 offset += CAST(uint32_t, o); in mget()
1653 if (offset == 0) in mget()
1656 if (nbytes < offset) in mget()
1664 bb.fbuf = s + offset; in mget()
1665 bb.flen = nbytes - offset; in mget()
1670 fprintf(stderr, "indirect @offs=%u[%d]\n", offset, rv); in mget()
1678 file_printf(ms, F(ms, m->desc, "%u"), offset) == -1) { in mget()
1691 if (nbytes < offset) in mget()
1706 rv = match(ms, ml.magic, ml.nmagic, b, offset + o, in mget()
1997 ms->search.offset += idx; in magiccheck()
2051 zval *match, *offset; in magiccheck() local
2053 (offset = zend_hash_index_find(Z_ARRVAL_P(pzval), 1))) { in magiccheck()
2054 if (Z_TYPE_P(match) != IS_STRING && Z_TYPE_P(offset) != IS_LONG) { in magiccheck()
2057 ms->search.s += Z_LVAL_P(offset); /* this is where the match starts */ in magiccheck()
2058 ms->search.offset += Z_LVAL_P(offset); /* this is where the match starts as size_t */ in magiccheck()