X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-c-bindings;a=blobdiff_plain;f=lightning-c-bindings%2Finclude%2Flightning.h;h=cb929f6700df8a9679435b38fa70a0c7a7b60f49;hp=ee15c0f2ee797b439aa36d3a5a7771285dcaafb3;hb=9b2593eba755e38b2723b93a0343ec5ceb5ada45;hpb=a7cf2f084b1fdde79bf52197708388b10ba93844 diff --git a/lightning-c-bindings/include/lightning.h b/lightning-c-bindings/include/lightning.h index ee15c0f..cb929f6 100644 --- a/lightning-c-bindings/include/lightning.h +++ b/lightning-c-bindings/include/lightning.h @@ -459,6 +459,56 @@ typedef struct LDKStr { bool chars_is_owned; } LDKStr; +/** + * Represents an error returned from the bech32 library during validation of some bech32 data + */ +typedef enum LDKBech32Error_Tag { + /** + * String does not contain the separator character + */ + LDKBech32Error_MissingSeparator, + /** + * The checksum does not match the rest of the data + */ + LDKBech32Error_InvalidChecksum, + /** + * The data or human-readable part is too long or too short + */ + LDKBech32Error_InvalidLength, + /** + * Some part of the string contains an invalid character + */ + LDKBech32Error_InvalidChar, + /** + * Some part of the data has an invalid value + */ + LDKBech32Error_InvalidData, + /** + * The bit conversion failed due to a padding issue + */ + LDKBech32Error_InvalidPadding, + /** + * The whole string must be of one case + */ + LDKBech32Error_MixedCase, + /** + * Must be last for serialization purposes + */ + LDKBech32Error_Sentinel, +} LDKBech32Error_Tag; + +typedef struct LDKBech32Error { + LDKBech32Error_Tag tag; + union { + struct { + uint32_t invalid_char; + }; + struct { + uint8_t invalid_data; + }; + }; +} LDKBech32Error; + /** * A serialized transaction, in (pointer, length) form. * @@ -7131,56 +7181,6 @@ typedef struct LDKCResult_PaymentIdPaymentErrorZ { bool result_ok; } LDKCResult_PaymentIdPaymentErrorZ; -/** - * Represents an error returned from the bech32 library during validation of some bech32 data - */ -typedef enum LDKBech32Error_Tag { - /** - * String does not contain the separator character - */ - LDKBech32Error_MissingSeparator, - /** - * The checksum does not match the rest of the data - */ - LDKBech32Error_InvalidChecksum, - /** - * The data or human-readable part is too long or too short - */ - LDKBech32Error_InvalidLength, - /** - * Some part of the string contains an invalid character - */ - LDKBech32Error_InvalidChar, - /** - * Some part of the data has an invalid value - */ - LDKBech32Error_InvalidData, - /** - * The bit conversion failed due to a padding issue - */ - LDKBech32Error_InvalidPadding, - /** - * The whole string must be of one case - */ - LDKBech32Error_MixedCase, - /** - * Must be last for serialization purposes - */ - LDKBech32Error_Sentinel, -} LDKBech32Error_Tag; - -typedef struct LDKBech32Error { - LDKBech32Error_Tag tag; - union { - struct { - uint32_t invalid_char; - }; - struct { - uint8_t invalid_data; - }; - }; -} LDKBech32Error; - /** * Sub-errors which don't have specific information in them use this type. */ @@ -12473,6 +12473,16 @@ struct LDKStr _ldk_get_compiled_version(void); struct LDKStr _ldk_c_bindings_get_compiled_version(void); +/** + * Creates a new Bech32Error which has the same data as `orig` + */ +struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig); + +/** + * Releases any memory held by the given `Bech32Error` (which is currently none) + */ +void Bech32Error_free(struct LDKBech32Error o); + /** * Frees the data buffer, if data_is_owned is set and datalen > 0. */