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

Function cirbuf_del_buf_head

dpdk/lib/cmdline/cmdline_cirbuf.c:227–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225/* buffer del */
226
227int
228cirbuf_del_buf_head(struct cirbuf *cbuf, unsigned int size)
229{
230 if (!cbuf || !size || size > CIRBUF_GET_LEN(cbuf))
231 return -EINVAL;
232
233 cbuf->len -= size;
234 if (CIRBUF_IS_EMPTY(cbuf)) {
235 cbuf->start += size - 1;
236 cbuf->start %= cbuf->maxlen;
237 }
238 else {
239 cbuf->start += size;
240 cbuf->start %= cbuf->maxlen;
241 }
242 return 0;
243}
244
245/* buffer del */
246

Calls

no outgoing calls