Core header libraries and utilities
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Přemysl Eric Janouch bd1013f16a
Parse block attribute list lines
This code is of strategic importance, but its output is so far unused.
6 months ago
cmake Get rid of CMake dev warnings 3 years ago
meson/packaging Little improvements 6 years ago
tests Import protocol code generator from xK, add tests 1 year ago
tools Parse block attribute list lines 6 months ago
.clang-format Add clang-format configuration, clean up 2 years ago
.gitignore Update .gitignore 2 years ago
CMakeLists.txt Document the recently added scripts 1 year ago
LICENSE Extend string syntax in config 1 year ago
README.adoc asciiman: fixes, improve mandoc compatibility 1 year ago
fuzz Add remaining fuzzing entry points 3 years ago
liberty-proto.c Remove pointless, wrong constant 2 years ago
liberty-pulse.c Import libpulse poller integration, add tests 2 years ago
liberty-tui.c Name change 3 years ago
liberty.c Allow for overriding feature test macros 1 year ago
libertyconf.vim Add VIM syntax highlight for "config" 7 years ago
libertyxdr.adoc Improve documentation 1 year ago
libertyxdr.vim Import protocol code generator from xK, add tests 1 year ago
siphash.c Add clang-format configuration, clean up 2 years ago



liberty is a pseudolibrary largely consisting of reusable C code for my various projects. I used to copy-paste large swaths of it with minimal changes, and it slowly became awfully painful to synchronize. The project can be thought of as a successor to my other C library, libxtnd.

You are supposed to import it as a git submodule and include the main source file directly everywhere you need it, setting feature flags as appropriate. Everything is declared "static". I have come to the conclusion that this style of C programming suits me the best, as it allows me to nearly forget about the mess that are header files.

The API is intentionally unstable, which allows for easy refactoring.

All development is done on Linux, but other POSIX-compatible operating systems should be generally supported as well. They have an extremely low priority, however, and Im not testing them at all, perhaps with the exception of macOS.


This project also hosts a number of supporting scripts written in portable AWK:


A fallback manual page generator for AsciiDoc documents, motivated by the hugeness of AsciiDocs and Asciidoctors dependency trees. Just like them, it uses the man macro package.


Parses the CMake language to the extent that is necessary to reliably extract project versions. Its greatest limitation is its inability to expand variables, which would require a full interpreter.


This can be used in conjunction with the previous script to dump CMake scripts in a normalized format for further processing.


Protocol code generator for a variant of XDR, which is documented separately. Successfully employed in xK.


LibertyXDR backend that builds on top of the C pseudolibrary.


LibertyXDR backend for Go, supporting encoding/json interfaces. It also produces optimized JSON marshallers (however, note that the json.Marshaler interface is bound to be underperforming, due to the amount of otherwise avoidable memory allocations it necessitates).


LibertyXDR backend for Javascript, currently for decoding only. It cuts a corner by not using BigInts, on par with JSON.parse().

Contributing and Support

Use to report any bugs, request features, or submit pull requests. git send-email is tolerated. If you want to discuss the project, feel free to join me at ircs://, channel #dev.

Bitcoin donations are accepted at: 12r5uEWEgcHC46xd64tt3hHt9EUvYYDHe9


This software is released under the terms of the 0BSD license, the text of which is included within the package along with the list of authors.