X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-c-bindings%2Fdemo.c;h=1e9bfb0c283a28c28cfac1840962557f3844e57e;hb=b12e216ff9416617ccbc9891d1873e740b8da6d0;hp=a9556303fa3d1a0e826fbcff69625a38f8124b03;hpb=7f9395bb7810b269a0aa5a882cc8b1b647747359;p=ldk-c-bindings diff --git a/lightning-c-bindings/demo.c b/lightning-c-bindings/demo.c index a955630..1e9bfb0 100644 --- a/lightning-c-bindings/demo.c +++ b/lightning-c-bindings/demo.c @@ -4,8 +4,12 @@ #include #include -void print_log(const void *this_arg, const char *record) { - printf("%s", record); +void print_log(const void *this_arg, const LDKRecord *record) { + LDKStr mod = Record_get_module_path(record); + LDKStr str = Record_get_args(record); + printf("%.*s:%d - %.*s\n", (int)mod.len, mod.chars, Record_get_line(record), (int)str.len, str.chars); + Str_free(str); + Str_free(mod); } uint32_t get_fee(const void *this_arg, LDKConfirmationTarget target) { @@ -27,15 +31,15 @@ LDKCResult_NoneChannelMonitorUpdateErrZ add_channel_monitor(const void *this_arg LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_monitor(const void *this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate monitor) { return CResult_NoneChannelMonitorUpdateErrZ_ok(); } -LDKCVec_MonitorEventZ monitors_pending_monitor_events(const void *this_arg) { - LDKCVec_MonitorEventZ empty_htlc_vec = { +LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ monitors_pending_monitor_events(const void *this_arg) { + LDKCVec_C2Tuple_OutPointCVec_MonitorEventZZZ empty_htlc_vec = { .data = NULL, .datalen = 0, }; return empty_htlc_vec; } -void never_handle_event(const void *this_arg, struct LDKEvent event) { +void never_handle_event(const void *this_arg, const struct LDKEvent* event) { // Note that we never actually generate any events to handle in the code below. assert(false); }