2009.02.12 20:12 "[Tiff] Accessing tif->tif_clientdata within my own error and warning functions", by Philip Watkinson
I have created my own functions for reading and writing TIFF files. I have also created a structure that contains variables for use with my functions. Essentially, I put a TIFF file into a buffer and my functions allow Libtiff to read and write TIFF files in memory. The structure that I created can be accessed by TIFF->tif_clientdata after TIFFClientData() is called.
For error and warning handling, the default action is write errors and warnings to standard error. You can create your own error and warning functions and set them with TIFFSetErrorHandler() (tif_error.c) and TIFFSetWarningHandler() (tif_warning.c). Error and warning messages are created with TIFFError() and TIFFWarning(). These functions can then call my own error and warning functions.
I would like to be able to access my structure pointed to by TIFF->tif_clientdata within my functions. I would like to buffer error and warning messages in my structure instead of using stderr. Unfortunately a pointer to TIFF is not passed to TIFFError() or TIFFWarning().
Is there another to control warning and error messages? I'm using version 3.7.1.
Is it possible in a future release to include access to tif->tif_clientdata for custom error and warning functions?