Allocates a zero-initialized byte buffer of the given size.
Allocates a zero-initialized buffer for 'count' elements of the scalar type named by type_string.
Allocates a raw buffer (NOT zero-initialized) for 'count' scalar elements. Caller must write every element before reading.
Allocates a zero-initialized buffer for 'count' byte (uint8) elements.
Allocates a zero-initialized buffer for 'count' float32 elements.
Allocates a zero-initialized buffer for 'count' float64 elements.
Allocates a zero-initialized buffer for 'count' int16 elements.
Allocates a zero-initialized buffer for 'count' int32 elements.
Allocates a zero-initialized buffer for 'count' int64 elements.
Allocates a zero-initialized buffer for 'count' int8 elements.
Allocates memory for a C struct of the given Za struct type. The struct must be defined with the 'struct' keyword.
Allocates a zero-initialized buffer for 'count' uint16 elements.
Allocates a zero-initialized buffer for 'count' uint32 elements.
Allocates a zero-initialized buffer for 'count' uint64 elements.
Allocates a zero-initialized buffer for 'count' uint8 elements.
Allocates a raw byte buffer (NOT zero-initialized). Caller must write every byte before reading.
Reads multiple float32 values starting at the given element index and returns them as a []float32 Za array.
Reads multiple float64 values starting at the given element index and returns them as a Za array.
Reads multiple int16 values starting at the given element index and returns them as a [][int16] typed Za array.
Reads multiple int32 values starting at the given element index and returns them as a [][int32] typed Za array.
Reads multiple int64 values starting at the given element index and returns them as a [][int64] typed Za array.
Reads multiple int8 values starting at the given element index and returns them as a [][int8] typed Za array.
Reads multiple uint16 values starting at the given element index and returns them as a [][uint16] typed Za array.
Reads multiple uint32 values starting at the given element index and returns them as a [][uint32] typed Za array.
Reads multiple uint64 values starting at the given element index and returns them as a [][uint64] typed Za array.
Reads multiple uint8 values starting at the given element index and returns them as a [][uint8] typed Za array.
Writes multiple float32 values starting at the given element index.
Writes multiple float64 values starting at the given element index.
Writes multiple int16 values ([][int16] typed array) starting at the given element index.
Writes multiple int32 values ([][int32] typed array) starting at the given element index.
Writes multiple int64 values ([][int64] typed array) starting at the given element index.
Writes multiple int8 values ([][int8] typed array) starting at the given element index.
Writes multiple uint16 values ([][uint16] typed array) starting at the given element index.
Writes multiple uint32 values ([][uint32] typed array) starting at the given element index.
Writes multiple uint64 values ([][uint64] typed array) starting at the given element index.
Writes multiple uint8 values ([][uint8] typed array) starting at the given element index.
Reads count float32 values from a C buffer into a []float32 Za array.
Reads count float64 values from a C buffer into a Za array.
Reads count int16 values from a C buffer into a [][int16] Za array.
Reads count int32 values from a C buffer into a [][int32] Za array.
Reads count int64 values from a C buffer into a [][int64] Za array.
Reads count int8 values from a C buffer into a [][int8] Za array.
Reads count uint16 values from a C buffer into a [][uint16] Za array.
Reads count uint32 values from a C buffer into a [][uint32] Za array.
Reads count uint64 values from a C buffer into a [][uint64] Za array.
Reads count uint8 values from a C buffer into a [][uint8] Za array.
Copies an entire Za array into a C float32 buffer.
Copies an entire Za array into a C float64 buffer.
Copies an entire [][int16] Za array into a C int16 buffer.
Copies an entire [][int32] Za array into a C int32 buffer.
Copies an entire [][int64] Za array into a C int64 buffer.
Copies an entire [][int8] Za array into a C int8 buffer.
Copies an entire [][uint16] Za array into a C uint16 buffer.
Copies an entire [][uint32] Za array into a C uint32 buffer.
Copies an entire [][uint64] Za array into a C uint64 buffer.
Copies an entire [][uint8] Za array into a C uint8 buffer.
Reads a float32 at the given element index in a buffer.
Reads a float64 at the given element index in a buffer.
Reads a int16 at the given element index in a buffer.
Reads a int32 at the given element index in a buffer.
Reads a int64 at the given element index in a buffer.
Reads a int8 at the given element index in a buffer.
Reads a uint16 at the given element index in a buffer.
Reads a uint32 at the given element index in a buffer.
Reads a uint64 at the given element index in a buffer.
Reads a uint8 at the given element index in a buffer.
Writes a float32 at the given element index in a buffer.
Writes a float64 at the given element index in a buffer.
Writes a int16 at the given element index in a buffer.
Writes a int32 at the given element index in a buffer.
Writes a int64 at the given element index in a buffer.
Writes a int8 at the given element index in a buffer.
Writes a uint16 at the given element index in a buffer.
Writes a uint32 at the given element index in a buffer.
Writes a uint64 at the given element index in a buffer.
Writes a uint8 at the given element index in a buffer.
Closes a FILE* pointer. Returns 0 on success.
Opens a file and returns a FILE* pointer. Mode is like C fopen ("r", "w", "rb", "wb", etc).
Frees a C pointer allocated by c_alloc.
Frees a C struct pointer allocated by c_alloc_struct.
Reads a byte at the given offset in a buffer.
Reads a byte at the given int64 address + offset. For opaque pointers returned from FFI calls.
Reads a double (64-bit) at the given offset in a buffer.
Reads a double (64-bit) at the given int64 address + offset. For opaque pointers returned from FFI calls.
Reads a float (32-bit) at the given offset in a buffer.
Reads a float32 (32-bit) at the given offset in a buffer.
Reads a float32 (32-bit) at the given int64 address + offset. For opaque pointers returned from FFI calls.
Reads a float (32-bit) at the given int64 address + offset. For opaque pointers returned from FFI calls.
Reads an int16 at the given offset in a buffer.
Reads an int16 at the given int64 address + offset. For opaque pointers returned from FFI calls.
Reads an int32 at the given offset in a buffer.
Reads an int32 at the given int64 address + offset. For opaque pointers returned from FFI calls.
Reads an int64 at the given offset in a buffer.
Reads an int64 at the given int64 address + offset. For opaque pointers returned from FFI calls.
Reads a data symbol (constant/variable) from a loaded C library. Note: C preprocessor #defines are NOT symbols and cannot be read this way.
Reads a uint16 at the given offset in a buffer.
Reads a uint16 at the given int64 address + offset. For opaque pointers returned from FFI calls.
Reads a uint32 at the given offset in a buffer.
Reads a uint32 at the given int64 address + offset. For opaque pointers returned from FFI calls.
Reads a uint64 at the given offset in a buffer.
Reads a uint64 at the given int64 address + offset. For opaque pointers returned from FFI calls.
Allocates a C string (char*) from a Za string. The caller is responsible for freeing it with c_free().
Returns a null C pointer for use in FFI calls.
Returns true if the C pointer is null.
Converts a C pointer to an integer. Useful for size_t, uintptr_t, and other integer-valued returns. Tip: Can also use ptr.ToInt() method for convenience.
Converts a C string pointer (char*) to a Za string. The pointer should reference valid C string memory.
Sets a byte at the given offset in a buffer.
Sets a byte at the given int64 address + offset. For opaque pointers returned from FFI calls.
Writes a double (64-bit) at the given offset in a buffer.
Writes a double (64-bit) at the given int64 address + offset. For opaque pointers returned from FFI calls.
Writes a float (32-bit) at the given offset in a buffer. Accepts float64 or float32.
Writes a float32 (32-bit) at the given offset in a buffer.
Writes a float32 (32-bit) at the given int64 address + offset. For opaque pointers returned from FFI calls.
Writes a float (32-bit) at the given int64 address + offset. For opaque pointers returned from FFI calls.
Sets an int16 at the given offset in a buffer.
Sets an int16 at the given int64 address + offset. For opaque pointers returned from FFI calls.
Sets an int32 at the given offset in a buffer.
Sets an int32 at the given int64 address + offset. For opaque pointers returned from FFI calls.
Sets an int64 at the given offset in a buffer.
Sets an int64 at the given int64 address + offset. For opaque pointers returned from FFI calls.
Copies a Za string to a C buffer at the given pointer. The buffer must be large enough.
Sets a uint16 at the given offset in a buffer.
Sets a uint16 at the given int64 address + offset. For opaque pointers returned from FFI calls.
Sets a uint32 at the given offset in a buffer.
Sets a uint32 at the given int64 address + offset. For opaque pointers returned from FFI calls.
Sets a uint64 at the given offset in a buffer.
Sets a uint64 at the given int64 address + offset. For opaque pointers returned from FFI calls.
Reads C struct data from memory and converts it to a Za struct. Use this for 'out' parameters that C functions fill with data.