Skip to main content

Module c_api_utils

Module c_api_utils 

Source
Expand description

Macros and helper functions for the C FFI layer.

This module provides the internal infrastructure used by the *_c modules to implement extern "C" functions. It defines:

  • Return code constants: DIFFSOL_OK (0), DIFFSOL_ERR (-1), DIFFSOL_BAD_ARG (-2).
  • Conversion traits CMapTo<Out> / CMapFrom<In> for mapping between Rust and C types.
  • Helper functions for common patterns: map_get, map_set, invalid_arg_at, error_at, null_err_at, valid_f64_ptr.
  • Convenience macros: c_invalid_arg!, c_error!, c_null_err!, c_getter_simple!, c_setter_simple!.

This module is not intended for external use; it exists to share boilerplate across the _c modules.

Constants§

DIFFSOL_BAD_ARG
DIFFSOL_ERR
DIFFSOL_OK

Traits§

CMapFrom
CMapTo

Functions§

error_at
invalid_arg_at
map_get
map_set
null_err_at
valid_f64_ptr