customizable FILE pointer-like structure written in pure C99