diff options
| author | Fuwn <[email protected]> | 2022-03-13 16:50:16 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-03-13 16:50:16 -0700 |
| commit | 02d03bfe87859ccbe68bccca52f25c9e51c042e2 (patch) | |
| tree | feea6aa16c2f1129a7c9053323c1208b32ee2e12 /examples | |
| parent | refactor(examples): python cdef struct (diff) | |
| download | senpy-ffi-02d03bfe87859ccbe68bccca52f25c9e51c042e2.tar.xz senpy-ffi-02d03bfe87859ccbe68bccca52f25c9e51c042e2.zip | |
docs(examples): add julia ffi example
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/ffi.jl | 14 |
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) |