From 21d7dac23f44697c43fb9155c8e746678f0c2a68 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 13 Nov 2022 16:23:21 +0100 Subject: Rework TIFFOpenExt() and similar to use an opaque TIFFOpenOptions* opts argument, with alloc, free and setters --- test/test_error_handlers.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'test') 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 { -- cgit v1.2.1