cfan is open source ANSI C basic library. see: https://bitbucket.org/chunquedong/fancpp/src