Lines Matching refs:start

15 cirbuf_init(struct cirbuf *cbuf, char *buf, unsigned int start, unsigned int maxlen)  in cirbuf_init()  argument
21 cbuf->start = start; in cirbuf_init()
22 cbuf->end = start; in cirbuf_init()
39 if (n < cbuf->start + e) { in cirbuf_add_buf_head()
40 dprintf("s[%d] -> d[%d] (%d)\n", 0, cbuf->start - n + e, n); in cirbuf_add_buf_head()
41 memcpy(cbuf->buf + cbuf->start - n + e, c, n); in cirbuf_add_buf_head()
44 dprintf("s[%d] -> d[%d] (%d)\n", + n - (cbuf->start + e), 0, in cirbuf_add_buf_head()
45 cbuf->start + e); in cirbuf_add_buf_head()
47 (cbuf->start + e), 0, n - (cbuf->start + e)); in cirbuf_add_buf_head()
48 memcpy(cbuf->buf, c + n - (cbuf->start + e) , cbuf->start + e); in cirbuf_add_buf_head()
49 memcpy(cbuf->buf + cbuf->maxlen - n + (cbuf->start + e), c, in cirbuf_add_buf_head()
50 n - (cbuf->start + e)); in cirbuf_add_buf_head()
53 cbuf->start += (cbuf->maxlen - n + e); in cirbuf_add_buf_head()
54 cbuf->start %= cbuf->maxlen; in cirbuf_add_buf_head()
96 cbuf->start += (cbuf->maxlen - 1); in __cirbuf_add_head()
97 cbuf->start %= cbuf->maxlen; in __cirbuf_add_head()
99 cbuf->buf[cbuf->start] = c; in __cirbuf_add_head()
153 char tmp = cbuf->buf[cbuf->start]; in __cirbuf_shift_left()
156 cbuf->buf[(cbuf->start+i)%cbuf->maxlen] = in __cirbuf_shift_left()
157 cbuf->buf[(cbuf->start+i+1)%cbuf->maxlen]; in __cirbuf_shift_left()
159 cbuf->buf[(cbuf->start-1+cbuf->maxlen)%cbuf->maxlen] = tmp; in __cirbuf_shift_left()
160 cbuf->start += (cbuf->maxlen - 1); in __cirbuf_shift_left()
161 cbuf->start %= cbuf->maxlen; in __cirbuf_shift_left()
177 cbuf->start += 1; in __cirbuf_shift_right()
178 cbuf->start %= cbuf->maxlen; in __cirbuf_shift_right()
190 if (cbuf->start < cbuf->maxlen/2) { in cirbuf_align_left()
191 while (cbuf->start != 0) { in cirbuf_align_left()
196 while (cbuf->start != 0) { in cirbuf_align_left()
211 if (cbuf->start >= cbuf->maxlen/2) { in cirbuf_align_right()
217 while (cbuf->start != cbuf->maxlen-1) { in cirbuf_align_right()
235 cbuf->start += size - 1; in cirbuf_del_buf_head()
236 cbuf->start %= cbuf->maxlen; in cirbuf_del_buf_head()
239 cbuf->start += size; in cirbuf_del_buf_head()
240 cbuf->start %= cbuf->maxlen; in cirbuf_del_buf_head()
272 cbuf->start ++; in __cirbuf_del_head()
273 cbuf->start %= cbuf->maxlen; in __cirbuf_del_head()
336 if (cbuf->start <= cbuf->end) { in cirbuf_get_buf_head()
337 dprintf("s[%d] -> d[%d] (%d)\n", cbuf->start, 0, n); in cirbuf_get_buf_head()
338 memcpy(c, cbuf->buf + cbuf->start , n); in cirbuf_get_buf_head()
342 if (n <= cbuf->maxlen - cbuf->start) { in cirbuf_get_buf_head()
343 dprintf("s[%d] -> d[%d] (%d)\n", 0, cbuf->start, n); in cirbuf_get_buf_head()
344 memcpy(c, cbuf->buf + cbuf->start , n); in cirbuf_get_buf_head()
347 dprintf("s[%d] -> d[%d] (%d)\n", cbuf->start, 0, in cirbuf_get_buf_head()
348 cbuf->maxlen - cbuf->start); in cirbuf_get_buf_head()
349 dprintf("s[%d] -> d[%d] (%d)\n", 0, cbuf->maxlen - cbuf->start, in cirbuf_get_buf_head()
350 n - cbuf->maxlen + cbuf->start); in cirbuf_get_buf_head()
351 memcpy(c, cbuf->buf + cbuf->start , cbuf->maxlen - cbuf->start); in cirbuf_get_buf_head()
352 memcpy(c + cbuf->maxlen - cbuf->start, cbuf->buf, in cirbuf_get_buf_head()
353 n - cbuf->maxlen + cbuf->start); in cirbuf_get_buf_head()
374 if (cbuf->start <= cbuf->end) { in cirbuf_get_buf_tail()
386 cbuf->maxlen - cbuf->start, cbuf->end + 1); in cirbuf_get_buf_tail()
389 memcpy(c + cbuf->maxlen - cbuf->start, in cirbuf_get_buf_tail()
403 return cbuf->buf[cbuf->start]; in cirbuf_get_head()