Merge pull request #94 from TheBlueMatt/main
[ldk-c-bindings] / 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"