Lines Matching refs:nbytes

95 file_softmagic(struct magic_set *ms, const unsigned char *buf, size_t nbytes,  in file_softmagic()  argument
112 if ((rv = match(ms, ml->magic, ml->nmagic, buf, nbytes, 0, mode, in file_softmagic()
170 const unsigned char *s, size_t nbytes, size_t offset, int mode, int text, in match() argument
209 switch (mget(ms, s, m, nbytes, offset, cont_level, mode, text, in match()
263 switch (moffset(ms, m, nbytes, &ms->c.li[cont_level].off)) { in match()
302 switch (mget(ms, s, m, nbytes, offset, cont_level, mode, in match()
375 switch (moffset(ms, m, nbytes, in match()
706 moffset(struct magic_set *ms, struct magic *m, size_t nbytes, int32_t *op) in moffset() argument
812 o = der_offs(ms, m, nbytes); in moffset()
813 if (o == -1 || (size_t)o > nbytes) { in moffset()
817 o, nbytes); in moffset()
830 if ((size_t)o > nbytes) { in moffset()
833 (size_t)o, nbytes); in moffset()
1163 const unsigned char *s, uint32_t offset, size_t nbytes, struct magic *m) in mcopy() argument
1173 if (offset > nbytes) in mcopy()
1174 offset = CAST(uint32_t, nbytes); in mcopy()
1176 ms->search.s_len = nbytes - offset; in mcopy()
1202 if (bytecnt == 0 || bytecnt > nbytes - offset) in mcopy()
1203 bytecnt = nbytes - offset; in mcopy()
1232 const unsigned char *esrc = s + nbytes; in mcopy()
1240 if (offset >= nbytes) in mcopy()
1265 if (offset >= nbytes) { in mcopy()
1269 if (nbytes - offset < sizeof(*p)) in mcopy()
1270 nbytes = nbytes - offset; in mcopy()
1272 nbytes = sizeof(*p); in mcopy()
1274 (void)memcpy(p, s + offset, nbytes); in mcopy()
1280 if (nbytes < sizeof(*p)) in mcopy()
1281 (void)memset(((char *)(void *)p) + nbytes, '\0', in mcopy()
1282 sizeof(*p) - nbytes); in mcopy()
1327 size_t nbytes, size_t o, unsigned int cont_level, int mode, int text, in mget() argument
1352 (uint32_t)nbytes, m) == -1) in mget()
1359 m->type, m->flag, offset, o, nbytes, in mget()
1370 if (OFFSET_OOB(nbytes, offset + off, sizeof(*q))) in mget()
1405 if (OFFSET_OOB(nbytes, offset, 1)) in mget()
1410 if (OFFSET_OOB(nbytes, offset, 2)) in mget()
1415 if (OFFSET_OOB(nbytes, offset, 2)) in mget()
1420 if (OFFSET_OOB(nbytes, offset, 2)) in mget()
1426 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1435 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1443 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1448 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1467 if (mcopy(ms, p, m->type, 0, s, offset, nbytes, m) == -1) in mget()
1480 if (OFFSET_OOB(nbytes, offset, 1)) in mget()
1487 if (OFFSET_OOB(nbytes, offset, 2)) in mget()
1506 if (OFFSET_OOB(nbytes, offset, 4)) in mget()
1513 if (OFFSET_OOB(nbytes, offset, 8)) in mget()
1520 if (OFFSET_OOB(nbytes, offset, m->vallen)) in mget()
1525 if (nbytes < offset) in mget()
1535 if (nbytes < offset) in mget()
1542 rv = file_softmagic(ms, s + offset, nbytes - offset, in mget()
1567 if (nbytes < offset) in mget()
1582 rv = match(ms, ml.magic, ml.nmagic, s, nbytes, offset + o, in mget()