5 - Examples

Here are some examples file descriptions using Lunary.


5.1 - PNG file format

png.lua contains a partial description of the PNG file format. It can parse the chunk structure, and some chunk content (like embedded texts), but not actual image data. Two helpers scripts allow converting PNG files to and from Lua, png2lua and lua2png respectively.


5.2 - RIFF file format

riff.lua contains a partial description of the RIFF file format. It can parse the chunk structure, and some chunk content from WAV or AVI files (like embedded texts), but not actual sound or video data. Two helpers scripts allow converting RIFF files to and from Lua, riff2lua and lua2riff respectively.


5.3 - ed2k .met files

Not shipped with this project, but available online is a description of met files used by popular eDonkey2000 clients like eMule. It is more complex than the examples above, but they are more complete, in two senses. They use almost all built-in Lunary data types. They are also complete in the sense that they describe all fields of supported .met files. It is therefore possible to generate .met files from scratch using that library.

The serial/met.lua file describes all the .met files formats. The met2lua script can convert met files to a Lua equivalent and vice-versa.