mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-23 16:52:18 +01:00
Generate inline headers for use declarations
This commit is contained in:
1 parent
c5b5efd7c8
commit
9867cd5e3a
6 files changed
+549
-16
No files matched your search
@@ -111,6 +111,244 @@ typedef struct {
|
||||
|
||||
// ---------------- BEGIN USE "std/flate"
|
||||
|
||||
#ifndef WUFFS_FLATE_H
|
||||
#define WUFFS_FLATE_H
|
||||
|
||||
// Code generated by wuffs-c. DO NOT EDIT.
|
||||
|
||||
// ---------------- Use Declarations
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// ---------------- Status Codes
|
||||
|
||||
// Status codes are int32_t values:
|
||||
// - the sign bit indicates a non-recoverable status code: an error
|
||||
// - bits 10-30 hold the packageid: a namespace
|
||||
// - bits 8-9 are reserved
|
||||
// - bits 0-7 are a package-namespaced numeric code
|
||||
//
|
||||
// Do not manipulate these bits directly. Use the API functions such as
|
||||
// wuffs_flate__status__is_error instead.
|
||||
typedef int32_t wuffs_flate__status;
|
||||
|
||||
#define wuffs_flate__packageid 967230 // 0x000EC23E
|
||||
|
||||
#define WUFFS_FLATE__STATUS_OK 0 // 0x00000000
|
||||
#define WUFFS_FLATE__ERROR_BAD_WUFFS_VERSION -2147483647 // 0x80000001
|
||||
#define WUFFS_FLATE__ERROR_BAD_RECEIVER -2147483646 // 0x80000002
|
||||
#define WUFFS_FLATE__ERROR_BAD_ARGUMENT -2147483645 // 0x80000003
|
||||
#define WUFFS_FLATE__ERROR_INITIALIZER_NOT_CALLED -2147483644 // 0x80000004
|
||||
#define WUFFS_FLATE__ERROR_INVALID_I_O_OPERATION -2147483643 // 0x80000005
|
||||
#define WUFFS_FLATE__ERROR_CLOSED_FOR_WRITES -2147483642 // 0x80000006
|
||||
#define WUFFS_FLATE__ERROR_UNEXPECTED_EOF -2147483641 // 0x80000007
|
||||
#define WUFFS_FLATE__SUSPENSION_SHORT_READ 8 // 0x00000008
|
||||
#define WUFFS_FLATE__SUSPENSION_SHORT_WRITE 9 // 0x00000009
|
||||
#define WUFFS_FLATE__ERROR_CANNOT_RETURN_A_SUSPENSION -2147483638 // 0x8000000A
|
||||
|
||||
#define WUFFS_FLATE__ERROR_BAD_HUFFMAN_CODE_OVER_SUBSCRIBED \
|
||||
-1157040128 // 0xBB08F800
|
||||
#define WUFFS_FLATE__ERROR_BAD_HUFFMAN_CODE_UNDER_SUBSCRIBED \
|
||||
-1157040127 // 0xBB08F801
|
||||
#define WUFFS_FLATE__ERROR_BAD_HUFFMAN_CODE_LENGTH_COUNT \
|
||||
-1157040126 // 0xBB08F802
|
||||
#define WUFFS_FLATE__ERROR_BAD_HUFFMAN_CODE_LENGTH_REPETITION \
|
||||
-1157040125 // 0xBB08F803
|
||||
#define WUFFS_FLATE__ERROR_BAD_HUFFMAN_CODE -1157040124 // 0xBB08F804
|
||||
#define WUFFS_FLATE__ERROR_BAD_HUFFMAN_MINIMUM_CODE_LENGTH \
|
||||
-1157040123 // 0xBB08F805
|
||||
#define WUFFS_FLATE__ERROR_BAD_DISTANCE -1157040122 // 0xBB08F806
|
||||
#define WUFFS_FLATE__ERROR_BAD_DISTANCE_CODE_COUNT -1157040121 // 0xBB08F807
|
||||
#define WUFFS_FLATE__ERROR_BAD_FLATE_BLOCK -1157040120 // 0xBB08F808
|
||||
#define WUFFS_FLATE__ERROR_BAD_LITERAL_LENGTH_CODE_COUNT \
|
||||
-1157040119 // 0xBB08F809
|
||||
#define WUFFS_FLATE__ERROR_CHECKSUM_MISMATCH -1157040118 // 0xBB08F80A
|
||||
#define WUFFS_FLATE__ERROR_INCONSISTENT_STORED_BLOCK_LENGTH \
|
||||
-1157040117 // 0xBB08F80B
|
||||
#define WUFFS_FLATE__ERROR_INTERNAL_ERROR_INCONSISTENT_HUFFMAN_DECODER_STATE \
|
||||
-1157040116 // 0xBB08F80C
|
||||
#define WUFFS_FLATE__ERROR_INTERNAL_ERROR_INCONSISTENT_HUFFMAN_END_OF_BLOCK \
|
||||
-1157040115 // 0xBB08F80D
|
||||
#define WUFFS_FLATE__ERROR_INTERNAL_ERROR_INCONSISTENT_DISTANCE \
|
||||
-1157040114 // 0xBB08F80E
|
||||
#define WUFFS_FLATE__ERROR_INTERNAL_ERROR_INCONSISTENT_N_BITS \
|
||||
-1157040113 // 0xBB08F80F
|
||||
#define WUFFS_FLATE__ERROR_MISSING_END_OF_BLOCK_CODE -1157040112 // 0xBB08F810
|
||||
#define WUFFS_FLATE__ERROR_NO_HUFFMAN_CODES -1157040111 // 0xBB08F811
|
||||
#define WUFFS_FLATE__ERROR_INVALID_ZLIB_COMPRESSION_METHOD \
|
||||
-1157040110 // 0xBB08F812
|
||||
#define WUFFS_FLATE__ERROR_INVALID_ZLIB_COMPRESSION_WINDOW_SIZE \
|
||||
-1157040109 // 0xBB08F813
|
||||
#define WUFFS_FLATE__ERROR_INVALID_ZLIB_PARITY_CHECK -1157040108 // 0xBB08F814
|
||||
#define WUFFS_FLATE__ERROR_TODO_UNSUPPORTED_ZLIB_PRESET_DICTIONARY \
|
||||
-1157040107 // 0xBB08F815
|
||||
|
||||
bool wuffs_flate__status__is_error(wuffs_flate__status s);
|
||||
|
||||
const char* wuffs_flate__status__string(wuffs_flate__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_flate__flate_decoder__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_flate__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_bits;
|
||||
uint32_t f_n_bits;
|
||||
uint32_t f_huffs[2][1234];
|
||||
uint32_t f_n_huffs_bits[2];
|
||||
uint8_t f_history[32768];
|
||||
uint32_t f_history_index;
|
||||
uint8_t f_code_lengths[320];
|
||||
bool f_end_of_block;
|
||||
|
||||
struct {
|
||||
uint32_t coro_susp_point;
|
||||
wuffs_flate__status v_z;
|
||||
uint64_t v_n_copied;
|
||||
uint32_t v_already_full;
|
||||
} c_decode[1];
|
||||
struct {
|
||||
uint32_t coro_susp_point;
|
||||
uint32_t v_final;
|
||||
uint32_t v_type;
|
||||
} c_decode_blocks[1];
|
||||
struct {
|
||||
uint32_t coro_susp_point;
|
||||
uint32_t v_length;
|
||||
uint32_t v_n_copied;
|
||||
uint64_t scratch;
|
||||
} c_decode_uncompressed[1];
|
||||
struct {
|
||||
uint32_t coro_susp_point;
|
||||
uint32_t v_i;
|
||||
} c_init_fixed_huffman[1];
|
||||
struct {
|
||||
uint32_t coro_susp_point;
|
||||
uint32_t v_bits;
|
||||
uint32_t v_n_bits;
|
||||
uint32_t v_n_lit;
|
||||
uint32_t v_n_dist;
|
||||
uint32_t v_n_clen;
|
||||
uint32_t v_i;
|
||||
uint32_t v_mask;
|
||||
uint32_t v_table_entry;
|
||||
uint32_t v_table_entry_n_bits;
|
||||
uint32_t v_n_extra_bits;
|
||||
uint8_t v_rep_symbol;
|
||||
uint32_t v_rep_count;
|
||||
} c_init_dynamic_huffman[1];
|
||||
struct {
|
||||
uint32_t coro_susp_point;
|
||||
uint32_t v_bits;
|
||||
uint32_t v_n_bits;
|
||||
uint32_t v_table_entry;
|
||||
uint32_t v_table_entry_n_bits;
|
||||
uint32_t v_lmask;
|
||||
uint32_t v_dmask;
|
||||
uint32_t v_redir_top;
|
||||
uint32_t v_redir_mask;
|
||||
uint32_t v_length;
|
||||
uint32_t v_distance;
|
||||
uint32_t v_n_copied;
|
||||
uint32_t v_hlen;
|
||||
uint32_t v_hdist;
|
||||
} c_decode_huffman_slow[1];
|
||||
} private_impl;
|
||||
} wuffs_flate__flate_decoder;
|
||||
|
||||
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_flate__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_flate__status status;
|
||||
uint32_t magic;
|
||||
|
||||
uint32_t f_state;
|
||||
|
||||
} private_impl;
|
||||
} wuffs_flate__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
|
||||
// wuffs_flate__zlib_decoder__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_flate__status status;
|
||||
uint32_t magic;
|
||||
|
||||
wuffs_flate__flate_decoder f_flate;
|
||||
wuffs_flate__adler32 f_adler;
|
||||
|
||||
struct {
|
||||
uint32_t coro_susp_point;
|
||||
uint16_t v_x;
|
||||
uint32_t v_checksum;
|
||||
wuffs_flate__status v_z;
|
||||
uint64_t scratch;
|
||||
} c_decode[1];
|
||||
} private_impl;
|
||||
} wuffs_flate__zlib_decoder;
|
||||
|
||||
// ---------------- Public Initializer Prototypes
|
||||
|
||||
// wuffs_flate__flate_decoder__initialize is an initializer function.
|
||||
//
|
||||
// It should be called before any other wuffs_flate__flate_decoder__* function.
|
||||
//
|
||||
// Pass WUFFS_VERSION and 0 for wuffs_version and for_internal_use_only.
|
||||
void wuffs_flate__flate_decoder__initialize(wuffs_flate__flate_decoder* self,
|
||||
uint32_t wuffs_version,
|
||||
uint32_t for_internal_use_only);
|
||||
|
||||
// wuffs_flate__zlib_decoder__initialize is an initializer function.
|
||||
//
|
||||
// It should be called before any other wuffs_flate__zlib_decoder__* function.
|
||||
//
|
||||
// Pass WUFFS_VERSION and 0 for wuffs_version and for_internal_use_only.
|
||||
void wuffs_flate__zlib_decoder__initialize(wuffs_flate__zlib_decoder* self,
|
||||
uint32_t wuffs_version,
|
||||
uint32_t for_internal_use_only);
|
||||
|
||||
// ---------------- Public Function Prototypes
|
||||
|
||||
wuffs_flate__status wuffs_flate__flate_decoder__decode(
|
||||
wuffs_flate__flate_decoder* self,
|
||||
wuffs_base__writer1 a_dst,
|
||||
wuffs_base__reader1 a_src);
|
||||
|
||||
wuffs_flate__status wuffs_flate__zlib_decoder__decode(
|
||||
wuffs_flate__zlib_decoder* self,
|
||||
wuffs_base__writer1 a_dst,
|
||||
wuffs_base__reader1 a_src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // WUFFS_FLATE_H
|
||||
|
||||
// ---------------- END USE "std/flate"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in new issue
Block a user