Lines Matching refs:offset
130 const unsigned char *s, size_t nbytes, size_t offset, int mode, int text, in match() argument
164 ms->offset = m->offset; in match()
168 switch (mget(ms, s, m, nbytes, offset, cont_level, mode, text, in match()
244 ms->offset = m->offset; in match()
246 ms->offset += in match()
257 switch (mget(ms, s, m, nbytes, offset, cont_level, mode, in match()
405 t = ms->offset + sizeof(char); in mprint()
427 t = ms->offset + sizeof(short); in mprint()
449 t = ms->offset + sizeof(int32_t); in mprint()
471 t = ms->offset + sizeof(int64_t); in mprint()
481 t = ms->offset + m->vallen; in mprint()
487 t = ms->offset + strlen(str); in mprint()
521 t = ms->offset + sizeof(uint32_t); in mprint()
531 t = ms->offset + sizeof(uint32_t); in mprint()
540 t = ms->offset + sizeof(uint64_t); in mprint()
549 t = ms->offset + sizeof(uint64_t); in mprint()
558 t = ms->offset + sizeof(uint64_t); in mprint()
578 t = ms->offset + sizeof(float); in mprint()
598 t = ms->offset + sizeof(double); in mprint()
617 t = ms->search.offset; in mprint()
619 t = ms->search.offset + ms->search.rm_len; in mprint()
627 t = ms->search.offset; in mprint()
629 t = ms->search.offset + m->vallen; in mprint()
636 t = ms->offset; in mprint()
642 t = ms->offset; in mprint()
657 return CAST(int32_t, (ms->offset + sizeof(char))); in moffset()
662 return CAST(int32_t, (ms->offset + sizeof(short))); in moffset()
668 return CAST(int32_t, (ms->offset + sizeof(int32_t))); in moffset()
673 return CAST(int32_t, (ms->offset + sizeof(int64_t))); in moffset()
680 return ms->offset + m->vallen; in moffset()
687 t = CAST(uint32_t, (ms->offset + strlen(p->s))); in moffset()
697 return CAST(int32_t, (ms->offset + sizeof(uint32_t))); in moffset()
703 return CAST(int32_t, (ms->offset + sizeof(uint32_t))); in moffset()
708 return CAST(int32_t, (ms->offset + sizeof(uint64_t))); in moffset()
713 return CAST(int32_t, (ms->offset + sizeof(uint64_t))); in moffset()
718 return CAST(int32_t, (ms->offset + sizeof(float))); in moffset()
723 return CAST(int32_t, (ms->offset + sizeof(double))); in moffset()
727 return CAST(int32_t, ms->search.offset); in moffset()
729 return CAST(int32_t, (ms->search.offset + in moffset()
734 return CAST(int32_t, ms->search.offset); in moffset()
736 return CAST(int32_t, (ms->search.offset + m->vallen)); in moffset()
741 return ms->offset; in moffset()
1034 mdebug(uint32_t offset, const char *str, size_t len) in mdebug() argument
1036 (void) fprintf(stderr, "mget/%zu @%d: ", len, offset); in mdebug()
1044 const unsigned char *s, uint32_t offset, size_t nbytes, struct magic *m) in mcopy() argument
1053 ms->search.s = RCAST(const char *, s) + offset; in mcopy()
1054 ms->search.s_len = nbytes - offset; in mcopy()
1055 ms->search.offset = offset; in mcopy()
1075 if (offset > bytecnt) { in mcopy()
1076 offset = bytecnt; in mcopy()
1083 buf = RCAST(const char *, s) + offset; in mcopy()
1101 ms->search.offset = offset; in mcopy()
1107 const unsigned char *src = s + offset; in mcopy()
1116 if (offset >= nbytes) in mcopy()
1140 if (offset >= nbytes) { in mcopy()
1144 if (nbytes - offset < sizeof(*p)) in mcopy()
1145 nbytes = nbytes - offset; in mcopy()
1149 (void)memcpy(p, s + offset, nbytes); in mcopy()
1167 uint32_t soffset, offset = ms->offset; in mget() local
1178 if (mcopy(ms, p, m->type, m->flag & INDIR, s, (uint32_t)(offset + o), in mget()
1184 "nbytes=%zu)\n", m->type, m->flag, offset, o, nbytes); in mget()
1185 mdebug(offset, (char *)(void *)p, sizeof(union VALUETYPE)); in mget()
1192 ((const void *)(s + offset + off))); in mget()
1229 if (OFFSET_OOB(nbytes, offset, 1)) in mget()
1234 offset = p->b & off; in mget()
1237 offset = p->b | off; in mget()
1240 offset = p->b ^ off; in mget()
1243 offset = p->b + off; in mget()
1246 offset = p->b - off; in mget()
1249 offset = p->b * off; in mget()
1252 offset = p->b / off; in mget()
1255 offset = p->b % off; in mget()
1259 offset = p->b; in mget()
1261 offset = ~offset; in mget()
1264 if (OFFSET_OOB(nbytes, offset, 2)) in mget()
1269 offset = (short)((p->hs[0]<<8)| in mget()
1274 offset = (short)((p->hs[0]<<8)| in mget()
1279 offset = (short)((p->hs[0]<<8)| in mget()
1284 offset = (short)((p->hs[0]<<8)| in mget()
1289 offset = (short)((p->hs[0]<<8)| in mget()
1294 offset = (short)((p->hs[0]<<8)| in mget()
1299 offset = (short)((p->hs[0]<<8)| in mget()
1304 offset = (short)((p->hs[0]<<8)| in mget()
1310 offset = (short)((p->hs[0]<<8)| in mget()
1313 offset = ~offset; in mget()
1316 if (OFFSET_OOB(nbytes, offset, 2)) in mget()
1321 offset = (short)((p->hs[1]<<8)| in mget()
1326 offset = (short)((p->hs[1]<<8)| in mget()
1331 offset = (short)((p->hs[1]<<8)| in mget()
1336 offset = (short)((p->hs[1]<<8)| in mget()
1341 offset = (short)((p->hs[1]<<8)| in mget()
1346 offset = (short)((p->hs[1]<<8)| in mget()
1351 offset = (short)((p->hs[1]<<8)| in mget()
1356 offset = (short)((p->hs[1]<<8)| in mget()
1362 offset = (short)((p->hs[1]<<8)| in mget()
1365 offset = ~offset; in mget()
1368 if (OFFSET_OOB(nbytes, offset, 2)) in mget()
1373 offset = p->h & off; in mget()
1376 offset = p->h | off; in mget()
1379 offset = p->h ^ off; in mget()
1382 offset = p->h + off; in mget()
1385 offset = p->h - off; in mget()
1388 offset = p->h * off; in mget()
1391 offset = p->h / off; in mget()
1394 offset = p->h % off; in mget()
1399 offset = p->h; in mget()
1401 offset = ~offset; in mget()
1405 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1410 offset = (int32_t)((p->hl[0]<<24)| in mget()
1417 offset = (int32_t)((p->hl[0]<<24)| in mget()
1424 offset = (int32_t)((p->hl[0]<<24)| in mget()
1431 offset = (int32_t)((p->hl[0]<<24)| in mget()
1438 offset = (int32_t)((p->hl[0]<<24)| in mget()
1445 offset = (int32_t)((p->hl[0]<<24)| in mget()
1452 offset = (int32_t)((p->hl[0]<<24)| in mget()
1459 offset = (int32_t)((p->hl[0]<<24)| in mget()
1467 offset = (int32_t)((p->hl[0]<<24)| in mget()
1472 offset = ~offset; in mget()
1476 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1481 offset = (int32_t)((p->hl[3]<<24)| in mget()
1488 offset = (int32_t)((p->hl[3]<<24)| in mget()
1495 offset = (int32_t)((p->hl[3]<<24)| in mget()
1502 offset = (int32_t)((p->hl[3]<<24)| in mget()
1509 offset = (int32_t)((p->hl[3]<<24)| in mget()
1516 offset = (int32_t)((p->hl[3]<<24)| in mget()
1523 offset = (int32_t)((p->hl[3]<<24)| in mget()
1530 offset = (int32_t)((p->hl[3]<<24)| in mget()
1538 offset = (int32_t)((p->hl[3]<<24)| in mget()
1543 offset = ~offset; in mget()
1546 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1551 offset = (int32_t)((p->hl[1]<<24)| in mget()
1558 offset = (int32_t)((p->hl[1]<<24)| in mget()
1565 offset = (int32_t)((p->hl[1]<<24)| in mget()
1572 offset = (int32_t)((p->hl[1]<<24)| in mget()
1579 offset = (int32_t)((p->hl[1]<<24)| in mget()
1586 offset = (int32_t)((p->hl[1]<<24)| in mget()
1593 offset = (int32_t)((p->hl[1]<<24)| in mget()
1600 offset = (int32_t)((p->hl[1]<<24)| in mget()
1608 offset = (int32_t)((p->hl[1]<<24)| in mget()
1613 offset = ~offset; in mget()
1616 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1621 offset = p->l & off; in mget()
1624 offset = p->l | off; in mget()
1627 offset = p->l ^ off; in mget()
1630 offset = p->l + off; in mget()
1633 offset = p->l - off; in mget()
1636 offset = p->l * off; in mget()
1639 offset = p->l / off; in mget()
1642 offset = p->l % off; in mget()
1646 offset = p->l; in mget()
1648 offset = ~offset; in mget()
1657 offset = ((((offset >> 0) & 0x7f) << 0) | in mget()
1658 (((offset >> 8) & 0x7f) << 7) | in mget()
1659 (((offset >> 16) & 0x7f) << 14) | in mget()
1660 (((offset >> 24) & 0x7f) << 21)) + 10; in mget()
1667 offset += ms->c.li[cont_level-1].off; in mget()
1668 if (offset == 0) { in mget()
1675 fprintf(stderr, "indirect +offs=%u\n", offset); in mget()
1677 if (mcopy(ms, p, m->type, 0, s, offset, nbytes, m) == -1) in mget()
1679 ms->offset = offset; in mget()
1682 mdebug(offset, (char *)(void *)p, in mget()
1690 if (OFFSET_OOB(nbytes, offset, 1)) in mget()
1697 if (OFFSET_OOB(nbytes, offset, 2)) in mget()
1716 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1723 if (OFFSET_OOB(nbytes, offset, 8)) in mget()
1730 if (OFFSET_OOB(nbytes, offset, m->vallen)) in mget()
1735 if (OFFSET_OOB(nbytes, offset, 0)) in mget()
1740 if (offset == 0) in mget()
1742 if (OFFSET_OOB(nbytes, offset, 0)) in mget()
1745 soffset = ms->offset; in mget()
1747 ms->offset = 0; in mget()
1748 rv = file_softmagic(ms, s + offset, nbytes - offset, in mget()
1751 fprintf(stderr, "indirect @offs=%u[%d]\n", offset, rv); in mget()
1754 ms->offset = soffset; in mget()
1757 file_printf(ms, m->desc, offset) == -1) { in mget()
1776 if (OFFSET_OOB(nbytes, offset, 0)) in mget()
1791 rv = match(ms, ml.magic, ml.nmagic, s, nbytes, offset + o, in mget()
2076 ms->search.offset += idx; in magiccheck()
2134 zval **match, **offset; in magiccheck() local
2140 && zend_hash_index_find(Z_ARRVAL_PP(ppzval), 1, (void **)&offset) == SUCCESS) { in magiccheck()
2141 if (Z_TYPE_PP(match) != IS_STRING || Z_TYPE_PP(offset) != IS_LONG) { in magiccheck()
2144 ms->search.s += (int)Z_LVAL_PP(offset); /* this is where the match starts */ in magiccheck()
2145 ms->search.offset += (size_t)Z_LVAL_PP(offset); /* this is where the match starts as size_t */ in magiccheck()