5e2aeb4793
I wanted to modify the lockfile specification, but then remembered that it currently lives in two places right now: once on the Rust side where it's deserialized, and once more on the C side where it's serialized. If we could write the lockfile from the Rust side, then we wouldn't have to deal with the `GVariantBuild` and `json-glib` goop, and instead we could consistently use serde against the same struct for both serialization and deserialization. But there isn't an easy way to do this given that the state to be serialized is intrinsically linked to libdnf. So this patch takes the next step in our oxidation process by adding a minimal `libdnf_sys` module which allows us to call `libdnf` functions from Rust. This is not the prettiest code I've written, and there's definitely some polishing that could be done. But I think overall it's a move in the right general direction: as we oxidize more things, we'll at some point *have* to integrate more tightly with the C side in a bidirectional way, instead of the "one-way" approach we've been using so far. For this patch specifically, in exchange we get a unique source of truth for the lockfile spec, just like the treefile, and we drop a lot of C code in the process. Closes: #1867 Approved by: cgwalters
11 lines
365 B
TOML
11 lines
365 B
TOML
autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */"
|
|
language = "C"
|
|
header = "#pragma once\n#include <gio/gio.h>\ntypedef GError RORGError;\ntypedef GHashTable RORGHashTable;\ntypedef GPtrArray RORGPtrArray;"
|
|
trailer = """
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(RORTreefile, ror_treefile_free)
|
|
"""
|
|
|
|
|
|
[export]
|
|
prefix = "ROR"
|