|
Zen API
|
What platforms are supported?
| Windows | Zen is routinely tested on Windows 7/8. We no longer test Zen with Windows XP or Vista, but we don't know of any reason why it would not be compatible. |
| Linux | Zen is routinely tested on the most recent version of Ubuntu Linux. We expect that Zen is compatible with other Linux distributions, but Ubuntu is the only distribution that we use for testing. |
| Mac OS X | Some portions of Zen are ported to Mac OS X, but this port is not routinely tested and is not officially supported. |
| DSP/BIOS | Zen is routinely tested on TI DSP/BIOS 5.32 (NDK 1.9.3). |
| QNX Neutrino | Some portions of Zen are ported to QNX Neutrino, but this port is not routinely tested and is not officially supported. |
Are 64-bit platforms supported?
Yes. If you received 32-bit binaries, 64-bit versions can be created by recompiling the Zen library (use the 'x64' build configuration for Windows).
Where is the 'include' folder?
Zen does not segregate source files and include files into separate folders. Add [install-location]/Platform/kApi to your include path to access kApi header files.
What is the difference between '.h' header files and 'x.h' header files?
Zen classes are almost always implemented using two header files and one source file. The '.h' file is the public header. This file contains declarations that can be used from anywhere. The '.x.h' header file is the internal header file. This file contains declarations that should only be used from within the Zen library.
Why is Zen written in C?
The Zen library began in 2005 as an initiative to create a portable middleware layer that would enable applications to run on both embedded and host platforms. At the time, C was the obvious choice due to the wide availability of high quality C compilers and standard library implementations for embedded platforms. By comparison, C++ support was often lacking or altogether absent. Though C++ support has since improved, mostly due to the increasing use of GCC and clang for embedded development, it remains true that C is supported everywhere while C++ support must be evaluated on a case-by-case basis.
C provides a few other notable advantages. First, nearly every programming environment provides some way to use C functions. This makes it possible to provide a C library that implements core functionality and to expect that developers working in other languages will be able to make use of this functionality with only moderate effort. Second, C tends to produce smaller program sizes, which is still a consideration for embedded systems (albeit a diminishing one).
That said, we are fans of C++. If we were to start over today, it's possible that we would make a different choice.
Why so many macros?
Writing a large, efficient system in C can be challenging, as the C language (particularly C89) lacks many features that modern developers expect (e.g., inheritance, exception handling, inline functions). Liberal use of macros allows us to fill in some of these gaps without sacrificing readability. However, we recognize the dangers inherent in macros, and prefer to avoid them where better alternatives exist.
Wasn't there a version of the Zen library that used a 'z' prefix instead of 'k'?
In 2009, a lightweight, open-source version of the Zen library was created that used a 'z' prefix for function and data structure declarations. However, maintaining two separate versions of the Zen library proved impractical, and the lightweight version has since been discontinued. The MIT license is now used for the full version of Zen, enabling it to serve as a foundation for both proprietary embedded applications and open-source SDKs.