MEDIUM: pattern/acl: get rid of temp_pattern in ACLs

This one is not needed anymore as we can return the data and its type in the
sample provided by the caller. ACLs now always return the proper type. BOOL
is already returned when the result is expected to be processed as a boolean.

temp_pattern has been unexported now.
diff --git a/src/session.c b/src/session.c
index 54bd7a0..b4c0a82 100644
--- a/src/session.c
+++ b/src/session.c
@@ -2311,12 +2311,13 @@
 acl_fetch_get_gpc0(struct stktable *table, struct sample *smp, struct stksess *ts)
 {
 	smp->flags = SMP_F_VOL_TEST;
-	temp_pattern.data.uint = 0;
+	smp->type = SMP_T_UINT;
+	smp->data.uint = 0;
 	if (ts != NULL) {
 		void *ptr = stktable_data_ptr(table, ts, STKTABLE_DT_GPC0);
 		if (!ptr)
 			return 0; /* parameter not stored */
-		temp_pattern.data.uint = stktable_data_cast(ptr, gpc0);
+		smp->data.uint = stktable_data_cast(ptr, gpc0);
 	}
 	return 1;
 }
@@ -2370,12 +2371,13 @@
 acl_fetch_inc_gpc0(struct stktable *table, struct sample *smp, struct stksess *ts)
 {
 	smp->flags = SMP_F_VOL_TEST;
-	temp_pattern.data.uint = 0;
+	smp->type = SMP_T_UINT;
+	smp->data.uint = 0;
 	if (ts != NULL) {
 		void *ptr = stktable_data_ptr(table, ts, STKTABLE_DT_GPC0);
 		if (!ptr)
 			return 0; /* parameter not stored */
-		temp_pattern.data.uint = ++stktable_data_cast(ptr, gpc0);
+		smp->data.uint = ++stktable_data_cast(ptr, gpc0);
 	}
 	return 1;
 }
@@ -2429,12 +2431,13 @@
 acl_fetch_clr_gpc0(struct stktable *table, struct sample *smp, struct stksess *ts)
 {
 	smp->flags = SMP_F_VOL_TEST;
-	temp_pattern.data.uint = 0;
+	smp->type = SMP_T_UINT;
+	smp->data.uint = 0;
 	if (ts != NULL) {
 		void *ptr = stktable_data_ptr(table, ts, STKTABLE_DT_GPC0);
 		if (!ptr)
 			return 0; /* parameter not stored */
-		temp_pattern.data.uint = stktable_data_cast(ptr, gpc0);
+		smp->data.uint = stktable_data_cast(ptr, gpc0);
 		stktable_data_cast(ptr, gpc0) = 0;
 	}
 	return 1;
@@ -2487,12 +2490,13 @@
 acl_fetch_conn_cnt(struct stktable *table, struct sample *smp, struct stksess *ts)
 {
 	smp->flags = SMP_F_VOL_TEST;
-	temp_pattern.data.uint = 0;
+	smp->type = SMP_T_UINT;
+	smp->data.uint = 0;
 	if (ts != NULL) {
 		void *ptr = stktable_data_ptr(table, ts, STKTABLE_DT_CONN_CNT);
 		if (!ptr)
 			return 0; /* parameter not stored */
-		temp_pattern.data.uint = stktable_data_cast(ptr, conn_cnt);
+		smp->data.uint = stktable_data_cast(ptr, conn_cnt);
 	}
 	return 1;
 }
@@ -2542,12 +2546,13 @@
 acl_fetch_conn_rate(struct stktable *table, struct sample *smp, struct stksess *ts)
 {
 	smp->flags = SMP_F_VOL_TEST;
-	temp_pattern.data.uint = 0;
+	smp->type = SMP_T_UINT;
+	smp->data.uint = 0;
 	if (ts != NULL) {
 		void *ptr = stktable_data_ptr(table, ts, STKTABLE_DT_CONN_RATE);
 		if (!ptr)
 			return 0; /* parameter not stored */
-		temp_pattern.data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, conn_rate),
+		smp->data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, conn_rate),
 					       table->data_arg[STKTABLE_DT_CONN_RATE].u);
 	}
 	return 1;
@@ -2623,7 +2628,8 @@
 	if (!ptr)
 		return 0; /* parameter not stored in this table */
 
-	temp_pattern.data.uint = ++stktable_data_cast(ptr, conn_cnt);
+	smp->type = SMP_T_UINT;
+	smp->data.uint = ++stktable_data_cast(ptr, conn_cnt);
 	smp->flags = SMP_F_VOL_TEST;
 	return 1;
 }
@@ -2633,13 +2639,14 @@
 acl_fetch_conn_cur(struct stktable *table, struct sample *smp, struct stksess *ts)
 {
 	smp->flags = SMP_F_VOL_TEST;
-	temp_pattern.data.uint = 0;
+	smp->type = SMP_T_UINT;
+	smp->data.uint = 0;
 
 	if (ts != NULL) {
 		void *ptr = stktable_data_ptr(table, ts, STKTABLE_DT_CONN_CUR);
 		if (!ptr)
 			return 0; /* parameter not stored */
-		temp_pattern.data.uint = stktable_data_cast(ptr, conn_cur);
+		smp->data.uint = stktable_data_cast(ptr, conn_cur);
 	}
 	return 1;
 }
@@ -2689,12 +2696,13 @@
 acl_fetch_sess_cnt(struct stktable *table, struct sample *smp, struct stksess *ts)
 {
 	smp->flags = SMP_F_VOL_TEST;
-	temp_pattern.data.uint = 0;
+	smp->type = SMP_T_UINT;
+	smp->data.uint = 0;
 	if (ts != NULL) {
 		void *ptr = stktable_data_ptr(table, ts, STKTABLE_DT_SESS_CNT);
 		if (!ptr)
 			return 0; /* parameter not stored */
-		temp_pattern.data.uint = stktable_data_cast(ptr, sess_cnt);
+		smp->data.uint = stktable_data_cast(ptr, sess_cnt);
 	}
 	return 1;
 }
@@ -2744,12 +2752,13 @@
 acl_fetch_sess_rate(struct stktable *table, struct sample *smp, struct stksess *ts)
 {
 	smp->flags = SMP_F_VOL_TEST;
-	temp_pattern.data.uint = 0;
+	smp->type = SMP_T_UINT;
+	smp->data.uint = 0;
 	if (ts != NULL) {
 		void *ptr = stktable_data_ptr(table, ts, STKTABLE_DT_SESS_RATE);
 		if (!ptr)
 			return 0; /* parameter not stored */
-		temp_pattern.data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, sess_rate),
+		smp->data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, sess_rate),
 					       table->data_arg[STKTABLE_DT_SESS_RATE].u);
 	}
 	return 1;
@@ -2804,12 +2813,13 @@
 acl_fetch_http_req_cnt(struct stktable *table, struct sample *smp, struct stksess *ts)
 {
 	smp->flags = SMP_F_VOL_TEST;
-	temp_pattern.data.uint = 0;
+	smp->type = SMP_T_UINT;
+	smp->data.uint = 0;
 	if (ts != NULL) {
 		void *ptr = stktable_data_ptr(table, ts, STKTABLE_DT_HTTP_REQ_CNT);
 		if (!ptr)
 			return 0; /* parameter not stored */
-		temp_pattern.data.uint = stktable_data_cast(ptr, http_req_cnt);
+		smp->data.uint = stktable_data_cast(ptr, http_req_cnt);
 	}
 	return 1;
 }
@@ -2859,12 +2869,13 @@
 acl_fetch_http_req_rate(struct stktable *table, struct sample *smp, struct stksess *ts)
 {
 	smp->flags = SMP_F_VOL_TEST;
-	temp_pattern.data.uint = 0;
+	smp->type = SMP_T_UINT;
+	smp->data.uint = 0;
 	if (ts != NULL) {
 		void *ptr = stktable_data_ptr(table, ts, STKTABLE_DT_HTTP_REQ_RATE);
 		if (!ptr)
 			return 0; /* parameter not stored */
-		temp_pattern.data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, http_req_rate),
+		smp->data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, http_req_rate),
 					       table->data_arg[STKTABLE_DT_HTTP_REQ_RATE].u);
 	}
 	return 1;
@@ -2919,12 +2930,13 @@
 acl_fetch_http_err_cnt(struct stktable *table, struct sample *smp, struct stksess *ts)
 {
 	smp->flags = SMP_F_VOL_TEST;
-	temp_pattern.data.uint = 0;
+	smp->type = SMP_T_UINT;
+	smp->data.uint = 0;
 	if (ts != NULL) {
 		void *ptr = stktable_data_ptr(table, ts, STKTABLE_DT_HTTP_ERR_CNT);
 		if (!ptr)
 			return 0; /* parameter not stored */
-		temp_pattern.data.uint = stktable_data_cast(ptr, http_err_cnt);
+		smp->data.uint = stktable_data_cast(ptr, http_err_cnt);
 	}
 	return 1;
 }
@@ -2974,12 +2986,13 @@
 acl_fetch_http_err_rate(struct stktable *table, struct sample *smp, struct stksess *ts)
 {
 	smp->flags = SMP_F_VOL_TEST;
-	temp_pattern.data.uint = 0;
+	smp->type = SMP_T_UINT;
+	smp->data.uint = 0;
 	if (ts != NULL) {
 		void *ptr = stktable_data_ptr(table, ts, STKTABLE_DT_HTTP_ERR_RATE);
 		if (!ptr)
 			return 0; /* parameter not stored */
-		temp_pattern.data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, http_err_rate),
+		smp->data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, http_err_rate),
 					       table->data_arg[STKTABLE_DT_HTTP_ERR_RATE].u);
 	}
 	return 1;
@@ -3034,13 +3047,14 @@
 acl_fetch_kbytes_in(struct stktable *table, struct sample *smp, struct stksess *ts)
 {
 	smp->flags = SMP_F_VOL_TEST;
-	temp_pattern.data.uint = 0;
+	smp->type = SMP_T_UINT;
+	smp->data.uint = 0;
 
 	if (ts != NULL) {
 		void *ptr = stktable_data_ptr(table, ts, STKTABLE_DT_BYTES_IN_CNT);
 		if (!ptr)
 			return 0; /* parameter not stored */
-		temp_pattern.data.uint = stktable_data_cast(ptr, bytes_in_cnt) >> 10;
+		smp->data.uint = stktable_data_cast(ptr, bytes_in_cnt) >> 10;
 	}
 	return 1;
 }
@@ -3096,12 +3110,13 @@
 acl_fetch_bytes_in_rate(struct stktable *table, struct sample *smp, struct stksess *ts)
 {
 	smp->flags = SMP_F_VOL_TEST;
-	temp_pattern.data.uint = 0;
+	smp->type = SMP_T_UINT;
+	smp->data.uint = 0;
 	if (ts != NULL) {
 		void *ptr = stktable_data_ptr(table, ts, STKTABLE_DT_BYTES_IN_RATE);
 		if (!ptr)
 			return 0; /* parameter not stored */
-		temp_pattern.data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, bytes_in_rate),
+		smp->data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, bytes_in_rate),
 					       table->data_arg[STKTABLE_DT_BYTES_IN_RATE].u);
 	}
 	return 1;
@@ -3156,13 +3171,14 @@
 acl_fetch_kbytes_out(struct stktable *table, struct sample *smp, struct stksess *ts)
 {
 	smp->flags = SMP_F_VOL_TEST;
-	temp_pattern.data.uint = 0;
+	smp->type = SMP_T_UINT;
+	smp->data.uint = 0;
 
 	if (ts != NULL) {
 		void *ptr = stktable_data_ptr(table, ts, STKTABLE_DT_BYTES_OUT_CNT);
 		if (!ptr)
 			return 0; /* parameter not stored */
-		temp_pattern.data.uint = stktable_data_cast(ptr, bytes_out_cnt) >> 10;
+		smp->data.uint = stktable_data_cast(ptr, bytes_out_cnt) >> 10;
 	}
 	return 1;
 }
@@ -3218,12 +3234,13 @@
 acl_fetch_bytes_out_rate(struct stktable *table, struct sample *smp, struct stksess *ts)
 {
 	smp->flags = SMP_F_VOL_TEST;
-	temp_pattern.data.uint = 0;
+	smp->type = SMP_T_UINT;
+	smp->data.uint = 0;
 	if (ts != NULL) {
 		void *ptr = stktable_data_ptr(table, ts, STKTABLE_DT_BYTES_OUT_RATE);
 		if (!ptr)
 			return 0; /* parameter not stored */
-		temp_pattern.data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, bytes_out_rate),
+		smp->data.uint = read_freq_ctr_period(&stktable_data_cast(ptr, bytes_out_rate),
 					       table->data_arg[STKTABLE_DT_BYTES_OUT_RATE].u);
 	}
 	return 1;
@@ -3281,7 +3298,8 @@
                     struct acl_expr *expr, struct sample *smp)
 {
 	smp->flags = SMP_F_VOL_TEST;
-	temp_pattern.data.uint = expr->args->data.prx->table.current;
+	smp->type = SMP_T_UINT;
+	smp->data.uint = expr->args->data.prx->table.current;
 	return 1;
 }
 
@@ -3294,7 +3312,8 @@
 {
 	px = expr->args->data.prx;
 	smp->flags = SMP_F_VOL_TEST;
-	temp_pattern.data.uint = px->table.size - px->table.current;
+	smp->type = SMP_T_UINT;
+	smp->data.uint = px->table.size - px->table.current;
 	return 1;
 }