I have a code library that was written to read from a file stream (FILE *) doing mostly getc ungetc, and processing that data. However I actually need to run against a string already in memory. So I can convert all the code to work over my string array, but what I'd like is somehow get a FILE * to my string.
I don't see any way to do this though, and this code does need to be fast so I'd like to avoid anything that requires writing out the data to disk to get an fd. If I have to I will just convert it all to work on an array vs getc ungetc but there's a fair amount of code to convert.
Any suggestions? (btw this is linux platform)