Skip to content

Commit 80820ac

Browse files
authored
Merge pull request #30019 from sebasguts/sg/ccall_docs
Extended ccall documentation
2 parents b3cf152 + ef8e852 commit 80820ac

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

base/docs/basedocs.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,11 +618,13 @@ kw"||"
618618

619619
"""
620620
ccall((function_name, library), returntype, (argtype1, ...), argvalue1, ...)
621+
ccall(function_name, returntype, (argtype1, ...), argvalue1, ...)
621622
ccall(function_pointer, returntype, (argtype1, ...), argvalue1, ...)
622623
623624
Call a function in a C-exported shared library, specified by the tuple `(function_name, library)`,
624-
where each component is either a string or symbol. Alternatively, `ccall` may
625-
also be used to call a function pointer `function_pointer`, such as one returned by `dlsym`.
625+
where each component is either a string or symbol. Instead of specifying a library,
626+
one can also use a `function_name` symbol or string, which is resolved in the current process.
627+
Alternatively, `ccall` may also be used to call a function pointer `function_pointer`, such as one returned by `dlsym`.
626628
627629
Note that the argument type tuple must be a literal tuple, and not a tuple-valued
628630
variable or expression.

doc/src/manual/calling-c-and-fortran-code.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ to [`ccall`](@ref) are as follows:
4444

4545
OR
4646

47+
a `:function` name symbol or `"function"` name string, which is resolved in the
48+
current process,
49+
50+
OR
51+
4752
a function pointer (for example, from `dlsym`).
4853

4954
2. Return type (see below for mapping the declared C type to Julia)

0 commit comments

Comments
 (0)