Lines Matching full:head
16 /* set mb->head and mb->tail so the buffers look empty */ in membuff_purge()
17 mb->head = mb->start; in membuff_purge()
26 /* always write to 'mb->head' */ in membuff_putrawflex()
29 *offsetp = mb->head - mb->start; in membuff_putrawflex()
36 * if head is ahead of tail, we can write from head until the end of in membuff_putrawflex()
39 if (mb->head >= mb->tail) { in membuff_putrawflex()
41 len = mb->end - mb->head - 1; in membuff_putrawflex()
45 /* update the head pointer to mark these bytes as written */ in membuff_putrawflex()
47 mb->head += len; in membuff_putrawflex()
56 mb->head = mb->start; in membuff_putrawflex()
59 /* otherwise now we can write until head almost reaches tail */ in membuff_putrawflex()
62 len = mb->tail - mb->head - 1; in membuff_putrawflex()
66 /* update the head pointer to mark these bytes as written */ in membuff_putrawflex()
68 mb->head += len; in membuff_putrawflex()
106 * in this case head is ahead of tail, so we must return data between in membuff_getraw()
107 *'tail' and 'head' in membuff_getraw()
109 if (mb->head > mb->tail) { in membuff_getraw()
112 len = mb->head - mb->tail; in membuff_getraw()
124 * if head is before tail, then we have data between 'tail' and 'end' in membuff_getraw()
125 * and some more data between 'start' and 'head'(which we can't in membuff_getraw()
128 else if (mb->head < mb->tail) { in membuff_getraw()
141 debug("getraw: maxlen=%d, update=%d, head=%d, tail=%d, data=%d, len=%d", in membuff_getraw()
142 maxlen, update, (int)(mb->head - mb->start), in membuff_getraw()
208 return mb->head == mb->tail; in membuff_isempty()
237 debug("makecontig: head=%d, tail=%d, size=%d", in membuff_makecontig()
238 (int)(mb->head - mb->start), (int)(mb->tail - mb->start), in membuff_makecontig()
245 if (mb->tail > mb->head) { in membuff_makecontig()
247 * the data is split into two parts, from 0 to ->head and in membuff_makecontig()
248 * from ->tail to ->end. We move the stuff from 0 to ->head in membuff_makecontig()
252 botsize = mb->head - mb->start; in membuff_makecontig()
258 if (mb->head + topsize >= mb->tail) in membuff_makecontig()
265 topsize = mb->head - mb->tail; in membuff_makecontig()
275 mb->head = mb->start + topsize + botsize; in membuff_makecontig()
277 debug(" - head=%d, tail=%d", (int)(mb->head - mb->start), in membuff_makecontig()
297 end = mb->head >= mb->tail ? mb->head : mb->end; in membuff_readline()
305 if (s == end && mb->tail > mb->head) { in membuff_readline()
307 end = mb->head; in membuff_readline()
343 oldhead = mb->head - mb->start; in membuff_extend_by()
349 mb->head = mb->start + oldhead; in membuff_extend_by()
352 if (mb->head < mb->tail) { in membuff_extend_by()