2007.08.09 12:07 "[Tiff] Error handling & threading", by John Aldridge

2007.08.09 12:07 "[Tiff] Error handling & threading", by John Aldridge

In a multi-threaded application, it can be a nuisance that the handlers set by TIFFSetErrorHandler[Ext] & TIFFSetWarningHandler[Ext] are static variables.

Would there be any sympathy for adding a pair of such handler function pointers to the TIFF structure? I suppose we'd need to add new versions of the

   TIFFOpen, TIFFOpenW, TIFFFdOpen, TIFFClientOpen

functions which takes such function pointers as arguments and fill them into the returned TIFF structure. The existing open functions could just default them to the current TIFFErrorExt and TIFFWarningExt functions.

Then all calls to TIFFErrorExt and TIFFWarningExt in the library could be replaced by one of

    tiff->tif_errorProc (...)
    tiff->tif_warningProc (...)

These changes would allow applications to establish per-TIFF strcture error policy without upsetting existing code.

--
Cheers,

John