Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated header includes fns and types from other crate #127

Open
TheButlah opened this issue Jul 20, 2022 · 5 comments
Open

Generated header includes fns and types from other crate #127

TheButlah opened this issue Jul 20, 2022 · 5 comments
Labels
K-feature Kind: proposed new code to implement new behaviour

Comments

@TheButlah
Copy link
Contributor

TheButlah commented Jul 20, 2022

My codebase is split into multiple crates. I have one crate that uses safer-ffi and has #[derive_ReprC]s on various data types, guarded by a c_api feature. I have another crate that depends on the first one, and also uses safer-ffi to expose some functions to C.

The second crate is putting all types and functions from the first crate used in #[ffi_export] into the header file as well as the second crates #[ffi_export]s, even though I would rather have the header file simply include the header from the first crate. I'm concerned that if I were to #include both files, I would have duplicate function declarations.

@TheButlah TheButlah changed the title Generated header includes functions from other crate Generated header includes type definitions from other crate Jul 20, 2022
@TheButlah TheButlah changed the title Generated header includes type definitions from other crate Generated header includes fns and types from other crate Jul 20, 2022
@TheButlah
Copy link
Contributor Author

TheButlah commented Jul 20, 2022

This isn't a minimally reproducible example at all, but in case its helpful, here is the second crate:
https://github.com/0xTELEPORTAL/tp-platform/blob/29c62451672d3a353f98cddef7c7c951b356973e/demos/unity_states/rust/src/lib.rs

here is the generated header, which includes many functions not defined in the crates `lib.rs`:
/*! \file */
/*******************************************
 *                                         *
 *  File auto-generated by `::safer_ffi`.  *
 *                                         *
 *  Do not manually edit this file.        *
 *                                         *
 *******************************************/

#ifndef __RUST_UNITY_STATES__
#define __RUST_UNITY_STATES__

#ifdef __cplusplus
extern "C" {
#endif

typedef struct BallStates BallStates_t;

typedef struct tp_client__contract__properties__states__StateId_F32 tp_client__contract__properties__states__StateId_F32_t;

tp_client__contract__properties__states__StateId_F32_t * BallStates__pos_x (
    BallStates_t const * s);

tp_client__contract__properties__states__StateId_F32_t * BallStates__pos_y (
    BallStates_t const * s);

tp_client__contract__properties__states__StateId_F32_t * BallStates__pos_z (
    BallStates_t const * s);

typedef struct tp_client__contract__properties__states__StateId_I16 tp_client__contract__properties__states__StateId_I16_t;

tp_client__contract__properties__states__StateId_I16_t * BallStates__euler_x (
    BallStates_t const * s);

tp_client__contract__properties__states__StateId_I16_t * BallStates__euler_y (
    BallStates_t const * s);

tp_client__contract__properties__states__StateId_I16_t * BallStates__euler_z (
    BallStates_t const * s);

tp_client__contract__properties__states__StateId_F32_t * BallStates__scale_x (
    BallStates_t const * s);

tp_client__contract__properties__states__StateId_F32_t * BallStates__scale_y (
    BallStates_t const * s);

tp_client__contract__properties__states__StateId_F32_t * BallStates__scale_z (
    BallStates_t const * s);

typedef struct tp_client__contract__properties__states__StateId_U64 tp_client__contract__properties__states__StateId_U64_t;

tp_client__contract__properties__states__StateId_U64_t * BallStates__color (
    BallStates_t const * s);

typedef struct Baseline Baseline_t;

typedef struct BallContract BallContract_t;

BallContract_t * BallContract__register (
    Baseline_t * baseline);

typedef struct tp_client__contract__ContractDataHandle tp_client__contract__ContractDataHandle_t;

void BallContract__unregister (
    Baseline_t * baseline,
    tp_client__contract__ContractDataHandle_t * contract);

void BallContract__drop (
    BallContract_t * contract);

tp_client__contract__ContractDataHandle_t * BallContract__handle (
    BallContract_t const * c);

BallStates_t const * BallContract__states (
    BallContract_t const * c);


#include <stddef.h>
#include <stdint.h>

typedef struct tp_client__object__ObjectHandle tp_client__object__ObjectHandle_t;

tp_client__object__ObjectHandle_t * BallContract__object_create (
    Baseline_t * baseline,
    BallContract_t const * contract,
    float pos_x,
    float pos_y,
    float pos_z,
    int16_t euler_x,
    int16_t euler_y,
    int16_t euler_z,
    float scale_x,
    float scale_y,
    float scale_z,
    uint64_t color);

void BallContract__object_remove (
    Baseline_t * baseline,
    tp_client__object__ObjectHandle_t * obj);

typedef struct tp_client__contract__properties__channels__ChannelId_ContractDataHandle tp_client__contract__properties__channels__ChannelId_ContractDataHandle_t;

tp_client__contract__ContractDataHandle_t * ChannelId_ContractDataHandle__contract (
    tp_client__contract__properties__channels__ChannelId_ContractDataHandle_t const * id);

typedef struct tp_client__contract__properties__channels__ChannelId_I8 tp_client__contract__properties__channels__ChannelId_I8_t;

tp_client__contract__ContractDataHandle_t * ChannelId_I8__contract (
    tp_client__contract__properties__channels__ChannelId_I8_t const * id);

typedef struct tp_client__contract__properties__channels__Keyframe_ObjectHandle tp_client__contract__properties__channels__Keyframe_ObjectHandle_t;

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_ObjectHandle {

    tp_client__contract__properties__channels__Keyframe_ObjectHandle_t * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_ObjectHandle_t;

void tp_client__contract__properties__channels__RVec_KeyframeObjectHandle__push (
    Vec_tp_client__contract__properties__channels__Keyframe_ObjectHandle_t * vec,
    tp_client__contract__properties__channels__Keyframe_ObjectHandle_t * item);

Vec_tp_client__contract__properties__channels__Keyframe_ObjectHandle_t tp_client__contract__properties__channels__RVec_KeyframeObjectHandle__new (void);

void tp_client__contract__properties__channels__RVec_KeyframeObjectHandle__drop (
    Vec_tp_client__contract__properties__channels__Keyframe_ObjectHandle_t vec);

tp_client__contract__properties__channels__Keyframe_ObjectHandle_t const * tp_client__contract__properties__channels__RVec_KeyframeObjectHandle__get (
    Vec_tp_client__contract__properties__channels__Keyframe_ObjectHandle_t const * vec,
    size_t idx);

void tp_client__contract__properties__channels__RVec_KeyframeObjectHandle__set (
    Vec_tp_client__contract__properties__channels__Keyframe_ObjectHandle_t * vec,
    size_t idx,
    tp_client__contract__properties__channels__Keyframe_ObjectHandle_t * value);

double tp_client__contract__properties__channels__Keyframe_ObjectHandle__time (
    tp_client__contract__properties__channels__Keyframe_ObjectHandle_t const * kf);

tp_client__object__ObjectHandle_t const * tp_client__contract__properties__channels__Keyframe_ObjectHandle__value (
    tp_client__contract__properties__channels__Keyframe_ObjectHandle_t const * kf);

void tp_client__contract__properties__channels__Keyframe_ObjectHandle__drop (
    tp_client__contract__properties__channels__Keyframe_ObjectHandle_t * kf);

tp_client__contract__properties__channels__Keyframe_ObjectHandle_t * tp_client__contract__properties__channels__Keyframe_ObjectHandle__new (
    tp_client__object__ObjectHandle_t * value,
    double time);

typedef struct tp_client__contract__properties__channels__Channel_U64 tp_client__contract__properties__channels__Channel_U64_t;

typedef struct tp_client__contract__properties__channels__Keyframe_U64 tp_client__contract__properties__channels__Keyframe_U64_t;

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_U64_ptr {

    tp_client__contract__properties__channels__Keyframe_U64_t * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_U64_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_U64_ptr_t tp_client__contract__properties__channels__Channel_U64__keyframes_mut (
    tp_client__contract__properties__channels__Channel_U64_t * chan);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_U64_const_ptr {

    tp_client__contract__properties__channels__Keyframe_U64_t const * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_U64_const_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_U64_const_ptr_t tp_client__contract__properties__channels__Channel_U64__keyframes (
    tp_client__contract__properties__channels__Channel_U64_t const * chan);

void tp_client__contract__properties__channels__Channel_U64__drop (
    tp_client__contract__properties__channels__Channel_U64_t * c);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_U64 {

    tp_client__contract__properties__channels__Keyframe_U64_t * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_U64_t;

tp_client__contract__properties__channels__Channel_U64_t * tp_client__contract__properties__channels__Channel_U64__new (
    Vec_tp_client__contract__properties__channels__Keyframe_U64_t v);

typedef struct tp_client__contract__properties__states__StateHandle_ContractDataHandle tp_client__contract__properties__states__StateHandle_ContractDataHandle_t;

void tp_client__contract__properties__states__StateHandle_ContractDataHandle__drop (
    tp_client__contract__properties__states__StateHandle_ContractDataHandle_t * h);

typedef struct tp_client__contract__properties__states__StateHandle_U32 tp_client__contract__properties__states__StateHandle_U32_t;

void tp_client__contract__properties__states__StateHandle_U32__drop (
    tp_client__contract__properties__states__StateHandle_U32_t * h);

void tp_client__contract__properties__states__StateId_U64__drop (
    tp_client__contract__properties__states__StateId_U64_t * id);

tp_client__contract__ContractDataHandle_t * tp_client__contract__properties__states__StateId_U64__contract (
    tp_client__contract__properties__states__StateId_U64_t const * id);

typedef struct tp_client__contract__properties__channels__ChannelId_U16 tp_client__contract__properties__channels__ChannelId_U16_t;

typedef struct tp_client__contract__properties__channels__ChannelHandle_U16 tp_client__contract__properties__channels__ChannelHandle_U16_t;

tp_client__contract__properties__channels__ChannelHandle_U16_t * tp_client__baseline__Baseline__bind_channel_U16 (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelId_U16_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

typedef struct tp_client__contract__properties__states__StateId_U16 tp_client__contract__properties__states__StateId_U16_t;

typedef struct tp_client__contract__properties__states__StateHandle_U16 tp_client__contract__properties__states__StateHandle_U16_t;

tp_client__contract__properties__states__StateHandle_U16_t * tp_client__baseline__Baseline__bind_state_U16 (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateId_U16_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

typedef struct tp_client__contract__properties__channels__Channel_U16 tp_client__contract__properties__channels__Channel_U16_t;

tp_client__contract__properties__channels__Channel_U16_t * tp_client__baseline__Baseline__channel_mut_U16 (
    Baseline_t * b,
    tp_client__contract__properties__channels__ChannelHandle_U16_t const * chan);

tp_client__contract__properties__channels__Channel_U16_t const * tp_client__baseline__Baseline__channel_U16 (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelHandle_U16_t const * chan);

typedef struct tp_client__contract__properties__states__State_U16 tp_client__contract__properties__states__State_U16_t;

tp_client__contract__properties__states__State_U16_t * tp_client__baseline__Baseline__state_mut_U16 (
    Baseline_t * b,
    tp_client__contract__properties__states__StateHandle_U16_t const * state);

tp_client__contract__properties__states__State_U16_t const * tp_client__baseline__Baseline__state_U16 (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateHandle_U16_t const * state);

typedef struct tp_client__contract__properties__states__State_I8 tp_client__contract__properties__states__State_I8_t;

void tp_client__contract__properties__states__State_I8__value_set (
    tp_client__contract__properties__states__State_I8_t * state,
    int8_t * new_value);

int8_t const * tp_client__contract__properties__states__State_I8__value (
    tp_client__contract__properties__states__State_I8_t const * state);

void tp_client__contract__properties__states__State_I8__drop (
    tp_client__contract__properties__states__State_I8_t * s);

tp_client__contract__properties__states__State_I8_t * tp_client__contract__properties__states__State_I8__new (
    int8_t * value);

typedef struct tp_client__contract__properties__states__State_U8 tp_client__contract__properties__states__State_U8_t;

void tp_client__contract__properties__states__State_U8__value_set (
    tp_client__contract__properties__states__State_U8_t * state,
    uint8_t * new_value);

uint8_t const * tp_client__contract__properties__states__State_U8__value (
    tp_client__contract__properties__states__State_U8_t const * state);

void tp_client__contract__properties__states__State_U8__drop (
    tp_client__contract__properties__states__State_U8_t * s);

tp_client__contract__properties__states__State_U8_t * tp_client__contract__properties__states__State_U8__new (
    uint8_t * value);

typedef struct tp_client__contract__properties__states__State_F32 tp_client__contract__properties__states__State_F32_t;

void tp_client__contract__properties__states__State_F32__value_set (
    tp_client__contract__properties__states__State_F32_t * state,
    float * new_value);

float const * tp_client__contract__properties__states__State_F32__value (
    tp_client__contract__properties__states__State_F32_t const * state);

void tp_client__contract__properties__states__State_F32__drop (
    tp_client__contract__properties__states__State_F32_t * s);

tp_client__contract__properties__states__State_F32_t * tp_client__contract__properties__states__State_F32__new (
    float * value);

void tp_client__contract__ExampleContract__object_remove (
    Baseline_t * baseline,
    tp_client__object__ObjectHandle_t * obj);

typedef struct tp_client__contract__ExampleContract tp_client__contract__ExampleContract_t;

tp_client__object__ObjectHandle_t * tp_client__contract__ExampleContract__object_create (
    tp_client__contract__ExampleContract_t const * contract,
    Baseline_t * baseline,
    uint8_t u8_0,
    uint8_t u8_1,
    int8_t i8_0,
    int8_t i8_1,
    float f32_0,
    float f32_1);

typedef struct tp_client__contract__ExampleStates tp_client__contract__ExampleStates_t;

tp_client__contract__ExampleStates_t const * tp_client__contract__ExampleContract__states (
    tp_client__contract__ExampleContract_t const * c);

tp_client__contract__ContractDataHandle_t * tp_client__contract__ExampleContract__handle (
    tp_client__contract__ExampleContract_t const * c);

void tp_client__contract__ExampleContract__drop (
    tp_client__contract__ExampleContract_t * c);

typedef struct tp_client__contract__properties__channels__Keyframe_U32 tp_client__contract__properties__channels__Keyframe_U32_t;

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_U32 {

    tp_client__contract__properties__channels__Keyframe_U32_t * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_U32_t;

void tp_client__contract__properties__channels__RVec_KeyframeU32__push (
    Vec_tp_client__contract__properties__channels__Keyframe_U32_t * vec,
    tp_client__contract__properties__channels__Keyframe_U32_t * item);

Vec_tp_client__contract__properties__channels__Keyframe_U32_t tp_client__contract__properties__channels__RVec_KeyframeU32__new (void);

void tp_client__contract__properties__channels__RVec_KeyframeU32__drop (
    Vec_tp_client__contract__properties__channels__Keyframe_U32_t vec);

tp_client__contract__properties__channels__Keyframe_U32_t const * tp_client__contract__properties__channels__RVec_KeyframeU32__get (
    Vec_tp_client__contract__properties__channels__Keyframe_U32_t const * vec,
    size_t idx);

void tp_client__contract__properties__channels__RVec_KeyframeU32__set (
    Vec_tp_client__contract__properties__channels__Keyframe_U32_t * vec,
    size_t idx,
    tp_client__contract__properties__channels__Keyframe_U32_t * value);

double tp_client__contract__properties__channels__Keyframe_U32__time (
    tp_client__contract__properties__channels__Keyframe_U32_t const * kf);

uint32_t const * tp_client__contract__properties__channels__Keyframe_U32__value (
    tp_client__contract__properties__channels__Keyframe_U32_t const * kf);

void tp_client__contract__properties__channels__Keyframe_U32__drop (
    tp_client__contract__properties__channels__Keyframe_U32_t * kf);

tp_client__contract__properties__channels__Keyframe_U32_t * tp_client__contract__properties__channels__Keyframe_U32__new (
    uint32_t * value,
    double time);

typedef struct tp_client__contract__properties__states__StateId_I64 tp_client__contract__properties__states__StateId_I64_t;

void tp_client__contract__properties__states__StateId_I64__drop (
    tp_client__contract__properties__states__StateId_I64_t * id);

tp_client__contract__ContractDataHandle_t * tp_client__contract__properties__states__StateId_I64__contract (
    tp_client__contract__properties__states__StateId_I64_t const * id);

tp_client__contract__ExampleContract_t * tp_client__baseline__Baseline__register_contract___example (
    Baseline_t * baseline);

typedef struct Object Object_t;

Object_t * tp_client__baseline__Baseline__object_mut (
    Baseline_t * baseline,
    tp_client__object__ObjectHandle_t const * handle);

Object_t const * tp_client__baseline__Baseline__object (
    Baseline_t const * baseline,
    tp_client__object__ObjectHandle_t const * handle);

typedef struct tp_client__contract__ContractData tp_client__contract__ContractData_t;

tp_client__contract__ContractData_t const * tp_client__baseline__Baseline__contract_data (
    Baseline_t const * b,
    tp_client__contract__ContractDataHandle_t const * contract);

/** \remark Has the same ABI as `uint8_t` **/
#ifdef DOXYGEN
typedef enum BaselineKind
#else
typedef uint8_t BaselineKind_t; enum
#endif
{
    /** . */
    BASELINE_KIND_MAIN = 0,
    /** . */
    BASELINE_KIND_FORK,
}
#ifdef DOXYGEN
BaselineKind_t
#endif
;

BaselineKind_t tp_client__baseline__Baseline__kind (
    Baseline_t const * b);

void tp_client__baseline__Baseline__drop (
    Baseline_t * baseline);

Baseline_t * tp_client__baseline__Baseline__new (
    BaselineKind_t kind);

typedef struct tp_client__contract__properties__channels__ChannelHandle_I8 tp_client__contract__properties__channels__ChannelHandle_I8_t;

tp_client__contract__properties__channels__ChannelHandle_I8_t * tp_client__baseline__Baseline__bind_channel_I8 (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelId_I8_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

typedef struct tp_client__contract__properties__states__StateId_I8 tp_client__contract__properties__states__StateId_I8_t;

typedef struct tp_client__contract__properties__states__StateHandle_I8 tp_client__contract__properties__states__StateHandle_I8_t;

tp_client__contract__properties__states__StateHandle_I8_t * tp_client__baseline__Baseline__bind_state_I8 (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateId_I8_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

typedef struct tp_client__contract__properties__channels__Channel_I8 tp_client__contract__properties__channels__Channel_I8_t;

tp_client__contract__properties__channels__Channel_I8_t * tp_client__baseline__Baseline__channel_mut_I8 (
    Baseline_t * b,
    tp_client__contract__properties__channels__ChannelHandle_I8_t const * chan);

tp_client__contract__properties__channels__Channel_I8_t const * tp_client__baseline__Baseline__channel_I8 (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelHandle_I8_t const * chan);

tp_client__contract__properties__states__State_I8_t * tp_client__baseline__Baseline__state_mut_I8 (
    Baseline_t * b,
    tp_client__contract__properties__states__StateHandle_I8_t const * state);

tp_client__contract__properties__states__State_I8_t const * tp_client__baseline__Baseline__state_I8 (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateHandle_I8_t const * state);

typedef struct tp_client__contract__properties__channels__Keyframe_I8 tp_client__contract__properties__channels__Keyframe_I8_t;

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_I8_ptr {

    tp_client__contract__properties__channels__Keyframe_I8_t * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_I8_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_I8_ptr_t tp_client__contract__properties__channels__Channel_I8__keyframes_mut (
    tp_client__contract__properties__channels__Channel_I8_t * chan);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_I8_const_ptr {

    tp_client__contract__properties__channels__Keyframe_I8_t const * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_I8_const_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_I8_const_ptr_t tp_client__contract__properties__channels__Channel_I8__keyframes (
    tp_client__contract__properties__channels__Channel_I8_t const * chan);

void tp_client__contract__properties__channels__Channel_I8__drop (
    tp_client__contract__properties__channels__Channel_I8_t * c);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_I8 {

    tp_client__contract__properties__channels__Keyframe_I8_t * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_I8_t;

tp_client__contract__properties__channels__Channel_I8_t * tp_client__contract__properties__channels__Channel_I8__new (
    Vec_tp_client__contract__properties__channels__Keyframe_I8_t v);

typedef struct tp_client__contract__properties__channels__Keyframe_Bool tp_client__contract__properties__channels__Keyframe_Bool_t;

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_Bool {

    tp_client__contract__properties__channels__Keyframe_Bool_t * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_Bool_t;

void tp_client__contract__properties__channels__RVec_KeyframeBool__push (
    Vec_tp_client__contract__properties__channels__Keyframe_Bool_t * vec,
    tp_client__contract__properties__channels__Keyframe_Bool_t * item);

Vec_tp_client__contract__properties__channels__Keyframe_Bool_t tp_client__contract__properties__channels__RVec_KeyframeBool__new (void);

void tp_client__contract__properties__channels__RVec_KeyframeBool__drop (
    Vec_tp_client__contract__properties__channels__Keyframe_Bool_t vec);

tp_client__contract__properties__channels__Keyframe_Bool_t const * tp_client__contract__properties__channels__RVec_KeyframeBool__get (
    Vec_tp_client__contract__properties__channels__Keyframe_Bool_t const * vec,
    size_t idx);

void tp_client__contract__properties__channels__RVec_KeyframeBool__set (
    Vec_tp_client__contract__properties__channels__Keyframe_Bool_t * vec,
    size_t idx,
    tp_client__contract__properties__channels__Keyframe_Bool_t * value);

double tp_client__contract__properties__channels__Keyframe_Bool__time (
    tp_client__contract__properties__channels__Keyframe_Bool_t const * kf);


#include <stdbool.h>

bool const * tp_client__contract__properties__channels__Keyframe_Bool__value (
    tp_client__contract__properties__channels__Keyframe_Bool_t const * kf);

void tp_client__contract__properties__channels__Keyframe_Bool__drop (
    tp_client__contract__properties__channels__Keyframe_Bool_t * kf);

tp_client__contract__properties__channels__Keyframe_Bool_t * tp_client__contract__properties__channels__Keyframe_Bool__new (
    bool * value,
    double time);

typedef struct tp_client__contract__properties__states__StateId_ContractDataHandle tp_client__contract__properties__states__StateId_ContractDataHandle_t;

void tp_client__contract__properties__states__StateId_ContractDataHandle__drop (
    tp_client__contract__properties__states__StateId_ContractDataHandle_t * id);

tp_client__contract__ContractDataHandle_t * tp_client__contract__properties__states__StateId_ContractDataHandle__contract (
    tp_client__contract__properties__states__StateId_ContractDataHandle_t const * id);

void tp_client__contract__properties__channels__RVec_KeyframeI8__push (
    Vec_tp_client__contract__properties__channels__Keyframe_I8_t * vec,
    tp_client__contract__properties__channels__Keyframe_I8_t * item);

Vec_tp_client__contract__properties__channels__Keyframe_I8_t tp_client__contract__properties__channels__RVec_KeyframeI8__new (void);

void tp_client__contract__properties__channels__RVec_KeyframeI8__drop (
    Vec_tp_client__contract__properties__channels__Keyframe_I8_t vec);

tp_client__contract__properties__channels__Keyframe_I8_t const * tp_client__contract__properties__channels__RVec_KeyframeI8__get (
    Vec_tp_client__contract__properties__channels__Keyframe_I8_t const * vec,
    size_t idx);

void tp_client__contract__properties__channels__RVec_KeyframeI8__set (
    Vec_tp_client__contract__properties__channels__Keyframe_I8_t * vec,
    size_t idx,
    tp_client__contract__properties__channels__Keyframe_I8_t * value);

double tp_client__contract__properties__channels__Keyframe_I8__time (
    tp_client__contract__properties__channels__Keyframe_I8_t const * kf);

int8_t const * tp_client__contract__properties__channels__Keyframe_I8__value (
    tp_client__contract__properties__channels__Keyframe_I8_t const * kf);

void tp_client__contract__properties__channels__Keyframe_I8__drop (
    tp_client__contract__properties__channels__Keyframe_I8_t * kf);

tp_client__contract__properties__channels__Keyframe_I8_t * tp_client__contract__properties__channels__Keyframe_I8__new (
    int8_t * value,
    double time);

typedef struct tp_client__contract__properties__channels__ChannelId_F32 tp_client__contract__properties__channels__ChannelId_F32_t;

typedef struct tp_client__contract__properties__channels__ChannelHandle_F32 tp_client__contract__properties__channels__ChannelHandle_F32_t;

tp_client__contract__properties__channels__ChannelHandle_F32_t * tp_client__baseline__Baseline__bind_channel_F32 (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelId_F32_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

typedef struct tp_client__contract__properties__states__StateHandle_F32 tp_client__contract__properties__states__StateHandle_F32_t;

tp_client__contract__properties__states__StateHandle_F32_t * tp_client__baseline__Baseline__bind_state_F32 (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateId_F32_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

typedef struct tp_client__contract__properties__channels__Channel_F32 tp_client__contract__properties__channels__Channel_F32_t;

tp_client__contract__properties__channels__Channel_F32_t * tp_client__baseline__Baseline__channel_mut_F32 (
    Baseline_t * b,
    tp_client__contract__properties__channels__ChannelHandle_F32_t const * chan);

tp_client__contract__properties__channels__Channel_F32_t const * tp_client__baseline__Baseline__channel_F32 (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelHandle_F32_t const * chan);

tp_client__contract__properties__states__State_F32_t * tp_client__baseline__Baseline__state_mut_F32 (
    Baseline_t * b,
    tp_client__contract__properties__states__StateHandle_F32_t const * state);

tp_client__contract__properties__states__State_F32_t const * tp_client__baseline__Baseline__state_F32 (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateHandle_F32_t const * state);

typedef struct tp_client__contract__properties__channels__ChannelId_I16 tp_client__contract__properties__channels__ChannelId_I16_t;

tp_client__contract__ContractDataHandle_t * ChannelId_I16__contract (
    tp_client__contract__properties__channels__ChannelId_I16_t const * id);

typedef struct tp_client__contract__properties__channels__ChannelId_U32 tp_client__contract__properties__channels__ChannelId_U32_t;

tp_client__contract__ContractDataHandle_t * ChannelId_U32__contract (
    tp_client__contract__properties__channels__ChannelId_U32_t const * id);

typedef struct tp_client__contract__properties__channels__Channel_I16 tp_client__contract__properties__channels__Channel_I16_t;

typedef struct tp_client__contract__properties__channels__Keyframe_I16 tp_client__contract__properties__channels__Keyframe_I16_t;

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_I16_ptr {

    tp_client__contract__properties__channels__Keyframe_I16_t * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_I16_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_I16_ptr_t tp_client__contract__properties__channels__Channel_I16__keyframes_mut (
    tp_client__contract__properties__channels__Channel_I16_t * chan);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_I16_const_ptr {

    tp_client__contract__properties__channels__Keyframe_I16_t const * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_I16_const_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_I16_const_ptr_t tp_client__contract__properties__channels__Channel_I16__keyframes (
    tp_client__contract__properties__channels__Channel_I16_t const * chan);

void tp_client__contract__properties__channels__Channel_I16__drop (
    tp_client__contract__properties__channels__Channel_I16_t * c);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_I16 {

    tp_client__contract__properties__channels__Keyframe_I16_t * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_I16_t;

tp_client__contract__properties__channels__Channel_I16_t * tp_client__contract__properties__channels__Channel_I16__new (
    Vec_tp_client__contract__properties__channels__Keyframe_I16_t v);

void tp_client__object__ObjectHandle__drop (
    tp_client__object__ObjectHandle_t * c);

typedef struct tp_client__contract__properties__channels__Keyframe_F32 tp_client__contract__properties__channels__Keyframe_F32_t;

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_F32 {

    tp_client__contract__properties__channels__Keyframe_F32_t * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_F32_t;

void tp_client__contract__properties__channels__RVec_KeyframeF32__push (
    Vec_tp_client__contract__properties__channels__Keyframe_F32_t * vec,
    tp_client__contract__properties__channels__Keyframe_F32_t * item);

Vec_tp_client__contract__properties__channels__Keyframe_F32_t tp_client__contract__properties__channels__RVec_KeyframeF32__new (void);

void tp_client__contract__properties__channels__RVec_KeyframeF32__drop (
    Vec_tp_client__contract__properties__channels__Keyframe_F32_t vec);

tp_client__contract__properties__channels__Keyframe_F32_t const * tp_client__contract__properties__channels__RVec_KeyframeF32__get (
    Vec_tp_client__contract__properties__channels__Keyframe_F32_t const * vec,
    size_t idx);

void tp_client__contract__properties__channels__RVec_KeyframeF32__set (
    Vec_tp_client__contract__properties__channels__Keyframe_F32_t * vec,
    size_t idx,
    tp_client__contract__properties__channels__Keyframe_F32_t * value);

double tp_client__contract__properties__channels__Keyframe_F32__time (
    tp_client__contract__properties__channels__Keyframe_F32_t const * kf);

float const * tp_client__contract__properties__channels__Keyframe_F32__value (
    tp_client__contract__properties__channels__Keyframe_F32_t const * kf);

void tp_client__contract__properties__channels__Keyframe_F32__drop (
    tp_client__contract__properties__channels__Keyframe_F32_t * kf);

tp_client__contract__properties__channels__Keyframe_F32_t * tp_client__contract__properties__channels__Keyframe_F32__new (
    float * value,
    double time);

typedef struct tp_client__contract__properties__channels__ChannelId_F64 tp_client__contract__properties__channels__ChannelId_F64_t;

tp_client__contract__ContractDataHandle_t * ChannelId_F64__contract (
    tp_client__contract__properties__channels__ChannelId_F64_t const * id);

typedef struct tp_client__contract__properties__channels__Keyframe_F64 tp_client__contract__properties__channels__Keyframe_F64_t;

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_F64 {

    tp_client__contract__properties__channels__Keyframe_F64_t * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_F64_t;

void tp_client__contract__properties__channels__RVec_KeyframeF64__push (
    Vec_tp_client__contract__properties__channels__Keyframe_F64_t * vec,
    tp_client__contract__properties__channels__Keyframe_F64_t * item);

Vec_tp_client__contract__properties__channels__Keyframe_F64_t tp_client__contract__properties__channels__RVec_KeyframeF64__new (void);

void tp_client__contract__properties__channels__RVec_KeyframeF64__drop (
    Vec_tp_client__contract__properties__channels__Keyframe_F64_t vec);

tp_client__contract__properties__channels__Keyframe_F64_t const * tp_client__contract__properties__channels__RVec_KeyframeF64__get (
    Vec_tp_client__contract__properties__channels__Keyframe_F64_t const * vec,
    size_t idx);

void tp_client__contract__properties__channels__RVec_KeyframeF64__set (
    Vec_tp_client__contract__properties__channels__Keyframe_F64_t * vec,
    size_t idx,
    tp_client__contract__properties__channels__Keyframe_F64_t * value);

double tp_client__contract__properties__channels__Keyframe_F64__time (
    tp_client__contract__properties__channels__Keyframe_F64_t const * kf);

double const * tp_client__contract__properties__channels__Keyframe_F64__value (
    tp_client__contract__properties__channels__Keyframe_F64_t const * kf);

void tp_client__contract__properties__channels__Keyframe_F64__drop (
    tp_client__contract__properties__channels__Keyframe_F64_t * kf);

tp_client__contract__properties__channels__Keyframe_F64_t * tp_client__contract__properties__channels__Keyframe_F64__new (
    double * value,
    double time);

typedef struct tp_client__contract__properties__states__State_F64 tp_client__contract__properties__states__State_F64_t;

void tp_client__contract__properties__states__State_F64__value_set (
    tp_client__contract__properties__states__State_F64_t * state,
    double * new_value);

double const * tp_client__contract__properties__states__State_F64__value (
    tp_client__contract__properties__states__State_F64_t const * state);

void tp_client__contract__properties__states__State_F64__drop (
    tp_client__contract__properties__states__State_F64_t * s);

tp_client__contract__properties__states__State_F64_t * tp_client__contract__properties__states__State_F64__new (
    double * value);

tp_client__contract__properties__states__StateId_F32_t * tp_client__contract__ExampleStates__f32_1 (
    tp_client__contract__ExampleStates_t const * s);

tp_client__contract__properties__states__StateId_F32_t * tp_client__contract__ExampleStates__f32_0 (
    tp_client__contract__ExampleStates_t const * s);

tp_client__contract__properties__states__StateId_I8_t * tp_client__contract__ExampleStates__i8_1 (
    tp_client__contract__ExampleStates_t const * s);

tp_client__contract__properties__states__StateId_I8_t * tp_client__contract__ExampleStates__i8_0 (
    tp_client__contract__ExampleStates_t const * s);

typedef struct tp_client__contract__properties__states__StateId_U8 tp_client__contract__properties__states__StateId_U8_t;

tp_client__contract__properties__states__StateId_U8_t * tp_client__contract__ExampleStates__u8_1 (
    tp_client__contract__ExampleStates_t const * s);

tp_client__contract__properties__states__StateId_U8_t * tp_client__contract__ExampleStates__u8_0 (
    tp_client__contract__ExampleStates_t const * s);

typedef struct tp_client__contract__properties__states__StateHandle_I16 tp_client__contract__properties__states__StateHandle_I16_t;

void tp_client__contract__properties__states__StateHandle_I16__drop (
    tp_client__contract__properties__states__StateHandle_I16_t * h);

void tp_client__contract__properties__states__StateHandle_I8__drop (
    tp_client__contract__properties__states__StateHandle_I8_t * h);

typedef struct tp_client__contract__properties__channels__ChannelId_U8 tp_client__contract__properties__channels__ChannelId_U8_t;

typedef struct tp_client__contract__properties__channels__ChannelHandle_U8 tp_client__contract__properties__channels__ChannelHandle_U8_t;

tp_client__contract__properties__channels__ChannelHandle_U8_t * tp_client__baseline__Baseline__bind_channel_U8 (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelId_U8_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

typedef struct tp_client__contract__properties__states__StateHandle_U8 tp_client__contract__properties__states__StateHandle_U8_t;

tp_client__contract__properties__states__StateHandle_U8_t * tp_client__baseline__Baseline__bind_state_U8 (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateId_U8_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

typedef struct tp_client__contract__properties__channels__Channel_U8 tp_client__contract__properties__channels__Channel_U8_t;

tp_client__contract__properties__channels__Channel_U8_t * tp_client__baseline__Baseline__channel_mut_U8 (
    Baseline_t * b,
    tp_client__contract__properties__channels__ChannelHandle_U8_t const * chan);

tp_client__contract__properties__channels__Channel_U8_t const * tp_client__baseline__Baseline__channel_U8 (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelHandle_U8_t const * chan);

tp_client__contract__properties__states__State_U8_t * tp_client__baseline__Baseline__state_mut_U8 (
    Baseline_t * b,
    tp_client__contract__properties__states__StateHandle_U8_t const * state);

tp_client__contract__properties__states__State_U8_t const * tp_client__baseline__Baseline__state_U8 (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateHandle_U8_t const * state);

typedef struct tp_client__contract__properties__channels__ChannelId_ObjectHandle tp_client__contract__properties__channels__ChannelId_ObjectHandle_t;

typedef struct tp_client__contract__properties__channels__ChannelHandle_ObjectHandle tp_client__contract__properties__channels__ChannelHandle_ObjectHandle_t;

tp_client__contract__properties__channels__ChannelHandle_ObjectHandle_t * tp_client__baseline__Baseline__bind_channel_ObjectHandle (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelId_ObjectHandle_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

typedef struct tp_client__contract__properties__states__StateId_ObjectHandle tp_client__contract__properties__states__StateId_ObjectHandle_t;

typedef struct tp_client__contract__properties__states__StateHandle_ObjectHandle tp_client__contract__properties__states__StateHandle_ObjectHandle_t;

tp_client__contract__properties__states__StateHandle_ObjectHandle_t * tp_client__baseline__Baseline__bind_state_ObjectHandle (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateId_ObjectHandle_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

typedef struct tp_client__contract__properties__channels__Channel_ObjectHandle tp_client__contract__properties__channels__Channel_ObjectHandle_t;

tp_client__contract__properties__channels__Channel_ObjectHandle_t * tp_client__baseline__Baseline__channel_mut_ObjectHandle (
    Baseline_t * b,
    tp_client__contract__properties__channels__ChannelHandle_ObjectHandle_t const * chan);

tp_client__contract__properties__channels__Channel_ObjectHandle_t const * tp_client__baseline__Baseline__channel_ObjectHandle (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelHandle_ObjectHandle_t const * chan);

typedef struct tp_client__contract__properties__states__State_ObjectHandle tp_client__contract__properties__states__State_ObjectHandle_t;

tp_client__contract__properties__states__State_ObjectHandle_t * tp_client__baseline__Baseline__state_mut_ObjectHandle (
    Baseline_t * b,
    tp_client__contract__properties__states__StateHandle_ObjectHandle_t const * state);

tp_client__contract__properties__states__State_ObjectHandle_t const * tp_client__baseline__Baseline__state_ObjectHandle (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateHandle_ObjectHandle_t const * state);

typedef struct tp_client__contract__properties__states__StateId_I32 tp_client__contract__properties__states__StateId_I32_t;

void tp_client__contract__properties__states__StateId_I32__drop (
    tp_client__contract__properties__states__StateId_I32_t * id);

tp_client__contract__ContractDataHandle_t * tp_client__contract__properties__states__StateId_I32__contract (
    tp_client__contract__properties__states__StateId_I32_t const * id);

typedef struct tp_client__contract__properties__states__StateHandle_Bool tp_client__contract__properties__states__StateHandle_Bool_t;

void tp_client__contract__properties__states__StateHandle_Bool__drop (
    tp_client__contract__properties__states__StateHandle_Bool_t * h);

void tp_client__contract__properties__states__StateHandle_U8__drop (
    tp_client__contract__properties__states__StateHandle_U8_t * h);

typedef struct tp_client__contract__properties__states__StateHandle_I64 tp_client__contract__properties__states__StateHandle_I64_t;

void tp_client__contract__properties__states__StateHandle_I64__drop (
    tp_client__contract__properties__states__StateHandle_I64_t * h);

typedef struct tp_client__contract__properties__channels__Keyframe_U16 tp_client__contract__properties__channels__Keyframe_U16_t;

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_U16 {

    tp_client__contract__properties__channels__Keyframe_U16_t * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_U16_t;

void tp_client__contract__properties__channels__RVec_KeyframeU16__push (
    Vec_tp_client__contract__properties__channels__Keyframe_U16_t * vec,
    tp_client__contract__properties__channels__Keyframe_U16_t * item);

Vec_tp_client__contract__properties__channels__Keyframe_U16_t tp_client__contract__properties__channels__RVec_KeyframeU16__new (void);

void tp_client__contract__properties__channels__RVec_KeyframeU16__drop (
    Vec_tp_client__contract__properties__channels__Keyframe_U16_t vec);

tp_client__contract__properties__channels__Keyframe_U16_t const * tp_client__contract__properties__channels__RVec_KeyframeU16__get (
    Vec_tp_client__contract__properties__channels__Keyframe_U16_t const * vec,
    size_t idx);

void tp_client__contract__properties__channels__RVec_KeyframeU16__set (
    Vec_tp_client__contract__properties__channels__Keyframe_U16_t * vec,
    size_t idx,
    tp_client__contract__properties__channels__Keyframe_U16_t * value);

double tp_client__contract__properties__channels__Keyframe_U16__time (
    tp_client__contract__properties__channels__Keyframe_U16_t const * kf);

uint16_t const * tp_client__contract__properties__channels__Keyframe_U16__value (
    tp_client__contract__properties__channels__Keyframe_U16_t const * kf);

void tp_client__contract__properties__channels__Keyframe_U16__drop (
    tp_client__contract__properties__channels__Keyframe_U16_t * kf);

tp_client__contract__properties__channels__Keyframe_U16_t * tp_client__contract__properties__channels__Keyframe_U16__new (
    uint16_t * value,
    double time);

typedef struct tp_client__contract__properties__channels__ChannelHandle_U32 tp_client__contract__properties__channels__ChannelHandle_U32_t;

tp_client__contract__properties__channels__ChannelHandle_U32_t * tp_client__baseline__Baseline__bind_channel_U32 (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelId_U32_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

typedef struct tp_client__contract__properties__states__StateId_U32 tp_client__contract__properties__states__StateId_U32_t;

tp_client__contract__properties__states__StateHandle_U32_t * tp_client__baseline__Baseline__bind_state_U32 (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateId_U32_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

typedef struct tp_client__contract__properties__channels__Channel_U32 tp_client__contract__properties__channels__Channel_U32_t;

tp_client__contract__properties__channels__Channel_U32_t * tp_client__baseline__Baseline__channel_mut_U32 (
    Baseline_t * b,
    tp_client__contract__properties__channels__ChannelHandle_U32_t const * chan);

tp_client__contract__properties__channels__Channel_U32_t const * tp_client__baseline__Baseline__channel_U32 (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelHandle_U32_t const * chan);

typedef struct tp_client__contract__properties__states__State_U32 tp_client__contract__properties__states__State_U32_t;

tp_client__contract__properties__states__State_U32_t * tp_client__baseline__Baseline__state_mut_U32 (
    Baseline_t * b,
    tp_client__contract__properties__states__StateHandle_U32_t const * state);

tp_client__contract__properties__states__State_U32_t const * tp_client__baseline__Baseline__state_U32 (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateHandle_U32_t const * state);

typedef struct tp_client__contract__properties__channels__ChannelHandle_ContractDataHandle tp_client__contract__properties__channels__ChannelHandle_ContractDataHandle_t;

tp_client__contract__properties__channels__ChannelHandle_ContractDataHandle_t * tp_client__baseline__Baseline__bind_channel_ContractDataHandle (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelId_ContractDataHandle_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

tp_client__contract__properties__states__StateHandle_ContractDataHandle_t * tp_client__baseline__Baseline__bind_state_ContractDataHandle (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateId_ContractDataHandle_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

typedef struct tp_client__contract__properties__channels__Channel_ContractDataHandle tp_client__contract__properties__channels__Channel_ContractDataHandle_t;

tp_client__contract__properties__channels__Channel_ContractDataHandle_t * tp_client__baseline__Baseline__channel_mut_ContractDataHandle (
    Baseline_t * b,
    tp_client__contract__properties__channels__ChannelHandle_ContractDataHandle_t const * chan);

tp_client__contract__properties__channels__Channel_ContractDataHandle_t const * tp_client__baseline__Baseline__channel_ContractDataHandle (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelHandle_ContractDataHandle_t const * chan);

typedef struct tp_client__contract__properties__states__State_ContractDataHandle tp_client__contract__properties__states__State_ContractDataHandle_t;

tp_client__contract__properties__states__State_ContractDataHandle_t * tp_client__baseline__Baseline__state_mut_ContractDataHandle (
    Baseline_t * b,
    tp_client__contract__properties__states__StateHandle_ContractDataHandle_t const * state);

tp_client__contract__properties__states__State_ContractDataHandle_t const * tp_client__baseline__Baseline__state_ContractDataHandle (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateHandle_ContractDataHandle_t const * state);

typedef struct tp_client__contract__properties__channels__Keyframe_ContractDataHandle tp_client__contract__properties__channels__Keyframe_ContractDataHandle_t;

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_ContractDataHandle {

    tp_client__contract__properties__channels__Keyframe_ContractDataHandle_t * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_ContractDataHandle_t;

void tp_client__contract__properties__channels__RVec_KeyframeContractDataHandle__push (
    Vec_tp_client__contract__properties__channels__Keyframe_ContractDataHandle_t * vec,
    tp_client__contract__properties__channels__Keyframe_ContractDataHandle_t * item);

Vec_tp_client__contract__properties__channels__Keyframe_ContractDataHandle_t tp_client__contract__properties__channels__RVec_KeyframeContractDataHandle__new (void);

void tp_client__contract__properties__channels__RVec_KeyframeContractDataHandle__drop (
    Vec_tp_client__contract__properties__channels__Keyframe_ContractDataHandle_t vec);

tp_client__contract__properties__channels__Keyframe_ContractDataHandle_t const * tp_client__contract__properties__channels__RVec_KeyframeContractDataHandle__get (
    Vec_tp_client__contract__properties__channels__Keyframe_ContractDataHandle_t const * vec,
    size_t idx);

void tp_client__contract__properties__channels__RVec_KeyframeContractDataHandle__set (
    Vec_tp_client__contract__properties__channels__Keyframe_ContractDataHandle_t * vec,
    size_t idx,
    tp_client__contract__properties__channels__Keyframe_ContractDataHandle_t * value);

double tp_client__contract__properties__channels__Keyframe_ContractDataHandle__time (
    tp_client__contract__properties__channels__Keyframe_ContractDataHandle_t const * kf);

tp_client__contract__ContractDataHandle_t const * tp_client__contract__properties__channels__Keyframe_ContractDataHandle__value (
    tp_client__contract__properties__channels__Keyframe_ContractDataHandle_t const * kf);

void tp_client__contract__properties__channels__Keyframe_ContractDataHandle__drop (
    tp_client__contract__properties__channels__Keyframe_ContractDataHandle_t * kf);

tp_client__contract__properties__channels__Keyframe_ContractDataHandle_t * tp_client__contract__properties__channels__Keyframe_ContractDataHandle__new (
    tp_client__contract__ContractDataHandle_t * value,
    double time);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_ContractDataHandle_ptr {

    tp_client__contract__properties__channels__Keyframe_ContractDataHandle_t * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_ContractDataHandle_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_ContractDataHandle_ptr_t tp_client__contract__properties__channels__Channel_ContractDataHandle__keyframes_mut (
    tp_client__contract__properties__channels__Channel_ContractDataHandle_t * chan);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_ContractDataHandle_const_ptr {

    tp_client__contract__properties__channels__Keyframe_ContractDataHandle_t const * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_ContractDataHandle_const_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_ContractDataHandle_const_ptr_t tp_client__contract__properties__channels__Channel_ContractDataHandle__keyframes (
    tp_client__contract__properties__channels__Channel_ContractDataHandle_t const * chan);

void tp_client__contract__properties__channels__Channel_ContractDataHandle__drop (
    tp_client__contract__properties__channels__Channel_ContractDataHandle_t * c);

tp_client__contract__properties__channels__Channel_ContractDataHandle_t * tp_client__contract__properties__channels__Channel_ContractDataHandle__new (
    Vec_tp_client__contract__properties__channels__Keyframe_ContractDataHandle_t v);

void tp_client__contract__properties__states__StateId_I16__drop (
    tp_client__contract__properties__states__StateId_I16_t * id);

tp_client__contract__ContractDataHandle_t * tp_client__contract__properties__states__StateId_I16__contract (
    tp_client__contract__properties__states__StateId_I16_t const * id);

typedef struct tp_client__contract__properties__channels__ChannelId_U64 tp_client__contract__properties__channels__ChannelId_U64_t;

typedef struct tp_client__contract__properties__channels__ChannelHandle_U64 tp_client__contract__properties__channels__ChannelHandle_U64_t;

tp_client__contract__properties__channels__ChannelHandle_U64_t * tp_client__baseline__Baseline__bind_channel_U64 (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelId_U64_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

typedef struct tp_client__contract__properties__states__StateHandle_U64 tp_client__contract__properties__states__StateHandle_U64_t;

tp_client__contract__properties__states__StateHandle_U64_t * tp_client__baseline__Baseline__bind_state_U64 (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateId_U64_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

tp_client__contract__properties__channels__Channel_U64_t * tp_client__baseline__Baseline__channel_mut_U64 (
    Baseline_t * b,
    tp_client__contract__properties__channels__ChannelHandle_U64_t const * chan);

tp_client__contract__properties__channels__Channel_U64_t const * tp_client__baseline__Baseline__channel_U64 (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelHandle_U64_t const * chan);

typedef struct tp_client__contract__properties__states__State_U64 tp_client__contract__properties__states__State_U64_t;

tp_client__contract__properties__states__State_U64_t * tp_client__baseline__Baseline__state_mut_U64 (
    Baseline_t * b,
    tp_client__contract__properties__states__StateHandle_U64_t const * state);

tp_client__contract__properties__states__State_U64_t const * tp_client__baseline__Baseline__state_U64 (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateHandle_U64_t const * state);

typedef struct tp_client__contract__properties__channels__Channel_I32 tp_client__contract__properties__channels__Channel_I32_t;

typedef struct tp_client__contract__properties__channels__Keyframe_I32 tp_client__contract__properties__channels__Keyframe_I32_t;

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_I32_ptr {

    tp_client__contract__properties__channels__Keyframe_I32_t * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_I32_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_I32_ptr_t tp_client__contract__properties__channels__Channel_I32__keyframes_mut (
    tp_client__contract__properties__channels__Channel_I32_t * chan);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_I32_const_ptr {

    tp_client__contract__properties__channels__Keyframe_I32_t const * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_I32_const_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_I32_const_ptr_t tp_client__contract__properties__channels__Channel_I32__keyframes (
    tp_client__contract__properties__channels__Channel_I32_t const * chan);

void tp_client__contract__properties__channels__Channel_I32__drop (
    tp_client__contract__properties__channels__Channel_I32_t * c);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_I32 {

    tp_client__contract__properties__channels__Keyframe_I32_t * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_I32_t;

tp_client__contract__properties__channels__Channel_I32_t * tp_client__contract__properties__channels__Channel_I32__new (
    Vec_tp_client__contract__properties__channels__Keyframe_I32_t v);

void tp_client__contract__properties__states__StateId_U32__drop (
    tp_client__contract__properties__states__StateId_U32_t * id);

tp_client__contract__ContractDataHandle_t * tp_client__contract__properties__states__StateId_U32__contract (
    tp_client__contract__properties__states__StateId_U32_t const * id);

void tp_client__contract__properties__states__State_ObjectHandle__value_set (
    tp_client__contract__properties__states__State_ObjectHandle_t * state,
    tp_client__object__ObjectHandle_t * new_value);

tp_client__object__ObjectHandle_t const * tp_client__contract__properties__states__State_ObjectHandle__value (
    tp_client__contract__properties__states__State_ObjectHandle_t const * state);

void tp_client__contract__properties__states__State_ObjectHandle__drop (
    tp_client__contract__properties__states__State_ObjectHandle_t * s);

tp_client__contract__properties__states__State_ObjectHandle_t * tp_client__contract__properties__states__State_ObjectHandle__new (
    tp_client__object__ObjectHandle_t * value);

typedef struct tp_client__contract__properties__states__State_I64 tp_client__contract__properties__states__State_I64_t;

void tp_client__contract__properties__states__State_I64__value_set (
    tp_client__contract__properties__states__State_I64_t * state,
    int64_t * new_value);

int64_t const * tp_client__contract__properties__states__State_I64__value (
    tp_client__contract__properties__states__State_I64_t const * state);

void tp_client__contract__properties__states__State_I64__drop (
    tp_client__contract__properties__states__State_I64_t * s);

tp_client__contract__properties__states__State_I64_t * tp_client__contract__properties__states__State_I64__new (
    int64_t * value);

tp_client__contract__ContractDataHandle_t * ChannelId_F32__contract (
    tp_client__contract__properties__channels__ChannelId_F32_t const * id);

typedef struct tp_client__contract__properties__channels__ChannelId_Bool tp_client__contract__properties__channels__ChannelId_Bool_t;

tp_client__contract__ContractDataHandle_t * ChannelId_Bool__contract (
    tp_client__contract__properties__channels__ChannelId_Bool_t const * id);

typedef struct tp_client__contract__properties__channels__Keyframe_I64 tp_client__contract__properties__channels__Keyframe_I64_t;

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_I64 {

    tp_client__contract__properties__channels__Keyframe_I64_t * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_I64_t;

void tp_client__contract__properties__channels__RVec_KeyframeI64__push (
    Vec_tp_client__contract__properties__channels__Keyframe_I64_t * vec,
    tp_client__contract__properties__channels__Keyframe_I64_t * item);

Vec_tp_client__contract__properties__channels__Keyframe_I64_t tp_client__contract__properties__channels__RVec_KeyframeI64__new (void);

void tp_client__contract__properties__channels__RVec_KeyframeI64__drop (
    Vec_tp_client__contract__properties__channels__Keyframe_I64_t vec);

tp_client__contract__properties__channels__Keyframe_I64_t const * tp_client__contract__properties__channels__RVec_KeyframeI64__get (
    Vec_tp_client__contract__properties__channels__Keyframe_I64_t const * vec,
    size_t idx);

void tp_client__contract__properties__channels__RVec_KeyframeI64__set (
    Vec_tp_client__contract__properties__channels__Keyframe_I64_t * vec,
    size_t idx,
    tp_client__contract__properties__channels__Keyframe_I64_t * value);

double tp_client__contract__properties__channels__Keyframe_I64__time (
    tp_client__contract__properties__channels__Keyframe_I64_t const * kf);

int64_t const * tp_client__contract__properties__channels__Keyframe_I64__value (
    tp_client__contract__properties__channels__Keyframe_I64_t const * kf);

void tp_client__contract__properties__channels__Keyframe_I64__drop (
    tp_client__contract__properties__channels__Keyframe_I64_t * kf);

tp_client__contract__properties__channels__Keyframe_I64_t * tp_client__contract__properties__channels__Keyframe_I64__new (
    int64_t * value,
    double time);

void tp_client__contract__properties__states__StateHandle_F32__drop (
    tp_client__contract__properties__states__StateHandle_F32_t * h);

typedef struct tp_client__contract__properties__states__StateHandle_I32 tp_client__contract__properties__states__StateHandle_I32_t;

void tp_client__contract__properties__states__StateHandle_I32__drop (
    tp_client__contract__properties__states__StateHandle_I32_t * h);

typedef struct tp_client__contract__properties__states__State_I32 tp_client__contract__properties__states__State_I32_t;

void tp_client__contract__properties__states__State_I32__value_set (
    tp_client__contract__properties__states__State_I32_t * state,
    int32_t * new_value);

int32_t const * tp_client__contract__properties__states__State_I32__value (
    tp_client__contract__properties__states__State_I32_t const * state);

void tp_client__contract__properties__states__State_I32__drop (
    tp_client__contract__properties__states__State_I32_t * s);

tp_client__contract__properties__states__State_I32_t * tp_client__contract__properties__states__State_I32__new (
    int32_t * value);

typedef struct tp_client__contract__properties__states__StateId_F64 tp_client__contract__properties__states__StateId_F64_t;

void tp_client__contract__properties__states__StateId_F64__drop (
    tp_client__contract__properties__states__StateId_F64_t * id);

tp_client__contract__ContractDataHandle_t * tp_client__contract__properties__states__StateId_F64__contract (
    tp_client__contract__properties__states__StateId_F64_t const * id);

typedef struct tp_client__contract__ContractId tp_client__contract__ContractId_t;

typedef struct tp_client__contract__ContractId_Version {

    uint16_t major;

    uint16_t minor;

    uint16_t patch;

} tp_client__contract__ContractId_Version_t;

tp_client__contract__ContractId_Version_t tp_client__contract__ContractId__version (
    tp_client__contract__ContractId_t const * cid);

/** \brief
 *  `&'lt [T]` but with a guaranteed `#[repr(C)]` layout.
 * 
 *  # C layout (for some given type T)
 * 
 *  ```c
 *  typedef struct {
 *      // Cannot be NULL
 *      T * ptr;
 *      size_t len;
 *  } slice_T;
 *  ```
 * 
 *  # Nullable pointer?
 * 
 *  If you want to support the above typedef, but where the `ptr` field is
 *  allowed to be `NULL` (with the contents of `len` then being undefined)
 *  use the `Option< slice_ptr<_> >` type.
 */
typedef struct slice_ref_uint8 {

    uint8_t const * ptr;

    size_t len;

} slice_ref_uint8_t;

slice_ref_uint8_t tp_client__contract__ContractId__name (
    tp_client__contract__ContractId_t const * cid);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__object__ObjectHandle {

    tp_client__object__ObjectHandle_t * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__object__ObjectHandle_t;

Vec_tp_client__object__ObjectHandle_t tp_client__contract__ContractData__objects (
    tp_client__contract__ContractData_t const * cd);

tp_client__contract__ContractId_t const * tp_client__contract__ContractData__id (
    tp_client__contract__ContractData_t const * cd);

void tp_client__contract__properties__states__State_U16__value_set (
    tp_client__contract__properties__states__State_U16_t * state,
    uint16_t * new_value);

uint16_t const * tp_client__contract__properties__states__State_U16__value (
    tp_client__contract__properties__states__State_U16_t const * state);

void tp_client__contract__properties__states__State_U16__drop (
    tp_client__contract__properties__states__State_U16_t * s);

tp_client__contract__properties__states__State_U16_t * tp_client__contract__properties__states__State_U16__new (
    uint16_t * value);

typedef struct tp_client__contract__properties__states__StateHandle_F64 tp_client__contract__properties__states__StateHandle_F64_t;

void tp_client__contract__properties__states__StateHandle_F64__drop (
    tp_client__contract__properties__states__StateHandle_F64_t * h);

void tp_client__contract__properties__states__StateHandle_U16__drop (
    tp_client__contract__properties__states__StateHandle_U16_t * h);

typedef struct tp_client__contract__properties__channels__ChannelHandle_I16 tp_client__contract__properties__channels__ChannelHandle_I16_t;

tp_client__contract__properties__channels__ChannelHandle_I16_t * tp_client__baseline__Baseline__bind_channel_I16 (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelId_I16_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

tp_client__contract__properties__states__StateHandle_I16_t * tp_client__baseline__Baseline__bind_state_I16 (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateId_I16_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

tp_client__contract__properties__channels__Channel_I16_t * tp_client__baseline__Baseline__channel_mut_I16 (
    Baseline_t * b,
    tp_client__contract__properties__channels__ChannelHandle_I16_t const * chan);

tp_client__contract__properties__channels__Channel_I16_t const * tp_client__baseline__Baseline__channel_I16 (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelHandle_I16_t const * chan);

typedef struct tp_client__contract__properties__states__State_I16 tp_client__contract__properties__states__State_I16_t;

tp_client__contract__properties__states__State_I16_t * tp_client__baseline__Baseline__state_mut_I16 (
    Baseline_t * b,
    tp_client__contract__properties__states__StateHandle_I16_t const * state);

tp_client__contract__properties__states__State_I16_t const * tp_client__baseline__Baseline__state_I16 (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateHandle_I16_t const * state);

typedef struct tp_client__contract__properties__channels__Channel_I64 tp_client__contract__properties__channels__Channel_I64_t;

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_I64_ptr {

    tp_client__contract__properties__channels__Keyframe_I64_t * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_I64_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_I64_ptr_t tp_client__contract__properties__channels__Channel_I64__keyframes_mut (
    tp_client__contract__properties__channels__Channel_I64_t * chan);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_I64_const_ptr {

    tp_client__contract__properties__channels__Keyframe_I64_t const * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_I64_const_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_I64_const_ptr_t tp_client__contract__properties__channels__Channel_I64__keyframes (
    tp_client__contract__properties__channels__Channel_I64_t const * chan);

void tp_client__contract__properties__channels__Channel_I64__drop (
    tp_client__contract__properties__channels__Channel_I64_t * c);

tp_client__contract__properties__channels__Channel_I64_t * tp_client__contract__properties__channels__Channel_I64__new (
    Vec_tp_client__contract__properties__channels__Keyframe_I64_t v);

typedef struct tp_client__contract__properties__channels__ChannelHandle_Bool tp_client__contract__properties__channels__ChannelHandle_Bool_t;

tp_client__contract__properties__channels__ChannelHandle_Bool_t * tp_client__baseline__Baseline__bind_channel_Bool (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelId_Bool_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

typedef struct tp_client__contract__properties__states__StateId_Bool tp_client__contract__properties__states__StateId_Bool_t;

tp_client__contract__properties__states__StateHandle_Bool_t * tp_client__baseline__Baseline__bind_state_Bool (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateId_Bool_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

typedef struct tp_client__contract__properties__channels__Channel_Bool tp_client__contract__properties__channels__Channel_Bool_t;

tp_client__contract__properties__channels__Channel_Bool_t * tp_client__baseline__Baseline__channel_mut_Bool (
    Baseline_t * b,
    tp_client__contract__properties__channels__ChannelHandle_Bool_t const * chan);

tp_client__contract__properties__channels__Channel_Bool_t const * tp_client__baseline__Baseline__channel_Bool (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelHandle_Bool_t const * chan);

typedef struct tp_client__contract__properties__states__State_Bool tp_client__contract__properties__states__State_Bool_t;

tp_client__contract__properties__states__State_Bool_t * tp_client__baseline__Baseline__state_mut_Bool (
    Baseline_t * b,
    tp_client__contract__properties__states__StateHandle_Bool_t const * state);

tp_client__contract__properties__states__State_Bool_t const * tp_client__baseline__Baseline__state_Bool (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateHandle_Bool_t const * state);

typedef struct tp_client__contract__properties__channels__ChannelHandle_F64 tp_client__contract__properties__channels__ChannelHandle_F64_t;

tp_client__contract__properties__channels__ChannelHandle_F64_t * tp_client__baseline__Baseline__bind_channel_F64 (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelId_F64_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

tp_client__contract__properties__states__StateHandle_F64_t * tp_client__baseline__Baseline__bind_state_F64 (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateId_F64_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

typedef struct tp_client__contract__properties__channels__Channel_F64 tp_client__contract__properties__channels__Channel_F64_t;

tp_client__contract__properties__channels__Channel_F64_t * tp_client__baseline__Baseline__channel_mut_F64 (
    Baseline_t * b,
    tp_client__contract__properties__channels__ChannelHandle_F64_t const * chan);

tp_client__contract__properties__channels__Channel_F64_t const * tp_client__baseline__Baseline__channel_F64 (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelHandle_F64_t const * chan);

tp_client__contract__properties__states__State_F64_t * tp_client__baseline__Baseline__state_mut_F64 (
    Baseline_t * b,
    tp_client__contract__properties__states__StateHandle_F64_t const * state);

tp_client__contract__properties__states__State_F64_t const * tp_client__baseline__Baseline__state_F64 (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateHandle_F64_t const * state);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_U32_ptr {

    tp_client__contract__properties__channels__Keyframe_U32_t * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_U32_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_U32_ptr_t tp_client__contract__properties__channels__Channel_U32__keyframes_mut (
    tp_client__contract__properties__channels__Channel_U32_t * chan);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_U32_const_ptr {

    tp_client__contract__properties__channels__Keyframe_U32_t const * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_U32_const_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_U32_const_ptr_t tp_client__contract__properties__channels__Channel_U32__keyframes (
    tp_client__contract__properties__channels__Channel_U32_t const * chan);

void tp_client__contract__properties__channels__Channel_U32__drop (
    tp_client__contract__properties__channels__Channel_U32_t * c);

tp_client__contract__properties__channels__Channel_U32_t * tp_client__contract__properties__channels__Channel_U32__new (
    Vec_tp_client__contract__properties__channels__Keyframe_U32_t v);

void tp_client__contract__properties__channels__RVec_KeyframeI32__push (
    Vec_tp_client__contract__properties__channels__Keyframe_I32_t * vec,
    tp_client__contract__properties__channels__Keyframe_I32_t * item);

Vec_tp_client__contract__properties__channels__Keyframe_I32_t tp_client__contract__properties__channels__RVec_KeyframeI32__new (void);

void tp_client__contract__properties__channels__RVec_KeyframeI32__drop (
    Vec_tp_client__contract__properties__channels__Keyframe_I32_t vec);

tp_client__contract__properties__channels__Keyframe_I32_t const * tp_client__contract__properties__channels__RVec_KeyframeI32__get (
    Vec_tp_client__contract__properties__channels__Keyframe_I32_t const * vec,
    size_t idx);

void tp_client__contract__properties__channels__RVec_KeyframeI32__set (
    Vec_tp_client__contract__properties__channels__Keyframe_I32_t * vec,
    size_t idx,
    tp_client__contract__properties__channels__Keyframe_I32_t * value);

double tp_client__contract__properties__channels__Keyframe_I32__time (
    tp_client__contract__properties__channels__Keyframe_I32_t const * kf);

int32_t const * tp_client__contract__properties__channels__Keyframe_I32__value (
    tp_client__contract__properties__channels__Keyframe_I32_t const * kf);

void tp_client__contract__properties__channels__Keyframe_I32__drop (
    tp_client__contract__properties__channels__Keyframe_I32_t * kf);

tp_client__contract__properties__channels__Keyframe_I32_t * tp_client__contract__properties__channels__Keyframe_I32__new (
    int32_t * value,
    double time);

typedef struct tp_client__contract__properties__channels__ChannelId_I64 tp_client__contract__properties__channels__ChannelId_I64_t;

typedef struct tp_client__contract__properties__channels__ChannelHandle_I64 tp_client__contract__properties__channels__ChannelHandle_I64_t;

tp_client__contract__properties__channels__ChannelHandle_I64_t * tp_client__baseline__Baseline__bind_channel_I64 (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelId_I64_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

tp_client__contract__properties__states__StateHandle_I64_t * tp_client__baseline__Baseline__bind_state_I64 (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateId_I64_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

tp_client__contract__properties__channels__Channel_I64_t * tp_client__baseline__Baseline__channel_mut_I64 (
    Baseline_t * b,
    tp_client__contract__properties__channels__ChannelHandle_I64_t const * chan);

tp_client__contract__properties__channels__Channel_I64_t const * tp_client__baseline__Baseline__channel_I64 (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelHandle_I64_t const * chan);

tp_client__contract__properties__states__State_I64_t * tp_client__baseline__Baseline__state_mut_I64 (
    Baseline_t * b,
    tp_client__contract__properties__states__StateHandle_I64_t const * state);

tp_client__contract__properties__states__State_I64_t const * tp_client__baseline__Baseline__state_I64 (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateHandle_I64_t const * state);

void tp_client__contract__properties__states__StateId_U16__drop (
    tp_client__contract__properties__states__StateId_U16_t * id);

tp_client__contract__ContractDataHandle_t * tp_client__contract__properties__states__StateId_U16__contract (
    tp_client__contract__properties__states__StateId_U16_t const * id);

void tp_client__contract__properties__states__StateId_ObjectHandle__drop (
    tp_client__contract__properties__states__StateId_ObjectHandle_t * id);

tp_client__contract__ContractDataHandle_t * tp_client__contract__properties__states__StateId_ObjectHandle__contract (
    tp_client__contract__properties__states__StateId_ObjectHandle_t const * id);

void tp_client__contract__properties__states__StateId_F32__drop (
    tp_client__contract__properties__states__StateId_F32_t * id);

tp_client__contract__ContractDataHandle_t * tp_client__contract__properties__states__StateId_F32__contract (
    tp_client__contract__properties__states__StateId_F32_t const * id);

void tp_client__contract__properties__channels__RVec_KeyframeU64__push (
    Vec_tp_client__contract__properties__channels__Keyframe_U64_t * vec,
    tp_client__contract__properties__channels__Keyframe_U64_t * item);

Vec_tp_client__contract__properties__channels__Keyframe_U64_t tp_client__contract__properties__channels__RVec_KeyframeU64__new (void);

void tp_client__contract__properties__channels__RVec_KeyframeU64__drop (
    Vec_tp_client__contract__properties__channels__Keyframe_U64_t vec);

tp_client__contract__properties__channels__Keyframe_U64_t const * tp_client__contract__properties__channels__RVec_KeyframeU64__get (
    Vec_tp_client__contract__properties__channels__Keyframe_U64_t const * vec,
    size_t idx);

void tp_client__contract__properties__channels__RVec_KeyframeU64__set (
    Vec_tp_client__contract__properties__channels__Keyframe_U64_t * vec,
    size_t idx,
    tp_client__contract__properties__channels__Keyframe_U64_t * value);

double tp_client__contract__properties__channels__Keyframe_U64__time (
    tp_client__contract__properties__channels__Keyframe_U64_t const * kf);

uint64_t const * tp_client__contract__properties__channels__Keyframe_U64__value (
    tp_client__contract__properties__channels__Keyframe_U64_t const * kf);

void tp_client__contract__properties__channels__Keyframe_U64__drop (
    tp_client__contract__properties__channels__Keyframe_U64_t * kf);

tp_client__contract__properties__channels__Keyframe_U64_t * tp_client__contract__properties__channels__Keyframe_U64__new (
    uint64_t * value,
    double time);

typedef struct tp_client__contract__properties__channels__ChannelId_I32 tp_client__contract__properties__channels__ChannelId_I32_t;

typedef struct tp_client__contract__properties__channels__ChannelHandle_I32 tp_client__contract__properties__channels__ChannelHandle_I32_t;

tp_client__contract__properties__channels__ChannelHandle_I32_t * tp_client__baseline__Baseline__bind_channel_I32 (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelId_I32_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

tp_client__contract__properties__states__StateHandle_I32_t * tp_client__baseline__Baseline__bind_state_I32 (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateId_I32_t const * id,
    tp_client__object__ObjectHandle_t const * obj);

tp_client__contract__properties__channels__Channel_I32_t * tp_client__baseline__Baseline__channel_mut_I32 (
    Baseline_t * b,
    tp_client__contract__properties__channels__ChannelHandle_I32_t const * chan);

tp_client__contract__properties__channels__Channel_I32_t const * tp_client__baseline__Baseline__channel_I32 (
    Baseline_t const * b,
    tp_client__contract__properties__channels__ChannelHandle_I32_t const * chan);

tp_client__contract__properties__states__State_I32_t * tp_client__baseline__Baseline__state_mut_I32 (
    Baseline_t * b,
    tp_client__contract__properties__states__StateHandle_I32_t const * state);

tp_client__contract__properties__states__State_I32_t const * tp_client__baseline__Baseline__state_I32 (
    Baseline_t const * b,
    tp_client__contract__properties__states__StateHandle_I32_t const * state);

tp_client__contract__ContractDataHandle_t * ChannelId_I64__contract (
    tp_client__contract__properties__channels__ChannelId_I64_t const * id);

tp_client__contract__ContractDataHandle_t * ChannelId_U64__contract (
    tp_client__contract__properties__channels__ChannelId_U64_t const * id);

void tp_client__contract__properties__states__State_ContractDataHandle__value_set (
    tp_client__contract__properties__states__State_ContractDataHandle_t * state,
    tp_client__contract__ContractDataHandle_t * new_value);

tp_client__contract__ContractDataHandle_t const * tp_client__contract__properties__states__State_ContractDataHandle__value (
    tp_client__contract__properties__states__State_ContractDataHandle_t const * state);

void tp_client__contract__properties__states__State_ContractDataHandle__drop (
    tp_client__contract__properties__states__State_ContractDataHandle_t * s);

tp_client__contract__properties__states__State_ContractDataHandle_t * tp_client__contract__properties__states__State_ContractDataHandle__new (
    tp_client__contract__ContractDataHandle_t * value);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_Bool_ptr {

    tp_client__contract__properties__channels__Keyframe_Bool_t * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_Bool_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_Bool_ptr_t tp_client__contract__properties__channels__Channel_Bool__keyframes_mut (
    tp_client__contract__properties__channels__Channel_Bool_t * chan);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_Bool_const_ptr {

    tp_client__contract__properties__channels__Keyframe_Bool_t const * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_Bool_const_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_Bool_const_ptr_t tp_client__contract__properties__channels__Channel_Bool__keyframes (
    tp_client__contract__properties__channels__Channel_Bool_t const * chan);

void tp_client__contract__properties__channels__Channel_Bool__drop (
    tp_client__contract__properties__channels__Channel_Bool_t * c);

tp_client__contract__properties__channels__Channel_Bool_t * tp_client__contract__properties__channels__Channel_Bool__new (
    Vec_tp_client__contract__properties__channels__Keyframe_Bool_t v);

void tp_client__contract__properties__states__StateId_U8__drop (
    tp_client__contract__properties__states__StateId_U8_t * id);

tp_client__contract__ContractDataHandle_t * tp_client__contract__properties__states__StateId_U8__contract (
    tp_client__contract__properties__states__StateId_U8_t const * id);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_F32_ptr {

    tp_client__contract__properties__channels__Keyframe_F32_t * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_F32_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_F32_ptr_t tp_client__contract__properties__channels__Channel_F32__keyframes_mut (
    tp_client__contract__properties__channels__Channel_F32_t * chan);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_F32_const_ptr {

    tp_client__contract__properties__channels__Keyframe_F32_t const * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_F32_const_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_F32_const_ptr_t tp_client__contract__properties__channels__Channel_F32__keyframes (
    tp_client__contract__properties__channels__Channel_F32_t const * chan);

void tp_client__contract__properties__channels__Channel_F32__drop (
    tp_client__contract__properties__channels__Channel_F32_t * c);

tp_client__contract__properties__channels__Channel_F32_t * tp_client__contract__properties__channels__Channel_F32__new (
    Vec_tp_client__contract__properties__channels__Keyframe_F32_t v);

void tp_client__contract__properties__states__State_U64__value_set (
    tp_client__contract__properties__states__State_U64_t * state,
    uint64_t * new_value);

uint64_t const * tp_client__contract__properties__states__State_U64__value (
    tp_client__contract__properties__states__State_U64_t const * state);

void tp_client__contract__properties__states__State_U64__drop (
    tp_client__contract__properties__states__State_U64_t * s);

tp_client__contract__properties__states__State_U64_t * tp_client__contract__properties__states__State_U64__new (
    uint64_t * value);

tp_client__contract__ContractDataHandle_t * ChannelId_I32__contract (
    tp_client__contract__properties__channels__ChannelId_I32_t const * id);

tp_client__contract__ContractDataHandle_t * ChannelId_U16__contract (
    tp_client__contract__properties__channels__ChannelId_U16_t const * id);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_F64_ptr {

    tp_client__contract__properties__channels__Keyframe_F64_t * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_F64_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_F64_ptr_t tp_client__contract__properties__channels__Channel_F64__keyframes_mut (
    tp_client__contract__properties__channels__Channel_F64_t * chan);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_F64_const_ptr {

    tp_client__contract__properties__channels__Keyframe_F64_t const * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_F64_const_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_F64_const_ptr_t tp_client__contract__properties__channels__Channel_F64__keyframes (
    tp_client__contract__properties__channels__Channel_F64_t const * chan);

void tp_client__contract__properties__channels__Channel_F64__drop (
    tp_client__contract__properties__channels__Channel_F64_t * c);

tp_client__contract__properties__channels__Channel_F64_t * tp_client__contract__properties__channels__Channel_F64__new (
    Vec_tp_client__contract__properties__channels__Keyframe_F64_t v);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_ObjectHandle_ptr {

    tp_client__contract__properties__channels__Keyframe_ObjectHandle_t * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_ObjectHandle_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_ObjectHandle_ptr_t tp_client__contract__properties__channels__Channel_ObjectHandle__keyframes_mut (
    tp_client__contract__properties__channels__Channel_ObjectHandle_t * chan);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_ObjectHandle_const_ptr {

    tp_client__contract__properties__channels__Keyframe_ObjectHandle_t const * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_ObjectHandle_const_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_ObjectHandle_const_ptr_t tp_client__contract__properties__channels__Channel_ObjectHandle__keyframes (
    tp_client__contract__properties__channels__Channel_ObjectHandle_t const * chan);

void tp_client__contract__properties__channels__Channel_ObjectHandle__drop (
    tp_client__contract__properties__channels__Channel_ObjectHandle_t * c);

tp_client__contract__properties__channels__Channel_ObjectHandle_t * tp_client__contract__properties__channels__Channel_ObjectHandle__new (
    Vec_tp_client__contract__properties__channels__Keyframe_ObjectHandle_t v);

void tp_client__contract__properties__states__State_I16__value_set (
    tp_client__contract__properties__states__State_I16_t * state,
    int16_t * new_value);

int16_t const * tp_client__contract__properties__states__State_I16__value (
    tp_client__contract__properties__states__State_I16_t const * state);

void tp_client__contract__properties__states__State_I16__drop (
    tp_client__contract__properties__states__State_I16_t * s);

tp_client__contract__properties__states__State_I16_t * tp_client__contract__properties__states__State_I16__new (
    int16_t * value);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_U16_ptr {

    tp_client__contract__properties__channels__Keyframe_U16_t * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_U16_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_U16_ptr_t tp_client__contract__properties__channels__Channel_U16__keyframes_mut (
    tp_client__contract__properties__channels__Channel_U16_t * chan);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_U16_const_ptr {

    tp_client__contract__properties__channels__Keyframe_U16_t const * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_U16_const_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_U16_const_ptr_t tp_client__contract__properties__channels__Channel_U16__keyframes (
    tp_client__contract__properties__channels__Channel_U16_t const * chan);

void tp_client__contract__properties__channels__Channel_U16__drop (
    tp_client__contract__properties__channels__Channel_U16_t * c);

tp_client__contract__properties__channels__Channel_U16_t * tp_client__contract__properties__channels__Channel_U16__new (
    Vec_tp_client__contract__properties__channels__Keyframe_U16_t v);

tp_client__contract__ContractDataHandle_t * ChannelId_ObjectHandle__contract (
    tp_client__contract__properties__channels__ChannelId_ObjectHandle_t const * id);

tp_client__contract__ContractDataHandle_t * ChannelId_U8__contract (
    tp_client__contract__properties__channels__ChannelId_U8_t const * id);

void tp_client__contract__properties__states__State_U32__value_set (
    tp_client__contract__properties__states__State_U32_t * state,
    uint32_t * new_value);

uint32_t const * tp_client__contract__properties__states__State_U32__value (
    tp_client__contract__properties__states__State_U32_t const * state);

void tp_client__contract__properties__states__State_U32__drop (
    tp_client__contract__properties__states__State_U32_t * s);

tp_client__contract__properties__states__State_U32_t * tp_client__contract__properties__states__State_U32__new (
    uint32_t * value);

void tp_client__contract__properties__states__StateHandle_ObjectHandle__drop (
    tp_client__contract__properties__states__StateHandle_ObjectHandle_t * h);

void tp_client__contract__properties__states__StateHandle_U64__drop (
    tp_client__contract__properties__states__StateHandle_U64_t * h);

void tp_client__contract__ContractDataHandle__drop (
    tp_client__contract__ContractDataHandle_t * c);

void tp_client__contract__properties__states__StateId_Bool__drop (
    tp_client__contract__properties__states__StateId_Bool_t * id);

tp_client__contract__ContractDataHandle_t * tp_client__contract__properties__states__StateId_Bool__contract (
    tp_client__contract__properties__states__StateId_Bool_t const * id);

void tp_client__contract__properties__states__State_Bool__value_set (
    tp_client__contract__properties__states__State_Bool_t * state,
    bool * new_value);

bool const * tp_client__contract__properties__states__State_Bool__value (
    tp_client__contract__properties__states__State_Bool_t const * state);

void tp_client__contract__properties__states__State_Bool__drop (
    tp_client__contract__properties__states__State_Bool_t * s);

tp_client__contract__properties__states__State_Bool_t * tp_client__contract__properties__states__State_Bool__new (
    bool * value);

typedef struct tp_client__contract__properties__channels__Keyframe_U8 tp_client__contract__properties__channels__Keyframe_U8_t;

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_U8_ptr {

    tp_client__contract__properties__channels__Keyframe_U8_t * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_U8_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_U8_ptr_t tp_client__contract__properties__channels__Channel_U8__keyframes_mut (
    tp_client__contract__properties__channels__Channel_U8_t * chan);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_U8_const_ptr {

    tp_client__contract__properties__channels__Keyframe_U8_t const * * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_U8_const_ptr_t;

Vec_tp_client__contract__properties__channels__Keyframe_U8_const_ptr_t tp_client__contract__properties__channels__Channel_U8__keyframes (
    tp_client__contract__properties__channels__Channel_U8_t const * chan);

void tp_client__contract__properties__channels__Channel_U8__drop (
    tp_client__contract__properties__channels__Channel_U8_t * c);

/** \brief
 *  Same as [`Vec<T>`][`rust::Vec`], but with guaranteed `#[repr(C)]` layout
 */
typedef struct Vec_tp_client__contract__properties__channels__Keyframe_U8 {

    tp_client__contract__properties__channels__Keyframe_U8_t * ptr;

    size_t len;

    size_t cap;

} Vec_tp_client__contract__properties__channels__Keyframe_U8_t;

tp_client__contract__properties__channels__Channel_U8_t * tp_client__contract__properties__channels__Channel_U8__new (
    Vec_tp_client__contract__properties__channels__Keyframe_U8_t v);

void tp_client__contract__properties__states__StateId_I8__drop (
    tp_client__contract__properties__states__StateId_I8_t * id);

tp_client__contract__ContractDataHandle_t * tp_client__contract__properties__states__StateId_I8__contract (
    tp_client__contract__properties__states__StateId_I8_t const * id);

void tp_client__contract__properties__channels__RVec_KeyframeU8__push (
    Vec_tp_client__contract__properties__channels__Keyframe_U8_t * vec,
    tp_client__contract__properties__channels__Keyframe_U8_t * item);

Vec_tp_client__contract__properties__channels__Keyframe_U8_t tp_client__contract__properties__channels__RVec_KeyframeU8__new (void);

void tp_client__contract__properties__channels__RVec_KeyframeU8__drop (
    Vec_tp_client__contract__properties__channels__Keyframe_U8_t vec);

tp_client__contract__properties__channels__Keyframe_U8_t const * tp_client__contract__properties__channels__RVec_KeyframeU8__get (
    Vec_tp_client__contract__properties__channels__Keyframe_U8_t const * vec,
    size_t idx);

void tp_client__contract__properties__channels__RVec_KeyframeU8__set (
    Vec_tp_client__contract__properties__channels__Keyframe_U8_t * vec,
    size_t idx,
    tp_client__contract__properties__channels__Keyframe_U8_t * value);

double tp_client__contract__properties__channels__Keyframe_U8__time (
    tp_client__contract__properties__channels__Keyframe_U8_t const * kf);

uint8_t const * tp_client__contract__properties__channels__Keyframe_U8__value (
    tp_client__contract__properties__channels__Keyframe_U8_t const * kf);

void tp_client__contract__properties__channels__Keyframe_U8__drop (
    tp_client__contract__properties__channels__Keyframe_U8_t * kf);

tp_client__contract__properties__channels__Keyframe_U8_t * tp_client__contract__properties__channels__Keyframe_U8__new (
    uint8_t * value,
    double time);

void tp_client__contract__properties__channels__RVec_KeyframeI16__push (
    Vec_tp_client__contract__properties__channels__Keyframe_I16_t * vec,
    tp_client__contract__properties__channels__Keyframe_I16_t * item);

Vec_tp_client__contract__properties__channels__Keyframe_I16_t tp_client__contract__properties__channels__RVec_KeyframeI16__new (void);

void tp_client__contract__properties__channels__RVec_KeyframeI16__drop (
    Vec_tp_client__contract__properties__channels__Keyframe_I16_t vec);

tp_client__contract__properties__channels__Keyframe_I16_t const * tp_client__contract__properties__channels__RVec_KeyframeI16__get (
    Vec_tp_client__contract__properties__channels__Keyframe_I16_t const * vec,
    size_t idx);

void tp_client__contract__properties__channels__RVec_KeyframeI16__set (
    Vec_tp_client__contract__properties__channels__Keyframe_I16_t * vec,
    size_t idx,
    tp_client__contract__properties__channels__Keyframe_I16_t * value);

double tp_client__contract__properties__channels__Keyframe_I16__time (
    tp_client__contract__properties__channels__Keyframe_I16_t const * kf);

int16_t const * tp_client__contract__properties__channels__Keyframe_I16__value (
    tp_client__contract__properties__channels__Keyframe_I16_t const * kf);

void tp_client__contract__properties__channels__Keyframe_I16__drop (
    tp_client__contract__properties__channels__Keyframe_I16_t * kf);

tp_client__contract__properties__channels__Keyframe_I16_t * tp_client__contract__properties__channels__Keyframe_I16__new (
    int16_t * value,
    double time);

/** \brief
 *  Copies `value` into a rust `Box`
 */
uint8_t * rsharp__Box_U8__new (
    uint8_t value);

void rsharp__Box_U8__drop (
    uint8_t * value);

/** \brief
 *  Copies `value` into a rust `Box`
 */
uint16_t * rsharp__Box_U16__new (
    uint16_t value);

void rsharp__Box_U16__drop (
    uint16_t * value);

/** \brief
 *  Copies `value` into a rust `Box`
 */
uint32_t * rsharp__Box_U32__new (
    uint32_t value);

void rsharp__Box_U32__drop (
    uint32_t * value);

/** \brief
 *  Copies `value` into a rust `Box`
 */
uint64_t * rsharp__Box_U64__new (
    uint64_t value);

void rsharp__Box_U64__drop (
    uint64_t * value);

/** \brief
 *  Copies `value` into a rust `Box`
 */
int8_t * rsharp__Box_I8__new (
    int8_t value);

void rsharp__Box_I8__drop (
    int8_t * value);

/** \brief
 *  Copies `value` into a rust `Box`
 */
int16_t * rsharp__Box_I16__new (
    int16_t value);

void rsharp__Box_I16__drop (
    int16_t * value);

/** \brief
 *  Copies `value` into a rust `Box`
 */
int32_t * rsharp__Box_I32__new (
    int32_t value);

void rsharp__Box_I32__drop (
    int32_t * value);

/** \brief
 *  Copies `value` into a rust `Box`
 */
int64_t * rsharp__Box_I64__new (
    int64_t value);

void rsharp__Box_I64__drop (
    int64_t * value);

/** \brief
 *  Copies `value` into a rust `Box`
 */
bool * rsharp__Box_Bool__new (
    bool value);

void rsharp__Box_Bool__drop (
    bool * value);

/** \brief
 *  Copies `value` into a rust `Box`
 */
float * rsharp__Box_F32__new (
    float value);

void rsharp__Box_F32__drop (
    float * value);

/** \brief
 *  Copies `value` into a rust `Box`
 */
double * rsharp__Box_F64__new (
    double value);

void rsharp__Box_F64__drop (
    double * value);


#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /* __RUST_UNITY_STATES__ */

@danielhenrymantilla danielhenrymantilla added the K-feature Kind: proposed new code to implement new behaviour label Jul 20, 2022
@danielhenrymantilla
Copy link
Collaborator

So, multiple function declarations of the same item may be fine, but the type definitions will indeed be problematic.

It's actually complex / difficult for safer-ffi, alone, to make that split, since it doesn't know of crate boundaries.

The way I'd do it, then, following the more "modern" approach of header generation (that of having the lib export a header-generating function, so as to then have either a unit-test or an example binary call that function):

  1. Have the first library (in your case, ::tp_client?) export a helper function for this, one taking a &mut HashSetDefiner:

    • EDIT: hmm, generate_with_definer consumes ownership of its impl Definer arg (definitely an oversight!) so this suggestion will need some fixes from my side to be usable:
    // #[cfg…] /* feel free to cfg-gate etc. */
    pub fn generate_headers_with_definer(
        definer: &mut ::safer_ffi::headers::HashSetDefiner,
    ) -> ::std::io::Result<()>
    {
        ::safer_ffi::headers::builder()
            .generate_with_definer(definer)?
    }

    The key idea is that an impl Definer, such as HashSetDefiner, has to remember the items they've already generated / emitted, precisely to avoid duplicated definitions within a header generation pass.

    So, by using this more advanced API, the resulting Definer is not lost, but left under the caller's power/reach. _Such resulting Definer thus, by definition, will prevent any definitions of these already-defined items!

    The caller will then be able to swap the out field of that definer when using it to generate a second header (that of the dependent crate (e.g., ::unity_states).

  2. In the header generation function of the dependent crate (e.g., ::unity_states):

    1. Hand-roll the HashSetDefiner's construction:

      let ref mut dummy = ::std::io::sink();
      let mut definer = HashSetDefiner {
          defines_set: <_>::default(),
          out: dummy,
      };
    2. Call into the previously defined function:

      ::tp_client::generate_headers_with_definer(&mut definer).unwrap();
    3. Tweak the resulting HashSetDefiner so that now it generates the header where you want it to:

      let ref mut real_out = ::std::fs::File::options()
          .write(true)
          .truncate(true)
          .create(true)
          .open("generated.h")?;
      definer.out = real_out;
    4. Generate your new headers:

      ::safer_ffi::headers::builder().generate_with_definer(definer)?;

This last step should have done exactly what you wanted (but for #include-ing the previous header, which for the moment you'll have to manually tweak yourself): generate a header for ::unity_states without reëmitting any of the items exported by ::tp_client.


I'll admit it's quite rough at the moment; it could be envisioned to expose a few helper macros to make this smoother:

  1. Slap a ::safer_ffi::generate_headers!(to = "filename.h"); on ::tp_client's src/lib.rs;
  2. Slap a ::safer_ffi::generate_headers!(skip = ::tp_client, import = "filename.h", to = "other_filename.h"); on ::unity_states's src/lib.rs.

@TheButlah
Copy link
Contributor Author

OK, sorry for the slow response. I ended up not doing this because it was complicated, but now that is biting me and I'm forced to deal with my past decisions XD. So I'm looking at actually doing this properly now.

It looks like I'll need to make a simple PR to have generate_with_definer consume the definer by &mut instead of ownership.

Then, for every crate that I want to create headers for, I have to provide a "generate the headers only for this crate" function, which accepts a &mut impl Definer.

To implement that function, I would then call the corresponding functions from all dependencies first using a definer with a Writer that does nothing (think /dev/null). That will collect all the types from the dependent crates. Then I put back in the actual writer and do the final write, which should contain only the current crate's types.

Whew that is a lot of stuff, but conceptually it is simple.

@TheButlah
Copy link
Contributor Author

In the time since I originally posted the question, did you get any ideas on how to solve this is in a more robust way? If we had a registry of types in the current crate somehow, this would be a non-issue I assume. Is there no way to accomplish that with rust?

Maybe we could add a unique string for the crate (either a hash or the crate name + version directly) to each type that implements ReprC? The attribute macros would read this information from CARGO_PKG_VERSION and CARGO_PKG_NAME` and that could go into the generated trait implementations.

@kriswuollett
Copy link
Contributor

kriswuollett commented Dec 3, 2023

Perhaps an approach could be like prost for protobufs where each type is associated with a package, and a graph of all the type information is known before generating multiple files at once.

But in here they could be associated with a header file that is relative to the path defined at the crate-level which can overwritten at build time if necessary. So not necessarily at the source file level like mentioned above. That way if I'm using a monorepo-like workspace, a type named like Error in my_corp_util crate could be known to be found in the my/corp/util.h file for example, while something else like LocalizedText could be found in my/corp/strings.h -- both from same crate. For example code purposes, usually each crate would provide a type specification set rather than a builder that can directly write only a single file. That gives the flexibility of generating multiple header files at once, especially if project is only producing a single static library for example.

If the type graph is also provided as the result of header generation, the end user could also make use of it for further custom code generation like making a bridging header for xcode builds.

The safer_ffi types of course would need to be in a well known, possibly configurable location, like safer_ffi/safer_ffi.h that also be added to the user's include search path. Include file path and crate name would also be very helpful with any custom naming plugins as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
K-feature Kind: proposed new code to implement new behaviour
Projects
None yet
Development

No branches or pull requests

3 participants