a collection of code snippets and examples
To build an example run
in the directory of the example. The output can be found in a subdir 'output/'
Tool to strip comment lines from c-like code
An event framework, based on libevent
Example showing how to open and mmap a file
A fast minimalistic JSON parser
Implementation of the Linux kernel (embedded, doubly-linked) list. It also uses the to_container builtin function.
Basic logging framework
Demo of working longjmp()
Signal handling example
Open a server socket and listen to it
A very simple StringBuffer showing off struct functions
showing of incremental arrays, used to store unit tests
To show working cross-compilation to ARM, install the arm cross toolchain in Ubuntu 17.04 with
sudo apt-get install gcc-arm-linux-gnueabi qemu-user
Then cross compile the examples with
c2c -b build_arm.toml
This should even work for the lua example that uses a lua library.