A C Application Programming Interface (API) and binary data exchange format.
To illustrate this, consider the example of storing an array of integers to file using Tpl. First, include Tpl in your C program by adding "#include tpl.h". Next, initialize the tpl_node and integer variable by using "tpl_map( "A(i)", &i )". Finally, use a loop to iterate over the array and add each element to the tpl_node. This will create a serialized image that can be written to file with "# tpl_dump( tn, TPL_FILE, "file.tpl" )".
One of the benefits of Tpl is that it deals with typed, structured data in a way that is transparent and easy to use. Each tpl has a data type, expressed as a format string. For example, "A(i)" is an integer array, while "A(is)" is an array of integer/string pairs. Deeper structures can also be defined using the same format. For instance, an array of integers with an array of strings is expressed as A(iA(s)).
Another benefit of Tpl is that it ensures binary data portability by transparently applying endian-conversion when necessary. It also prescribes sizes for the supported types, allowing binary data to be shared effectively between machines that use different CPU types. For instance, a tpl generated on a 32-bit x86 can be read on a 64-bit Sparc Ultra. This is especially useful for socket IPC.
Finally, Tpl offers full native binary efficiency. The data within a tpl is never converted unless necessary, preserving the full efficiency of using your data types in their native binary representation. This allows for the efficient handling of large tpl images (up to 4GB) and uses memory-mapped I/O when reading and writing files to avoid the overhead of copying data through the kernel.
Version 1.4: N/A