Lines Matching refs:ms

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
89 return (ms->ms_pos); in _citrus_memory_stream_tell()
93 _citrus_memory_stream_remainder(struct _citrus_memory_stream *ms) in _citrus_memory_stream_remainder() argument
97 sz = _citrus_region_size(&ms->ms_region); in _citrus_memory_stream_remainder()
98 if (ms->ms_pos>sz) in _citrus_memory_stream_remainder()
100 return (sz-ms->ms_pos); in _citrus_memory_stream_remainder()
104 _citrus_memory_stream_seek(struct _citrus_memory_stream *ms, size_t pos, int w) in _citrus_memory_stream_seek() argument
108 sz = _citrus_region_size(&ms->ms_region); in _citrus_memory_stream_seek()
114 ms->ms_pos = pos; in _citrus_memory_stream_seek()
117 pos += (ssize_t)ms->ms_pos; in _citrus_memory_stream_seek()
120 ms->ms_pos = pos; in _citrus_memory_stream_seek()
125 ms->ms_pos = sz - pos; in _citrus_memory_stream_seek()
132 _citrus_memory_stream_getc(struct _citrus_memory_stream *ms) in _citrus_memory_stream_getc() argument
135 if (_citrus_memory_stream_iseof(ms)) in _citrus_memory_stream_getc()
137 return (_citrus_region_peek8(&ms->ms_region, ms->ms_pos++)); in _citrus_memory_stream_getc()
141 _citrus_memory_stream_ungetc(struct _citrus_memory_stream *ms, int ch) in _citrus_memory_stream_ungetc() argument
144 if (ch != EOF && ms->ms_pos > 0) in _citrus_memory_stream_ungetc()
145 ms->ms_pos--; in _citrus_memory_stream_ungetc()
149 _citrus_memory_stream_peek(struct _citrus_memory_stream *ms) in _citrus_memory_stream_peek() argument
152 if (_citrus_memory_stream_iseof(ms)) in _citrus_memory_stream_peek()
154 return (_citrus_region_peek8(&ms->ms_region, ms->ms_pos)); in _citrus_memory_stream_peek()
158 _citrus_memory_stream_getregion(struct _citrus_memory_stream *ms, in _citrus_memory_stream_getregion() argument
163 if (ms->ms_pos + sz > _citrus_region_size(&ms->ms_region)) in _citrus_memory_stream_getregion()
166 ret = _citrus_region_offset(&ms->ms_region, ms->ms_pos); in _citrus_memory_stream_getregion()
167 ms->ms_pos += sz; in _citrus_memory_stream_getregion()
175 _citrus_memory_stream_get8(struct _citrus_memory_stream *ms, uint8_t *rval) in _citrus_memory_stream_get8() argument
178 if (ms->ms_pos + 1 > _citrus_region_size(&ms->ms_region)) in _citrus_memory_stream_get8()
181 *rval = _citrus_region_peek8(&ms->ms_region, ms->ms_pos); in _citrus_memory_stream_get8()
182 ms->ms_pos += 2; in _citrus_memory_stream_get8()
188 _citrus_memory_stream_get16(struct _citrus_memory_stream *ms, uint16_t *rval) in _citrus_memory_stream_get16() argument
191 if (ms->ms_pos + 2 > _citrus_region_size(&ms->ms_region)) in _citrus_memory_stream_get16()
194 *rval = _citrus_region_peek16(&ms->ms_region, ms->ms_pos); in _citrus_memory_stream_get16()
195 ms->ms_pos += 2; in _citrus_memory_stream_get16()
201 _citrus_memory_stream_get32(struct _citrus_memory_stream *ms, uint32_t *rval) in _citrus_memory_stream_get32() argument
204 if (ms->ms_pos + 4 > _citrus_region_size(&ms->ms_region)) in _citrus_memory_stream_get32()
207 *rval = _citrus_region_peek32(&ms->ms_region, ms->ms_pos); in _citrus_memory_stream_get32()
208 ms->ms_pos += 4; in _citrus_memory_stream_get32()
214 _citrus_memory_stream_getln_region(struct _citrus_memory_stream *ms, in _citrus_memory_stream_getln_region() argument
220 ptr = _citrus_memory_stream_getln(ms, &sz); in _citrus_memory_stream_getln_region()