MINOR: channel/buffer: replace b_{adv,rew} with c_{adv,rew}

These ones manipulate the output data count which will be specific to
the channel soon, so prepare the call points to use the channel only.
The b_* functions are now unused and were removed.
diff --git a/src/backend.c b/src/backend.c
index 8473efb..70972b4 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -485,12 +485,12 @@
 
 	memset(&smp, 0, sizeof(smp));
 
-	b_rew(s->req.buf, rewind = s->req.buf->o);
+	c_rew(&s->req, rewind = s->req.buf->o);
 
 	ret = fetch_rdp_cookie_name(s, &smp, px->hh_name, px->hh_len);
 	len = smp.data.u.str.len;
 
-	b_adv(s->req.buf, rewind);
+	c_adv(&s->req, rewind);
 
 	if (ret == 0 || (smp.flags & SMP_F_MAY_CHANGE) || len == 0)
 		return NULL;
@@ -1020,13 +1020,13 @@
 			((struct sockaddr_in *)&srv_conn->addr.from)->sin_port = 0;
 			((struct sockaddr_in *)&srv_conn->addr.from)->sin_addr.s_addr = 0;
 
-			b_rew(s->req.buf, rewind = http_hdr_rewind(&s->txn->req));
+			c_rew(&s->req, rewind = http_hdr_rewind(&s->txn->req));
 			if (http_get_hdr(&s->txn->req, src->bind_hdr_name, src->bind_hdr_len,
 					 &s->txn->hdr_idx, src->bind_hdr_occ, NULL, &vptr, &vlen)) {
 				((struct sockaddr_in *)&srv_conn->addr.from)->sin_addr.s_addr =
 					htonl(inetaddr_host_lim(vptr, vptr + vlen));
 			}
-			b_adv(s->req.buf, rewind);
+			c_adv(&s->req, rewind);
 		}
 		break;
 	default:
@@ -1261,12 +1261,12 @@
 			 * output data.
 			 */
 			rewind = s->txn ? http_hdr_rewind(&s->txn->req) : s->req.buf->o;
-			b_rew(s->req.buf, rewind);
+			c_rew(&s->req, rewind);
 
 			smp = sample_fetch_as_type(s->be, s->sess, s, SMP_OPT_DIR_REQ | SMP_OPT_FINAL, srv->ssl_ctx.sni, SMP_T_STR);
 
 			/* restore the pointers */
-			b_adv(s->req.buf, rewind);
+			c_adv(&s->req, rewind);
 
 			if (smp_make_safe(smp)) {
 				ssl_sock_set_servername(srv_conn, smp->data.u.str.str);
diff --git a/src/cache.c b/src/cache.c
index c72d9de..aec9ba6 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -221,13 +221,13 @@
 				pool_free(pool_head_cache_st, st);
 			} else {
 				/* Skip remaining headers to fill the cache */
-				b_adv(msg->chn->buf, st->hdrs_len);
+				c_adv(msg->chn, st->hdrs_len);
 				ret = shctx_row_data_append(shctx,
 							    st->first_block,
 							    (unsigned char *)bi_ptr(msg->chn->buf),
 							    MIN(bi_contig_data(msg->chn->buf), len - st->hdrs_len));
 				/* Rewind the buffer to forward all data */
-				b_rew(msg->chn->buf, st->hdrs_len);
+				c_rew(msg->chn, st->hdrs_len);
 				st->hdrs_len = 0;
 				if (ret)
 					goto disable_cache;
diff --git a/src/channel.c b/src/channel.c
index 7235ffc..0ddfc6f 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -38,7 +38,7 @@
 	 * regular code paths.
 	 */
 	if (unlikely(chn->to_forward == CHN_INFINITE_FORWARD)) {
-		b_adv(chn->buf, chn->buf->i);
+		c_adv(chn, chn->buf->i);
 		return bytes;
 	}
 
@@ -49,7 +49,7 @@
 
 	/* transfer as much as we can of buf->i */
 	forwarded = MIN(chn->buf->i, budget);
-	b_adv(chn->buf, forwarded);
+	c_adv(chn, forwarded);
 	budget -= forwarded;
 
 	if (!budget)
@@ -125,7 +125,7 @@
 	if (chn->to_forward >= 1) {
 		if (chn->to_forward != CHN_INFINITE_FORWARD)
 			chn->to_forward--;
-		b_adv(chn->buf, 1);
+		c_adv(chn, 1);
 	}
 
 	chn->total++;
@@ -180,7 +180,7 @@
 				fwd = chn->to_forward;
 			chn->to_forward -= fwd;
 		}
-		b_adv(chn->buf, fwd);
+		c_adv(chn, fwd);
 	}
 
 	/* notify that some data was read from the SI into the buffer */
@@ -223,7 +223,7 @@
 				fwd = chn->to_forward;
 			chn->to_forward -= fwd;
 		}
-		b_adv(chn->buf, fwd);
+		c_adv(chn, fwd);
 	}
 
 	/* notify that some data was read from the SI into the buffer */
diff --git a/src/filters.c b/src/filters.c
index 1bd50c3..26bed64 100644
--- a/src/filters.c
+++ b/src/filters.c
@@ -1089,7 +1089,7 @@
 		goto end;
 
 	/* Consume data that all filters consider as forwarded. */
-	b_adv(chn->buf, ret);
+	c_adv(chn, ret);
 
 	/* Stop waiting data if the input in closed and no data is pending or if
 	 * the output is closed. */
diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c
index ca2ab7c..df59d7d 100644
--- a/src/flt_http_comp.c
+++ b/src/flt_http_comp.c
@@ -177,7 +177,8 @@
 comp_http_data(struct stream *s, struct filter *filter, struct http_msg *msg)
 {
 	struct comp_state *st = filter->ctx;
-	struct buffer     *buf = msg->chn->buf;
+	struct channel    *chn = msg->chn;
+	struct buffer     *buf = chn->buf;
 	unsigned int      *nxt = &flt_rsp_nxt(filter);
 	unsigned int       len;
 	int                ret;
@@ -190,9 +191,9 @@
 		unsigned int fwd = flt_rsp_fwd(filter) + st->hdrs_len;
 
 		b_reset(tmpbuf);
-		b_adv(buf, fwd);
+		c_adv(chn, fwd);
 		ret = http_compression_buffer_init(buf, zbuf);
-		b_rew(buf, fwd);
+		c_rew(chn, fwd);
 		if (ret < 0) {
 			msg->chn->flags |= CF_WAKE_WRITE;
 			return 0;
@@ -204,20 +205,20 @@
 
 		len = MIN(tmpbuf->size - buffer_len(tmpbuf), len);
 
-		b_adv(buf, *nxt);
+		c_adv(chn, *nxt);
 		block = bi_contig_data(buf);
 		memcpy(bi_end(tmpbuf), bi_ptr(buf), block);
 		if (len > block)
 			memcpy(bi_end(tmpbuf)+block, buf->data, len-block);
-		b_rew(buf, *nxt);
+		c_rew(chn, *nxt);
 
 		tmpbuf->i += len;
 		ret        = len;
 	}
 	else {
-		b_adv(buf, *nxt);
+		c_adv(chn, *nxt);
 		ret = http_compression_buffer_add_data(st, buf, zbuf, len);
-		b_rew(buf, *nxt);
+		c_rew(chn, *nxt);
 		if (ret < 0)
 			return ret;
 	}
@@ -237,13 +238,13 @@
 
 	if (!st->initialized) {
 		if (!st->finished) {
-			struct buffer *buf = msg->chn->buf;
+			struct channel *chn = msg->chn;
 			unsigned int   fwd = flt_rsp_fwd(filter) + st->hdrs_len;
 
 			b_reset(tmpbuf);
-			b_adv(buf, fwd);
-			http_compression_buffer_init(buf, zbuf);
-			b_rew(buf, fwd);
+			c_adv(chn, fwd);
+			http_compression_buffer_init(chn->buf, zbuf);
+			c_rew(chn, fwd);
 			st->initialized = 1;
 		}
 	}
@@ -305,9 +306,9 @@
 	}
 
 	st->consumed = len - st->hdrs_len - st->tlrs_len;
-	b_adv(msg->chn->buf, flt_rsp_fwd(filter) + st->hdrs_len);
+	c_adv(msg->chn, flt_rsp_fwd(filter) + st->hdrs_len);
 	ret = http_compression_buffer_end(st, s, msg->chn, &zbuf, msg->msg_state >= HTTP_MSG_TRAILERS);
-	b_rew(msg->chn->buf, flt_rsp_fwd(filter) + st->hdrs_len);
+	c_rew(msg->chn, flt_rsp_fwd(filter) + st->hdrs_len);
 	if (ret < 0)
 		return ret;
 
@@ -762,7 +763,7 @@
 	}
 
 	/* copy the remaining data in the tmp buffer. */
-	b_adv(ib, st->consumed);
+	c_adv(chn, st->consumed);
 	if (ib->i > 0) {
 		left = bi_contig_data(ib);
 		memcpy(ob->p + ob->i, bi_ptr(ib), left);
diff --git a/src/flt_trace.c b/src/flt_trace.c
index fa26de1..f088340 100644
--- a/src/flt_trace.c
+++ b/src/flt_trace.c
@@ -465,9 +465,9 @@
 		   FLT_NXT(filter, msg->chn), FLT_FWD(filter, msg->chn), ret);
 
 	if (conf->hexdump) {
-		b_adv(msg->chn->buf, FLT_FWD(filter, msg->chn));
+		c_adv(msg->chn, FLT_FWD(filter, msg->chn));
 		trace_hexdump(msg->chn->buf, ret);
-		b_rew(msg->chn->buf, FLT_FWD(filter, msg->chn));
+		c_rew(msg->chn, FLT_FWD(filter, msg->chn));
 	}
 
 	if ((ret != len) ||
@@ -515,9 +515,9 @@
 		   FLT_FWD(filter, chn), ret);
 
 	if (conf->hexdump) {
-		b_adv(chn->buf, FLT_FWD(filter, chn));
+		c_adv(chn, FLT_FWD(filter, chn));
 		trace_hexdump(chn->buf, ret);
-		b_rew(chn->buf, FLT_FWD(filter, chn));
+		c_rew(chn, FLT_FWD(filter, chn));
 	}
 
 	if (ret != len)
diff --git a/src/hlua.c b/src/hlua.c
index f817006..967f05e 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -3049,7 +3049,7 @@
 	/* buffer replace considers that the input part is filled.
 	 * so, I must forward these new data in the output part.
 	 */
-	b_adv(chn->buf, max);
+	c_adv(chn, max);
 
 	l += max;
 	lua_pop(L, 1);
diff --git a/src/proto_http.c b/src/proto_http.c
index 67598e5..a009d94 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -1108,12 +1108,12 @@
 	 * to temporarily rewind the buffer.
 	 */
 	txn = s->txn;
-	b_rew(s->req.buf, rewind = http_hdr_rewind(&txn->req));
+	c_rew(&s->req, rewind = http_hdr_rewind(&txn->req));
 
 	path = http_get_path(txn);
 	len = buffer_count(s->req.buf, path, b_ptr(s->req.buf, txn->req.sl.rq.u + txn->req.sl.rq.u_l));
 
-	b_adv(s->req.buf, rewind);
+	c_adv(&s->req, rewind);
 
 	if (!path)
 		return;
@@ -4251,7 +4251,7 @@
 	old_o = http_hdr_rewind(&txn->req);
 	if (old_o) {
 		/* The request was already skipped, let's restore it */
-		b_rew(chn->buf, old_o);
+		c_rew(chn, old_o);
 		txn->req.next += old_o;
 		txn->req.sov += old_o;
 	}
@@ -4278,7 +4278,7 @@
 		 * so we don't have to adjust ->sol.
 		 */
 		old_o += chn->buf->i - old_i;
-		b_adv(chn->buf, old_o);
+		c_adv(chn, old_o);
 		txn->req.next -= old_o;
 		txn->req.sov  -= old_o;
 	}
@@ -6289,7 +6289,7 @@
 	ret = FLT_STRM_DATA_CB(s, chn, flt_http_forward_data(s, msg, msg->next),
 			       /* default_ret */ msg->next,
 			       /* on_error    */ goto error);
-	b_adv(chn->buf, ret);
+	c_adv(chn, ret);
 	msg->next -= ret;
 	if (unlikely(!(chn->flags & CF_WROTE_DATA) || msg->sov > 0))
 		msg->sov -= ret;
@@ -6309,7 +6309,7 @@
 	ret = FLT_STRM_DATA_CB(s, chn, flt_http_forward_data(s, msg, msg->next),
 			       /* default_ret */ msg->next,
 			       /* on_error    */ goto error);
-	b_adv(chn->buf, ret);
+	c_adv(chn, ret);
 	msg->next -= ret;
 	if (!(chn->flags & CF_WROTE_DATA) || msg->sov > 0)
 		msg->sov -= ret;
@@ -6420,7 +6420,7 @@
 	ret = FLT_STRM_DATA_CB(s, chn, flt_http_forward_data(s, msg, msg->next),
 			  /* default_ret */ msg->next,
 			  /* on_error    */ goto error);
-	b_adv(chn->buf, ret);
+	c_adv(chn, ret);
 	msg->next -= ret;
 	if (unlikely(!(chn->flags & CF_WROTE_DATA) || msg->sov > 0))
 		msg->sov -= ret;
@@ -6439,7 +6439,7 @@
 	ret = FLT_STRM_DATA_CB(s, chn, flt_http_forward_data(s, msg, msg->next),
 			  /* default_ret */ msg->next,
 			  /* on_error    */ goto error);
-	b_adv(chn->buf, ret);
+	c_adv(chn, ret);
 	msg->next -= ret;
 	if (!(chn->flags & CF_WROTE_DATA) || msg->sov > 0)
 		msg->sov -= ret;
diff --git a/src/stream_interface.c b/src/stream_interface.c
index a78694f..62cbf71 100644
--- a/src/stream_interface.c
+++ b/src/stream_interface.c
@@ -1203,7 +1203,7 @@
 					fwd = ic->to_forward;
 				ic->to_forward -= fwd;
 			}
-			b_adv(ic->buf, fwd);
+			c_adv(ic, fwd);
 		}
 
 		ic->flags |= CF_READ_PARTIAL;