Function nix_alloc_primop

Source
pub unsafe extern "C" fn nix_alloc_primop(
    context: *mut nix_c_context,
    fun: PrimOpFun,
    arity: c_int,
    name: *const c_char,
    args: *mut *const c_char,
    doc: *const c_char,
    user_data: *mut c_void,
) -> *mut PrimOp
Expand description

Allocate a PrimOp Owned by the garbage collector. Use nix_gc_decref() when you’re done with the returned PrimOp.

§Arguments

  • context [out] - Optional, stores error information
  • fun [in] - callback
  • arity [in] - expected number of function arguments
  • name [in] - function name
  • args [in] - array of argument names, NULL-terminated
  • doc [in] - optional, documentation for this primop
  • user_data [in] - optional, arbitrary data, passed to the callback when it’s called

§Returns

primop, or null in case of errors

§See also

nix_init_primop