Lines Matching refs:buf

15 cirbuf_init(struct cirbuf *cbuf, char *buf, unsigned int start, unsigned int maxlen)  in cirbuf_init()  argument
17 if (!cbuf || !buf) in cirbuf_init()
23 cbuf->buf = buf; in cirbuf_init()
41 memcpy(cbuf->buf + cbuf->start - n + e, c, n); 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()
72 memcpy(cbuf->buf + cbuf->end + !e, c, n); in cirbuf_add_buf_tail()
79 memcpy(cbuf->buf + cbuf->end + !e, c, cbuf->maxlen - in cirbuf_add_buf_tail()
81 memcpy(cbuf->buf, c + cbuf->maxlen - cbuf->end - 1 + e, in cirbuf_add_buf_tail()
99 cbuf->buf[cbuf->start] = c; in __cirbuf_add_head()
128 cbuf->buf[cbuf->end] = c; in __cirbuf_add_tail()
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()
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()
338 memcpy(c, cbuf->buf + cbuf->start , n); in cirbuf_get_buf_head()
344 memcpy(c, cbuf->buf + cbuf->start , n); 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()
376 memcpy(c, cbuf->buf + 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()
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()
403 return cbuf->buf[cbuf->start]; in cirbuf_get_head()
411 return cbuf->buf[cbuf->end]; in cirbuf_get_tail()