Add WUFFS_CONFIG__STATIC_FUNCTIONS

This commit is contained in:
Nigel Tao committed 2018-07-14 10:16:10 +10:00
1 parent b82a1992de
commit 8a6e177701
7 files changed
+125 -73

No files matched your search

@@ -52,6 +52,16 @@ extern "C" {
#define WUFFS_VERSION_EXTENSION "" #define WUFFS_VERSION_EXTENSION ""
#define WUFFS_VERSION_STRING "0.0.0" #define WUFFS_VERSION_STRING "0.0.0"
// Define WUFFS_CONFIG__STATIC_FUNCTIONS to make all of Wuffs' functions have
// static storage. The motivation is discussed in the "ALLOW STATIC
// IMPLEMENTATION" section of
// https://raw.githubusercontent.com/nothings/stb/master/docs/stb_howto.txt
#ifdef WUFFS_CONFIG__STATIC_FUNCTIONS
#define WUFFS_BASE__MAYBE_STATIC static
#else
#define WUFFS_BASE__MAYBE_STATIC
#endif
// wuffs_base__empty_struct is used when a Wuffs function returns an empty // wuffs_base__empty_struct is used when a Wuffs function returns an empty
// struct. In C, if a function f returns void, you can't say "x = f()", but in // struct. In C, if a function f returns void, you can't say "x = f()", but in
// Wuffs, if a function g returns empty, you can say "y = g()". // Wuffs, if a function g returns empty, you can say "y = g()".
+3 -1
View File
@@ -589,7 +589,9 @@ func (g *gen) gatherStatuses(b *buffer, n *a.Status) error {
} }
func (g *gen) writeConst(b *buffer, n *a.Const) error { func (g *gen) writeConst(b *buffer, n *a.Const) error {
if !n.Public() { if n.Public() {
b.writes("WUFFS_BASE__MAYBE_STATIC ")
} else {
b.writes("static ") b.writes("static ")
} }
b.writes("const ") b.writes("const ")
+3 -3
View File
@@ -18,9 +18,9 @@ package cgen
const basePublicH = "" + const basePublicH = "" +
"#ifndef WUFFS_INCLUDE_GUARD__BASE_PUBLIC\n#define WUFFS_INCLUDE_GUARD__BASE_PUBLIC\n\n// Copyright 2017 The Wuffs Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stdbool.h>\n#include <stdint.h>\n#include <string.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n// Wuffs assumes that:\n// - converting a uint32_t to a size_t will never overflow.\n// - converting a size_t to a uint64_t will never overflow.\n#ifdef __WORDSIZE\n#if (__WORDSIZE != 32) && (__WORDSIZE != 64)\n#error \"Wuffs requires a word size " + "#ifndef WUFFS_INCLUDE_GUARD__BASE_PUBLIC\n#define WUFFS_INCLUDE_GUARD__BASE_PUBLIC\n\n// Copyright 2017 The Wuffs Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include <stdbool.h>\n#include <stdint.h>\n#include <string.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n// Wuffs assumes that:\n// - converting a uint32_t to a size_t will never overflow.\n// - converting a size_t to a uint64_t will never overflow.\n#ifdef __WORDSIZE\n#if (__WORDSIZE != 32) && (__WORDSIZE != 64)\n#error \"Wuffs requires a word size " +
"of either 32 or 64 bits\"\n#endif\n#endif\n\n// WUFFS_VERSION is the major.minor.patch version, as per https://semver.org/,\n// as a uint64_t. The major number is the high 32 bits. The minor number is the\n// middle 16 bits. The patch number is the low 16 bits. The version extension\n// (such as \"\", \"beta\" or \"rc.1\") is part of the string representation (such as\n// \"1.2.3-beta\") but not the uint64_t representation.\n//\n// All three of major, minor and patch being zero means that this is a\n// work-in-progress version, not a release version, and has no backwards or\n// forwards compatibility guarantees.\n//\n// !! Some code generation programs can override WUFFS_VERSION.\n#define WUFFS_VERSION ((uint64_t)0)\n#define WUFFS_VERSION_MAJOR ((uint64_t)0)\n#define WUFFS_VERSION_MINOR ((uint64_t)0)\n#define WUFFS_VERSION_PATCH ((uint64_t)0)\n#define WUFFS_VERSION_EXTENSION \"\"\n#define WUFFS_VERSION_STRING \"0.0.0\"\n\n// wuffs_base__empty_struct is used when a Wuffs function returns an empty\n// struct. In C, if a function f returns void, y" + "of either 32 or 64 bits\"\n#endif\n#endif\n\n// WUFFS_VERSION is the major.minor.patch version, as per https://semver.org/,\n// as a uint64_t. The major number is the high 32 bits. The minor number is the\n// middle 16 bits. The patch number is the low 16 bits. The version extension\n// (such as \"\", \"beta\" or \"rc.1\") is part of the string representation (such as\n// \"1.2.3-beta\") but not the uint64_t representation.\n//\n// All three of major, minor and patch being zero means that this is a\n// work-in-progress version, not a release version, and has no backwards or\n// forwards compatibility guarantees.\n//\n// !! Some code generation programs can override WUFFS_VERSION.\n#define WUFFS_VERSION ((uint64_t)0)\n#define WUFFS_VERSION_MAJOR ((uint64_t)0)\n#define WUFFS_VERSION_MINOR ((uint64_t)0)\n#define WUFFS_VERSION_PATCH ((uint64_t)0)\n#define WUFFS_VERSION_EXTENSION \"\"\n#define WUFFS_VERSION_STRING \"0.0.0\"\n\n// Define WUFFS_CONFIG__STATIC_FUNCTIONS to make all of Wuffs' functions have\n// static storage. The motivation is discusse" +
"ou can't say \"x = f()\", but in\n// Wuffs, if a function g returns empty, you can say \"y = g()\".\ntypedef struct {\n // private_impl is a placeholder field. It isn't explicitly used, except that\n // without it, the sizeof a struct with no fields can differ across C/C++\n // compilers, and it is undefined behavior in C99. For example, gcc says that\n // the sizeof an empty struct is 0, and g++ says that it is 1. This leads to\n // ABI incompatibility if a Wuffs .c file is processed by one compiler and\n // its .h file with another compiler.\n //\n // Instead, we explicitly insert an otherwise unused field, so that the\n // sizeof this struct is always 1.\n uint8_t private_impl;\n} wuffs_base__empty_struct;\n\n// wuffs_base__utility is a placeholder receiver type. It enables what Java\n// calls static methods, as opposed to regular methods.\ntypedef struct {\n // private_impl is a placeholder field. It isn't explicitly used, except that\n // without it, the sizeof a struct with no fields can differ across C/C++\n // c" + "d in the \"ALLOW STATIC\n// IMPLEMENTATION\" section of\n// https://raw.githubusercontent.com/nothings/stb/master/docs/stb_howto.txt\n#ifdef WUFFS_CONFIG__STATIC_FUNCTIONS\n#define WUFFS_BASE__MAYBE_STATIC static\n#else\n#define WUFFS_BASE__MAYBE_STATIC\n#endif\n\n// wuffs_base__empty_struct is used when a Wuffs function returns an empty\n// struct. In C, if a function f returns void, you can't say \"x = f()\", but in\n// Wuffs, if a function g returns empty, you can say \"y = g()\".\ntypedef struct {\n // private_impl is a placeholder field. It isn't explicitly used, except that\n // without it, the sizeof a struct with no fields can differ across C/C++\n // compilers, and it is undefined behavior in C99. For example, gcc says that\n // the sizeof an empty struct is 0, and g++ says that it is 1. This leads to\n // ABI incompatibility if a Wuffs .c file is processed by one compiler and\n // its .h file with another compiler.\n //\n // Instead, we explicitly insert an otherwise unused field, so that the\n // sizeof this struct " +
"ompilers, and it is undefined behavior in C99. For example, gcc says that\n // the sizeof an empty struct is 0, and g++ says that it is 1. This leads to\n // ABI incompatibility if a Wuffs .c file is processed by one compiler and\n // its .h file with another compiler.\n //\n // Instead, we explicitly insert an otherwise unused field, so that the\n // sizeof this struct is always 1.\n uint8_t private_impl;\n} wuffs_base__utility;\n\n" + "is always 1.\n uint8_t private_impl;\n} wuffs_base__empty_struct;\n\n// wuffs_base__utility is a placeholder receiver type. It enables what Java\n// calls static methods, as opposed to regular methods.\ntypedef struct {\n // private_impl is a placeholder field. It isn't explicitly used, except that\n // without it, the sizeof a struct with no fields can differ across C/C++\n // compilers, and it is undefined behavior in C99. For example, gcc says that\n // the sizeof an empty struct is 0, and g++ says that it is 1. This leads to\n // ABI incompatibility if a Wuffs .c file is processed by one compiler and\n // its .h file with another compiler.\n //\n // Instead, we explicitly insert an otherwise unused field, so that the\n // sizeof this struct is always 1.\n uint8_t private_impl;\n} wuffs_base__utility;\n\n" +
"" + "" +
"// --------\n\n// A status code is either zero (OK), positive (a recoverable suspension or\n// pause in processing) or negative (a non-recoverable error). Its bits:\n// - bit 31 (the sign bit) indicates unrecoverable-ness: an error.\n// - bits 30 .. 24 are a package-namespaced numeric code\n// - bits 23 .. 21 are reserved.\n// - bits 20 .. 0 are the packageid (a namespace) as a base38 value.\n//\n// Do not manipulate these bits directly; they are private implementation\n// details. Use methods such as wuffs_base__status__is_error instead.\ntypedef int32_t wuffs_base__status;\n\n// !! INSERT wuffs_base__status names.\n\nstatic inline bool wuffs_base__status__is_error(wuffs_base__status s) {\n return s < 0;\n}\n\nstatic inline bool wuffs_base__status__is_ok(wuffs_base__status s) {\n return s == 0;\n}\n\nstatic inline bool wuffs_base__status__is_suspension(wuffs_base__status s) {\n return s > 0;\n}\n\nconst char* wuffs_base__status__string(wuffs_base__status s);\n\n" + "// --------\n\n// A status code is either zero (OK), positive (a recoverable suspension or\n// pause in processing) or negative (a non-recoverable error). Its bits:\n// - bit 31 (the sign bit) indicates unrecoverable-ness: an error.\n// - bits 30 .. 24 are a package-namespaced numeric code\n// - bits 23 .. 21 are reserved.\n// - bits 20 .. 0 are the packageid (a namespace) as a base38 value.\n//\n// Do not manipulate these bits directly; they are private implementation\n// details. Use methods such as wuffs_base__status__is_error instead.\ntypedef int32_t wuffs_base__status;\n\n// !! INSERT wuffs_base__status names.\n\nstatic inline bool wuffs_base__status__is_error(wuffs_base__status s) {\n return s < 0;\n}\n\nstatic inline bool wuffs_base__status__is_ok(wuffs_base__status s) {\n return s == 0;\n}\n\nstatic inline bool wuffs_base__status__is_suspension(wuffs_base__status s) {\n return s > 0;\n}\n\nconst char* wuffs_base__status__string(wuffs_base__status s);\n\n" +
"" + "" +
+3 -1
View File
@@ -79,7 +79,9 @@ const (
func (g *gen) writeFuncSignature(b *buffer, n *a.Func, cpp uint32) error { func (g *gen) writeFuncSignature(b *buffer, n *a.Func, cpp uint32) error {
if cpp != cppNone { if cpp != cppNone {
b.writes("inline ") b.writes("inline ")
} else if !n.Public() { } else if n.Public() {
b.writes("WUFFS_BASE__MAYBE_STATIC ")
} else {
b.writes("static ") b.writes("static ")
} }
+2
View File
@@ -34,6 +34,8 @@
- Disallowed `__double_underscore` prefixed names. - Disallowed `__double_underscore` prefixed names.
- Added a stand-alone lang/interval package. - Added a stand-alone lang/interval package.
- Added fuzz tests. - Added fuzz tests.
- Added `WUFFS_CONFIG__MODULES`.
- Added `WUFFS_CONFIG__STATIC_FUNCTIONS`.
- Added some C++ convenience methods. - Added some C++ convenience methods.
- Added some Go and Rust benchmarks. - Added some Go and Rust benchmarks.
- Sped up the `mimic_deflate_xxx` benchmarks. - Sped up the `mimic_deflate_xxx` benchmarks.
+6
View File
@@ -38,6 +38,12 @@ for a C++ compiler $CXX, such as clang++ or g++.
// compiling it. // compiling it.
#define WUFFS_IMPLEMENTATION #define WUFFS_IMPLEMENTATION
// Defining the WUFFS_CONFIG__STATIC_FUNCTIONS macro is optional, but it
// demonstrates making all of Wuffs' functions have static storage. The
// motivation is discussed in the "ALLOW STATIC IMPLEMENTATION" section of
// https://raw.githubusercontent.com/nothings/stb/master/docs/stb_howto.txt
#define WUFFS_CONFIG__STATIC_FUNCTIONS
// If building this program in an environment that doesn't easily accomodate // If building this program in an environment that doesn't easily accomodate
// relative includes, you can use the script/inline-c-relative-includes.go // relative includes, you can use the script/inline-c-relative-includes.go
// program to generate a stand-alone C++ file. // program to generate a stand-alone C++ file.
+98 -68
View File
@@ -73,6 +73,16 @@ extern "C" {
#define WUFFS_VERSION_EXTENSION "" #define WUFFS_VERSION_EXTENSION ""
#define WUFFS_VERSION_STRING "0.0.0" #define WUFFS_VERSION_STRING "0.0.0"
// Define WUFFS_CONFIG__STATIC_FUNCTIONS to make all of Wuffs' functions have
// static storage. The motivation is discussed in the "ALLOW STATIC
// IMPLEMENTATION" section of
// https://raw.githubusercontent.com/nothings/stb/master/docs/stb_howto.txt
#ifdef WUFFS_CONFIG__STATIC_FUNCTIONS
#define WUFFS_BASE__MAYBE_STATIC static
#else
#define WUFFS_BASE__MAYBE_STATIC
#endif
// wuffs_base__empty_struct is used when a Wuffs function returns an empty // wuffs_base__empty_struct is used when a Wuffs function returns an empty
// struct. In C, if a function f returns void, you can't say "x = f()", but in // struct. In C, if a function f returns void, you can't say "x = f()", but in
// Wuffs, if a function g returns empty, you can say "y = g()". // Wuffs, if a function g returns empty, you can say "y = g()".
@@ -1811,8 +1821,9 @@ void wuffs_adler32__hasher__check_wuffs_version(wuffs_adler32__hasher* self,
// ---------------- Public Function Prototypes // ---------------- Public Function Prototypes
uint32_t wuffs_adler32__hasher__update(wuffs_adler32__hasher* self, WUFFS_BASE__MAYBE_STATIC uint32_t
wuffs_base__slice_u8 a_x); wuffs_adler32__hasher__update(wuffs_adler32__hasher* self,
wuffs_base__slice_u8 a_x);
// ---------------- C++ Convenience Methods // ---------------- C++ Convenience Methods
@@ -1890,8 +1901,9 @@ void wuffs_crc32__ieee_hasher__check_wuffs_version(
// ---------------- Public Function Prototypes // ---------------- Public Function Prototypes
uint32_t wuffs_crc32__ieee_hasher__update(wuffs_crc32__ieee_hasher* self, WUFFS_BASE__MAYBE_STATIC uint32_t
wuffs_base__slice_u8 a_x); wuffs_crc32__ieee_hasher__update(wuffs_crc32__ieee_hasher* self,
wuffs_base__slice_u8 a_x);
// ---------------- C++ Convenience Methods // ---------------- C++ Convenience Methods
@@ -2060,9 +2072,10 @@ void wuffs_deflate__decoder__check_wuffs_version(wuffs_deflate__decoder* self,
// ---------------- Public Function Prototypes // ---------------- Public Function Prototypes
wuffs_base__status wuffs_deflate__decoder__decode(wuffs_deflate__decoder* self, WUFFS_BASE__MAYBE_STATIC wuffs_base__status
wuffs_base__io_writer a_dst, wuffs_deflate__decoder__decode(wuffs_deflate__decoder* self,
wuffs_base__io_reader a_src); wuffs_base__io_writer a_dst,
wuffs_base__io_reader a_src);
// ---------------- C++ Convenience Methods // ---------------- C++ Convenience Methods
@@ -2171,12 +2184,14 @@ void wuffs_lzw__decoder__check_wuffs_version(wuffs_lzw__decoder* self,
// ---------------- Public Function Prototypes // ---------------- Public Function Prototypes
void wuffs_lzw__decoder__set_literal_width(wuffs_lzw__decoder* self, WUFFS_BASE__MAYBE_STATIC void wuffs_lzw__decoder__set_literal_width(
uint32_t a_lw); wuffs_lzw__decoder* self,
uint32_t a_lw);
wuffs_base__status wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self, WUFFS_BASE__MAYBE_STATIC wuffs_base__status
wuffs_base__io_writer a_dst, wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self,
wuffs_base__io_reader a_src); wuffs_base__io_writer a_dst,
wuffs_base__io_reader a_src);
// ---------------- C++ Convenience Methods // ---------------- C++ Convenience Methods
@@ -2364,21 +2379,22 @@ void wuffs_gif__decoder__check_wuffs_version(wuffs_gif__decoder* self,
// ---------------- Public Function Prototypes // ---------------- Public Function Prototypes
wuffs_base__status wuffs_gif__decoder__decode_config( WUFFS_BASE__MAYBE_STATIC wuffs_base__status
wuffs_gif__decoder* self, wuffs_gif__decoder__decode_config(wuffs_gif__decoder* self,
wuffs_base__image_config* a_dst, wuffs_base__image_config* a_dst,
wuffs_base__io_reader a_src); wuffs_base__io_reader a_src);
uint64_t wuffs_gif__decoder__frame_count(wuffs_gif__decoder* self); WUFFS_BASE__MAYBE_STATIC uint64_t
wuffs_gif__decoder__frame_count(wuffs_gif__decoder* self);
wuffs_base__range_ii_u64 wuffs_gif__decoder__work_buffer_size( WUFFS_BASE__MAYBE_STATIC wuffs_base__range_ii_u64
wuffs_gif__decoder* self); wuffs_gif__decoder__work_buffer_size(wuffs_gif__decoder* self);
wuffs_base__status wuffs_gif__decoder__decode_frame( WUFFS_BASE__MAYBE_STATIC wuffs_base__status
wuffs_gif__decoder* self, wuffs_gif__decoder__decode_frame(wuffs_gif__decoder* self,
wuffs_base__image_buffer* a_dst, wuffs_base__image_buffer* a_dst,
wuffs_base__io_reader a_src, wuffs_base__io_reader a_src,
wuffs_base__slice_u8 a_work_buffer); wuffs_base__slice_u8 a_work_buffer);
// ---------------- C++ Convenience Methods // ---------------- C++ Convenience Methods
@@ -2501,12 +2517,14 @@ void wuffs_gzip__decoder__check_wuffs_version(wuffs_gzip__decoder* self,
// ---------------- Public Function Prototypes // ---------------- Public Function Prototypes
void wuffs_gzip__decoder__set_ignore_checksum(wuffs_gzip__decoder* self, WUFFS_BASE__MAYBE_STATIC void wuffs_gzip__decoder__set_ignore_checksum(
bool a_ic); wuffs_gzip__decoder* self,
bool a_ic);
wuffs_base__status wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self, WUFFS_BASE__MAYBE_STATIC wuffs_base__status
wuffs_base__io_writer a_dst, wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
wuffs_base__io_reader a_src); wuffs_base__io_writer a_dst,
wuffs_base__io_reader a_src);
// ---------------- C++ Convenience Methods // ---------------- C++ Convenience Methods
@@ -2616,12 +2634,14 @@ void wuffs_zlib__decoder__check_wuffs_version(wuffs_zlib__decoder* self,
// ---------------- Public Function Prototypes // ---------------- Public Function Prototypes
void wuffs_zlib__decoder__set_ignore_checksum(wuffs_zlib__decoder* self, WUFFS_BASE__MAYBE_STATIC void wuffs_zlib__decoder__set_ignore_checksum(
bool a_ic); wuffs_zlib__decoder* self,
bool a_ic);
wuffs_base__status wuffs_zlib__decoder__decode(wuffs_zlib__decoder* self, WUFFS_BASE__MAYBE_STATIC wuffs_base__status
wuffs_base__io_writer a_dst, wuffs_zlib__decoder__decode(wuffs_zlib__decoder* self,
wuffs_base__io_reader a_src); wuffs_base__io_writer a_dst,
wuffs_base__io_reader a_src);
// ---------------- C++ Convenience Methods // ---------------- C++ Convenience Methods
@@ -3494,8 +3514,9 @@ void wuffs_adler32__hasher__check_wuffs_version(wuffs_adler32__hasher* self,
// -------- func adler32.hasher.update // -------- func adler32.hasher.update
uint32_t wuffs_adler32__hasher__update(wuffs_adler32__hasher* self, WUFFS_BASE__MAYBE_STATIC uint32_t
wuffs_base__slice_u8 a_x) { wuffs_adler32__hasher__update(wuffs_adler32__hasher* self,
wuffs_base__slice_u8 a_x) {
if (!self) { if (!self) {
return 0; return 0;
} }
@@ -4027,8 +4048,9 @@ void wuffs_crc32__ieee_hasher__check_wuffs_version(
// -------- func crc32.ieee_hasher.update // -------- func crc32.ieee_hasher.update
uint32_t wuffs_crc32__ieee_hasher__update(wuffs_crc32__ieee_hasher* self, WUFFS_BASE__MAYBE_STATIC uint32_t
wuffs_base__slice_u8 a_x) { wuffs_crc32__ieee_hasher__update(wuffs_crc32__ieee_hasher* self,
wuffs_base__slice_u8 a_x) {
if (!self) { if (!self) {
return 0; return 0;
} }
@@ -4402,9 +4424,10 @@ void wuffs_deflate__decoder__check_wuffs_version(wuffs_deflate__decoder* self,
// -------- func deflate.decoder.decode // -------- func deflate.decoder.decode
wuffs_base__status wuffs_deflate__decoder__decode(wuffs_deflate__decoder* self, WUFFS_BASE__MAYBE_STATIC wuffs_base__status
wuffs_base__io_writer a_dst, wuffs_deflate__decoder__decode(wuffs_deflate__decoder* self,
wuffs_base__io_reader a_src) { wuffs_base__io_writer a_dst,
wuffs_base__io_reader a_src) {
if (!self) { if (!self) {
return WUFFS_BASE__ERROR_BAD_RECEIVER; return WUFFS_BASE__ERROR_BAD_RECEIVER;
} }
@@ -6371,10 +6394,10 @@ void wuffs_gif__decoder__check_wuffs_version(wuffs_gif__decoder* self,
// -------- func gif.decoder.decode_config // -------- func gif.decoder.decode_config
wuffs_base__status wuffs_gif__decoder__decode_config( WUFFS_BASE__MAYBE_STATIC wuffs_base__status
wuffs_gif__decoder* self, wuffs_gif__decoder__decode_config(wuffs_gif__decoder* self,
wuffs_base__image_config* a_dst, wuffs_base__image_config* a_dst,
wuffs_base__io_reader a_src) { wuffs_base__io_reader a_src) {
if (!self) { if (!self) {
return WUFFS_BASE__ERROR_BAD_RECEIVER; return WUFFS_BASE__ERROR_BAD_RECEIVER;
} }
@@ -6460,7 +6483,8 @@ exit:
// -------- func gif.decoder.frame_count // -------- func gif.decoder.frame_count
uint64_t wuffs_gif__decoder__frame_count(wuffs_gif__decoder* self) { WUFFS_BASE__MAYBE_STATIC uint64_t
wuffs_gif__decoder__frame_count(wuffs_gif__decoder* self) {
if (!self) { if (!self) {
return 0; return 0;
} }
@@ -6477,8 +6501,8 @@ uint64_t wuffs_gif__decoder__frame_count(wuffs_gif__decoder* self) {
// -------- func gif.decoder.work_buffer_size // -------- func gif.decoder.work_buffer_size
wuffs_base__range_ii_u64 wuffs_gif__decoder__work_buffer_size( WUFFS_BASE__MAYBE_STATIC wuffs_base__range_ii_u64
wuffs_gif__decoder* self) { wuffs_gif__decoder__work_buffer_size(wuffs_gif__decoder* self) {
if (!self) { if (!self) {
return ((wuffs_base__range_ii_u64){}); return ((wuffs_base__range_ii_u64){});
} }
@@ -6496,11 +6520,11 @@ wuffs_base__range_ii_u64 wuffs_gif__decoder__work_buffer_size(
// -------- func gif.decoder.decode_frame // -------- func gif.decoder.decode_frame
wuffs_base__status wuffs_gif__decoder__decode_frame( WUFFS_BASE__MAYBE_STATIC wuffs_base__status
wuffs_gif__decoder* self, wuffs_gif__decoder__decode_frame(wuffs_gif__decoder* self,
wuffs_base__image_buffer* a_dst, wuffs_base__image_buffer* a_dst,
wuffs_base__io_reader a_src, wuffs_base__io_reader a_src,
wuffs_base__slice_u8 a_work_buffer) { wuffs_base__slice_u8 a_work_buffer) {
if (!self) { if (!self) {
return WUFFS_BASE__ERROR_BAD_RECEIVER; return WUFFS_BASE__ERROR_BAD_RECEIVER;
} }
@@ -8244,8 +8268,9 @@ void wuffs_gzip__decoder__check_wuffs_version(wuffs_gzip__decoder* self,
// -------- func gzip.decoder.set_ignore_checksum // -------- func gzip.decoder.set_ignore_checksum
void wuffs_gzip__decoder__set_ignore_checksum(wuffs_gzip__decoder* self, WUFFS_BASE__MAYBE_STATIC void wuffs_gzip__decoder__set_ignore_checksum(
bool a_ic) { wuffs_gzip__decoder* self,
bool a_ic) {
if (!self) { if (!self) {
return; return;
} }
@@ -8262,9 +8287,10 @@ void wuffs_gzip__decoder__set_ignore_checksum(wuffs_gzip__decoder* self,
// -------- func gzip.decoder.decode // -------- func gzip.decoder.decode
wuffs_base__status wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self, WUFFS_BASE__MAYBE_STATIC wuffs_base__status
wuffs_base__io_writer a_dst, wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
wuffs_base__io_reader a_src) { wuffs_base__io_writer a_dst,
wuffs_base__io_reader a_src) {
if (!self) { if (!self) {
return WUFFS_BASE__ERROR_BAD_RECEIVER; return WUFFS_BASE__ERROR_BAD_RECEIVER;
} }
@@ -8720,8 +8746,9 @@ void wuffs_lzw__decoder__check_wuffs_version(wuffs_lzw__decoder* self,
// -------- func lzw.decoder.set_literal_width // -------- func lzw.decoder.set_literal_width
void wuffs_lzw__decoder__set_literal_width(wuffs_lzw__decoder* self, WUFFS_BASE__MAYBE_STATIC void wuffs_lzw__decoder__set_literal_width(
uint32_t a_lw) { wuffs_lzw__decoder* self,
uint32_t a_lw) {
if (!self) { if (!self) {
return; return;
} }
@@ -8742,9 +8769,10 @@ void wuffs_lzw__decoder__set_literal_width(wuffs_lzw__decoder* self,
// -------- func lzw.decoder.decode // -------- func lzw.decoder.decode
wuffs_base__status wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self, WUFFS_BASE__MAYBE_STATIC wuffs_base__status
wuffs_base__io_writer a_dst, wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self,
wuffs_base__io_reader a_src) { wuffs_base__io_writer a_dst,
wuffs_base__io_reader a_src) {
if (!self) { if (!self) {
return WUFFS_BASE__ERROR_BAD_RECEIVER; return WUFFS_BASE__ERROR_BAD_RECEIVER;
} }
@@ -9085,8 +9113,9 @@ void wuffs_zlib__decoder__check_wuffs_version(wuffs_zlib__decoder* self,
// -------- func zlib.decoder.set_ignore_checksum // -------- func zlib.decoder.set_ignore_checksum
void wuffs_zlib__decoder__set_ignore_checksum(wuffs_zlib__decoder* self, WUFFS_BASE__MAYBE_STATIC void wuffs_zlib__decoder__set_ignore_checksum(
bool a_ic) { wuffs_zlib__decoder* self,
bool a_ic) {
if (!self) { if (!self) {
return; return;
} }
@@ -9103,9 +9132,10 @@ void wuffs_zlib__decoder__set_ignore_checksum(wuffs_zlib__decoder* self,
// -------- func zlib.decoder.decode // -------- func zlib.decoder.decode
wuffs_base__status wuffs_zlib__decoder__decode(wuffs_zlib__decoder* self, WUFFS_BASE__MAYBE_STATIC wuffs_base__status
wuffs_base__io_writer a_dst, wuffs_zlib__decoder__decode(wuffs_zlib__decoder* self,
wuffs_base__io_reader a_src) { wuffs_base__io_writer a_dst,
wuffs_base__io_reader a_src) {
if (!self) { if (!self) {
return WUFFS_BASE__ERROR_BAD_RECEIVER; return WUFFS_BASE__ERROR_BAD_RECEIVER;
} }