Zen API
|
Zen is a C/C++ library that provides a portable foundation for software developed by LMI Technologies. A small Zen program is shown below:
Zen recognizes two fundamental kinds of data: value types (e.g. k8u) and reference types (e.g. kImage). Value types (structs, enums) are simple data structures with public fields. Reference types (classes, interfaces) are opaque data structures represented with handles and accessed using functions.
Zen implements a single-inheritance, multiple-interface class model. All Zen classes descend from kObject. In the example above, this enables the kObject_Destroy method to be used on both an image object and an assembly object.
A Zen assembly is a collection of types. A program must construct an assembly before using its services and should destroy the assembly before the program exits. In the example above, the kApiLib_Construct function is used to construct an instance of Zen's core assembly (kApiLib). Zen-based libraries can define new assemblies and the types defined in one assembly can extend the types defined in another assembly.
A variety of macros are provided as syntactic aids. In the example above, the kTypeOf macro is used to obtain run-time type information (kType), while the kCheck macro is used to test function return values.
Zen is open source, provided under the MIT license. See the Zen FAQ for information on supported platforms.