MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cirbuf_align_left

Function cirbuf_align_left

dpdk/lib/cmdline/cmdline_cirbuf.c:184–202  ·  view source on GitHub ↗

XXX we could do a better algorithm here... */

Source from the content-addressed store, hash-verified

182
183/* XXX we could do a better algorithm here... */
184int
185cirbuf_align_left(struct cirbuf * cbuf)
186{
187 if (!cbuf)
188 return -EINVAL;
189
190 if (cbuf->start < cbuf->maxlen/2) {
191 while (cbuf->start != 0) {
192 __cirbuf_shift_left(cbuf);
193 }
194 }
195 else {
196 while (cbuf->start != 0) {
197 __cirbuf_shift_right(cbuf);
198 }
199 }
200
201 return 0;
202}
203
204/* XXX we could do a better algorithm here... */
205int

Callers 5

rdline_get_bufferFunction · 0.85
rdline_char_inFunction · 0.85
rdline_get_history_itemFunction · 0.85
test_cirbuf_align_leftFunction · 0.85

Calls 2

__cirbuf_shift_leftFunction · 0.85
__cirbuf_shift_rightFunction · 0.85

Tested by 2

test_cirbuf_align_leftFunction · 0.68