patchererror: Document and add C wrapper