inkcpp
|
C bindings for inkcpp More...
Classes | |
struct | InkListIter |
Iterater used to iterate flags of a HInkList. More... | |
struct | InkValue |
Repserentation of a ink variable. More... | |
class | HInkSnapshot |
Handler for a ink snapshot. More... | |
class | HInkChoice |
Handler for a ink choice. More... | |
class | HInkList |
Handler for a ink list. More... | |
class | HInkRunner |
A handle for an ink runner. More... | |
class | HInkGlobals |
Handle for the global variable store shared among ink runners. More... | |
class | HInkStory |
Handle for a loaded ink story. More... | |
Functions | |
void | ink_compile_json (const char *input_filename, const char *output_filename, const char **error) |
Compiles a .ink.json file to an inkCPP .bin file. | |
C bindings for inkcpp
There are two different ways to get the C bindings.
<os>-lib.zip
for a C++ and C lib combined, then use CMake for the linkadge (or do it manually)<os>-clib.zip
for a C only lib, then use CMake, or pkg-config.Please note that the included header is different between this two installation methods.
#include <ink/c/inkcpp.h>
#include <ink/inkcpp.h>
To setup an example for option 1.
and 2.
if you use cmake checkout CMAKE usage and replace target_link_libraries
with target_link_libraries(main inkcpp_c)
The story and source file can be used as noted down
For setup an example for option 2.
without cmake create a directory with the files below:
main.c
: found belowtest.ink.json
: found at test.inkAnd extract <os>-clib.zip
from the release page to /MY/INKCPP/EXAMPLE_INSTALL/PATH
.
To run the example do the following:
prefix=...
in /MY/INKCPP/EXAMPLE_INSTALL/PATH/lib/pkgconfig/inkcpp.pc
to prefix=/MY/INKCPP_EXAMPLE_INSTALL_PATH/
export PKG_CONFIG_PATH=/MY/INKCPP/EXAMPLE_INSTALL/PATH/lib/pkgconfig
gcc -c main.c $(pkg-config --cflags inkcpp)
g++ -o main main.o $(pkg-config --libs inkcpp)
./main
As a sideproduct a file named test.bin
should be created coaining the binary format used by inkCPP.
void ink_compile_json | ( | const char * | input_filename, |
const char * | output_filename, | ||
const char ** | error ) |
Compiles a .ink.json file to an inkCPP .bin file.
input_filename | path to file contaning input data (.ink.json) |
output_filename | path to file output data will be written (.bin) |
error | if not NULL will contain a error message if an error occures (else will be set to NULL) |