/freebsd/lib/libc/iconv/ |
H A D | citrus_memstream.h | 53 _citrus_memory_stream_iseof(struct _citrus_memory_stream *ms) in _citrus_memory_stream_iseof() argument 56 return (ms->ms_pos >= _citrus_region_size(&ms->ms_region)); in _citrus_memory_stream_iseof() 60 _citrus_memory_stream_bind(struct _citrus_memory_stream * __restrict ms, in _citrus_memory_stream_bind() argument 64 ms->ms_region = *r; in _citrus_memory_stream_bind() 65 ms->ms_pos = 0; in _citrus_memory_stream_bind() 69 _citrus_memory_stream_bind_ptr(struct _citrus_memory_stream * __restrict ms, in _citrus_memory_stream_bind_ptr() argument 75 _citrus_memory_stream_bind(ms, &r); in _citrus_memory_stream_bind_ptr() 79 _citrus_memory_stream_rewind(struct _citrus_memory_stream *ms) in _citrus_memory_stream_rewind() argument 82 ms->ms_pos = 0; in _citrus_memory_stream_rewind() 86 _citrus_memory_stream_tell(struct _citrus_memory_stream *ms) in _citrus_memory_stream_tell() argument [all …]
|
H A D | citrus_prop.c | 79 _citrus_prop_read_##_func_##_common(struct _memstream * __restrict ms, \ 90 ch = _memstream_getc(ms); \ 99 _memstream_ungetc(ms, ch); \ 109 _citrus_prop_read_##_func_(struct _memstream * __restrict ms, \ in _CITRUS_PROP_READ_UINT_COMMON() 114 _memstream_skip_ws(ms); \ in _CITRUS_PROP_READ_UINT_COMMON() 115 ch = _memstream_getc(ms); \ in _CITRUS_PROP_READ_UINT_COMMON() 121 ch = _memstream_getc(ms); \ in _CITRUS_PROP_READ_UINT_COMMON() 126 ch = _memstream_getc(ms); \ in _CITRUS_PROP_READ_UINT_COMMON() 128 ch = _memstream_getc(ms); \ in _CITRUS_PROP_READ_UINT_COMMON() 130 _memstream_ungetc(ms, ch); \ in _CITRUS_PROP_READ_UINT_COMMON() [all …]
|
H A D | citrus_memstream.c | 43 _citrus_memory_stream_getln(struct _citrus_memory_stream * __restrict ms, in _citrus_memory_stream_getln() argument 49 if (ms->ms_pos>=_region_size(&ms->ms_region)) in _citrus_memory_stream_getln() 52 h = p = (uint8_t *)_region_offset(&ms->ms_region, ms->ms_pos); in _citrus_memory_stream_getln() 54 for (i = _region_size(&ms->ms_region) - ms->ms_pos; i > 0; i--) { in _citrus_memory_stream_getln() 61 ms->ms_pos += ret; in _citrus_memory_stream_getln() 69 _citrus_memory_stream_matchline(struct _citrus_memory_stream * __restrict ms, in _citrus_memory_stream_matchline() argument 77 p = _citrus_memory_stream_getln(ms, &len); in _citrus_memory_stream_matchline() 113 _citrus_memory_stream_chr(struct _citrus_memory_stream *ms, in _citrus_memory_stream_chr() argument 119 if (ms->ms_pos >= _region_size(&ms->ms_region)) in _citrus_memory_stream_chr() 122 head = _region_offset(&ms->ms_region, ms->ms_pos); in _citrus_memory_stream_chr() [all …]
|
H A D | citrus_db.c | 62 struct _memstream ms; in _citrus_db_open() local 64 _memstream_bind(&ms, r); in _citrus_db_open() 67 dhx = _memstream_getregion(&ms, NULL, sizeof(*dhx)); in _citrus_db_open() 72 if (_memstream_seek(&ms, be32toh(dhx->dhx_entry_offset), SEEK_SET)) in _citrus_db_open() 76 _memstream_remainder(&ms)) in _citrus_db_open() 104 struct _memstream ms; in _citrus_db_lookup() local 108 _memstream_bind(&ms, &db->db_region); in _citrus_db_lookup() 110 dhx = _memstream_getregion(&ms, NULL, sizeof(*dhx)); in _citrus_db_lookup() 129 if (_citrus_memory_stream_seek(&ms, offset, SEEK_SET)) in _citrus_db_lookup() 132 dex = _memstream_getregion(&ms, NULL, _CITRUS_DB_ENTRY_SIZE); in _citrus_db_lookup() [all …]
|
/freebsd/contrib/file/src/ |
H A D | funcs.c | 67 file_clearbuf(struct magic_set *ms) in file_clearbuf() argument 69 free(ms->o.buf); in file_clearbuf() 70 ms->o.buf = NULL; in file_clearbuf() 71 ms->o.blen = 0; in file_clearbuf() 133 file_vprintf(struct magic_set *ms, const char *fmt, va_list ap) in file_vprintf() argument 139 if (ms->event_flags & EVENT_HAD_ERR) in file_vprintf() 143 file_clearbuf(ms); in file_vprintf() 144 file_error(ms, 0, "Bad magic format `%s' (%s)", fmt, tbuf); in file_vprintf() 149 if (len < 0 || (size_t)len > 1024 || len + ms->o.blen > 1024 * 1024) { in file_vprintf() 150 size_t blen = ms->o.blen; in file_vprintf() [all …]
|
H A D | fsmagic.c | 71 bad_link(struct magic_set *ms, int err, char *buf) in bad_link() argument 73 int mime = ms->flags & MAGIC_MIME; in bad_link() 75 file_printf(ms, "inode/symlink") in bad_link() 79 if (ms->flags & MAGIC_ERROR) { in bad_link() 80 file_error(ms, err, in bad_link() 84 if (file_printf(ms, "broken symbolic link to %s", buf) == -1) in bad_link() 91 handle_mime(struct magic_set *ms, int mime, const char *str) in handle_mime() argument 94 if (file_printf(ms, "inode/%s", str) == -1) in handle_mime() 96 if ((mime & MAGIC_MIME_ENCODING) && file_printf(ms, in handle_mime() 100 if ((mime & MAGIC_MIME_ENCODING) && file_printf(ms, "binary") == -1) in handle_mime() [all …]
|
H A D | magic.c | 273 unreadable_info(struct magic_set *ms, mode_t md, const char *file) in unreadable_info() argument 278 if (file_printf(ms, "writable, ") == -1) in unreadable_info() 282 if (file_printf(ms, "executable, ") == -1) in unreadable_info() 292 if (file_printf(ms, "writable, ") == -1) in unreadable_info() 298 if (file_printf(ms, "regular file, ") == -1) in unreadable_info() 300 if (file_printf(ms, "no read permission") == -1) in unreadable_info() 306 magic_close(struct magic_set *ms) in magic_close() argument 308 if (ms == NULL) in magic_close() 310 file_ms_free(ms); in magic_close() 317 magic_load(struct magic_set *ms, const char *magicfile) in magic_load() argument [all …]
|
H A D | softmagic.c | 119 file_softmagic(struct magic_set *ms, const struct buffer *b, in file_softmagic() argument 135 for (ml = ms->mlist[0]->next; ml != ms->mlist[0]; ml = ml->next) { in file_softmagic() 136 int ret = match(ms, ml->magic, ml->magic_rxcomp, ml->nmagic, b, in file_softmagic() 146 if ((ms->flags & MAGIC_CONTINUE) == 0) in file_softmagic() 161 file_fmtcheck(struct magic_set *ms, const char *desc, const char *def, in file_fmtcheck() argument 171 file_magerror(ms, in file_fmtcheck() 208 match(struct magic_set *ms, struct magic *magic, file_regex_t **magic_rxcomp, in match() argument 219 int print = (ms->flags & MAGIC_NODESC) == 0; in match() 230 if (file_check_mem(ms, cont_level) == -1) in match() 253 if (msetoffset(ms, m, &bb, b, offset, cont_level) == -1) in match() [all …]
|
H A D | readcdf.c | 42 #define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0) argument 148 cdf_file_property_info(struct magic_set *ms, const cdf_property_info_t *info, in cdf_file_property_info() argument 159 if (!NOTMIME(ms) && root_storage) in cdf_file_property_info() 169 if (NOTMIME(ms) && file_printf(ms, ", %s: %hd", buf, in cdf_file_property_info() 174 if (NOTMIME(ms) && file_printf(ms, ", %s: %d", buf, in cdf_file_property_info() 179 if (NOTMIME(ms) && file_printf(ms, ", %s: %u", buf, in cdf_file_property_info() 184 if (NOTMIME(ms) && file_printf(ms, ", %s: %g", buf, in cdf_file_property_info() 189 if (NOTMIME(ms) && file_printf(ms, ", %s: %g", buf, in cdf_file_property_info() 214 if (NOTMIME(ms)) { in cdf_file_property_info() 216 if (file_printf(ms, ", %s: %s", in cdf_file_property_info() [all …]
|
H A D | apprentice.c | 115 file_private int getvalue(struct magic_set *ms, struct magic *, const char **, int); 196 struct magic_set *ms; in main() local 209 if ((ms = magic_open(MAGIC_CHECK)) == NULL) { in main() 213 ret = magic_compile(ms, argv[1]) == -1 ? 1 : 0; in main() 215 (void)fprintf(stderr, "%s: %s\n", progname, magic_error(ms)); in main() 216 magic_close(ms); in main() 474 apprentice_1(struct magic_set *ms, const char *fn, int action) in apprentice_1() argument 482 file_error(ms, 0, "magic element size %lu != %lu", in apprentice_1() 489 map = apprentice_load(ms, fn, action); in apprentice_1() 492 return apprentice_compile(ms, map, fn); in apprentice_1() [all …]
|
H A D | readelf.c | 69 toomany(struct magic_set *ms, const char *name, uint16_t num) in toomany() argument 71 if (ms->flags & MAGIC_MIME) in toomany() 73 if (file_printf(ms, ", too many %s (%u)", name, num) == -1) in toomany() 351 dophn_core(struct magic_set *ms, int clazz, int swap, int fd, off_t off, in dophn_core() argument 362 if (ms->flags & MAGIC_MIME) in dophn_core() 366 if (file_printf(ms, ", no program header") == -1) in dophn_core() 371 if (file_printf(ms, ", corrupted program header size") == -1) in dophn_core() 382 if (file_printf(ms, in dophn_core() 405 if (file_printf(ms, " can't read note section at %jd", in dophn_core() 414 offset = donote(ms, nbuf, offset, CAST(size_t, bufsize), in dophn_core() [all …]
|
H A D | ascmagic.c | 71 file_ascmagic(struct magic_set *ms, const struct buffer *b, int text) in file_ascmagic() argument 92 if (file_encoding(ms, &bb, &ubuf, &ulen, &code, &code_mime, in file_ascmagic() 96 rv = file_ascmagic_with_encoding(ms, &bb, in file_ascmagic() 105 file_ascmagic_with_encoding(struct magic_set *ms, const struct buffer *b, in file_ascmagic_with_encoding() argument 115 int mime = ms->flags & MAGIC_MIME; in file_ascmagic_with_encoding() 141 if (ulen > 0 && (ms->flags & MAGIC_NO_CHECK_SOFT) == 0) { in file_ascmagic_with_encoding() 147 file_oomem(ms, mlen); in file_ascmagic_with_encoding() 158 if ((rv = file_softmagic(ms, &bb, NULL, NULL, in file_ascmagic_with_encoding() 164 if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) { in file_ascmagic_with_encoding() 170 if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) { in file_ascmagic_with_encoding() [all …]
|
H A D | apptype.c | 45 file_os2_apptype(struct magic_set *ms, const char *fn, const void *buf, in file_os2_apptype() argument 57 file_error(ms, errno, "cannot create tempnam"); in file_os2_apptype() 69 file_error(ms, errno, "cannot open tmp file `%s'", path); in file_os2_apptype() 73 file_error(ms, errno, "cannot write tmp file `%s'", in file_os2_apptype() 109 if (file_printf(ms, "32-bit ") == -1) in file_os2_apptype() 112 if (file_printf(ms, "physical device driver") == -1) in file_os2_apptype() 115 if (file_printf(ms, "virtual device driver") == -1) in file_os2_apptype() 119 if (file_printf(ms, "file_protected ") == -1) in file_os2_apptype() 121 if (file_printf(ms, "DLL") == -1) in file_os2_apptype() 124 if (file_printf(ms, "Windows executable") == -1) in file_os2_apptype() [all …]
|
/freebsd/lib/libc/stdio/ |
H A D | open_memstream.c | 54 memstream_grow(struct memstream *ms, fpos_t newoff) in memstream_grow() argument 63 if (newsize > ms->len) { in memstream_grow() 64 buf = realloc(*ms->bufp, newsize + 1); in memstream_grow() 68 ms, ms->len, newsize); in memstream_grow() 70 memset(buf + ms->len + 1, 0, newsize - ms->len); in memstream_grow() 71 *ms->bufp = buf; in memstream_grow() 72 ms->len = newsize; in memstream_grow() 81 memstream_update(struct memstream *ms) in memstream_update() argument 84 assert(ms->len >= 0 && ms->offset >= 0); in memstream_update() 85 *ms->sizep = ms->len < ms->offset ? ms->len : ms->offset; in memstream_update() [all …]
|
H A D | open_wmemstream.c | 55 wmemstream_grow(struct wmemstream *ms, fpos_t newoff) in wmemstream_grow() argument 64 if (newsize > ms->len) { in wmemstream_grow() 65 buf = reallocarray(*ms->bufp, newsize + 1, sizeof(wchar_t)); in wmemstream_grow() 69 ms, ms->len, newsize); in wmemstream_grow() 71 wmemset(buf + ms->len + 1, 0, newsize - ms->len); in wmemstream_grow() 72 *ms->bufp = buf; in wmemstream_grow() 73 ms->len = newsize; in wmemstream_grow() 82 wmemstream_update(struct wmemstream *ms) in wmemstream_update() argument 85 assert(ms->len >= 0 && ms->offset >= 0); in wmemstream_update() 86 *ms->sizep = ms->len < ms->offset ? ms->len : ms->offset; in wmemstream_update() [all …]
|
/freebsd/tests/sys/kern/ |
H A D | module_test.c | 98 struct module_stat ms; in ATF_TC_BODY() local 101 ms.version = sizeof(ms); in ATF_TC_BODY() 102 ATF_REQUIRE(modstat(0, &ms) == -1); in ATF_TC_BODY() 111 ms.version = 0; in ATF_TC_BODY() 112 ATF_REQUIRE(modstat(modid, &ms) == -1); in ATF_TC_BODY() 115 ms.version = sizeof(ms); in ATF_TC_BODY() 116 ATF_REQUIRE(modstat(modid, &ms) == 0); in ATF_TC_BODY() 117 ATF_REQUIRE(ms.id == modid); in ATF_TC_BODY() 118 if (strnlen(ms.name, sizeof(ms.name)) < sizeof(ms.name)) in ATF_TC_BODY() 119 ATF_REQUIRE(modfind(ms.name) == modid); in ATF_TC_BODY() [all …]
|
/freebsd/sys/contrib/openzfs/module/lua/ |
H A D | lstrlib.c | 223 static const char *match (MatchState *ms, const char *s, const char *p); 236 static int check_capture (MatchState *ms, int l) { in check_capture() argument 238 if (l < 0 || l >= ms->level || ms->capture[l].len == CAP_UNFINISHED) in check_capture() 239 return luaL_error(ms->L, "invalid capture index %%%d", l + 1); in check_capture() 244 static int capture_to_close (MatchState *ms) { in capture_to_close() argument 245 int level = ms->level; in capture_to_close() 247 if (ms->capture[level].len == CAP_UNFINISHED) return level; in capture_to_close() 248 return luaL_error(ms->L, "invalid pattern capture"); in capture_to_close() 252 static const char *classend (MatchState *ms, const char *p) { in classend() argument 255 if (p == ms->p_end) in classend() [all …]
|
/freebsd/sys/contrib/zstd/lib/compress/ |
H A D | zstd_lazy.h | 28 U32 ZSTD_insertAndFindFirstIndex(ZSTD_matchState_t* ms, const BYTE* ip); 29 void ZSTD_row_update(ZSTD_matchState_t* const ms, const BYTE* ip); 31 void ZSTD_dedicatedDictSearch_lazy_loadDictionary(ZSTD_matchState_t* ms, const BYTE* const ip); 36 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], 39 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], 42 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], 45 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], 48 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], 51 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], 54 ZSTD_matchState_t* ms, seqStore_t* seqStore, U32 rep[ZSTD_REP_NUM], [all …]
|
H A D | zstd_lazy.c | 20 ZSTD_updateDUBT(ZSTD_matchState_t* ms, in ZSTD_updateDUBT() argument 24 const ZSTD_compressionParameters* const cParams = &ms->cParams; in ZSTD_updateDUBT() 25 U32* const hashTable = ms->hashTable; in ZSTD_updateDUBT() 28 U32* const bt = ms->chainTable; in ZSTD_updateDUBT() 32 const BYTE* const base = ms->window.base; in ZSTD_updateDUBT() 34 U32 idx = ms->nextToUpdate; in ZSTD_updateDUBT() 38 idx, target, ms->window.dictLimit); in ZSTD_updateDUBT() 42 assert(idx >= ms->window.dictLimit); /* condition for valid base+idx */ in ZSTD_updateDUBT() 55 ms->nextToUpdate = target; in ZSTD_updateDUBT() 64 ZSTD_insertDUBT1(const ZSTD_matchState_t* ms, in ZSTD_insertDUBT1() argument [all …]
|
/freebsd/sys/contrib/openzfs/module/zstd/lib/compress/ |
H A D | zstd_lazy.c | 20 ZSTD_updateDUBT(ZSTD_matchState_t* ms, in ZSTD_updateDUBT() argument 24 const ZSTD_compressionParameters* const cParams = &ms->cParams; in ZSTD_updateDUBT() 25 U32* const hashTable = ms->hashTable; in ZSTD_updateDUBT() 28 U32* const bt = ms->chainTable; in ZSTD_updateDUBT() 32 const BYTE* const base = ms->window.base; in ZSTD_updateDUBT() 34 U32 idx = ms->nextToUpdate; in ZSTD_updateDUBT() 38 idx, target, ms->window.dictLimit); in ZSTD_updateDUBT() 42 assert(idx >= ms->window.dictLimit); /* condition for valid base+idx */ in ZSTD_updateDUBT() 55 ms->nextToUpdate = target; in ZSTD_updateDUBT() 64 ZSTD_insertDUBT1(ZSTD_matchState_t* ms, in ZSTD_insertDUBT1() argument [all …]
|
/freebsd/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/buffering/ |
H A D | tst.fill1.d | 49 #pragma D option statusrate=10ms 54 tick-10ms 59 tick-10ms 64 tick-10ms 69 tick-10ms 74 tick-10ms 79 tick-10ms 84 tick-10ms 89 tick-10ms 94 tick-10ms [all …]
|
/freebsd/lib/libiconv_modules/mapper_std/ |
H A D | citrus_mapper_std.c | 79 rowcol_convert(struct _citrus_mapper_std * __restrict ms, in rowcol_convert() argument 89 rc = &ms->ms_rowcol; in rowcol_convert() 234 rowcol_uninit(struct _citrus_mapper_std *ms) in rowcol_uninit() argument 238 rc = &ms->ms_rowcol; in rowcol_uninit() 243 rowcol_init(struct _citrus_mapper_std *ms) in rowcol_init() argument 253 ms->ms_convert = &rowcol_convert; in rowcol_init() 254 ms->ms_uninit = &rowcol_uninit; in rowcol_init() 255 rc = &ms->ms_rowcol; in rowcol_init() 258 ret = _db_lookup_by_s(ms->ms_db, _CITRUS_MAPPER_STD_SYM_TABLE, in rowcol_init() 267 ret = _db_lookup_by_s(ms->ms_db, _CITRUS_MAPPER_STD_SYM_INFO, &r, NULL); in rowcol_init() [all …]
|
/freebsd/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/predicates/ |
H A D | tst.complex.d | 47 tick-10ms 55 tick-10ms 61 tick-10ms 67 tick-10ms 73 tick-10ms 79 tick-10ms 85 tick-10ms 91 tick-10ms 97 tick-10ms 103 tick-10ms [all …]
|
/freebsd/lib/libiconv_modules/mapper_zone/ |
H A D | citrus_mapper_zone.c | 100 get_imm(struct _memstream *ms, struct _parse_state *ps) in get_imm() argument 108 c = _memstream_peek(ms); in get_imm() 112 _memstream_getc(ms); in get_imm() 119 buf[i] = _memstream_getc(ms); in get_imm() 131 get_tok(struct _memstream *ms, struct _parse_state *ps) in get_tok() argument 136 c = _memstream_peek(ms); in get_tok() 140 _memstream_getc(ms); in get_tok() 150 _memstream_getc(ms); in get_tok() 162 return (get_imm(ms, ps)); in get_tok() 168 _memstream_getc(ms); in get_tok() [all …]
|
/freebsd/contrib/libfido2/src/ |
H A D | config.c | 45 const char *pin, int *ms) in config_tx() argument 77 if ((r = fido_do_ecdh(dev, &pk, &ecdh, ms)) != FIDO_OK) { in config_tx() 82 NULL, &argv[3], &argv[2], ms)) != FIDO_OK) { in config_tx() 90 fido_tx(dev, CTAP_CMD_CBOR, f.ptr, f.len, ms) < 0) { in config_tx() 108 config_enable_entattest_wait(fido_dev_t *dev, const char *pin, int *ms) in config_enable_entattest_wait() argument 113 ms)) != FIDO_OK) in config_enable_entattest_wait() 116 return fido_rx_cbor_status(dev, ms); in config_enable_entattest_wait() 122 int ms = dev->timeout_ms; in fido_dev_enable_entattest() local 124 return (config_enable_entattest_wait(dev, pin, &ms)); in fido_dev_enable_entattest() 128 config_toggle_always_uv_wait(fido_dev_t *dev, const char *pin, int *ms) in config_toggle_always_uv_wait() argument [all …]
|