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

Cookbook Chapter 2: Working with Packed Structs. More...

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

Classes

struct  Packed

Functions

static int process_packed (Packed p)
int main ()

Detailed Description

Cookbook Chapter 2: Working with Packed Structs.

This example demonstrates how to interface with C structs that have non-default alignment, typically specified with #pragma pack(1) or __attribute__((packed)). The infix signature language supports this with the !{...} syntax for 1-byte alignment, or !N:{...} for a specific N-byte alignment.

Function Documentation

◆ main()

int main ( void )

◆ process_packed()

int process_packed ( Packed p)
static