input_stream: return allocated input_stream objects
Major API redesign: don't let the caller allocate the input_stream object. Let each input plugin allocate its own (derived/extended) input_stream pointer. The "data" attribute can now be removed, and all input plugins simply cast the input_stream pointer to their own structure (with an "struct input_stream base" as the first attribute).
This commit is contained in:
@@ -80,13 +80,13 @@ archive_file_scan_next(struct archive_file *file)
|
||||
return file->plugin->scan_next(file);
|
||||
}
|
||||
|
||||
bool
|
||||
archive_file_open_stream(struct archive_file *file, struct input_stream *is,
|
||||
struct input_stream *
|
||||
archive_file_open_stream(struct archive_file *file,
|
||||
const char *path, GError **error_r)
|
||||
{
|
||||
assert(file != NULL);
|
||||
assert(file->plugin != NULL);
|
||||
assert(file->plugin->open_stream != NULL);
|
||||
|
||||
return file->plugin->open_stream(file, is, path, error_r);
|
||||
return file->plugin->open_stream(file, path, error_r);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user