aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/ffi.jl14
1 files changed, 14 insertions, 0 deletions
diff --git a/examples/ffi.jl b/examples/ffi.jl
new file mode 100644
index 0000000..b92a52d
--- /dev/null
+++ b/examples/ffi.jl
@@ -0,0 +1,14 @@
+c_status = ccall((:status, "target/debug/senpy_ffi"), Int32, ())
+status = ""
+
+if c_status == 1
+ status = "up"
+elseif c_status == 0
+ status = "down"
+elseif c_status == -1
+ status = "not down, but unreachable"
+else
+ status = "unknown"
+end
+
+print("status: api.senpy.club is ", status)