Small C library for reading Record-JAR (openrj) databases.
Open-RJ reads Record-JAR databases: text files (or in-memory buffers) of records separated by %% lines, each record holding name: value fields. Continuation lines, comments, field aliases, and ordered/case-insensitive lookup are supported by the C API.
This tree is the C base of the Open-RJ family (recovered from the historical Open-RJ 1.6.4 line). C++ / STL mappings and language bindings are separate follow-on work.
| Component | Implemented in | Use in | Dependencies |
|---|---|---|---|
| Core library | C | C — via openrj/openrj.h | <none> |
| Examples | C | - | <none> |
| Unit tests | C | - | STLSoft, xTests |
Detailed instructions — via CMake or bundling — are provided in INSTALL.md.
The public C API is declared in openrj/openrj.h:
| API | Purpose |
|---|---|
ORJ_ReadDatabaseA() |
Load a Record-JAR from a file path |
ORJ_CreateDatabaseFromMemoryA() |
Load a Record-JAR from a memory buffer |
ORJ_FreeDatabaseA() |
Release a database |
ORJ_Database_GetNumRecordsA() / …FieldsA() / …LinesA() |
Database metrics |
ORJ_Database_GetRecordA() |
Obtain a record by index |
ORJ_Record_GetFieldA() / ORJ_Record_FindFieldByNameA() |
Field access |
ORJ_GetErrorStringA() / ORJ_GetParseErrorStringA() |
Error messaging |
Eight C examples under examples/c/ exercise memory databases, field enumeration, flags, and lookups. Build them with CMake (BUILD_EXAMPLES=ON, the default) and run via run_all_examples.sh.
Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/openrj.
The Open-RJ C core has no non-standard dependencies.
Unit-tests depend on STLSoft (≥ 1.11) and xTests (≥ 0.26), and optionally shwild.
- FastFormat — includes an Open-RJ bundle inserter historically;
- Planned: Open-RJ C++ / STL mappings, and a Rust record-jar crate;
Open-RJ is released under the BSD 3-Clause license.