@ggbutcher , @Morgan_Hardwood - probably these are far too basic and simplified for what you are planning to write. But if you haven’t seen these two articles, maybe they might be helpful:
https://ninedegreesbelow.com/photography/dcraw-float-c-code.html
https://ninedegreesbelow.com/photography/dcraw-c-code-annotated.html
(actually this page just provides a link at the bottom to the actual article, which I’m trying to hide from google’s search engine).