From 235d9c321e64971a333c2d16f6cb3e6d8f119641 Mon Sep 17 00:00:00 2001 From: Isaiah Date: Sat, 16 Feb 2013 00:17:55 -0500 Subject: [PATCH] Add stdlib documentation for C interface functions --- doc/stdlib/base.rst | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/doc/stdlib/base.rst b/doc/stdlib/base.rst index af58612638e42..8fb4d6c992ebf 100644 --- a/doc/stdlib/base.rst +++ b/doc/stdlib/base.rst @@ -2991,13 +2991,37 @@ System Reference to the singleton ``EnvHash``. +C Interface +----------- + +.. function:: ccall( (symbol, library), RetType, (ArgType1, ...), ArgVar1, ...) + ccall( fptr::Ptr{Void}, RetType, (ArgType1, ...), ArgVar1, ...) + + Call function in C-exported shared library, specified by (function name, library) tuple (String or :Symbol). Alternatively, ccall may be used to call a function pointer returned by dlsym, but note that this usage is generally discouraged to facilitate future static compilation. + +.. function:: cfunction(fun::Function, RetType::Type, (ArgTypes...)) + + Generate C-callable function pointer from Julia function. + .. function:: dlopen(libfile::String) - Load a shared library, returning an opaque handle + Load a shared library, returning an opaque handle. .. function:: dlsym(handle, sym) - Look up a symbol from a shared library handle + Look up a symbol from a shared library handle, return callable function pointer on success. + +.. funciton:: dlsym_e(handle, sym) + + Look up a symbol from a shared library handle, silently return NULL pointer on lookup failure. + +.. function:: dlclose(handle) + + Close shared library referenced by handle. + +.. function:: c_free(addr::Ptr) + + Call free() from C standard library. Errors ------