mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-17 16:32:11 +01:00
Remove the wuffs_foo__status types
This commit is contained in:
1 parent
699bae15d2
commit
d770e879ab
28 files changed
+221
-361
No files matched your search
@@ -325,7 +325,6 @@ func (g *gen) genHeader(b *buffer) error {
|
||||
|
||||
b.writes("// ---------------- Status Codes\n\n")
|
||||
|
||||
b.printf("typedef int32_t %sstatus;\n\n", g.pkgPrefix)
|
||||
pkgID := g.checker.PackageID()
|
||||
b.printf("#define %spackageid %d // 0x%08X\n\n", g.pkgPrefix, pkgID, pkgID)
|
||||
|
||||
@@ -350,8 +349,7 @@ func (g *gen) genHeader(b *buffer) error {
|
||||
}
|
||||
b.writes("\n")
|
||||
|
||||
b.printf("bool %sstatus__is_error(%sstatus s);\n\n", g.pkgPrefix, g.pkgPrefix)
|
||||
b.printf("const char* %sstatus__string(%sstatus s);\n\n", g.pkgPrefix, g.pkgPrefix)
|
||||
b.printf("const char* %sstatus__string(wuffs_base__status s);\n\n", g.pkgPrefix)
|
||||
|
||||
b.writes("// ---------------- Public Consts\n\n")
|
||||
if err := g.forEachConst(b, pubOnly, (*gen).writeConst); err != nil {
|
||||
@@ -389,7 +387,6 @@ func (g *gen) genImpl(b *buffer) error {
|
||||
b.writeb('\n')
|
||||
|
||||
b.writes("// ---------------- Status Codes Implementations\n\n")
|
||||
b.printf("bool %sstatus__is_error(%sstatus s) { return s < 0; }\n\n", g.pkgPrefix, g.pkgPrefix)
|
||||
|
||||
{
|
||||
messages := [256]string{}
|
||||
@@ -401,7 +398,7 @@ func (g *gen) genImpl(b *buffer) error {
|
||||
}
|
||||
}
|
||||
|
||||
b.printf("const char* %sstatus__string(%sstatus s) {\n", g.pkgPrefix, g.pkgPrefix)
|
||||
b.printf("const char* %sstatus__string(wuffs_base__status s) {\n", g.pkgPrefix)
|
||||
b.printf("uint16_t o;")
|
||||
b.printf("switch (s & 0x%X) {\n", (1<<base38.MaxBits)-1)
|
||||
b.printf("case 0: return wuffs_base__status__string(s);\n")
|
||||
@@ -641,7 +638,7 @@ func (g *gen) writeStruct(b *buffer, n *a.Struct) error {
|
||||
b.writes("// It is a struct, not a struct*, so that it can be stack allocated.\n")
|
||||
b.writes("struct {\n")
|
||||
if n.Suspendible() {
|
||||
b.printf("%sstatus status;\n", g.pkgPrefix)
|
||||
b.printf("wuffs_base__status status;\n")
|
||||
b.writes("uint32_t magic;\n")
|
||||
b.writes("\n")
|
||||
}
|
||||
|
||||
@@ -411,12 +411,7 @@ func (g *gen) writeCTypeName(b *buffer, n *a.TypeExpr, varNamePrefix string, var
|
||||
}
|
||||
|
||||
func (g *gen) packagePrefix(qid t.QID) string {
|
||||
if qid == (t.QID{t.IDBase, t.IDStatus}) {
|
||||
// No-op: special case "base.status" as being inside this package.
|
||||
//
|
||||
// TODO: change "base.status" in Wuffs code to just "status"? Or
|
||||
// change the C code's "wuffs_foo__status" to "wuffs_base__status"?
|
||||
} else if qid[0] != 0 {
|
||||
if qid[0] != 0 {
|
||||
otherPkg := g.tm.ByID(qid[0])
|
||||
// TODO: map the "deflate" in "deflate.decoder" to the "deflate" in
|
||||
// `use "std/deflate"`, and use the latter "deflate".
|
||||
|
||||
@@ -76,7 +76,7 @@ func (g *gen) writeFuncSignature(b *buffer, n *a.Func) error {
|
||||
|
||||
// TODO: write n's return values.
|
||||
if n.Suspendible() {
|
||||
b.printf("%sstatus ", g.pkgPrefix)
|
||||
b.writes("wuffs_base__status ")
|
||||
} else if outFields := n.Out().Fields(); len(outFields) == 0 {
|
||||
b.writes("void ")
|
||||
} else if len(outFields) == 1 {
|
||||
@@ -217,7 +217,7 @@ func (g *gen) writeFuncImplHeader(b *buffer) error {
|
||||
}
|
||||
|
||||
if g.currFunk.suspendible {
|
||||
b.printf("%sstatus status = %sSTATUS_OK;\n", g.pkgPrefix, g.PKGPREFIX)
|
||||
b.printf("wuffs_base__status status = WUFFS_BASE__STATUS_OK;\n")
|
||||
}
|
||||
b.writes("\n")
|
||||
|
||||
|
||||
@@ -579,7 +579,7 @@ func (g *gen) writeCallSuspendibles(b *buffer, n *a.Expr, depth uint32) error {
|
||||
temp := g.currFunk.tempW
|
||||
g.currFunk.tempW++
|
||||
|
||||
b.printf("%sstatus %s%d = ", g.pkgPrefix, tPrefix, temp)
|
||||
b.printf("wuffs_base__status %s%d = ", tPrefix, temp)
|
||||
} else {
|
||||
b.writes("status = ")
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ const char* play() {
|
||||
|
||||
wuffs_base__image_buffer ib = ((wuffs_base__image_buffer){});
|
||||
wuffs_base__image_config ic = ((wuffs_base__image_config){});
|
||||
wuffs_gif__status s =
|
||||
wuffs_base__status s =
|
||||
wuffs_gif__decoder__decode_config(&dec, &ic, src_reader);
|
||||
if (s) {
|
||||
return wuffs_gif__status__string(s);
|
||||
|
||||
@@ -61,7 +61,7 @@ static const char* decode() {
|
||||
|
||||
wuffs_deflate__decoder dec = ((wuffs_deflate__decoder){});
|
||||
wuffs_deflate__decoder__check_wuffs_version(&dec, sizeof dec, WUFFS_VERSION);
|
||||
wuffs_deflate__status s =
|
||||
wuffs_base__status s =
|
||||
wuffs_deflate__decoder__decode(&dec, dst_writer, src_reader);
|
||||
if (s) {
|
||||
return wuffs_deflate__status__string(s);
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ static const char* decode() {
|
||||
wuffs_base__io_buffer dst =
|
||||
((wuffs_base__io_buffer){.ptr = dst_buffer, .len = DST_BUFFER_SIZE});
|
||||
wuffs_base__io_writer dst_writer = wuffs_base__io_buffer__writer(&dst);
|
||||
wuffs_gzip__status s =
|
||||
wuffs_base__status s =
|
||||
wuffs_gzip__decoder__decode(&dec, dst_writer, src_reader);
|
||||
|
||||
if (dst.wi) {
|
||||
|
||||
@@ -47,7 +47,7 @@ const char* fuzz(wuffs_base__io_reader src_reader, uint32_t hash) {
|
||||
// Use a {} code block so that "goto exit" doesn't trigger "jump bypasses
|
||||
// variable initialization" warnings.
|
||||
{
|
||||
wuffs_gif__status s = 0;
|
||||
wuffs_base__status s = 0;
|
||||
wuffs_gif__decoder dec = ((wuffs_gif__decoder){});
|
||||
wuffs_gif__decoder__check_wuffs_version(&dec, sizeof dec, WUFFS_VERSION);
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ It should print "PASS", amongst other information, and exit(0).
|
||||
|
||||
const char* fuzz(wuffs_base__io_reader src_reader, uint32_t hash) {
|
||||
const char* ret = NULL;
|
||||
wuffs_zlib__status s = 0;
|
||||
wuffs_base__status s = 0;
|
||||
wuffs_zlib__decoder dec = ((wuffs_zlib__decoder){});
|
||||
wuffs_zlib__decoder__check_wuffs_version(&dec, sizeof dec, WUFFS_VERSION);
|
||||
|
||||
|
||||
+3
-11
@@ -1269,8 +1269,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_adler32__status;
|
||||
|
||||
#define wuffs_adler32__packageid 681002 // 0x000A642A
|
||||
|
||||
#define WUFFS_ADLER32__STATUS_OK 0 // 0x00000000
|
||||
@@ -1292,9 +1290,7 @@ typedef int32_t wuffs_adler32__status;
|
||||
#define WUFFS_ADLER32__ERROR_INVALID_CALL_SEQUENCE -301989888 // 0xEE000000
|
||||
#define WUFFS_ADLER32__SUSPENSION_END_OF_DATA 16777216 // 0x01000000
|
||||
|
||||
bool wuffs_adler32__status__is_error(wuffs_adler32__status s);
|
||||
|
||||
const char* wuffs_adler32__status__string(wuffs_adler32__status s);
|
||||
const char* wuffs_adler32__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1309,7 +1305,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_adler32__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_state;
|
||||
@@ -1894,10 +1890,6 @@ static inline wuffs_base__empty_struct wuffs_base__io_writer__set_mark(
|
||||
|
||||
// ---------------- Status Codes Implementations
|
||||
|
||||
bool wuffs_adler32__status__is_error(wuffs_adler32__status s) {
|
||||
return s < 0;
|
||||
}
|
||||
|
||||
static const char wuffs_adler32__status__string_data[] = {
|
||||
0x00,
|
||||
};
|
||||
@@ -1934,7 +1926,7 @@ static const uint16_t wuffs_adler32__status__string_offsets[] = {
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
};
|
||||
|
||||
const char* wuffs_adler32__status__string(wuffs_adler32__status s) {
|
||||
const char* wuffs_adler32__status__string(wuffs_base__status s) {
|
||||
uint16_t o;
|
||||
switch (s & 0x1FFFFF) {
|
||||
case 0:
|
||||
|
||||
+3
-11
@@ -1269,8 +1269,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_crc32__status;
|
||||
|
||||
#define wuffs_crc32__packageid 810620 // 0x000C5E7C
|
||||
|
||||
#define WUFFS_CRC32__STATUS_OK 0 // 0x00000000
|
||||
@@ -1291,9 +1289,7 @@ typedef int32_t wuffs_crc32__status;
|
||||
#define WUFFS_CRC32__ERROR_INVALID_CALL_SEQUENCE -301989888 // 0xEE000000
|
||||
#define WUFFS_CRC32__SUSPENSION_END_OF_DATA 16777216 // 0x01000000
|
||||
|
||||
bool wuffs_crc32__status__is_error(wuffs_crc32__status s);
|
||||
|
||||
const char* wuffs_crc32__status__string(wuffs_crc32__status s);
|
||||
const char* wuffs_crc32__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1308,7 +1304,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_crc32__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_state;
|
||||
@@ -1893,10 +1889,6 @@ static inline wuffs_base__empty_struct wuffs_base__io_writer__set_mark(
|
||||
|
||||
// ---------------- Status Codes Implementations
|
||||
|
||||
bool wuffs_crc32__status__is_error(wuffs_crc32__status s) {
|
||||
return s < 0;
|
||||
}
|
||||
|
||||
static const char wuffs_crc32__status__string_data[] = {
|
||||
0x00,
|
||||
};
|
||||
@@ -1933,7 +1925,7 @@ static const uint16_t wuffs_crc32__status__string_offsets[] = {
|
||||
0x0000, 0x0000, 0x0000, 0x0000,
|
||||
};
|
||||
|
||||
const char* wuffs_crc32__status__string(wuffs_crc32__status s) {
|
||||
const char* wuffs_crc32__status__string(wuffs_base__status s) {
|
||||
uint16_t o;
|
||||
switch (s & 0x1FFFFF) {
|
||||
case 0:
|
||||
|
||||
+34
-44
@@ -1269,8 +1269,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_deflate__status;
|
||||
|
||||
#define wuffs_deflate__packageid 848533 // 0x000CF295
|
||||
|
||||
#define WUFFS_DEFLATE__STATUS_OK 0 // 0x00000000
|
||||
@@ -1321,9 +1319,7 @@ typedef int32_t wuffs_deflate__status;
|
||||
#define WUFFS_DEFLATE__ERROR_INTERNAL_ERROR_INCONSISTENT_N_BITS \
|
||||
-1123224939 // 0xBD0CF295
|
||||
|
||||
bool wuffs_deflate__status__is_error(wuffs_deflate__status s);
|
||||
|
||||
const char* wuffs_deflate__status__string(wuffs_deflate__status s);
|
||||
const char* wuffs_deflate__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1338,7 +1334,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_deflate__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_bits;
|
||||
@@ -1352,7 +1348,7 @@ typedef struct {
|
||||
|
||||
struct {
|
||||
uint32_t coro_susp_point;
|
||||
wuffs_deflate__status v_z;
|
||||
wuffs_base__status v_z;
|
||||
uint64_t v_n_copied;
|
||||
uint32_t v_already_full;
|
||||
} c_decode[1];
|
||||
@@ -1418,10 +1414,9 @@ void wuffs_deflate__decoder__check_wuffs_version(wuffs_deflate__decoder* self,
|
||||
|
||||
// ---------------- Public Function Prototypes
|
||||
|
||||
wuffs_deflate__status wuffs_deflate__decoder__decode(
|
||||
wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
wuffs_base__status wuffs_deflate__decoder__decode(wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
@@ -1983,10 +1978,6 @@ static inline wuffs_base__empty_struct wuffs_base__io_writer__set_mark(
|
||||
|
||||
// ---------------- Status Codes Implementations
|
||||
|
||||
bool wuffs_deflate__status__is_error(wuffs_deflate__status s) {
|
||||
return s < 0;
|
||||
}
|
||||
|
||||
static const char wuffs_deflate__status__string_data[] = {
|
||||
0x00, 0x64, 0x65, 0x66, 0x6C, 0x61, 0x74, 0x65, 0x3A, 0x20, 0x69, 0x6E,
|
||||
0x74, 0x65, 0x72, 0x6E, 0x61, 0x6C, 0x20, 0x65, 0x72, 0x72, 0x6F, 0x72,
|
||||
@@ -2078,7 +2069,7 @@ static const uint16_t wuffs_deflate__status__string_offsets[] = {
|
||||
0x01EF, 0x021B, 0x0242, 0x026F,
|
||||
};
|
||||
|
||||
const char* wuffs_deflate__status__string(wuffs_deflate__status s) {
|
||||
const char* wuffs_deflate__status__string(wuffs_base__status s) {
|
||||
uint16_t o;
|
||||
switch (s & 0x1FFFFF) {
|
||||
case 0:
|
||||
@@ -2140,36 +2131,36 @@ static const uint32_t wuffs_deflate__dcode_magic_numbers[32] = {
|
||||
|
||||
// ---------------- Private Function Prototypes
|
||||
|
||||
static wuffs_deflate__status wuffs_deflate__decoder__decode_blocks(
|
||||
static wuffs_base__status wuffs_deflate__decoder__decode_blocks(
|
||||
wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
static wuffs_deflate__status wuffs_deflate__decoder__decode_uncompressed(
|
||||
static wuffs_base__status wuffs_deflate__decoder__decode_uncompressed(
|
||||
wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
static wuffs_deflate__status wuffs_deflate__decoder__init_fixed_huffman(
|
||||
static wuffs_base__status wuffs_deflate__decoder__init_fixed_huffman(
|
||||
wuffs_deflate__decoder* self);
|
||||
|
||||
static wuffs_deflate__status wuffs_deflate__decoder__init_dynamic_huffman(
|
||||
static wuffs_base__status wuffs_deflate__decoder__init_dynamic_huffman(
|
||||
wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
static wuffs_deflate__status wuffs_deflate__decoder__init_huff(
|
||||
static wuffs_base__status wuffs_deflate__decoder__init_huff(
|
||||
wuffs_deflate__decoder* self,
|
||||
uint32_t a_which,
|
||||
uint32_t a_n_codes0,
|
||||
uint32_t a_n_codes1,
|
||||
uint32_t a_base_symbol);
|
||||
|
||||
static wuffs_deflate__status wuffs_deflate__decoder__decode_huffman_fast(
|
||||
static wuffs_base__status wuffs_deflate__decoder__decode_huffman_fast(
|
||||
wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
static wuffs_deflate__status wuffs_deflate__decoder__decode_huffman_slow(
|
||||
static wuffs_base__status wuffs_deflate__decoder__decode_huffman_slow(
|
||||
wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
@@ -2203,10 +2194,9 @@ void wuffs_deflate__decoder__check_wuffs_version(wuffs_deflate__decoder* self,
|
||||
|
||||
// -------- func decoder.decode
|
||||
|
||||
wuffs_deflate__status wuffs_deflate__decoder__decode(
|
||||
wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src) {
|
||||
wuffs_base__status wuffs_deflate__decoder__decode(wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src) {
|
||||
if (!self) {
|
||||
return WUFFS_DEFLATE__ERROR_BAD_RECEIVER;
|
||||
}
|
||||
@@ -2217,9 +2207,9 @@ wuffs_deflate__status wuffs_deflate__decoder__decode(
|
||||
if (self->private_impl.status < 0) {
|
||||
return self->private_impl.status;
|
||||
}
|
||||
wuffs_deflate__status status = WUFFS_DEFLATE__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
wuffs_deflate__status v_z;
|
||||
wuffs_base__status v_z;
|
||||
wuffs_base__slice_u8 v_written;
|
||||
uint64_t v_n_copied;
|
||||
uint32_t v_already_full;
|
||||
@@ -2261,7 +2251,7 @@ wuffs_deflate__status wuffs_deflate__decoder__decode(
|
||||
if (a_dst.private_impl.buf) {
|
||||
a_dst.private_impl.buf->wi = ioptr_dst - a_dst.private_impl.buf->ptr;
|
||||
}
|
||||
wuffs_deflate__status t_0 =
|
||||
wuffs_base__status t_0 =
|
||||
wuffs_deflate__decoder__decode_blocks(self, a_dst, a_src);
|
||||
if (a_dst.private_impl.buf) {
|
||||
ioptr_dst = a_dst.private_impl.buf->ptr + a_dst.private_impl.buf->wi;
|
||||
@@ -2342,11 +2332,11 @@ exit:
|
||||
|
||||
// -------- func decoder.decode_blocks
|
||||
|
||||
static wuffs_deflate__status wuffs_deflate__decoder__decode_blocks(
|
||||
static wuffs_base__status wuffs_deflate__decoder__decode_blocks(
|
||||
wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src) {
|
||||
wuffs_deflate__status status = WUFFS_DEFLATE__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
uint32_t v_final;
|
||||
uint32_t v_type;
|
||||
@@ -2497,11 +2487,11 @@ short_read_src:
|
||||
|
||||
// -------- func decoder.decode_uncompressed
|
||||
|
||||
static wuffs_deflate__status wuffs_deflate__decoder__decode_uncompressed(
|
||||
static wuffs_base__status wuffs_deflate__decoder__decode_uncompressed(
|
||||
wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src) {
|
||||
wuffs_deflate__status status = WUFFS_DEFLATE__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
uint32_t v_length;
|
||||
uint32_t v_n_copied;
|
||||
@@ -2643,9 +2633,9 @@ short_read_src:
|
||||
|
||||
// -------- func decoder.init_fixed_huffman
|
||||
|
||||
static wuffs_deflate__status wuffs_deflate__decoder__init_fixed_huffman(
|
||||
static wuffs_base__status wuffs_deflate__decoder__init_fixed_huffman(
|
||||
wuffs_deflate__decoder* self) {
|
||||
wuffs_deflate__status status = WUFFS_DEFLATE__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
uint32_t v_i;
|
||||
|
||||
@@ -2708,10 +2698,10 @@ exit:
|
||||
|
||||
// -------- func decoder.init_dynamic_huffman
|
||||
|
||||
static wuffs_deflate__status wuffs_deflate__decoder__init_dynamic_huffman(
|
||||
static wuffs_base__status wuffs_deflate__decoder__init_dynamic_huffman(
|
||||
wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_reader a_src) {
|
||||
wuffs_deflate__status status = WUFFS_DEFLATE__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
uint32_t v_bits;
|
||||
uint32_t v_n_bits;
|
||||
@@ -2968,13 +2958,13 @@ short_read_src:
|
||||
|
||||
// -------- func decoder.init_huff
|
||||
|
||||
static wuffs_deflate__status wuffs_deflate__decoder__init_huff(
|
||||
static wuffs_base__status wuffs_deflate__decoder__init_huff(
|
||||
wuffs_deflate__decoder* self,
|
||||
uint32_t a_which,
|
||||
uint32_t a_n_codes0,
|
||||
uint32_t a_n_codes1,
|
||||
uint32_t a_base_symbol) {
|
||||
wuffs_deflate__status status = WUFFS_DEFLATE__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
uint16_t v_counts[16];
|
||||
uint32_t v_i;
|
||||
@@ -3249,11 +3239,11 @@ exit:
|
||||
|
||||
// -------- func decoder.decode_huffman_fast
|
||||
|
||||
static wuffs_deflate__status wuffs_deflate__decoder__decode_huffman_fast(
|
||||
static wuffs_base__status wuffs_deflate__decoder__decode_huffman_fast(
|
||||
wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src) {
|
||||
wuffs_deflate__status status = WUFFS_DEFLATE__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
uint32_t v_bits;
|
||||
uint32_t v_n_bits;
|
||||
@@ -3603,11 +3593,11 @@ exit:
|
||||
|
||||
// -------- func decoder.decode_huffman_slow
|
||||
|
||||
static wuffs_deflate__status wuffs_deflate__decoder__decode_huffman_slow(
|
||||
static wuffs_base__status wuffs_deflate__decoder__decode_huffman_slow(
|
||||
wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src) {
|
||||
wuffs_deflate__status status = WUFFS_DEFLATE__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
uint32_t v_bits;
|
||||
uint32_t v_n_bits;
|
||||
|
||||
+47
-59
@@ -1278,8 +1278,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_lzw__status;
|
||||
|
||||
#define wuffs_lzw__packageid 1316776 // 0x001417A8
|
||||
|
||||
#define WUFFS_LZW__STATUS_OK 0 // 0x00000000
|
||||
@@ -1303,9 +1301,7 @@ typedef int32_t wuffs_lzw__status;
|
||||
#define WUFFS_LZW__ERROR_BAD_CODE -15460440 // 0xFF1417A8
|
||||
#define WUFFS_LZW__ERROR_CYCLICAL_PREFIX_CHAIN -32237656 // 0xFE1417A8
|
||||
|
||||
bool wuffs_lzw__status__is_error(wuffs_lzw__status s);
|
||||
|
||||
const char* wuffs_lzw__status__string(wuffs_lzw__status s);
|
||||
const char* wuffs_lzw__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1320,7 +1316,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_lzw__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_literal_width;
|
||||
@@ -1362,9 +1358,9 @@ void wuffs_lzw__decoder__check_wuffs_version(wuffs_lzw__decoder* self,
|
||||
void wuffs_lzw__decoder__set_literal_width(wuffs_lzw__decoder* self,
|
||||
uint32_t a_lw);
|
||||
|
||||
wuffs_lzw__status wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
wuffs_base__status wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
@@ -1380,8 +1376,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_gif__status;
|
||||
|
||||
#define wuffs_gif__packageid 1017222 // 0x000F8586
|
||||
|
||||
#define WUFFS_GIF__STATUS_OK 0 // 0x00000000
|
||||
@@ -1412,9 +1406,7 @@ typedef int32_t wuffs_gif__status;
|
||||
#define WUFFS_GIF__ERROR_INTERNAL_ERROR_INCONSISTENT_RI_WI \
|
||||
-1072724602 // 0xC00F8586
|
||||
|
||||
bool wuffs_gif__status__is_error(wuffs_gif__status s);
|
||||
|
||||
const char* wuffs_gif__status__string(wuffs_gif__status s);
|
||||
const char* wuffs_gif__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1429,7 +1421,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_gif__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_width;
|
||||
@@ -1522,7 +1514,7 @@ typedef struct {
|
||||
uint32_t v_argb;
|
||||
uint8_t v_lw;
|
||||
uint64_t v_block_size;
|
||||
wuffs_gif__status v_z;
|
||||
wuffs_base__status v_z;
|
||||
uint64_t scratch;
|
||||
} c_decode_id_part1[1];
|
||||
} private_impl;
|
||||
@@ -1541,17 +1533,17 @@ void wuffs_gif__decoder__check_wuffs_version(wuffs_gif__decoder* self,
|
||||
|
||||
// ---------------- Public Function Prototypes
|
||||
|
||||
wuffs_gif__status wuffs_gif__decoder__decode_config(
|
||||
wuffs_base__status wuffs_gif__decoder__decode_config(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__image_config* a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
wuffs_gif__status wuffs_gif__decoder__decode_frame(
|
||||
wuffs_base__status wuffs_gif__decoder__decode_frame(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__image_buffer* a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
wuffs_gif__status wuffs_gif__decoder__decode_up_to_id_part1(
|
||||
wuffs_base__status wuffs_gif__decoder__decode_up_to_id_part1(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
@@ -2115,10 +2107,6 @@ static inline wuffs_base__empty_struct wuffs_base__io_writer__set_mark(
|
||||
|
||||
// ---------------- Status Codes Implementations
|
||||
|
||||
bool wuffs_gif__status__is_error(wuffs_gif__status s) {
|
||||
return s < 0;
|
||||
}
|
||||
|
||||
static const char wuffs_gif__status__string_data[] = {
|
||||
0x00, 0x67, 0x69, 0x66, 0x3A, 0x20, 0x69, 0x6E, 0x74, 0x65, 0x72, 0x6E,
|
||||
0x61, 0x6C, 0x20, 0x65, 0x72, 0x72, 0x6F, 0x72, 0x3A, 0x20, 0x69, 0x6E,
|
||||
@@ -2171,7 +2159,7 @@ static const uint16_t wuffs_gif__status__string_offsets[] = {
|
||||
0x0074, 0x0084, 0x009D, 0x00B6,
|
||||
};
|
||||
|
||||
const char* wuffs_gif__status__string(wuffs_gif__status s) {
|
||||
const char* wuffs_gif__status__string(wuffs_base__status s) {
|
||||
uint16_t o;
|
||||
switch (s & 0x1FFFFF) {
|
||||
case 0:
|
||||
@@ -2210,40 +2198,40 @@ static const uint8_t wuffs_gif__netscape2dot0[11] = {
|
||||
|
||||
// ---------------- Private Function Prototypes
|
||||
|
||||
static wuffs_gif__status wuffs_gif__decoder__decode_header(
|
||||
static wuffs_base__status wuffs_gif__decoder__decode_header(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
static wuffs_gif__status wuffs_gif__decoder__decode_lsd(
|
||||
static wuffs_base__status wuffs_gif__decoder__decode_lsd(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
static wuffs_gif__status wuffs_gif__decoder__decode_extension(
|
||||
static wuffs_base__status wuffs_gif__decoder__decode_extension(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
static wuffs_gif__status wuffs_gif__decoder__skip_blocks(
|
||||
static wuffs_base__status wuffs_gif__decoder__skip_blocks(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
static wuffs_gif__status wuffs_gif__decoder__decode_ae(
|
||||
static wuffs_base__status wuffs_gif__decoder__decode_ae(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
static wuffs_gif__status wuffs_gif__decoder__decode_gc(
|
||||
static wuffs_base__status wuffs_gif__decoder__decode_gc(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
static wuffs_gif__status wuffs_gif__decoder__decode_id_part0(
|
||||
static wuffs_base__status wuffs_gif__decoder__decode_id_part0(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
static wuffs_gif__status wuffs_gif__decoder__decode_id_part1(
|
||||
static wuffs_base__status wuffs_gif__decoder__decode_id_part1(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__image_buffer* a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
static wuffs_gif__status wuffs_gif__decoder__copy_to_image_buffer(
|
||||
static wuffs_base__status wuffs_gif__decoder__copy_to_image_buffer(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__image_buffer* a_ib);
|
||||
|
||||
@@ -2279,7 +2267,7 @@ void wuffs_gif__decoder__check_wuffs_version(wuffs_gif__decoder* self,
|
||||
|
||||
// -------- func decoder.decode_config
|
||||
|
||||
wuffs_gif__status wuffs_gif__decoder__decode_config(
|
||||
wuffs_base__status wuffs_gif__decoder__decode_config(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__image_config* a_dst,
|
||||
wuffs_base__io_reader a_src) {
|
||||
@@ -2296,7 +2284,7 @@ wuffs_gif__status wuffs_gif__decoder__decode_config(
|
||||
self->private_impl.status = WUFFS_GIF__ERROR_BAD_ARGUMENT;
|
||||
return WUFFS_GIF__ERROR_BAD_ARGUMENT;
|
||||
}
|
||||
wuffs_gif__status status = WUFFS_GIF__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
uint32_t v_num_loops;
|
||||
|
||||
@@ -2356,7 +2344,7 @@ exit:
|
||||
|
||||
// -------- func decoder.decode_frame
|
||||
|
||||
wuffs_gif__status wuffs_gif__decoder__decode_frame(
|
||||
wuffs_base__status wuffs_gif__decoder__decode_frame(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__image_buffer* a_dst,
|
||||
wuffs_base__io_reader a_src) {
|
||||
@@ -2373,7 +2361,7 @@ wuffs_gif__status wuffs_gif__decoder__decode_frame(
|
||||
self->private_impl.status = WUFFS_GIF__ERROR_BAD_ARGUMENT;
|
||||
return WUFFS_GIF__ERROR_BAD_ARGUMENT;
|
||||
}
|
||||
wuffs_gif__status status = WUFFS_GIF__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
uint32_t coro_susp_point =
|
||||
self->private_impl.c_decode_frame[0].coro_susp_point;
|
||||
@@ -2428,7 +2416,7 @@ exit:
|
||||
|
||||
// -------- func decoder.decode_up_to_id_part1
|
||||
|
||||
wuffs_gif__status wuffs_gif__decoder__decode_up_to_id_part1(
|
||||
wuffs_base__status wuffs_gif__decoder__decode_up_to_id_part1(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__io_reader a_src) {
|
||||
if (!self) {
|
||||
@@ -2440,7 +2428,7 @@ wuffs_gif__status wuffs_gif__decoder__decode_up_to_id_part1(
|
||||
if (self->private_impl.status < 0) {
|
||||
return self->private_impl.status;
|
||||
}
|
||||
wuffs_gif__status status = WUFFS_GIF__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
uint8_t v_block_type;
|
||||
|
||||
@@ -2545,10 +2533,10 @@ short_read_src:
|
||||
|
||||
// -------- func decoder.decode_header
|
||||
|
||||
static wuffs_gif__status wuffs_gif__decoder__decode_header(
|
||||
static wuffs_base__status wuffs_gif__decoder__decode_header(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__io_reader a_src) {
|
||||
wuffs_gif__status status = WUFFS_GIF__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
uint8_t v_c[6];
|
||||
uint32_t v_i;
|
||||
@@ -2629,10 +2617,10 @@ short_read_src:
|
||||
|
||||
// -------- func decoder.decode_lsd
|
||||
|
||||
static wuffs_gif__status wuffs_gif__decoder__decode_lsd(
|
||||
static wuffs_base__status wuffs_gif__decoder__decode_lsd(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__io_reader a_src) {
|
||||
wuffs_gif__status status = WUFFS_GIF__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
uint8_t v_c[7];
|
||||
uint32_t v_i;
|
||||
@@ -2774,10 +2762,10 @@ short_read_src:
|
||||
|
||||
// -------- func decoder.decode_extension
|
||||
|
||||
static wuffs_gif__status wuffs_gif__decoder__decode_extension(
|
||||
static wuffs_base__status wuffs_gif__decoder__decode_extension(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__io_reader a_src) {
|
||||
wuffs_gif__status status = WUFFS_GIF__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
uint8_t v_label;
|
||||
|
||||
@@ -2885,10 +2873,10 @@ short_read_src:
|
||||
|
||||
// -------- func decoder.skip_blocks
|
||||
|
||||
static wuffs_gif__status wuffs_gif__decoder__skip_blocks(
|
||||
static wuffs_base__status wuffs_gif__decoder__skip_blocks(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__io_reader a_src) {
|
||||
wuffs_gif__status status = WUFFS_GIF__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
uint8_t v_block_size;
|
||||
|
||||
@@ -2973,10 +2961,10 @@ short_read_src:
|
||||
|
||||
// -------- func decoder.decode_ae
|
||||
|
||||
static wuffs_gif__status wuffs_gif__decoder__decode_ae(
|
||||
static wuffs_base__status wuffs_gif__decoder__decode_ae(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__io_reader a_src) {
|
||||
wuffs_gif__status status = WUFFS_GIF__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
uint8_t v_c;
|
||||
uint8_t v_block_size;
|
||||
@@ -3186,10 +3174,10 @@ short_read_src:
|
||||
|
||||
// -------- func decoder.decode_gc
|
||||
|
||||
static wuffs_gif__status wuffs_gif__decoder__decode_gc(
|
||||
static wuffs_base__status wuffs_gif__decoder__decode_gc(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__io_reader a_src) {
|
||||
wuffs_gif__status status = WUFFS_GIF__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
uint8_t v_flags;
|
||||
|
||||
@@ -3324,10 +3312,10 @@ short_read_src:
|
||||
|
||||
// -------- func decoder.decode_id_part0
|
||||
|
||||
static wuffs_gif__status wuffs_gif__decoder__decode_id_part0(
|
||||
static wuffs_base__status wuffs_gif__decoder__decode_id_part0(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__io_reader a_src) {
|
||||
wuffs_gif__status status = WUFFS_GIF__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
uint32_t v_frame_x;
|
||||
uint32_t v_frame_y;
|
||||
@@ -3522,11 +3510,11 @@ short_read_src:
|
||||
|
||||
// -------- func decoder.decode_id_part1
|
||||
|
||||
static wuffs_gif__status wuffs_gif__decoder__decode_id_part1(
|
||||
static wuffs_base__status wuffs_gif__decoder__decode_id_part1(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__image_buffer* a_dst,
|
||||
wuffs_base__io_reader a_src) {
|
||||
wuffs_gif__status status = WUFFS_GIF__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
uint8_t v_flags;
|
||||
bool v_use_local_palette;
|
||||
@@ -3542,7 +3530,7 @@ static wuffs_gif__status wuffs_gif__decoder__decode_id_part1(
|
||||
WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(u_w);
|
||||
WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(ioptr_w);
|
||||
WUFFS_BASE__IGNORE_POTENTIALLY_UNUSED_VARIABLE(iobounds1_w);
|
||||
wuffs_gif__status v_z;
|
||||
wuffs_base__status v_z;
|
||||
wuffs_base__slice_u8 v_palette;
|
||||
|
||||
uint8_t* ioptr_src = NULL;
|
||||
@@ -3727,7 +3715,7 @@ static wuffs_gif__status wuffs_gif__decoder__decode_id_part1(
|
||||
a_src.private_impl.buf->ri =
|
||||
ioptr_src - a_src.private_impl.buf->ptr;
|
||||
}
|
||||
wuffs_gif__status t_5 = wuffs_lzw__decoder__decode(
|
||||
wuffs_base__status t_5 = wuffs_lzw__decoder__decode(
|
||||
&self->private_impl.f_lzw, v_w, a_src);
|
||||
ioptr_w = u_w.ptr + u_w.wi;
|
||||
if (a_src.private_impl.buf) {
|
||||
@@ -3840,10 +3828,10 @@ short_read_src:
|
||||
|
||||
// -------- func decoder.copy_to_image_buffer
|
||||
|
||||
static wuffs_gif__status wuffs_gif__decoder__copy_to_image_buffer(
|
||||
static wuffs_base__status wuffs_gif__decoder__copy_to_image_buffer(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__image_buffer* a_ib) {
|
||||
wuffs_gif__status status = WUFFS_GIF__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
wuffs_base__slice_u8 v_dst;
|
||||
wuffs_base__slice_u8 v_src;
|
||||
|
||||
+17
-34
@@ -1278,8 +1278,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_crc32__status;
|
||||
|
||||
#define wuffs_crc32__packageid 810620 // 0x000C5E7C
|
||||
|
||||
#define WUFFS_CRC32__STATUS_OK 0 // 0x00000000
|
||||
@@ -1300,9 +1298,7 @@ typedef int32_t wuffs_crc32__status;
|
||||
#define WUFFS_CRC32__ERROR_INVALID_CALL_SEQUENCE -301989888 // 0xEE000000
|
||||
#define WUFFS_CRC32__SUSPENSION_END_OF_DATA 16777216 // 0x01000000
|
||||
|
||||
bool wuffs_crc32__status__is_error(wuffs_crc32__status s);
|
||||
|
||||
const char* wuffs_crc32__status__string(wuffs_crc32__status s);
|
||||
const char* wuffs_crc32__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1317,7 +1313,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_crc32__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_state;
|
||||
@@ -1365,8 +1361,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_deflate__status;
|
||||
|
||||
#define wuffs_deflate__packageid 848533 // 0x000CF295
|
||||
|
||||
#define WUFFS_DEFLATE__STATUS_OK 0 // 0x00000000
|
||||
@@ -1417,9 +1411,7 @@ typedef int32_t wuffs_deflate__status;
|
||||
#define WUFFS_DEFLATE__ERROR_INTERNAL_ERROR_INCONSISTENT_N_BITS \
|
||||
-1123224939 // 0xBD0CF295
|
||||
|
||||
bool wuffs_deflate__status__is_error(wuffs_deflate__status s);
|
||||
|
||||
const char* wuffs_deflate__status__string(wuffs_deflate__status s);
|
||||
const char* wuffs_deflate__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1434,7 +1426,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_deflate__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_bits;
|
||||
@@ -1448,7 +1440,7 @@ typedef struct {
|
||||
|
||||
struct {
|
||||
uint32_t coro_susp_point;
|
||||
wuffs_deflate__status v_z;
|
||||
wuffs_base__status v_z;
|
||||
uint64_t v_n_copied;
|
||||
uint32_t v_already_full;
|
||||
} c_decode[1];
|
||||
@@ -1514,10 +1506,9 @@ void wuffs_deflate__decoder__check_wuffs_version(wuffs_deflate__decoder* self,
|
||||
|
||||
// ---------------- Public Function Prototypes
|
||||
|
||||
wuffs_deflate__status wuffs_deflate__decoder__decode(
|
||||
wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
wuffs_base__status wuffs_deflate__decoder__decode(wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
@@ -1533,8 +1524,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_gzip__status;
|
||||
|
||||
#define wuffs_gzip__packageid 1041911 // 0x000FE5F7
|
||||
|
||||
#define WUFFS_GZIP__STATUS_OK 0 // 0x00000000
|
||||
@@ -1560,9 +1549,7 @@ typedef int32_t wuffs_gzip__status;
|
||||
#define WUFFS_GZIP__ERROR_BAD_ENCODING_FLAGS -49289737 // 0xFD0FE5F7
|
||||
#define WUFFS_GZIP__ERROR_BAD_HEADER -66066953 // 0xFC0FE5F7
|
||||
|
||||
bool wuffs_gzip__status__is_error(wuffs_gzip__status s);
|
||||
|
||||
const char* wuffs_gzip__status__string(wuffs_gzip__status s);
|
||||
const char* wuffs_gzip__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1577,7 +1564,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_gzip__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
wuffs_deflate__decoder f_flate;
|
||||
@@ -1591,7 +1578,7 @@ typedef struct {
|
||||
uint16_t v_xlen;
|
||||
uint32_t v_checksum_got;
|
||||
uint32_t v_decoded_length_got;
|
||||
wuffs_gzip__status v_z;
|
||||
wuffs_base__status v_z;
|
||||
uint32_t v_checksum_want;
|
||||
uint32_t v_decoded_length_want;
|
||||
uint64_t scratch;
|
||||
@@ -1615,7 +1602,7 @@ void wuffs_gzip__decoder__check_wuffs_version(wuffs_gzip__decoder* self,
|
||||
void wuffs_gzip__decoder__set_ignore_checksum(wuffs_gzip__decoder* self,
|
||||
bool a_ic);
|
||||
|
||||
wuffs_gzip__status wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
|
||||
wuffs_base__status wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
@@ -2179,10 +2166,6 @@ static inline wuffs_base__empty_struct wuffs_base__io_writer__set_mark(
|
||||
|
||||
// ---------------- Status Codes Implementations
|
||||
|
||||
bool wuffs_gzip__status__is_error(wuffs_gzip__status s) {
|
||||
return s < 0;
|
||||
}
|
||||
|
||||
static const char wuffs_gzip__status__string_data[] = {
|
||||
0x00, 0x67, 0x7A, 0x69, 0x70, 0x3A, 0x20, 0x62, 0x61, 0x64, 0x20, 0x68,
|
||||
0x65, 0x61, 0x64, 0x65, 0x72, 0x00, 0x67, 0x7A, 0x69, 0x70, 0x3A, 0x20,
|
||||
@@ -2226,7 +2209,7 @@ static const uint16_t wuffs_gzip__status__string_offsets[] = {
|
||||
0x0001, 0x0012, 0x002B, 0x0048,
|
||||
};
|
||||
|
||||
const char* wuffs_gzip__status__string(wuffs_gzip__status s) {
|
||||
const char* wuffs_gzip__status__string(wuffs_base__status s) {
|
||||
uint16_t o;
|
||||
switch (s & 0x1FFFFF) {
|
||||
case 0:
|
||||
@@ -2304,7 +2287,7 @@ void wuffs_gzip__decoder__set_ignore_checksum(wuffs_gzip__decoder* self,
|
||||
|
||||
// -------- func decoder.decode
|
||||
|
||||
wuffs_gzip__status wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
|
||||
wuffs_base__status wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src) {
|
||||
if (!self) {
|
||||
@@ -2317,14 +2300,14 @@ wuffs_gzip__status wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
|
||||
if (self->private_impl.status < 0) {
|
||||
return self->private_impl.status;
|
||||
}
|
||||
wuffs_gzip__status status = WUFFS_GZIP__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
uint8_t v_flags;
|
||||
uint8_t v_c;
|
||||
uint16_t v_xlen;
|
||||
uint32_t v_checksum_got;
|
||||
uint32_t v_decoded_length_got;
|
||||
wuffs_gzip__status v_z;
|
||||
wuffs_base__status v_z;
|
||||
uint32_t v_checksum_want;
|
||||
uint32_t v_decoded_length_want;
|
||||
|
||||
@@ -2520,7 +2503,7 @@ wuffs_gzip__status wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
|
||||
if (a_src.private_impl.buf) {
|
||||
a_src.private_impl.buf->ri = ioptr_src - a_src.private_impl.buf->ptr;
|
||||
}
|
||||
wuffs_gzip__status t_8 = wuffs_deflate__decoder__decode(
|
||||
wuffs_base__status t_8 = wuffs_deflate__decoder__decode(
|
||||
&self->private_impl.f_flate, a_dst, a_src);
|
||||
if (a_dst.private_impl.buf) {
|
||||
ioptr_dst = a_dst.private_impl.buf->ptr + a_dst.private_impl.buf->wi;
|
||||
|
||||
+10
-18
@@ -1269,8 +1269,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_lzw__status;
|
||||
|
||||
#define wuffs_lzw__packageid 1316776 // 0x001417A8
|
||||
|
||||
#define WUFFS_LZW__STATUS_OK 0 // 0x00000000
|
||||
@@ -1294,9 +1292,7 @@ typedef int32_t wuffs_lzw__status;
|
||||
#define WUFFS_LZW__ERROR_BAD_CODE -15460440 // 0xFF1417A8
|
||||
#define WUFFS_LZW__ERROR_CYCLICAL_PREFIX_CHAIN -32237656 // 0xFE1417A8
|
||||
|
||||
bool wuffs_lzw__status__is_error(wuffs_lzw__status s);
|
||||
|
||||
const char* wuffs_lzw__status__string(wuffs_lzw__status s);
|
||||
const char* wuffs_lzw__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1311,7 +1307,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_lzw__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_literal_width;
|
||||
@@ -1353,9 +1349,9 @@ void wuffs_lzw__decoder__check_wuffs_version(wuffs_lzw__decoder* self,
|
||||
void wuffs_lzw__decoder__set_literal_width(wuffs_lzw__decoder* self,
|
||||
uint32_t a_lw);
|
||||
|
||||
wuffs_lzw__status wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
wuffs_base__status wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
@@ -1917,10 +1913,6 @@ static inline wuffs_base__empty_struct wuffs_base__io_writer__set_mark(
|
||||
|
||||
// ---------------- Status Codes Implementations
|
||||
|
||||
bool wuffs_lzw__status__is_error(wuffs_lzw__status s) {
|
||||
return s < 0;
|
||||
}
|
||||
|
||||
static const char wuffs_lzw__status__string_data[] = {
|
||||
0x00, 0x6C, 0x7A, 0x77, 0x3A, 0x20, 0x63, 0x79, 0x63, 0x6C, 0x69,
|
||||
0x63, 0x61, 0x6C, 0x20, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x20,
|
||||
@@ -1960,7 +1952,7 @@ static const uint16_t wuffs_lzw__status__string_offsets[] = {
|
||||
0x0000, 0x0000, 0x0001, 0x001C,
|
||||
};
|
||||
|
||||
const char* wuffs_lzw__status__string(wuffs_lzw__status s) {
|
||||
const char* wuffs_lzw__status__string(wuffs_base__status s) {
|
||||
uint16_t o;
|
||||
switch (s & 0x1FFFFF) {
|
||||
case 0:
|
||||
@@ -2031,9 +2023,9 @@ void wuffs_lzw__decoder__set_literal_width(wuffs_lzw__decoder* self,
|
||||
|
||||
// -------- func decoder.decode
|
||||
|
||||
wuffs_lzw__status wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src) {
|
||||
wuffs_base__status wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src) {
|
||||
if (!self) {
|
||||
return WUFFS_LZW__ERROR_BAD_RECEIVER;
|
||||
}
|
||||
@@ -2043,7 +2035,7 @@ wuffs_lzw__status wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self,
|
||||
if (self->private_impl.status < 0) {
|
||||
return self->private_impl.status;
|
||||
}
|
||||
wuffs_lzw__status status = WUFFS_LZW__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
uint32_t v_literal_width;
|
||||
uint32_t v_clear_code;
|
||||
|
||||
+17
-34
@@ -1278,8 +1278,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_adler32__status;
|
||||
|
||||
#define wuffs_adler32__packageid 681002 // 0x000A642A
|
||||
|
||||
#define WUFFS_ADLER32__STATUS_OK 0 // 0x00000000
|
||||
@@ -1301,9 +1299,7 @@ typedef int32_t wuffs_adler32__status;
|
||||
#define WUFFS_ADLER32__ERROR_INVALID_CALL_SEQUENCE -301989888 // 0xEE000000
|
||||
#define WUFFS_ADLER32__SUSPENSION_END_OF_DATA 16777216 // 0x01000000
|
||||
|
||||
bool wuffs_adler32__status__is_error(wuffs_adler32__status s);
|
||||
|
||||
const char* wuffs_adler32__status__string(wuffs_adler32__status s);
|
||||
const char* wuffs_adler32__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1318,7 +1314,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_adler32__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_state;
|
||||
@@ -1366,8 +1362,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_deflate__status;
|
||||
|
||||
#define wuffs_deflate__packageid 848533 // 0x000CF295
|
||||
|
||||
#define WUFFS_DEFLATE__STATUS_OK 0 // 0x00000000
|
||||
@@ -1418,9 +1412,7 @@ typedef int32_t wuffs_deflate__status;
|
||||
#define WUFFS_DEFLATE__ERROR_INTERNAL_ERROR_INCONSISTENT_N_BITS \
|
||||
-1123224939 // 0xBD0CF295
|
||||
|
||||
bool wuffs_deflate__status__is_error(wuffs_deflate__status s);
|
||||
|
||||
const char* wuffs_deflate__status__string(wuffs_deflate__status s);
|
||||
const char* wuffs_deflate__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1435,7 +1427,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_deflate__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_bits;
|
||||
@@ -1449,7 +1441,7 @@ typedef struct {
|
||||
|
||||
struct {
|
||||
uint32_t coro_susp_point;
|
||||
wuffs_deflate__status v_z;
|
||||
wuffs_base__status v_z;
|
||||
uint64_t v_n_copied;
|
||||
uint32_t v_already_full;
|
||||
} c_decode[1];
|
||||
@@ -1515,10 +1507,9 @@ void wuffs_deflate__decoder__check_wuffs_version(wuffs_deflate__decoder* self,
|
||||
|
||||
// ---------------- Public Function Prototypes
|
||||
|
||||
wuffs_deflate__status wuffs_deflate__decoder__decode(
|
||||
wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
wuffs_base__status wuffs_deflate__decoder__decode(wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
@@ -1534,8 +1525,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_zlib__status;
|
||||
|
||||
#define wuffs_zlib__packageid 2064249 // 0x001F7F79
|
||||
|
||||
#define WUFFS_ZLIB__STATUS_OK 0 // 0x00000000
|
||||
@@ -1563,9 +1552,7 @@ typedef int32_t wuffs_zlib__status;
|
||||
#define WUFFS_ZLIB__ERROR_TODO_UNSUPPORTED_PRESET_DICTIONARY \
|
||||
-1071677575 // 0xC01F7F79
|
||||
|
||||
bool wuffs_zlib__status__is_error(wuffs_zlib__status s);
|
||||
|
||||
const char* wuffs_zlib__status__string(wuffs_zlib__status s);
|
||||
const char* wuffs_zlib__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1580,7 +1567,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_zlib__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
wuffs_deflate__decoder f_flate;
|
||||
@@ -1591,7 +1578,7 @@ typedef struct {
|
||||
uint32_t coro_susp_point;
|
||||
uint16_t v_x;
|
||||
uint32_t v_checksum_got;
|
||||
wuffs_zlib__status v_z;
|
||||
wuffs_base__status v_z;
|
||||
uint32_t v_checksum_want;
|
||||
uint64_t scratch;
|
||||
} c_decode[1];
|
||||
@@ -1614,7 +1601,7 @@ void wuffs_zlib__decoder__check_wuffs_version(wuffs_zlib__decoder* self,
|
||||
void wuffs_zlib__decoder__set_ignore_checksum(wuffs_zlib__decoder* self,
|
||||
bool a_ic);
|
||||
|
||||
wuffs_zlib__status wuffs_zlib__decoder__decode(wuffs_zlib__decoder* self,
|
||||
wuffs_base__status wuffs_zlib__decoder__decode(wuffs_zlib__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
@@ -2178,10 +2165,6 @@ static inline wuffs_base__empty_struct wuffs_base__io_writer__set_mark(
|
||||
|
||||
// ---------------- Status Codes Implementations
|
||||
|
||||
bool wuffs_zlib__status__is_error(wuffs_zlib__status s) {
|
||||
return s < 0;
|
||||
}
|
||||
|
||||
static const char wuffs_zlib__status__string_data[] = {
|
||||
0x00, 0x7A, 0x6C, 0x69, 0x62, 0x3A, 0x20, 0x54, 0x4F, 0x44, 0x4F, 0x3A,
|
||||
0x20, 0x75, 0x6E, 0x73, 0x75, 0x70, 0x70, 0x6F, 0x72, 0x74, 0x65, 0x64,
|
||||
@@ -2230,7 +2213,7 @@ static const uint16_t wuffs_zlib__status__string_offsets[] = {
|
||||
0x002B, 0x0042, 0x0064, 0x0081,
|
||||
};
|
||||
|
||||
const char* wuffs_zlib__status__string(wuffs_zlib__status s) {
|
||||
const char* wuffs_zlib__status__string(wuffs_base__status s) {
|
||||
uint16_t o;
|
||||
switch (s & 0x1FFFFF) {
|
||||
case 0:
|
||||
@@ -2308,7 +2291,7 @@ void wuffs_zlib__decoder__set_ignore_checksum(wuffs_zlib__decoder* self,
|
||||
|
||||
// -------- func decoder.decode
|
||||
|
||||
wuffs_zlib__status wuffs_zlib__decoder__decode(wuffs_zlib__decoder* self,
|
||||
wuffs_base__status wuffs_zlib__decoder__decode(wuffs_zlib__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src) {
|
||||
if (!self) {
|
||||
@@ -2321,11 +2304,11 @@ wuffs_zlib__status wuffs_zlib__decoder__decode(wuffs_zlib__decoder* self,
|
||||
if (self->private_impl.status < 0) {
|
||||
return self->private_impl.status;
|
||||
}
|
||||
wuffs_zlib__status status = WUFFS_ZLIB__STATUS_OK;
|
||||
wuffs_base__status status = WUFFS_BASE__STATUS_OK;
|
||||
|
||||
uint16_t v_x;
|
||||
uint32_t v_checksum_got;
|
||||
wuffs_zlib__status v_z;
|
||||
wuffs_base__status v_z;
|
||||
uint32_t v_checksum_want;
|
||||
|
||||
uint8_t* ioptr_dst = NULL;
|
||||
@@ -2427,7 +2410,7 @@ wuffs_zlib__status wuffs_zlib__decoder__decode(wuffs_zlib__decoder* self,
|
||||
if (a_src.private_impl.buf) {
|
||||
a_src.private_impl.buf->ri = ioptr_src - a_src.private_impl.buf->ptr;
|
||||
}
|
||||
wuffs_zlib__status t_2 = wuffs_deflate__decoder__decode(
|
||||
wuffs_base__status t_2 = wuffs_deflate__decoder__decode(
|
||||
&self->private_impl.f_flate, a_dst, a_src);
|
||||
if (a_dst.private_impl.buf) {
|
||||
ioptr_dst = a_dst.private_impl.buf->ptr + a_dst.private_impl.buf->wi;
|
||||
|
||||
+2
-6
@@ -1269,8 +1269,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_adler32__status;
|
||||
|
||||
#define wuffs_adler32__packageid 681002 // 0x000A642A
|
||||
|
||||
#define WUFFS_ADLER32__STATUS_OK 0 // 0x00000000
|
||||
@@ -1292,9 +1290,7 @@ typedef int32_t wuffs_adler32__status;
|
||||
#define WUFFS_ADLER32__ERROR_INVALID_CALL_SEQUENCE -301989888 // 0xEE000000
|
||||
#define WUFFS_ADLER32__SUSPENSION_END_OF_DATA 16777216 // 0x01000000
|
||||
|
||||
bool wuffs_adler32__status__is_error(wuffs_adler32__status s);
|
||||
|
||||
const char* wuffs_adler32__status__string(wuffs_adler32__status s);
|
||||
const char* wuffs_adler32__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1309,7 +1305,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_adler32__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_state;
|
||||
|
||||
+2
-6
@@ -1269,8 +1269,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_crc32__status;
|
||||
|
||||
#define wuffs_crc32__packageid 810620 // 0x000C5E7C
|
||||
|
||||
#define WUFFS_CRC32__STATUS_OK 0 // 0x00000000
|
||||
@@ -1291,9 +1289,7 @@ typedef int32_t wuffs_crc32__status;
|
||||
#define WUFFS_CRC32__ERROR_INVALID_CALL_SEQUENCE -301989888 // 0xEE000000
|
||||
#define WUFFS_CRC32__SUSPENSION_END_OF_DATA 16777216 // 0x01000000
|
||||
|
||||
bool wuffs_crc32__status__is_error(wuffs_crc32__status s);
|
||||
|
||||
const char* wuffs_crc32__status__string(wuffs_crc32__status s);
|
||||
const char* wuffs_crc32__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1308,7 +1304,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_crc32__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_state;
|
||||
|
||||
+6
-11
@@ -1269,8 +1269,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_deflate__status;
|
||||
|
||||
#define wuffs_deflate__packageid 848533 // 0x000CF295
|
||||
|
||||
#define WUFFS_DEFLATE__STATUS_OK 0 // 0x00000000
|
||||
@@ -1321,9 +1319,7 @@ typedef int32_t wuffs_deflate__status;
|
||||
#define WUFFS_DEFLATE__ERROR_INTERNAL_ERROR_INCONSISTENT_N_BITS \
|
||||
-1123224939 // 0xBD0CF295
|
||||
|
||||
bool wuffs_deflate__status__is_error(wuffs_deflate__status s);
|
||||
|
||||
const char* wuffs_deflate__status__string(wuffs_deflate__status s);
|
||||
const char* wuffs_deflate__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1338,7 +1334,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_deflate__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_bits;
|
||||
@@ -1352,7 +1348,7 @@ typedef struct {
|
||||
|
||||
struct {
|
||||
uint32_t coro_susp_point;
|
||||
wuffs_deflate__status v_z;
|
||||
wuffs_base__status v_z;
|
||||
uint64_t v_n_copied;
|
||||
uint32_t v_already_full;
|
||||
} c_decode[1];
|
||||
@@ -1418,10 +1414,9 @@ void wuffs_deflate__decoder__check_wuffs_version(wuffs_deflate__decoder* self,
|
||||
|
||||
// ---------------- Public Function Prototypes
|
||||
|
||||
wuffs_deflate__status wuffs_deflate__decoder__decode(
|
||||
wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
wuffs_base__status wuffs_deflate__decoder__decode(wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
||||
+11
-19
@@ -1278,8 +1278,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_lzw__status;
|
||||
|
||||
#define wuffs_lzw__packageid 1316776 // 0x001417A8
|
||||
|
||||
#define WUFFS_LZW__STATUS_OK 0 // 0x00000000
|
||||
@@ -1303,9 +1301,7 @@ typedef int32_t wuffs_lzw__status;
|
||||
#define WUFFS_LZW__ERROR_BAD_CODE -15460440 // 0xFF1417A8
|
||||
#define WUFFS_LZW__ERROR_CYCLICAL_PREFIX_CHAIN -32237656 // 0xFE1417A8
|
||||
|
||||
bool wuffs_lzw__status__is_error(wuffs_lzw__status s);
|
||||
|
||||
const char* wuffs_lzw__status__string(wuffs_lzw__status s);
|
||||
const char* wuffs_lzw__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1320,7 +1316,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_lzw__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_literal_width;
|
||||
@@ -1362,9 +1358,9 @@ void wuffs_lzw__decoder__check_wuffs_version(wuffs_lzw__decoder* self,
|
||||
void wuffs_lzw__decoder__set_literal_width(wuffs_lzw__decoder* self,
|
||||
uint32_t a_lw);
|
||||
|
||||
wuffs_lzw__status wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
wuffs_base__status wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
@@ -1380,8 +1376,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_gif__status;
|
||||
|
||||
#define wuffs_gif__packageid 1017222 // 0x000F8586
|
||||
|
||||
#define WUFFS_GIF__STATUS_OK 0 // 0x00000000
|
||||
@@ -1412,9 +1406,7 @@ typedef int32_t wuffs_gif__status;
|
||||
#define WUFFS_GIF__ERROR_INTERNAL_ERROR_INCONSISTENT_RI_WI \
|
||||
-1072724602 // 0xC00F8586
|
||||
|
||||
bool wuffs_gif__status__is_error(wuffs_gif__status s);
|
||||
|
||||
const char* wuffs_gif__status__string(wuffs_gif__status s);
|
||||
const char* wuffs_gif__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1429,7 +1421,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_gif__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_width;
|
||||
@@ -1522,7 +1514,7 @@ typedef struct {
|
||||
uint32_t v_argb;
|
||||
uint8_t v_lw;
|
||||
uint64_t v_block_size;
|
||||
wuffs_gif__status v_z;
|
||||
wuffs_base__status v_z;
|
||||
uint64_t scratch;
|
||||
} c_decode_id_part1[1];
|
||||
} private_impl;
|
||||
@@ -1541,17 +1533,17 @@ void wuffs_gif__decoder__check_wuffs_version(wuffs_gif__decoder* self,
|
||||
|
||||
// ---------------- Public Function Prototypes
|
||||
|
||||
wuffs_gif__status wuffs_gif__decoder__decode_config(
|
||||
wuffs_base__status wuffs_gif__decoder__decode_config(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__image_config* a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
wuffs_gif__status wuffs_gif__decoder__decode_frame(
|
||||
wuffs_base__status wuffs_gif__decoder__decode_frame(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__image_buffer* a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
wuffs_gif__status wuffs_gif__decoder__decode_up_to_id_part1(
|
||||
wuffs_base__status wuffs_gif__decoder__decode_up_to_id_part1(
|
||||
wuffs_gif__decoder* self,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
|
||||
+12
-25
@@ -1278,8 +1278,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_crc32__status;
|
||||
|
||||
#define wuffs_crc32__packageid 810620 // 0x000C5E7C
|
||||
|
||||
#define WUFFS_CRC32__STATUS_OK 0 // 0x00000000
|
||||
@@ -1300,9 +1298,7 @@ typedef int32_t wuffs_crc32__status;
|
||||
#define WUFFS_CRC32__ERROR_INVALID_CALL_SEQUENCE -301989888 // 0xEE000000
|
||||
#define WUFFS_CRC32__SUSPENSION_END_OF_DATA 16777216 // 0x01000000
|
||||
|
||||
bool wuffs_crc32__status__is_error(wuffs_crc32__status s);
|
||||
|
||||
const char* wuffs_crc32__status__string(wuffs_crc32__status s);
|
||||
const char* wuffs_crc32__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1317,7 +1313,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_crc32__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_state;
|
||||
@@ -1365,8 +1361,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_deflate__status;
|
||||
|
||||
#define wuffs_deflate__packageid 848533 // 0x000CF295
|
||||
|
||||
#define WUFFS_DEFLATE__STATUS_OK 0 // 0x00000000
|
||||
@@ -1417,9 +1411,7 @@ typedef int32_t wuffs_deflate__status;
|
||||
#define WUFFS_DEFLATE__ERROR_INTERNAL_ERROR_INCONSISTENT_N_BITS \
|
||||
-1123224939 // 0xBD0CF295
|
||||
|
||||
bool wuffs_deflate__status__is_error(wuffs_deflate__status s);
|
||||
|
||||
const char* wuffs_deflate__status__string(wuffs_deflate__status s);
|
||||
const char* wuffs_deflate__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1434,7 +1426,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_deflate__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_bits;
|
||||
@@ -1448,7 +1440,7 @@ typedef struct {
|
||||
|
||||
struct {
|
||||
uint32_t coro_susp_point;
|
||||
wuffs_deflate__status v_z;
|
||||
wuffs_base__status v_z;
|
||||
uint64_t v_n_copied;
|
||||
uint32_t v_already_full;
|
||||
} c_decode[1];
|
||||
@@ -1514,10 +1506,9 @@ void wuffs_deflate__decoder__check_wuffs_version(wuffs_deflate__decoder* self,
|
||||
|
||||
// ---------------- Public Function Prototypes
|
||||
|
||||
wuffs_deflate__status wuffs_deflate__decoder__decode(
|
||||
wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
wuffs_base__status wuffs_deflate__decoder__decode(wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
@@ -1533,8 +1524,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_gzip__status;
|
||||
|
||||
#define wuffs_gzip__packageid 1041911 // 0x000FE5F7
|
||||
|
||||
#define WUFFS_GZIP__STATUS_OK 0 // 0x00000000
|
||||
@@ -1560,9 +1549,7 @@ typedef int32_t wuffs_gzip__status;
|
||||
#define WUFFS_GZIP__ERROR_BAD_ENCODING_FLAGS -49289737 // 0xFD0FE5F7
|
||||
#define WUFFS_GZIP__ERROR_BAD_HEADER -66066953 // 0xFC0FE5F7
|
||||
|
||||
bool wuffs_gzip__status__is_error(wuffs_gzip__status s);
|
||||
|
||||
const char* wuffs_gzip__status__string(wuffs_gzip__status s);
|
||||
const char* wuffs_gzip__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1577,7 +1564,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_gzip__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
wuffs_deflate__decoder f_flate;
|
||||
@@ -1591,7 +1578,7 @@ typedef struct {
|
||||
uint16_t v_xlen;
|
||||
uint32_t v_checksum_got;
|
||||
uint32_t v_decoded_length_got;
|
||||
wuffs_gzip__status v_z;
|
||||
wuffs_base__status v_z;
|
||||
uint32_t v_checksum_want;
|
||||
uint32_t v_decoded_length_want;
|
||||
uint64_t scratch;
|
||||
@@ -1615,7 +1602,7 @@ void wuffs_gzip__decoder__check_wuffs_version(wuffs_gzip__decoder* self,
|
||||
void wuffs_gzip__decoder__set_ignore_checksum(wuffs_gzip__decoder* self,
|
||||
bool a_ic);
|
||||
|
||||
wuffs_gzip__status wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
|
||||
wuffs_base__status wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
|
||||
+5
-9
@@ -1269,8 +1269,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_lzw__status;
|
||||
|
||||
#define wuffs_lzw__packageid 1316776 // 0x001417A8
|
||||
|
||||
#define WUFFS_LZW__STATUS_OK 0 // 0x00000000
|
||||
@@ -1294,9 +1292,7 @@ typedef int32_t wuffs_lzw__status;
|
||||
#define WUFFS_LZW__ERROR_BAD_CODE -15460440 // 0xFF1417A8
|
||||
#define WUFFS_LZW__ERROR_CYCLICAL_PREFIX_CHAIN -32237656 // 0xFE1417A8
|
||||
|
||||
bool wuffs_lzw__status__is_error(wuffs_lzw__status s);
|
||||
|
||||
const char* wuffs_lzw__status__string(wuffs_lzw__status s);
|
||||
const char* wuffs_lzw__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1311,7 +1307,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_lzw__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_literal_width;
|
||||
@@ -1353,9 +1349,9 @@ void wuffs_lzw__decoder__check_wuffs_version(wuffs_lzw__decoder* self,
|
||||
void wuffs_lzw__decoder__set_literal_width(wuffs_lzw__decoder* self,
|
||||
uint32_t a_lw);
|
||||
|
||||
wuffs_lzw__status wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
wuffs_base__status wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
||||
+12
-25
@@ -1278,8 +1278,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_adler32__status;
|
||||
|
||||
#define wuffs_adler32__packageid 681002 // 0x000A642A
|
||||
|
||||
#define WUFFS_ADLER32__STATUS_OK 0 // 0x00000000
|
||||
@@ -1301,9 +1299,7 @@ typedef int32_t wuffs_adler32__status;
|
||||
#define WUFFS_ADLER32__ERROR_INVALID_CALL_SEQUENCE -301989888 // 0xEE000000
|
||||
#define WUFFS_ADLER32__SUSPENSION_END_OF_DATA 16777216 // 0x01000000
|
||||
|
||||
bool wuffs_adler32__status__is_error(wuffs_adler32__status s);
|
||||
|
||||
const char* wuffs_adler32__status__string(wuffs_adler32__status s);
|
||||
const char* wuffs_adler32__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1318,7 +1314,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_adler32__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_state;
|
||||
@@ -1366,8 +1362,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_deflate__status;
|
||||
|
||||
#define wuffs_deflate__packageid 848533 // 0x000CF295
|
||||
|
||||
#define WUFFS_DEFLATE__STATUS_OK 0 // 0x00000000
|
||||
@@ -1418,9 +1412,7 @@ typedef int32_t wuffs_deflate__status;
|
||||
#define WUFFS_DEFLATE__ERROR_INTERNAL_ERROR_INCONSISTENT_N_BITS \
|
||||
-1123224939 // 0xBD0CF295
|
||||
|
||||
bool wuffs_deflate__status__is_error(wuffs_deflate__status s);
|
||||
|
||||
const char* wuffs_deflate__status__string(wuffs_deflate__status s);
|
||||
const char* wuffs_deflate__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1435,7 +1427,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_deflate__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_bits;
|
||||
@@ -1449,7 +1441,7 @@ typedef struct {
|
||||
|
||||
struct {
|
||||
uint32_t coro_susp_point;
|
||||
wuffs_deflate__status v_z;
|
||||
wuffs_base__status v_z;
|
||||
uint64_t v_n_copied;
|
||||
uint32_t v_already_full;
|
||||
} c_decode[1];
|
||||
@@ -1515,10 +1507,9 @@ void wuffs_deflate__decoder__check_wuffs_version(wuffs_deflate__decoder* self,
|
||||
|
||||
// ---------------- Public Function Prototypes
|
||||
|
||||
wuffs_deflate__status wuffs_deflate__decoder__decode(
|
||||
wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
wuffs_base__status wuffs_deflate__decoder__decode(wuffs_deflate__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
@@ -1534,8 +1525,6 @@ extern "C" {
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
typedef int32_t wuffs_zlib__status;
|
||||
|
||||
#define wuffs_zlib__packageid 2064249 // 0x001F7F79
|
||||
|
||||
#define WUFFS_ZLIB__STATUS_OK 0 // 0x00000000
|
||||
@@ -1563,9 +1552,7 @@ typedef int32_t wuffs_zlib__status;
|
||||
#define WUFFS_ZLIB__ERROR_TODO_UNSUPPORTED_PRESET_DICTIONARY \
|
||||
-1071677575 // 0xC01F7F79
|
||||
|
||||
bool wuffs_zlib__status__is_error(wuffs_zlib__status s);
|
||||
|
||||
const char* wuffs_zlib__status__string(wuffs_zlib__status s);
|
||||
const char* wuffs_zlib__status__string(wuffs_base__status s);
|
||||
|
||||
// ---------------- Public Consts
|
||||
|
||||
@@ -1580,7 +1567,7 @@ typedef struct {
|
||||
//
|
||||
// It is a struct, not a struct*, so that it can be stack allocated.
|
||||
struct {
|
||||
wuffs_zlib__status status;
|
||||
wuffs_base__status status;
|
||||
uint32_t magic;
|
||||
|
||||
wuffs_deflate__decoder f_flate;
|
||||
@@ -1591,7 +1578,7 @@ typedef struct {
|
||||
uint32_t coro_susp_point;
|
||||
uint16_t v_x;
|
||||
uint32_t v_checksum_got;
|
||||
wuffs_zlib__status v_z;
|
||||
wuffs_base__status v_z;
|
||||
uint32_t v_checksum_want;
|
||||
uint64_t scratch;
|
||||
} c_decode[1];
|
||||
@@ -1614,7 +1601,7 @@ void wuffs_zlib__decoder__check_wuffs_version(wuffs_zlib__decoder* self,
|
||||
void wuffs_zlib__decoder__set_ignore_checksum(wuffs_zlib__decoder* self,
|
||||
bool a_ic);
|
||||
|
||||
wuffs_zlib__status wuffs_zlib__decoder__decode(wuffs_zlib__decoder* self,
|
||||
wuffs_base__status wuffs_zlib__decoder__decode(wuffs_zlib__decoder* self,
|
||||
wuffs_base__io_writer a_dst,
|
||||
wuffs_base__io_reader a_src);
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ const char* wuffs_deflate_decode(wuffs_base__io_buffer* dst,
|
||||
set_reader_limit(&src_reader, rlimit);
|
||||
}
|
||||
|
||||
wuffs_deflate__status s =
|
||||
wuffs_base__status s =
|
||||
wuffs_deflate__decoder__decode(&dec, dst_writer, src_reader);
|
||||
|
||||
if (s == WUFFS_DEFLATE__STATUS_OK) {
|
||||
@@ -227,13 +227,13 @@ void test_wuffs_deflate_decode_split_src() {
|
||||
src.closed = false;
|
||||
src.ri = gt->src_offset0;
|
||||
src.wi = split;
|
||||
wuffs_deflate__status s0 =
|
||||
wuffs_base__status s0 =
|
||||
wuffs_deflate__decoder__decode(&dec, dst_writer, src_reader);
|
||||
|
||||
src.closed = true;
|
||||
src.ri = split;
|
||||
src.wi = gt->src_offset1;
|
||||
wuffs_deflate__status s1 =
|
||||
wuffs_base__status s1 =
|
||||
wuffs_deflate__decoder__decode(&dec, dst_writer, src_reader);
|
||||
|
||||
if (s0 != WUFFS_DEFLATE__SUSPENSION_SHORT_READ) {
|
||||
@@ -266,7 +266,7 @@ bool do_test_wuffs_deflate_history(int i,
|
||||
wuffs_deflate__decoder* dec,
|
||||
uint32_t starting_history_index,
|
||||
uint64_t limit,
|
||||
wuffs_deflate__status want_s) {
|
||||
wuffs_base__status want_s) {
|
||||
src->ri = gt->src_offset0;
|
||||
src->wi = gt->src_offset1;
|
||||
got->ri = 0;
|
||||
@@ -279,7 +279,7 @@ bool do_test_wuffs_deflate_history(int i,
|
||||
|
||||
set_writer_limit(&dst_writer, limit);
|
||||
|
||||
wuffs_deflate__status got_s =
|
||||
wuffs_base__status got_s =
|
||||
wuffs_deflate__decoder__decode(dec, dst_writer, src_reader);
|
||||
if (got_s != want_s) {
|
||||
FAIL("i=%d: starting_history_index=0x%04" PRIX32
|
||||
@@ -483,8 +483,7 @@ void test_wuffs_deflate_table_redirect() {
|
||||
dec.private_impl.f_code_lengths[n++] = 13;
|
||||
dec.private_impl.f_code_lengths[n++] = 13;
|
||||
|
||||
wuffs_deflate__status s =
|
||||
wuffs_deflate__decoder__init_huff(&dec, 0, 0, n, 257);
|
||||
wuffs_base__status s = wuffs_deflate__decoder__init_huff(&dec, 0, 0, n, 257);
|
||||
if (s) {
|
||||
FAIL("%s", wuffs_deflate__status__string(s));
|
||||
return;
|
||||
|
||||
+14
-14
@@ -54,7 +54,7 @@ void test_basic_bad_receiver() {
|
||||
CHECK_FOCUS(__func__);
|
||||
wuffs_base__image_config ic = ((wuffs_base__image_config){});
|
||||
wuffs_base__io_reader src = ((wuffs_base__io_reader){});
|
||||
wuffs_gif__status status = wuffs_gif__decoder__decode_config(NULL, &ic, src);
|
||||
wuffs_base__status status = wuffs_gif__decoder__decode_config(NULL, &ic, src);
|
||||
if (status != WUFFS_GIF__ERROR_BAD_RECEIVER) {
|
||||
FAIL("decode_config: got %" PRIi32 " (%s), want %" PRIi32 " (%s)", status,
|
||||
wuffs_gif__status__string(status), WUFFS_GIF__ERROR_BAD_RECEIVER,
|
||||
@@ -96,7 +96,7 @@ void test_basic_check_wuffs_version_not_called() {
|
||||
wuffs_gif__decoder dec = ((wuffs_gif__decoder){});
|
||||
wuffs_base__image_config ic = ((wuffs_base__image_config){});
|
||||
wuffs_base__io_reader src = ((wuffs_base__io_reader){});
|
||||
wuffs_gif__status status = wuffs_gif__decoder__decode_config(&dec, &ic, src);
|
||||
wuffs_base__status status = wuffs_gif__decoder__decode_config(&dec, &ic, src);
|
||||
if (status != WUFFS_GIF__ERROR_CHECK_WUFFS_VERSION_NOT_CALLED) {
|
||||
FAIL("decode_config: got %" PRIi32 " (%s), want %" PRIi32 " (%s)", status,
|
||||
wuffs_gif__status__string(status),
|
||||
@@ -108,19 +108,19 @@ void test_basic_check_wuffs_version_not_called() {
|
||||
|
||||
void test_basic_status_is_error() {
|
||||
CHECK_FOCUS(__func__);
|
||||
if (wuffs_gif__status__is_error(WUFFS_GIF__STATUS_OK)) {
|
||||
if (wuffs_base__status__is_error(WUFFS_GIF__STATUS_OK)) {
|
||||
FAIL("is_error(OK) returned true");
|
||||
return;
|
||||
}
|
||||
if (!wuffs_gif__status__is_error(WUFFS_GIF__ERROR_BAD_WUFFS_VERSION)) {
|
||||
if (!wuffs_base__status__is_error(WUFFS_GIF__ERROR_BAD_WUFFS_VERSION)) {
|
||||
FAIL("is_error(BAD_WUFFS_VERSION) returned false");
|
||||
return;
|
||||
}
|
||||
if (wuffs_gif__status__is_error(WUFFS_GIF__SUSPENSION_SHORT_WRITE)) {
|
||||
if (wuffs_base__status__is_error(WUFFS_GIF__SUSPENSION_SHORT_WRITE)) {
|
||||
FAIL("is_error(SHORT_WRITE) returned true");
|
||||
return;
|
||||
}
|
||||
if (!wuffs_gif__status__is_error(WUFFS_GIF__ERROR_BAD_HEADER)) {
|
||||
if (!wuffs_base__status__is_error(WUFFS_GIF__ERROR_BAD_HEADER)) {
|
||||
FAIL("is_error(BAD_HEADER) returned false");
|
||||
return;
|
||||
}
|
||||
@@ -198,7 +198,7 @@ const char* wuffs_gif_decode(wuffs_base__io_buffer* dst,
|
||||
wuffs_base__image_buffer ib = ((wuffs_base__image_buffer){});
|
||||
wuffs_base__image_config ic = ((wuffs_base__image_config){});
|
||||
wuffs_base__io_reader src_reader = wuffs_base__io_buffer__reader(src);
|
||||
wuffs_gif__status s =
|
||||
wuffs_base__status s =
|
||||
wuffs_gif__decoder__decode_config(&dec, &ic, src_reader);
|
||||
if (s) {
|
||||
return wuffs_gif__status__string(s);
|
||||
@@ -246,7 +246,7 @@ bool do_test_wuffs_gif_decode(const char* filename,
|
||||
{
|
||||
wuffs_base__image_config ic = ((wuffs_base__image_config){});
|
||||
wuffs_base__io_reader src_reader = wuffs_base__io_buffer__reader(&src);
|
||||
wuffs_gif__status status =
|
||||
wuffs_base__status status =
|
||||
wuffs_gif__decoder__decode_config(&dec, &ic, src_reader);
|
||||
if (status != WUFFS_GIF__STATUS_OK) {
|
||||
FAIL("decode_config: got %" PRIi32 " (%s)", status,
|
||||
@@ -295,7 +295,7 @@ bool do_test_wuffs_gif_decode(const char* filename,
|
||||
}
|
||||
size_t old_ri = src.ri;
|
||||
|
||||
wuffs_gif__status status =
|
||||
wuffs_base__status status =
|
||||
wuffs_gif__decoder__decode_frame(&dec, &ib, src_reader);
|
||||
|
||||
if (status == WUFFS_GIF__STATUS_OK) {
|
||||
@@ -363,7 +363,7 @@ bool do_test_wuffs_gif_decode(const char* filename,
|
||||
return false;
|
||||
}
|
||||
wuffs_base__io_reader src_reader = wuffs_base__io_buffer__reader(&src);
|
||||
wuffs_gif__status status =
|
||||
wuffs_base__status status =
|
||||
wuffs_gif__decoder__decode_frame(&dec, &ib, src_reader);
|
||||
if (status != WUFFS_GIF__SUSPENSION_END_OF_DATA) {
|
||||
FAIL("decode_frame: got %" PRIi32 " (%s), want %" PRIi32 " (%s)", status,
|
||||
@@ -396,7 +396,7 @@ void test_wuffs_gif_call_sequence() {
|
||||
wuffs_base__image_buffer ib = ((wuffs_base__image_buffer){});
|
||||
wuffs_base__io_reader src_reader = wuffs_base__io_buffer__reader(&src);
|
||||
|
||||
wuffs_gif__status status =
|
||||
wuffs_base__status status =
|
||||
wuffs_gif__decoder__decode_frame(&dec, &ib, src_reader);
|
||||
if (status != WUFFS_GIF__ERROR_INVALID_CALL_SEQUENCE) {
|
||||
FAIL("decode_frame: got %" PRIi32 " (%s), want %" PRIi32 " (%s)", status,
|
||||
@@ -425,7 +425,7 @@ bool do_test_wuffs_gif_decode_animated(
|
||||
wuffs_base__image_config ic = ((wuffs_base__image_config){});
|
||||
wuffs_base__io_reader src_reader = wuffs_base__io_buffer__reader(&src);
|
||||
|
||||
wuffs_gif__status status =
|
||||
wuffs_base__status status =
|
||||
wuffs_gif__decoder__decode_config(&dec, &ic, src_reader);
|
||||
if (status != WUFFS_GIF__STATUS_OK) {
|
||||
FAIL("decode_config: got %" PRIi32 " (%s)", status,
|
||||
@@ -523,7 +523,7 @@ void test_wuffs_gif_decode_frame_out_of_bounds() {
|
||||
wuffs_gif__decoder__check_wuffs_version(&dec, sizeof dec, WUFFS_VERSION);
|
||||
wuffs_base__image_config ic = ((wuffs_base__image_config){});
|
||||
wuffs_base__io_reader src_reader = wuffs_base__io_buffer__reader(&src);
|
||||
wuffs_gif__status s =
|
||||
wuffs_base__status s =
|
||||
wuffs_gif__decoder__decode_config(&dec, &ic, src_reader);
|
||||
if (s) {
|
||||
FAIL("decode_config: %s", wuffs_gif__status__string(s));
|
||||
@@ -594,7 +594,7 @@ void test_wuffs_gif_decode_input_is_a_png() {
|
||||
wuffs_base__image_config ic = ((wuffs_base__image_config){});
|
||||
wuffs_base__io_reader src_reader = wuffs_base__io_buffer__reader(&src);
|
||||
|
||||
wuffs_gif__status status =
|
||||
wuffs_base__status status =
|
||||
wuffs_gif__decoder__decode_config(&dec, &ic, src_reader);
|
||||
if (status != WUFFS_GIF__ERROR_BAD_HEADER) {
|
||||
FAIL("decode_config: got %" PRIi32 " (%s), want %" PRIi32 " (%s)", status,
|
||||
|
||||
+3
-3
@@ -80,7 +80,7 @@ const char* wuffs_gzip_decode(wuffs_base__io_buffer* dst,
|
||||
set_reader_limit(&src_reader, rlimit);
|
||||
}
|
||||
|
||||
wuffs_gzip__status s =
|
||||
wuffs_base__status s =
|
||||
wuffs_gzip__decoder__decode(&dec, dst_writer, src_reader);
|
||||
|
||||
if (s == WUFFS_GZIP__STATUS_OK) {
|
||||
@@ -127,7 +127,7 @@ bool do_test_wuffs_gzip_checksum(bool ignore_checksum, uint32_t bad_checksum) {
|
||||
int i;
|
||||
for (i = 0; i < 2; i++) {
|
||||
wuffs_base__io_reader src_reader = wuffs_base__io_buffer__reader(&src);
|
||||
wuffs_gzip__status want = 0;
|
||||
wuffs_base__status want = 0;
|
||||
if (i == 0) {
|
||||
if (end_limit == 0) {
|
||||
continue;
|
||||
@@ -144,7 +144,7 @@ bool do_test_wuffs_gzip_checksum(bool ignore_checksum, uint32_t bad_checksum) {
|
||||
: WUFFS_GZIP__STATUS_OK;
|
||||
}
|
||||
|
||||
wuffs_gzip__status status =
|
||||
wuffs_base__status status =
|
||||
wuffs_gzip__decoder__decode(&dec, got_writer, src_reader);
|
||||
if (status != want) {
|
||||
FAIL("end_limit=%d: got %" PRIi32 " (%s), want %" PRIi32 " (%s)",
|
||||
|
||||
+2
-2
@@ -99,7 +99,7 @@ bool do_test_wuffs_lzw_decode(const char* src_filename,
|
||||
size_t old_wi = got.wi;
|
||||
size_t old_ri = src.ri;
|
||||
|
||||
wuffs_lzw__status status =
|
||||
wuffs_base__status status =
|
||||
wuffs_lzw__decoder__decode(&dec, got_writer, src_reader);
|
||||
if (status == WUFFS_LZW__STATUS_OK) {
|
||||
if (src.ri != src.wi) {
|
||||
@@ -211,7 +211,7 @@ bool do_bench_wuffs_lzw_decode(const char* filename, uint64_t iters_unscaled) {
|
||||
src.ri = 1; // Skip the literal width.
|
||||
wuffs_lzw__decoder dec = ((wuffs_lzw__decoder){});
|
||||
wuffs_lzw__decoder__check_wuffs_version(&dec, sizeof dec, WUFFS_VERSION);
|
||||
wuffs_lzw__status s =
|
||||
wuffs_base__status s =
|
||||
wuffs_lzw__decoder__decode(&dec, dst_writer, src_reader);
|
||||
if (s) {
|
||||
FAIL("decode: %" PRIi32 " (%s)", s, wuffs_lzw__status__string(s));
|
||||
|
||||
+3
-3
@@ -80,7 +80,7 @@ const char* wuffs_zlib_decode(wuffs_base__io_buffer* dst,
|
||||
set_reader_limit(&src_reader, rlimit);
|
||||
}
|
||||
|
||||
wuffs_zlib__status s =
|
||||
wuffs_base__status s =
|
||||
wuffs_zlib__decoder__decode(&dec, dst_writer, src_reader);
|
||||
|
||||
if (s == WUFFS_ZLIB__STATUS_OK) {
|
||||
@@ -126,7 +126,7 @@ bool do_test_wuffs_zlib_checksum(bool ignore_checksum, bool bad_checksum) {
|
||||
int i;
|
||||
for (i = 0; i < 2; i++) {
|
||||
wuffs_base__io_reader src_reader = wuffs_base__io_buffer__reader(&src);
|
||||
wuffs_zlib__status want = 0;
|
||||
wuffs_base__status want = 0;
|
||||
if (i == 0) {
|
||||
if (end_limit == 0) {
|
||||
continue;
|
||||
@@ -143,7 +143,7 @@ bool do_test_wuffs_zlib_checksum(bool ignore_checksum, bool bad_checksum) {
|
||||
: WUFFS_ZLIB__STATUS_OK;
|
||||
}
|
||||
|
||||
wuffs_zlib__status status =
|
||||
wuffs_base__status status =
|
||||
wuffs_zlib__decoder__decode(&dec, got_writer, src_reader);
|
||||
if (status != want) {
|
||||
FAIL("end_limit=%d: got %" PRIi32 " (%s), want %" PRIi32 " (%s)",
|
||||
|
||||
Reference in new issue
Block a user