Last active
December 14, 2015 10:49
-
-
Save ihnorton/5074512 to your computer and use it in GitHub Desktop.
Julia snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro c(ret_type, func, arg_types, lib) | |
args_in = Any[ symbol(string("a",x)) for x in 1:length(arg_types.args) ] | |
quote | |
$(esc(func))($(args_in...)) = ccall( ($(string(func)), $lib), $ret_type, $(arg_types), $(args_in...) ) | |
end | |
end | |
julia> @c Ptr{Void} wci_createCursorList () "../lib/libwrapcindex" | |
# methods for generic function wci_createCursorList | |
wci_createCursorList() at none:5 | |
julia> wci_createCursorList() | |
Ptr{Void} @0x00000000020ce530 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment