| Crates.io | apigen-xml |
| lib.rs | apigen-xml |
| version | 0.1.0 |
| created_at | 2025-08-18 15:42:37.586482+00 |
| updated_at | 2025-08-18 15:42:37.586482+00 |
| description | Generate APIs from XML description |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1800695 |
| size | 410,613 |

The primary purpose of apigen-xml is to auto-generate efficient, zero-copy encoders and decoders
for an XML-based API.
This project is a modern re-interpretation of the originalapigen used for gfxstream GLES, which
can be found here:
https://android.googlesource.com/platform/hardware/google/gfxstream/+/refs/heads/main/codegen/generic-apigen/
While many graphics APIs are defined in XML (e.g., by Khronos), those files are often very large and not optimized for generating a full encode/decode process. For example, tools often filter a subset of extensions they want to support.
This tool uses an intermediary XML format with a schema specifically designed for apigen-xml.
The goal is to generate:
The key elements of the XML schema are:
To generate the API files, run the following command. Note that ${out_dir} must be an absolute path, as shell expansions like ~ are not supported.
./target/debug/apigen-xml --filename=xml/magma.xml --out-dir=${out_dir}
An output directory will be created if it did not previously exist.
After modifying an XML file, ensure it is correctly formatted by running:
xmllint --format xml/magma.xml > magma_formatted.xml && mv magma_formatted.xml xml/magma.xml