pipethrough

Roland Illig roland.illig at gmx.de
Sat Sep 25 12:46:59 UTC 2004


Leonard den Ottolander wrote:
> Hi,
> 
> How should pipethrough that Roland wrote be integrated to avoid the
> broken pipe warnings when aborting the view of a not fully expanded gzip
> file? Would it be hard to integrate that code in init_growing_view() in
> src/view.c?

Currently, pipethrough cannot handle the growing buffer that is used 
with WView. I would prefer to rewrite WView so that it contains a 
DataProducer which can be either a GrowingBufferDataProducer, a 
MmapDataProducer or a PipethroughDataProducer. The interface to the 
DataProducer could look like:

typedef struct DataProducer DataProducer;
struct DataProducer {
	WView *view;
	int (*get_byte) (DataProducer *, off_t);
	off_t (*get_current_size) (DataProducer *);
	off_t (*get_size) (DataProducer *);
	void (*destroy) (DataProducer *);
};

The WView would then only keep a reference to the DataProducer and would 
not know what type it is. Most probably the interface above is 
incomplete, but the idea behind should be clear.

Roland



More information about the mc-devel mailing list