Class in ffi::types compiler

String

class String
Import
use ffi::types::{String};
Source: compiler/src/builtin_docs/ffi/types.hy

FFI tag for a NUL-terminated C string (const char *), passed from and returned as string.

A Coil string is passed as a pointer to its UTF-8 bytes; C must not keep it after the call. A returned char * is copied into a new Coil string at once (a null pointer gives an empty string), and C keeps ownership of its memory.

See also#

  • string
  • Int: FFI tag for a 64-bit signed integer (int64_t), passed from and returned as int.
  • Float: FFI tag for a 64-bit float (double), passed from and returned as float.
  • Void: FFI tag for no value (void), valid only as a return type.
  • Bool: FFI tag for a C bool (one byte, 0 or 1), passed from and returned as bool.
  • Int8: FFI tag for an 8-bit signed integer (int8_t), passed from and returned as int.
  • Int16: FFI tag for a 16-bit signed integer (int16_t), passed from and returned as int.
  • Int32: FFI tag for a 32-bit signed integer (int32_t), passed from and returned as int.
↑ ↓ navigate ↵ open