Add support for witnesses via a manual mapping
[ldk-c-bindings] / genbindings.sh
index d02a9c10d80f897e694f833db772fff1c17eeee8..4f795030f9301534010a6fec9729ec6c7df4d974 100755 (executable)
@@ -191,7 +191,7 @@ else
        add_crate lightning lightning --features=no-std
        drop_crate "lightning-persister"
        drop_crate "lightning-background-processor"
-       drop_crate "lightning-rapid-gossip-sync"
+       add_crate "lightning-rapid-gossip-sync" "lightning_rapid_gossip_sync" --features=no-std
        add_crate "lightning-invoice" "lightning_invoice" --features=no-std
        CARGO_BUILD_ARGS="--features=no-std"
 fi
@@ -272,7 +272,7 @@ while read LINE; do
                                echo "Unable to find method declaration for $LINE"
                                exit 1
                        fi
-                       RETVAL="$(echo "$METHOD" | sed 's/[ ]*\([A-Za-z0-9 _]*\)(\*\(.*\)).*/\1/' | sed 's/^struct LDK/LDK::/g' | tr -d ' ')"
+                       RETVAL="$(echo "$METHOD" | sed 's/[ ]*\([A-Za-z0-9 _]*\)(\*\(.*\)).*/\1/' | sed -E 's/^(struct|enum) LDK/LDK::/g' | tr -d ' ')"
                        [ "$RETVAL" = "LDK::SecretKey" ] && RETVAL="LDKSecretKey"
                        [ "$RETVAL" = "LDK::PublicKey" ] && RETVAL="LDKPublicKey"
                        [ "$RETVAL" = "LDK::ThirtyTwoBytes" ] && RETVAL="LDKThirtyTwoBytes"