Spin out a std/adler32 package

This commit is contained in:
Nigel Tao committed 2018-04-27 17:20:10 +10:00
1 parent 977f1fe64d
commit 035b138cb1
13 files changed
+3189 -319

No files matched your search

+95 -21
View File
@@ -1023,10 +1023,10 @@ static inline uint8_t* wuffs_base__image_buffer__palette(
// ---------------- Use Declarations
// ---------------- BEGIN USE "std/deflate"
// ---------------- BEGIN USE "std/adler32"
#ifndef WUFFS_DEFLATE_H
#define WUFFS_DEFLATE_H
#ifndef WUFFS_ADLER32_H
#define WUFFS_ADLER32_H
// Code generated by wuffs-c. DO NOT EDIT.
@@ -1038,6 +1038,97 @@ extern "C" {
// ---------------- Status Codes
// Status codes are int32_t values. Its bits:
// - bit 31 (the sign bit) indicates unrecoverable-ness: an error.
// - bits 30 .. 10 are the packageid: a namespace.
// - bits 9 .. 8 are reserved.
// - bits 7 .. 0 are a package-namespaced numeric code.
//
// Do not manipulate these bits directly; they are private implementation
// details. Use methods such as wuffs_adler32__status__is_error instead.
typedef int32_t wuffs_adler32__status;
#define wuffs_adler32__packageid 681002 // 0x000A642A
#define WUFFS_ADLER32__STATUS_OK 0 // 0x00000000
#define WUFFS_ADLER32__ERROR_BAD_WUFFS_VERSION -2147483647 // 0x80000001
#define WUFFS_ADLER32__ERROR_BAD_RECEIVER -2147483646 // 0x80000002
#define WUFFS_ADLER32__ERROR_BAD_ARGUMENT -2147483645 // 0x80000003
#define WUFFS_ADLER32__ERROR_INITIALIZER_NOT_CALLED -2147483644 // 0x80000004
#define WUFFS_ADLER32__ERROR_INVALID_I_O_OPERATION -2147483643 // 0x80000005
#define WUFFS_ADLER32__ERROR_CLOSED_FOR_WRITES -2147483642 // 0x80000006
#define WUFFS_ADLER32__ERROR_UNEXPECTED_EOF -2147483641 // 0x80000007
#define WUFFS_ADLER32__SUSPENSION_SHORT_READ 8 // 0x00000008
#define WUFFS_ADLER32__SUSPENSION_SHORT_WRITE 9 // 0x00000009
#define WUFFS_ADLER32__ERROR_CANNOT_RETURN_A_SUSPENSION \
-2147483638 // 0x8000000A
#define WUFFS_ADLER32__ERROR_INVALID_CALL_SEQUENCE -2147483637 // 0x8000000B
#define WUFFS_ADLER32__SUSPENSION_END_OF_DATA 12 // 0x0000000C
bool wuffs_adler32__status__is_error(wuffs_adler32__status s);
const char* wuffs_adler32__status__string(wuffs_adler32__status s);
// ---------------- Public Consts
// ---------------- Structs
typedef struct {
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so. Instead, use the
// wuffs_adler32__hasher__etc functions.
//
// In C++, these fields would be "private", but C does not support that.
//
// It is a struct, not a struct*, so that it can be stack allocated.
struct {
wuffs_adler32__status status;
uint32_t magic;
uint32_t f_state;
} private_impl;
} wuffs_adler32__hasher;
// ---------------- Public Initializer Prototypes
// wuffs_adler32__hasher__initialize is an initializer function.
//
// It should be called before any other wuffs_adler32__hasher__* function.
//
// Pass WUFFS_VERSION and 0 for wuffs_version and for_internal_use_only.
void wuffs_adler32__hasher__initialize(wuffs_adler32__hasher* self,
uint32_t wuffs_version,
uint32_t for_internal_use_only);
// ---------------- Public Function Prototypes
uint32_t wuffs_adler32__hasher__update(wuffs_adler32__hasher* self,
wuffs_base__slice_u8 a_x);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // WUFFS_ADLER32_H
// ---------------- END USE "std/adler32"
// ---------------- BEGIN USE "std/deflate"
#ifndef WUFFS_DEFLATE_H
#define WUFFS_DEFLATE_H
// Code generated by wuffs-c. DO NOT EDIT.
// ---------------- Use Declarations
#ifdef __cplusplus
extern "C" {
#endif
// ---------------- Status Codes
// Status codes are int32_t values. Its bits:
// - bit 31 (the sign bit) indicates unrecoverable-ness: an error.
// - bits 30 .. 10 are the packageid: a namespace.
@@ -1254,23 +1345,6 @@ const char* wuffs_zlib__status__string(wuffs_zlib__status s);
// ---------------- Structs
typedef struct {
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so. Instead, use the
// wuffs_zlib__adler32__etc functions.
//
// In C++, these fields would be "private", but C does not support that.
//
// It is a struct, not a struct*, so that it can be stack allocated.
struct {
wuffs_zlib__status status;
uint32_t magic;
uint32_t f_state;
} private_impl;
} wuffs_zlib__adler32;
typedef struct {
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so. Instead, use the
@@ -1284,7 +1358,7 @@ typedef struct {
uint32_t magic;
wuffs_deflate__decoder f_flate;
wuffs_zlib__adler32 f_checksum;
wuffs_adler32__hasher f_checksum;
bool f_ignore_checksum;
struct {