You can try Sean Eddy's squid library. It's a general purpose sequence analysis library, but deprecated by easel (the library now used by HMMER3). See sreformat_main.c for an example of how to read sequence files of (almost) any format.
Another (general purpose) library to consider might be seqan (C++ though and haven't used it myself).
I think there used to be a C version of readseq as well, but I can only find a newer Java version.
However, all of the above might be overkill if you just want to parse fasta format, which is pretty simple.