Skip to content

Update ccall documentation #543

Closed
Closed
@ViralBShah

Description

@ViralBShah

Update ccall documentation to capture the new functionality in commit 2ba6116

  1. Conversions are inserted automatically, so you can simply pass "x,
    y, z" instead of the "int32(x), uint64(y), int32(z)" we had to use
    everywhere. Of course, this uses the convert() function. Arrays and
    byte strings can be converted to pointers.
  2. A pointer to a scalar can be passed using the syntax "&x". This is
    especially useful for calling fortran. This syntax is a pun and does
    not do the same thing as C. In particular, while it is safe for called
    functions to write through this pointer, you will not be able to see
    its changes (the variable "x" will not change). Things like &0 and
    &f(x) also work, since this is not a real address-of operator.
    Conversion also happens with &; passing &x as a Ptr{T} will first
    convert x to type T.

Metadata

Metadata

Assignees

Labels

docsThis change adds or pertains to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions