This directory contains an example project that creates an Embedded Ch package including a header file, example program, and dynamic library. An executable program is also created that demonstrates the use of callback functions directly in C. The Ch example program executes entirely in script space, demonstrating the similarities between the C program and Ch script. The dynamic library is designed to show how to interface an agent to a CLI language such as C#.

To build the package, run the following in this directory from a Ch shell:

make create

To install the package, run the command:

make install

The C example program can be found in src/. Run it using the commands:

cd src
./cs2ch

or

cd src
./cs2ch.exe

in Windows.

After installing the package, you can run the example program as a script by switching to the package installation directory ($(CHHOME)/toolkit/embedch/package/cs2ch by default), then running:

cd demos
./cs2ch.c

The results will be the same as the C program, except for printing a different string to show the difference between the two execution environments.

As previously mentioned, the purpose of this example is to create a dynamically loaded library that can be accessed by both agents and programs written in a CLI language. Once the package is installed, please refer to the example documentation for an example program written in C# that demonstrates using the library. The library is located in the package installation directory, dl/ directory.
