Class in ffi::types compiler

Int

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

FFI tag for a 64-bit signed integer (int64_t), passed from and returned as int.

The bare name int means the same in declare and extern blocks.

Examples#

use ffi::{dload, declare, invoke};
use ffi::types::{Int};

let lib = dload("sum")?;
let sum_id = declare(lib, "sum", (Int, Int), Int)?; // int64_t sum(int64_t, int64_t)
let n = invoke(lib, sum_id, (40, 2))?;

See also#

  • int
  • Float: FFI tag for a 64-bit float (double), passed from and returned as float.
  • String: FFI tag for a NUL-terminated C string (const char *), passed from and returned as string.
  • 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