X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=ldk-c-bindings;a=blobdiff_plain;f=lightning-c-bindings%2Finclude%2Flightning.h;h=60acaae9290efe2ed0decf541d605bea305e56c3;hp=2527e65a2ed349e3b6714bbb7af5b2be5c401acb;hb=3c64a6c2358cfce2194c9db33890de03a5618984;hpb=51a702cc824ac8c0d280cf695ddaade7142d84fa diff --git a/lightning-c-bindings/include/lightning.h b/lightning-c-bindings/include/lightning.h index 2527e65..60acaae 100644 --- a/lightning-c-bindings/include/lightning.h +++ b/lightning-c-bindings/include/lightning.h @@ -8,7 +8,7 @@ #include #include #include - +#include /** * An error when accessing the chain via [`Access`]. @@ -368,6 +368,25 @@ typedef enum LDKSiPrefix { LDKSiPrefix_Sentinel, } LDKSiPrefix; +/** + * A Rust str object, ie a reference to a UTF8-valid string. + * This is *not* null-terminated so cannot be used directly as a C string! + */ +typedef struct LDKStr { + /** + * A pointer to the string's bytes, in UTF8 encoding + */ + const uint8_t *chars; + /** + * The number of bytes (not characters!) pointed to by `chars` + */ + uintptr_t len; + /** + * Whether the data pointed to by `chars` should be freed or not. + */ + bool chars_is_owned; +} LDKStr; + /** * A serialized transaction, in (pointer, length) form. * @@ -431,25 +450,6 @@ typedef struct LDKTxOut { uint64_t value; } LDKTxOut; -/** - * A Rust str object, ie a reference to a UTF8-valid string. - * This is *not* null-terminated so cannot be used directly as a C string! - */ -typedef struct LDKStr { - /** - * A pointer to the string's bytes, in UTF8 encoding - */ - const uint8_t *chars; - /** - * The number of bytes (not characters!) pointed to by `chars` - */ - uintptr_t len; - /** - * Whether the data pointed to by `chars` should be freed or not. - */ - bool chars_is_owned; -} LDKStr; - /** @@ -8757,6 +8757,10 @@ extern const uint8_t TAG_PAYMENT_SECRET; extern const uint8_t TAG_FEATURES; +struct LDKStr _ldk_get_compiled_version(void); + +struct LDKStr _ldk_c_bindings_get_compiled_version(void); + /** * Frees the data buffer, if data_is_owned is set and datalen > 0. */ @@ -17664,3 +17668,5 @@ struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o); struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o); #endif /* LDK_C_BINDINGS_H */ + +#include