This is a simple patch that allows passing in an already opened FILE stream from the outside, and reimplements mtr_init() trivially in terms of the new entry point.
Argument type has been picked as void * to avoid polluting the header with all of #include <stdio>. It's a trivial change to include it and use FILE *, but I think void * suits the no-error-checking, you-should-know-what-you're-doing spirit of the library, though.
This is a simple patch that allows passing in an already opened
FILE
stream from the outside, and reimplementsmtr_init()
trivially in terms of the new entry point.Argument type has been picked as
void *
to avoid polluting the header with all of#include <stdio>
. It's a trivial change to include it and useFILE *
, but I thinkvoid *
suits the no-error-checking, you-should-know-what-you're-doing spirit of the library, though.