Lines Matching refs:idx

32     size_t idx[2]; /* 0: head, 1: tail */  member
42 r->idx[0] = r->idx[1] = r->count = 0; in ring_buf_init()
62 static void ring_buf_head_tail(struct ring_buf *r, int idx, uint8_t **buf, size_t *len) in ring_buf_head_tail() argument
64 size_t max_len = r->len - r->idx[idx]; in ring_buf_head_tail()
66 if (idx == 0 && max_len > r->len - r->count) in ring_buf_head_tail()
68 if (idx == 1 && max_len > r->count) in ring_buf_head_tail()
71 *buf = (uint8_t *)r->start + r->idx[idx]; in ring_buf_head_tail()
82 static void ring_buf_push_pop(struct ring_buf *r, int idx, size_t num_bytes) in ring_buf_push_pop() argument
90 if (!ossl_assert(num_bytes <= r->len - r->idx[idx])) in ring_buf_push_pop()
96 if (!ossl_assert(idx != 0 ? num_bytes <= r->count in ring_buf_push_pop()
101 new_idx = r->idx[idx] + num_bytes; in ring_buf_push_pop()
105 r->idx[idx] = new_idx; in ring_buf_push_pop()
106 if (idx != 0) in ring_buf_push_pop()
117 r->idx[0] = r->idx[1] = r->count = 0; in ring_buf_clear()
140 if (r->idx[0] <= r->idx[1]) { in ring_buf_resize()
143 memmove(new_start + r->idx[1] + offset, new_start + r->idx[1], in ring_buf_resize()
144 r->len - r->idx[1]); in ring_buf_resize()
145 r->idx[1] += offset; in ring_buf_resize()
149 r->idx[0] = r->idx[1] = 0; in ring_buf_resize()
507 saved_idx = readb->rbuf.idx[1]; in dgram_pair_ctrl_pending()
512 readb->rbuf.idx[1] = saved_idx; in dgram_pair_ctrl_pending()
906 saved_idx = readb->rbuf.idx[1]; in dgram_pair_read_actual()
930 readb->rbuf.idx[1] = saved_idx; in dgram_pair_read_actual()
1235 saved_idx = b->rbuf.idx[0]; in dgram_pair_write_actual()
1243 b->rbuf.idx[0] = saved_idx; in dgram_pair_write_actual()