Guest User

Untitled

a guest
Oct 15th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. load("strpack.jl")
  2.  
  3. type Foo
  4. bar::Int32
  5. baz::Float64
  6. bat::Uint8
  7. end
  8.  
  9. const libtest = dlopen("libtest.so")
  10.  
  11. foo = Foo(int32(1), 4.0, uint8(7))
  12. foobuf = pack(foo, align_native)
  13. ccall(dlsym(libtest, :foobar), Void, (Ptr{Uint8},), foobuf.data)
  14. seek(foobuf, 0)
  15. foo2 = unpack(foobuf, Foo, align_native)
Add Comment
Please, Sign In to add comment