Lines Matching refs:offset
152 const unsigned char *s, size_t nbytes, size_t offset, int mode, int text, in match() argument
186 ms->offset = m->offset; in match()
190 switch (mget(ms, s, m, nbytes, offset, cont_level, mode, text, in match()
266 ms->offset = m->offset; in match()
268 ms->offset += in match()
279 switch (mget(ms, s, m, nbytes, offset, cont_level, mode, in match()
430 t = ms->offset + sizeof(char); in mprint()
452 t = ms->offset + sizeof(short); in mprint()
473 t = ms->offset + sizeof(int32_t); in mprint()
495 t = ms->offset + sizeof(int64_t); in mprint()
507 t = ms->offset + m->vallen; in mprint()
513 t = ms->offset + strlen(str); in mprint()
547 t = ms->offset + sizeof(uint32_t); in mprint()
557 t = ms->offset + sizeof(uint32_t); in mprint()
566 t = ms->offset + sizeof(uint64_t); in mprint()
575 t = ms->offset + sizeof(uint64_t); in mprint()
584 t = ms->offset + sizeof(uint64_t); in mprint()
604 t = ms->offset + sizeof(float); in mprint()
624 t = ms->offset + sizeof(double); in mprint()
644 t = ms->search.offset; in mprint()
646 t = ms->search.offset + ms->search.rm_len; in mprint()
654 t = ms->search.offset; in mprint()
656 t = ms->search.offset + m->vallen; in mprint()
663 t = ms->offset; in mprint()
669 t = ms->offset; in mprint()
684 return CAST(int32_t, (ms->offset + sizeof(char))); in moffset()
689 return CAST(int32_t, (ms->offset + sizeof(short))); in moffset()
695 return CAST(int32_t, (ms->offset + sizeof(int32_t))); in moffset()
700 return CAST(int32_t, (ms->offset + sizeof(int64_t))); in moffset()
707 return ms->offset + m->vallen; in moffset()
714 t = CAST(uint32_t, (ms->offset + strlen(p->s))); in moffset()
724 return CAST(int32_t, (ms->offset + sizeof(uint32_t))); in moffset()
730 return CAST(int32_t, (ms->offset + sizeof(uint32_t))); in moffset()
735 return CAST(int32_t, (ms->offset + sizeof(uint64_t))); in moffset()
740 return CAST(int32_t, (ms->offset + sizeof(uint64_t))); in moffset()
745 return CAST(int32_t, (ms->offset + sizeof(float))); in moffset()
750 return CAST(int32_t, (ms->offset + sizeof(double))); in moffset()
754 return CAST(int32_t, ms->search.offset); in moffset()
756 return CAST(int32_t, (ms->search.offset + in moffset()
761 return CAST(int32_t, ms->search.offset); in moffset()
763 return CAST(int32_t, (ms->search.offset + m->vallen)); in moffset()
768 return ms->offset; in moffset()
1062 mdebug(uint32_t offset, const char *str, size_t len) in mdebug() argument
1064 (void) fprintf(stderr, "mget/%" SIZE_T_FORMAT "u @%d: ", len, offset); in mdebug()
1072 const unsigned char *s, uint32_t offset, size_t nbytes, struct magic *m) in mcopy() argument
1081 ms->search.s = RCAST(const char *, s) + offset; in mcopy()
1082 ms->search.s_len = nbytes - offset; in mcopy()
1083 ms->search.offset = offset; in mcopy()
1112 if (offset > bytecnt) { in mcopy()
1113 offset = bytecnt; in mcopy()
1120 buf = RCAST(const char *, s) + offset; in mcopy()
1138 ms->search.offset = offset; in mcopy()
1144 const unsigned char *src = s + offset; in mcopy()
1153 if (offset >= nbytes) in mcopy()
1177 if (offset >= nbytes) { in mcopy()
1181 if (nbytes - offset < sizeof(*p)) in mcopy()
1182 nbytes = nbytes - offset; in mcopy()
1186 (void)memcpy(p, s + offset, nbytes); in mcopy()
1204 uint32_t offset = ms->offset; in mget() local
1224 if (mcopy(ms, p, m->type, m->flag & INDIR, s, (uint32_t)(offset + o), in mget()
1232 m->type, m->flag, offset, o, nbytes, in mget()
1234 mdebug(offset, (char *)(void *)p, sizeof(union VALUETYPE)); in mget()
1241 ((const void *)(s + offset + off))); in mget()
1278 if (OFFSET_OOB(nbytes, offset, 1)) in mget()
1283 offset = p->b & off; in mget()
1286 offset = p->b | off; in mget()
1289 offset = p->b ^ off; in mget()
1292 offset = p->b + off; in mget()
1295 offset = p->b - off; in mget()
1298 offset = p->b * off; in mget()
1301 offset = p->b / off; in mget()
1304 offset = p->b % off; in mget()
1308 offset = p->b; in mget()
1310 offset = ~offset; in mget()
1313 if (OFFSET_OOB(nbytes, offset, 2)) in mget()
1319 offset = lhs & off; in mget()
1322 offset = lhs | off; in mget()
1325 offset = lhs ^ off; in mget()
1328 offset = lhs + off; in mget()
1331 offset = lhs - off; in mget()
1334 offset = lhs * off; in mget()
1337 offset = lhs / off; in mget()
1340 offset = lhs % off; in mget()
1344 offset = lhs; in mget()
1346 offset = ~offset; in mget()
1349 if (OFFSET_OOB(nbytes, offset, 2)) in mget()
1355 offset = lhs & off; in mget()
1358 offset = lhs | off; in mget()
1361 offset = lhs ^ off; in mget()
1364 offset = lhs + off; in mget()
1367 offset = lhs - off; in mget()
1370 offset = lhs * off; in mget()
1373 offset = lhs / off; in mget()
1376 offset = lhs % off; in mget()
1380 offset = lhs; in mget()
1382 offset = ~offset; in mget()
1385 if (OFFSET_OOB(nbytes, offset, 2)) in mget()
1390 offset = p->h & off; in mget()
1393 offset = p->h | off; in mget()
1396 offset = p->h ^ off; in mget()
1399 offset = p->h + off; in mget()
1402 offset = p->h - off; in mget()
1405 offset = p->h * off; in mget()
1408 offset = p->h / off; in mget()
1411 offset = p->h % off; in mget()
1416 offset = p->h; in mget()
1418 offset = ~offset; in mget()
1422 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1429 offset = lhs & off; in mget()
1432 offset = lhs | off; in mget()
1435 offset = lhs ^ off; in mget()
1438 offset = lhs + off; in mget()
1441 offset = lhs - off; in mget()
1444 offset = lhs * off; in mget()
1447 offset = lhs / off; in mget()
1450 offset = lhs % off; in mget()
1454 offset = lhs; in mget()
1456 offset = ~offset; in mget()
1460 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1467 offset = lhs & off; in mget()
1470 offset = lhs | off; in mget()
1473 offset = lhs ^ off; in mget()
1476 offset = lhs + off; in mget()
1479 offset = lhs - off; in mget()
1482 offset = lhs * off; in mget()
1485 offset = lhs / off; in mget()
1488 offset = lhs % off; in mget()
1492 offset = lhs; in mget()
1494 offset = ~offset; in mget()
1497 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1504 offset = lhs & off; in mget()
1507 offset = lhs | off; in mget()
1510 offset = lhs ^ off; in mget()
1513 offset = lhs + off; in mget()
1516 offset = lhs - off; in mget()
1519 offset = lhs * off; in mget()
1522 offset = lhs / off; in mget()
1525 offset = lhs % off; in mget()
1529 offset = lhs; in mget()
1531 offset = ~offset; in mget()
1534 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1539 offset = p->l & off; in mget()
1542 offset = p->l | off; in mget()
1545 offset = p->l ^ off; in mget()
1548 offset = p->l + off; in mget()
1551 offset = p->l - off; in mget()
1554 offset = p->l * off; in mget()
1557 offset = p->l / off; in mget()
1560 offset = p->l % off; in mget()
1564 offset = p->l; in mget()
1566 offset = ~offset; in mget()
1575 offset = ((((offset >> 0) & 0x7f) << 0) | in mget()
1576 (((offset >> 8) & 0x7f) << 7) | in mget()
1577 (((offset >> 16) & 0x7f) << 14) | in mget()
1578 (((offset >> 24) & 0x7f) << 21)); in mget()
1580 fprintf(stderr, "id3 offs=%u\n", offset); in mget()
1587 offset += ms->c.li[cont_level-1].off; in mget()
1588 if (offset == 0) { in mget()
1595 fprintf(stderr, "indirect +offs=%u\n", offset); in mget()
1597 if (mcopy(ms, p, m->type, 0, s, offset, nbytes, m) == -1) in mget()
1599 ms->offset = offset; in mget()
1602 mdebug(offset, (char *)(void *)p, in mget()
1610 if (OFFSET_OOB(nbytes, offset, 1)) in mget()
1617 if (OFFSET_OOB(nbytes, offset, 2)) in mget()
1636 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1643 if (OFFSET_OOB(nbytes, offset, 8)) in mget()
1650 if (OFFSET_OOB(nbytes, offset, m->vallen)) in mget()
1655 if (nbytes < offset) in mget()
1661 offset += CAST(uint32_t, o); in mget()
1662 if (offset == 0) in mget()
1665 if (nbytes < offset) in mget()
1671 rv = file_softmagic(ms, s + offset, nbytes - offset, in mget()
1675 fprintf(stderr, "indirect @offs=%u[%d]\n", offset, rv); in mget()
1683 file_printf(ms, F(ms, m, "%u"), offset) == -1) { in mget()
1696 if (nbytes < offset) in mget()
1711 rv = match(ms, ml.magic, ml.nmagic, s, nbytes, offset + o, in mget()
1994 ms->search.offset += idx; in magiccheck()
2048 zval *match, *offset; in magiccheck() local
2050 (offset = zend_hash_index_find(Z_ARRVAL_P(pzval), 1))) { in magiccheck()
2051 if (Z_TYPE_P(match) != IS_STRING && Z_TYPE_P(offset) != IS_LONG) { in magiccheck()
2054 ms->search.s += Z_LVAL_P(offset); /* this is where the match starts */ in magiccheck()
2055 ms->search.offset += Z_LVAL_P(offset); /* this is where the match starts as size_t */ in magiccheck()