Skip to content

CPtr

1 min read

Import: import system;

Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.

CPtr

An opaque C pointer (void*, T*). @c passes it by value; ref p: CPtr is a T** out-param and Option<CPtr> a nullable pointer.

public struct CPtr

constructor

Creates a CPtr with raw.

public constructor(raw: usize)

null

The NULL pointer.

public static fun null(): CPtr

is_null

True when this is NULL.

public fun is_null(): bool

address

The pointer as an integer address.

public fun address(): usize

offset

The pointer bytes bytes past this one.

public fun offset(bytes: isize): CPtr