infix
A JIT-Powered FFI Library for C
Loading...
Searching...
No Matches
Ch02_Unions.c File Reference

Cookbook Chapter 2: Working with Unions. More...

#include <infix/infix.h>
#include <stdio.h>
Include dependency graph for Ch02_Unions.c:

Classes

union  Number
 A simple union to test aggregate classification. More...
 

Functions

static int process_number_as_int (Number n)
 
int main ()
 

Detailed Description

Cookbook Chapter 2: Working with Unions.

This example shows how to pass and return C union types. The infix signature for a union uses angle brackets <...> to list its members. The library calculates the correct size and alignment based on the largest and most-aligned member, respectively, just as a C compiler would.

Function Documentation

◆ main()

int main ( void  )

◆ process_number_as_int()

static int process_number_as_int ( Number  n)
static