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

Cookbook Chapter 6: Reading and Writing Global Variables. More...

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

Classes

struct  Config
 

Functions

int main ()
 

Variables

const char * LIB_NAME = "./libglobals.so"
 

Detailed Description

Cookbook Chapter 6: Reading and Writing Global Variables.

This example demonstrates how to use infix_read_global and infix_write_global to interact with global variables exported from a shared library. The infix signature language is used to describe the type of the variable, ensuring that the correct number of bytes are read or written, which prevents memory corruption.

Function Documentation

◆ main()

int main ( void  )

Variable Documentation

◆ LIB_NAME

const char* LIB_NAME = "./libglobals.so"