/* Code generated by cmd/cgo; DO NOT EDIT. */

/* package command-line-arguments */


#line 1 "cgo-builtin-export-prolog"

#include <stddef.h>

#ifndef GO_CGO_EXPORT_PROLOGUE_H
#define GO_CGO_EXPORT_PROLOGUE_H

#ifndef GO_CGO_GOSTRING_TYPEDEF
typedef struct { const char *p; ptrdiff_t n; } _GoString_;
#endif

#endif

/* Start of preamble from import "C" comments.  */




/* End of preamble from import "C" comments.  */


/* Start of boilerplate cgo prologue.  */
#line 1 "cgo-gcc-export-header-prolog"

#ifndef GO_CGO_PROLOGUE_H
#define GO_CGO_PROLOGUE_H

typedef signed char GoInt8;
typedef unsigned char GoUint8;
typedef short GoInt16;
typedef unsigned short GoUint16;
typedef int GoInt32;
typedef unsigned int GoUint32;
typedef long long GoInt64;
typedef unsigned long long GoUint64;
typedef GoInt64 GoInt;
typedef GoUint64 GoUint;
typedef size_t GoUintptr;
typedef float GoFloat32;
typedef double GoFloat64;
#ifdef _MSC_VER
#include <complex.h>
typedef _Fcomplex GoComplex64;
typedef _Dcomplex GoComplex128;
#else
typedef float _Complex GoComplex64;
typedef double _Complex GoComplex128;
#endif

/*
  static assertion to make sure the file is being used on architecture
  at least with matching size of GoInt.
*/
typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];

#ifndef GO_CGO_GOSTRING_TYPEDEF
typedef _GoString_ GoString;
#endif
typedef void *GoMap;
typedef void *GoChan;
typedef struct { void *t; void *v; } GoInterface;
typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;

#endif

/* End of boilerplate cgo prologue.  */

#ifdef __cplusplus
extern "C" {
#endif


// Init initializes the compressor.
// The dataLimit argument is the maximum size of the compressed data.
// Returns true if the compressor was initialized, false otherwise.
// If false is returned, the Error() method will return a string describing the error.
//
extern GoUint8 Init(GoInt dataLimit, char* dictPath);

// Reset resets the compressor. Must be called between each Blob.
//
extern void Reset();

// Write appends the input to the compressed data.
// The Go code doesn't keep a pointer to the input slice and the caller is free to modify it.
// Returns true if the chunk was appended, false if the chunk was discarded.
//
// The input []byte is interpreted as a RLP encoded Block.
//
extern GoUint8 Write(char* input, int inputLength);

// CanWrite behaves as Write, except that it doesn't append the input to the compressed data
// (but return true if it could)
//
extern GoUint8 CanWrite(char* input, int inputLength);

// Error returns the last encountered error.
// If no error was encountered, returns nil.
//
extern char* Error();

// StartNewBatch starts a new batch; must be called between each batch in the blob.
//
extern void StartNewBatch();

// Len returns the length of the compressed data.
//
extern GoInt Len();

// Bytes returns the compressed data.
// The caller is responsible for allocating the memory for the output slice.
// Length of the output slice must equal the value returned by Len().
//
extern void Bytes(char* dataOut);

// WorstCompressedBlockSize returns the size of the given block, as compressed by an "empty" blob maker.
// That is, with more context, blob maker could compress the block further, but this function
// returns the maximum size that can be achieved.
//
// The input is a RLP encoded block.
// Returns the length of the compressed data, or -1 if an error occurred.
// User must call Error() to get the error message.
//
// This function is thread-safe. Concurrent calls are allowed,
// but the other functions may not be thread-safe.
//
extern int WorstCompressedBlockSize(char* input, int inputLength);

// WorstCompressedTxSize returns the size of the given transaction, as compressed by an "empty" blob maker.
// That is, with more context, blob maker could compress the transaction further, but this function
// returns the maximum size that can be achieved.
//
// The input is a RLP encoded transaction.
// Returns the length of the compressed data, or -1 if an error occurred.
// User must call Error() to get the error message.
//
// This function is thread-safe. Concurrent calls are allowed,
// but the other functions may not be thread-safe.
//
extern int WorstCompressedTxSize(char* input, int inputLength);

// RawCompressedSize compresses the (raw) input and returns the length of the compressed data.
// The returned length account for the "padding" used by the blob maker to
// fit the data in field elements.
// Input size must be less than 256kB.
// If an error occurred, returns -1.
// User must call Error() to get the error message.
//
// This function is thread-safe. Concurrent calls are allowed,
// but the other functions are not thread-safe.
//
extern int RawCompressedSize(char* input, int inputLength);

#ifdef __cplusplus
}
#endif
