[master] ea96fd332 Rename vtc::h2's `struct txt` in preparation for #3659
Poul-Henning Kamp
phk at FreeBSD.org
Tue Aug 17 06:29:05 UTC 2021
commit ea96fd3322352bba0dfbe067b70ac7ef80c7e8ed
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Tue Aug 17 06:27:35 2021 +0000
Rename vtc::h2's `struct txt` in preparation for #3659
diff --git a/bin/varnishtest/hpack.h b/bin/varnishtest/hpack.h
index c9d55977b..c38fc4d90 100644
--- a/bin/varnishtest/hpack.h
+++ b/bin/varnishtest/hpack.h
@@ -44,15 +44,15 @@ enum hpk_indexed {
hpk_never,
};
-struct txt {
+struct hpk_txt {
char *ptr;
int len;
int huff;
};
struct hpk_hdr {
- struct txt key;
- struct txt value;
+ struct hpk_txt key;
+ struct hpk_txt value;
enum hpk_indexed t;
unsigned i;
};
diff --git a/bin/varnishtest/vtc_h2_hpack.c b/bin/varnishtest/vtc_h2_hpack.c
index 64b5d0360..085741323 100644
--- a/bin/varnishtest/vtc_h2_hpack.c
+++ b/bin/varnishtest/vtc_h2_hpack.c
@@ -227,7 +227,7 @@ num_encode(struct hpk_iter *iter, uint8_t prefix, uint32_t num)
}
static enum hpk_result
-str_encode(struct hpk_iter *iter, const struct txt *t)
+str_encode(struct hpk_iter *iter, const struct hpk_txt *t)
{
int slen = huff_simulate(t->ptr, t->len, t->huff);
assert(iter->buf < iter->end);
@@ -252,7 +252,7 @@ str_encode(struct hpk_iter *iter, const struct txt *t)
}
static enum hpk_result
-str_decode(struct hpk_iter *iter, struct txt *t)
+str_decode(struct hpk_iter *iter, struct hpk_txt *t)
{
uint32_t num;
int huff;
@@ -292,7 +292,7 @@ str_decode(struct hpk_iter *iter, struct txt *t)
}
static inline void
-txtcpy(struct txt *to, const struct txt *from)
+txtcpy(struct hpk_txt *to, const struct hpk_txt *from)
{
//AZ(to->ptr);
to->ptr = malloc(from->len + 1L);
@@ -311,7 +311,7 @@ enum hpk_result
HPK_DecHdr(struct hpk_iter *iter, struct hpk_hdr *header)
{
int pref = 0;
- const struct txt *t;
+ const struct hpk_txt *t;
uint32_t num;
int must_index = 0;
assert(iter);
diff --git a/bin/varnishtest/vtc_h2_priv.h b/bin/varnishtest/vtc_h2_priv.h
index 683d020b3..48221f86e 100644
--- a/bin/varnishtest/vtc_h2_priv.h
+++ b/bin/varnishtest/vtc_h2_priv.h
@@ -44,7 +44,7 @@ struct hpk_iter {
uint8_t *end;
};
-const struct txt * tbl_get_key(const struct hpk_ctx *ctx, uint32_t index);
+const struct hpk_txt * tbl_get_key(const struct hpk_ctx *ctx, uint32_t index);
-const struct txt * tbl_get_value(const struct hpk_ctx *ctx, uint32_t index);
+const struct hpk_txt * tbl_get_value(const struct hpk_ctx *ctx, uint32_t index);
void push_header (struct hpk_ctx *ctx, const struct hpk_hdr *h);
diff --git a/bin/varnishtest/vtc_h2_tbl.c b/bin/varnishtest/vtc_h2_tbl.c
index 5a5234254..658e9bc4b 100644
--- a/bin/varnishtest/vtc_h2_tbl.c
+++ b/bin/varnishtest/vtc_h2_tbl.c
@@ -179,7 +179,7 @@ HPK_ResizeTbl(struct hpk_ctx *ctx, uint32_t num)
return (hpk_done);
}
-static const struct txt *
+static const struct hpk_txt *
tbl_get_field(const struct hpk_ctx *ctx, uint32_t idx, int key)
{
struct dynhdr *dh;
@@ -206,13 +206,13 @@ tbl_get_field(const struct hpk_ctx *ctx, uint32_t idx, int key)
return (NULL);
}
-const struct txt *
+const struct hpk_txt *
tbl_get_key(const struct hpk_ctx *ctx, uint32_t idx)
{
return (tbl_get_field(ctx, idx, 1));
}
-const struct txt *
+const struct hpk_txt *
tbl_get_value(const struct hpk_ctx *ctx, uint32_t idx)
{
return (tbl_get_field(ctx, idx, 0));
More information about the varnish-commit
mailing list