I have to connect two APIs, which use different structures to describe files. One provides me with a std::FILE* and the second one expects a GFile* or GInputStream* belonging to the GIO. Is there a straightforward way to create either object from the raw file pointer which I receive?
void my_function(std::FILE * file) {
GFile * gfile = some_creator_method(file);
//or alternatively
GInputStream * ginput = some_stream_creator_method(file);
//...
//pass the GFile to the other library interface
//either using:
interface_function(gfile);
//or using
interface_stream_function(ginput);
}
//The interface function signatures I want to pass the parameter to:
void interface_function(GFile * f);
void interface_stream_function(GInputStream * is);