]> git.bitcoin.ninja Git - ldk-c-bindings/commitdiff
Support trait methods that return enums in the C++ sed script
authorMatt Corallo <git@bluematt.me>
Thu, 27 Oct 2022 00:08:55 +0000 (00:08 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 28 Oct 2022 00:25:10 +0000 (00:25 +0000)
genbindings.sh

index 94800ff6416c6921f1021619c32b9c8ba4c78044..4f795030f9301534010a6fec9729ec6c7df4d974 100755 (executable)
@@ -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"