infix
A JIT-Powered FFI Library for C
|
Tests FFI calls with C _Complex
types.
More...
#include "common/double_tap.h"
#include "types.h"
#include <complex.h>
#include <infix/infix.h>
#include <math.h>
Macros | |
#define | DBLTAP_IMPLEMENTATION |
Typedefs | |
typedef double _Complex | complex_double_t |
Functions | |
complex_double_t | c_add (complex_double_t a, complex_double_t b) |
complex_double_t | c_mul (complex_double_t a, complex_double_t b) |
complex_double_t | callback_c_add (complex_double_t a, complex_double_t b) |
void | execute_complex_callback (complex_double_t(*func_ptr)(complex_double_t, complex_double_t), complex_double_t val_a, complex_double_t val_b, complex_double_t expected_val) |
if (!ok(status==INFIX_SUCCESS, "Successfully created infix_type for double _Complex")) | |
subtest ("Forward call with _Complex arguments and return") | |
subtest ("Reverse call (callback) with _Complex types") | |
subtest ("Round trip signature parsing") | |
infix_arena_destroy (arena) | |
Variables | |
TEST | |
infix_arena_t * | arena = infix_arena_create(4096) |
infix_type * | complex_double_type = NULL |
infix_status | status |
Tests FFI calls with C _Complex
types.
Copyright (c) 2025 Sanko Robinson
This source code is dual-licensed under the Artistic License 2.0 or the MIT License. You may choose to use this code under the terms of either license.
SPDX-License-Identifier: (Artistic-2.0 OR MIT)
The documentation blocks within this file are licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
SPDX-License-Identifier: CC-BY-4.0
#define DBLTAP_IMPLEMENTATION |
typedef double _Complex complex_double_t |
complex_double_t c_add | ( | complex_double_t | a, |
complex_double_t | b | ||
) |
complex_double_t c_mul | ( | complex_double_t | a, |
complex_double_t | b | ||
) |
complex_double_t callback_c_add | ( | complex_double_t | a, |
complex_double_t | b | ||
) |
void execute_complex_callback | ( | complex_double_t(*)(complex_double_t, complex_double_t) | func_ptr, |
complex_double_t | val_a, | ||
complex_double_t | val_b, | ||
complex_double_t | expected_val | ||
) |
if | ( | ! | okstatus==INFIX_SUCCESS, "Successfully created infix_type for double _Complex" | ) |
infix_arena_destroy | ( | arena | ) |
subtest | ( | "Forward call with _Complex arguments and return" | ) |
subtest | ( | "Reverse call (callback) with _Complex types" | ) |
subtest | ( | "Round trip signature parsing" | ) |
infix_arena_t* arena = infix_arena_create(4096) |
infix_type* complex_double_type = NULL |
infix_status status |