summaryrefslogtreecommitdiff
path: root/src/binaryen-c.h
diff options
context:
space:
mode:
authorDaniel Wirtz <dcode@dcode.io>2017-11-15 18:55:50 +0100
committerAlon Zakai <alonzakai@gmail.com>2017-11-15 09:55:50 -0800
commitdc0cd445c08ede80fa2b1747cffcd2254c97a0f6 (patch)
treedea167a459ceab94c64aa947eae7a2c90db12552 /src/binaryen-c.h
parent4deed1eb310993391fa0e7e06a18cf2303674f98 (diff)
downloadbinaryen-dc0cd445c08ede80fa2b1747cffcd2254c97a0f6.tar.gz
binaryen-dc0cd445c08ede80fa2b1747cffcd2254c97a0f6.tar.bz2
binaryen-dc0cd445c08ede80fa2b1747cffcd2254c97a0f6.zip
Add const expression utilities to binaryen-c/.js (#1288)
Diffstat (limited to 'src/binaryen-c.h')
-rw-r--r--src/binaryen-c.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/binaryen-c.h b/src/binaryen-c.h
index c136b5f70..88fe8904c 100644
--- a/src/binaryen-c.h
+++ b/src/binaryen-c.h
@@ -371,6 +371,18 @@ BinaryenExpressionId BinaryenExpressionGetId(BinaryenExpressionRef expr);
BinaryenType BinaryenExpressionGetType(BinaryenExpressionRef expr);
// Print an expression to stdout. Useful for debugging.
void BinaryenExpressionPrint(BinaryenExpressionRef expr);
+// Gets the 32-bit integer value of the specified `Const` expression.
+int32_t BinaryenConstGetValueI32(BinaryenExpressionRef expr);
+// Gets the 64-bit integer value of the specified `Const` expression.
+int64_t BinaryenConstGetValueI64(BinaryenExpressionRef expr);
+// Gets the low 32-bits of a 64-bit integer value of the specified `Const` expression. Useful where I64 returning exports are illegal, i.e. binaryen.js.
+int32_t BinaryenConstGetValueI64Low(BinaryenExpressionRef expr);
+// Gets the high 32-bits of a 64-bit integer value of the specified `Const` expression. Useful where I64 returning exports are illegal, i.e. binaryen.js.
+int32_t BinaryenConstGetValueI64High(BinaryenExpressionRef expr);
+// Gets the 32-bit float value of the specified `Const` expression.
+float BinaryenConstGetValueF32(BinaryenExpressionRef expr);
+// Gets the 64-bit float value of the specified `Const` expression.
+double BinaryenConstGetValueF64(BinaryenExpressionRef expr);
// Functions