diff options
author | Even Rouault <even.rouault@spatialys.com> | 2022-11-13 16:23:21 +0100 |
---|---|---|
committer | Even Rouault <even.rouault@spatialys.com> | 2022-11-21 23:23:23 +0100 |
commit | 21d7dac23f44697c43fb9155c8e746678f0c2a68 (patch) | |
tree | 8e19cd580f0a8d6b4a784c6c89b98b8abfbb333a /test | |
parent | 352c1a7d03cb12f5bc18d116da6b8c1ab5a281d7 (diff) | |
download | libtiff-git-21d7dac23f44697c43fb9155c8e746678f0c2a68.tar.gz |
Rework TIFFOpenExt() and similar to use an opaque TIFFOpenOptions* opts argument, with alloc, free and setters
Diffstat (limited to 'test')
-rw-r--r-- | test/test_error_handlers.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/test/test_error_handlers.c b/test/test_error_handlers.c index 56faa29e..d1ba0587 100644 --- a/test/test_error_handlers.c +++ b/test/test_error_handlers.c @@ -80,14 +80,12 @@ int test_open_ext(int handlers_set_in_open) TIFF* tif; if( handlers_set_in_open ) { - TIFFOpenExtStruct arguments = { - .version = 1, - .errorhandler = myErrorHandler, - .errorhandler_user_data = &errorhandler_user_data, - .warnhandler = myErrorHandler, - .warnhandler_user_data = &warnhandler_user_data - }; - tif = TIFFOpenExt("test_error_handler.tif", "w", &arguments); + TIFFOpenOptions* opts = TIFFOpenOptionsAlloc(); + assert(opts); + TIFFOpenOptionsSetErrorHandlerExtR(opts, myErrorHandler, &errorhandler_user_data); + TIFFOpenOptionsSetWarningHandlerExtR(opts, myErrorHandler, &warnhandler_user_data); + tif = TIFFOpenExt("test_error_handler.tif", "w", opts); + TIFFOpenOptionsFree(opts); } else { |