From: Matt Corallo Date: Thu, 27 Oct 2022 00:08:55 +0000 (+0000) Subject: Support trait methods that return enums in the C++ sed script X-Git-Tag: v0.0.112.0^2~7 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=09c02eebe9d96c53cfc4458948b30c7a8639f9ac;p=ldk-c-bindings Support trait methods that return enums in the C++ sed script --- diff --git a/genbindings.sh b/genbindings.sh index 94800ff..4f79503 100755 --- a/genbindings.sh +++ b/genbindings.sh @@ -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"