Lines Matching refs:end
22 cbuf->end = start; in cirbuf_init()
70 if (n < cbuf->maxlen - cbuf->end - 1 + e) { in cirbuf_add_buf_tail()
71 dprintf("s[%d] -> d[%d] (%d)\n", 0, cbuf->end + !e, n); in cirbuf_add_buf_tail()
72 memcpy(cbuf->buf + cbuf->end + !e, c, n); in cirbuf_add_buf_tail()
75 dprintf("s[%d] -> d[%d] (%d)\n", cbuf->end + !e, 0, in cirbuf_add_buf_tail()
76 cbuf->maxlen - cbuf->end - 1 + e); in cirbuf_add_buf_tail()
77 dprintf("s[%d] -> d[%d] (%d)\n", cbuf->maxlen - cbuf->end - 1 + in cirbuf_add_buf_tail()
78 e, 0, n - cbuf->maxlen + cbuf->end + 1 - e); in cirbuf_add_buf_tail()
79 memcpy(cbuf->buf + cbuf->end + !e, c, cbuf->maxlen - in cirbuf_add_buf_tail()
80 cbuf->end - 1 + e); in cirbuf_add_buf_tail()
81 memcpy(cbuf->buf, c + cbuf->maxlen - cbuf->end - 1 + e, in cirbuf_add_buf_tail()
82 n - cbuf->maxlen + cbuf->end + 1 - e); in cirbuf_add_buf_tail()
85 cbuf->end += n - e; in cirbuf_add_buf_tail()
86 cbuf->end %= cbuf->maxlen; in cirbuf_add_buf_tail()
125 cbuf->end ++; in __cirbuf_add_tail()
126 cbuf->end %= cbuf->maxlen; in __cirbuf_add_tail()
128 cbuf->buf[cbuf->end] = c; in __cirbuf_add_tail()
162 cbuf->end += (cbuf->maxlen - 1); in __cirbuf_shift_left()
163 cbuf->end %= cbuf->maxlen; in __cirbuf_shift_left()
170 char tmp = cbuf->buf[cbuf->end]; in __cirbuf_shift_right()
173 cbuf->buf[(cbuf->end+cbuf->maxlen-i)%cbuf->maxlen] = in __cirbuf_shift_right()
174 cbuf->buf[(cbuf->end+cbuf->maxlen-i-1)%cbuf->maxlen]; in __cirbuf_shift_right()
176 cbuf->buf[(cbuf->end+1)%cbuf->maxlen] = tmp; in __cirbuf_shift_right()
179 cbuf->end += 1; in __cirbuf_shift_right()
180 cbuf->end %= cbuf->maxlen; in __cirbuf_shift_right()
212 while (cbuf->end != cbuf->maxlen-1) { in cirbuf_align_right()
255 cbuf->end += (cbuf->maxlen - size + 1); in cirbuf_del_buf_tail()
256 cbuf->end %= cbuf->maxlen; in cirbuf_del_buf_tail()
259 cbuf->end += (cbuf->maxlen - size); in cirbuf_del_buf_tail()
260 cbuf->end %= cbuf->maxlen; in cirbuf_del_buf_tail()
300 cbuf->end += (cbuf->maxlen - 1); in __cirbuf_del_tail()
301 cbuf->end %= cbuf->maxlen; in __cirbuf_del_tail()
336 if (cbuf->start <= cbuf->end) { in cirbuf_get_buf_head()
374 if (cbuf->start <= cbuf->end) { in cirbuf_get_buf_tail()
375 dprintf("s[%d] -> d[%d] (%d)\n", cbuf->end - n + 1, 0, n); in cirbuf_get_buf_tail()
376 memcpy(c, cbuf->buf + cbuf->end - n + 1, n); in cirbuf_get_buf_tail()
380 if (n <= cbuf->end + 1) { in cirbuf_get_buf_tail()
381 dprintf("s[%d] -> d[%d] (%d)\n", 0, cbuf->end - n + 1, n); in cirbuf_get_buf_tail()
382 memcpy(c, cbuf->buf + cbuf->end - n + 1, n); in cirbuf_get_buf_tail()
386 cbuf->maxlen - cbuf->start, cbuf->end + 1); in cirbuf_get_buf_tail()
388 cbuf->maxlen - n + cbuf->end + 1, 0, n - cbuf->end - 1); in cirbuf_get_buf_tail()
390 cbuf->buf, cbuf->end + 1); in cirbuf_get_buf_tail()
391 memcpy(c, cbuf->buf + cbuf->maxlen - n + cbuf->end +1, in cirbuf_get_buf_tail()
392 n - cbuf->end - 1); in cirbuf_get_buf_tail()
411 return cbuf->buf[cbuf->end]; in cirbuf_get_tail()