Refactor code for spectre_document_load_from_data()
Refactor code so that psscan()
can accept a FILE*, this will enable parsing from fmemopen()'d buffers. I figured this should be merged separately before spectre_document_load_from_data()
is added.
The file opening is moved from psscan()
to spectre_document_load()
but psscan()
still handles closing the file to minimize code changes, this is only done in like 2-3 places so it might be worth doing the changes anyway.
edit: I moved file closing to spectre_document_load()
and made it C90 compliant, they're trivial changes and it fixes an issue in parser-test.c where the handle may be closed twice.