A C implementation of urbit-ob, with much glancing at urbit-pob.
There is the simplest-possible Makefile and a Nix flake.
The library is based on GNU MP, making it bignum-correct (as long as your host is 64-bit, otherwise most probably not, sorry, testing & PRs welcome!) but rather awkward to use.
The library exposes two families of functions:
num2patp / patp2num / patp2hex / is_valid_patp
num2patq / patq2num / patq2hex / is_valid_patq
As well as:
clan
, for determining the ship class of a (numeric) pointsein
, for determining the parent of a (numeric) pointpatq_eq
, for comparing@q
values for equality