Library

std/ffi

What a binding declares about the C library it calls.

1 file lib/std/ffi/ffi.vader 1 exports

A CLibrary constant names a library once; each @extern that comes from it names the constant (@extern(RAYLIB, "InitWindow")). The compiler evaluates the constant when it builds, so its fields may depend on the target through VADER_OS and VADER_ARCH.

Types

CLibrary :: struct

A C library that @extern declarations come from.

A native build adds what it lists to the compilation and the link, and only when one of the library's functions is reached. The interpreter opens it by name, or, when it ships archives, calls it through adapters compiled with them.

Fields

name: string

What the interpreter opens: lib<name>.dylib, lib<name>.so or <name>.dll, and what its adapters link when there are no archives. A native build links what archives and system list.

header: string = ""

The header declaring the library's functions, written as @c_header writes it. It serves every @extern naming the library without a @c_header of its own.

include: string = ""

A folder of headers, relative to the module declaring the constant: the compilation searches it (-I).

archives: string[] = []

Static archives shipped with the binding, relative to the module declaring the constant.

system: string[] = []

What the platform provides: a library by name ("GL" links -lGL), or an Apple framework by its bundle name ("Cocoa.framework").

Written by vader doc. Icons: Codicons, CC BY 4.0. Fonts: Atkinson Hyperlegible, JetBrains Mono, OFL.