patchinfo: Document and add C wrapper