Return-Path: <awaresystems.be+caf_=filtered=awaresystems.be@gmail.com>
Delivered-To: filtered@awaresystems.be
Received: from mx3.public.one.com ([10.246.18.23])
	by mail6.local.one.com (Dovecot) with LMTP id oI5dK1Pry1gVMgEAsyOMew
	for <filtered@awaresystems.be>; Fri, 17 Mar 2017 14:58:12 +0000
X-HalOne-ID: 2268d842-0b22-11e7-91ed-b82a72d83ab6
Received: from mail-ot0-f180.google.com (unknown [74.125.82.180])
	by mx3.public.one.com (Halon) with ESMTPS
	id 2268d842-0b22-11e7-91ed-b82a72d83ab6;
	Fri, 17 Mar 2017 14:58:10 +0000 (UTC)
Received: by mail-ot0-f180.google.com with SMTP id x37so94004371ota.2
        for <filtered@awaresystems.be>; Fri, 17 Mar 2017 07:58:10 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-original-authentication-results:x-gm-message-state:delivered-to
         :date:from:to:in-reply-to:message-id:references:user-agent
         :mime-version:cc:subject:precedence:list-id:list-unsubscribe
         :list-archive:list-post:list-help:list-subscribe
         :content-transfer-encoding:sender:errors-to;
        bh=uBE5g4MSyPLKHtKJ73ChtSBdvR8fqGf2P6L4J6G3Ung=;
        b=E6Ah9FAxTpwIXDsHuDKijFXk0+xCLqMiWJ4Y/ubfHY+vKvYHNF9sj2DJ/cH34V0MmR
         e5/A5I4QImqwqrh3LQVO0PnfmlmXqGJ7BjTc1n1RlzEHKks8TDBFUPBHl9XUvYgwEmvF
         cgNv6Rd2F/ANQYAHZL8s+uF1tw2VcaI5TRjANwllzGwwWlrnMaqnUb2d9Wz9pzZoAZXf
         2Ei11+NEGSDuKafOruUWRLNQb439ssNbiAy/D/uYSfXRBSwaX2qiTABoFJebA7h5BcyG
         vKPAqkC+SC5mf1bLNpIxpaYfCk/50fjwn3Ek7FCd2GxNL5+Ml3BizgaWNUpXcZrD8bDI
         9EHQ==
X-Original-Authentication-Results: mx.google.com;       spf=neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) smtp.mailfrom=tiff-bounces@lists.maptools.org
X-Gm-Message-State: AFeK/H2j60sN27ydBL4xtuWJg5pjsxYJOHihCWE/36hEj542Y6YyZji5iyKgxMFfelXe0k1cN2Anl5CCegaANP8yhwjJ/xg=
X-Received: by 10.157.11.229 with SMTP id 92mr7397098oth.85.1489762688889;
        Fri, 17 Mar 2017 07:58:08 -0700 (PDT)
X-Forwarded-To: filtered@awaresystems.be
X-Forwarded-For: awaresystems.be@gmail.com filtered@awaresystems.be
Delivered-To: awaresystems.be@gmail.com
Received: by 10.202.195.2 with SMTP id t2csp323884oif;
        Fri, 17 Mar 2017 07:58:07 -0700 (PDT)
X-Received: by 10.28.65.65 with SMTP id o62mr3158666wma.14.1489762687452;
        Fri, 17 Mar 2017 07:58:07 -0700 (PDT)
Return-Path: <tiff-bounces@lists.maptools.org>
Received: from lists.maptools.org (ks365428.kimsufi.com. [94.23.4.142])
        by mx.google.com with ESMTP id p201si3528694wme.108.2017.03.17.07.58.06;
        Fri, 17 Mar 2017 07:58:07 -0700 (PDT)
Received-SPF: neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) client-ip=94.23.4.142;
Authentication-Results: mx.google.com;
       spf=neutral (google.com: 94.23.4.142 is neither permitted nor denied by best guess record for domain of tiff-bounces@lists.maptools.org) smtp.mailfrom=tiff-bounces@lists.maptools.org
Received: from [10.1.0.241] (localhost.localdomain [127.0.0.1])
	by lists.maptools.org (Postfix) with ESMTP id B361035C042;
	Fri, 17 Mar 2017 09:57:19 -0500 (EST)
Received: from smtp.simplesystems.org (smtp.simplesystems.org [65.66.246.90])
	by lists.maptools.org (Postfix) with ESMTPS id 4EB0535C040
	for <tiff@lists.maptools.org>; Fri, 17 Mar 2017 09:53:52 -0500 (EST)
Received: from scrappy.simplesystems.org (scrappy.simplesystems.org
	[65.66.246.73])
	by smtp.simplesystems.org (8.14.4+Sun/8.14.4) with ESMTP id
	v2HErl5H005068; Fri, 17 Mar 2017 09:53:47 -0500 (CDT)
Date: Fri, 17 Mar 2017 09:53:47 -0500 (CDT)
From: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
X-X-Sender: bfriesen@scrappy.simplesystems.org
To: Dinesh Iyer <dsi.maillist@gmail.com>
In-Reply-To: <CAHcSuBpB46=uPKCS48LuFCqbZ1GeQau6_f8Bbbj5fs6LbJdE+Q@mail.gmail.com>
Message-ID: <alpine.GSO.2.20.1703170947500.4525@scrappy.simplesystems.org>
References: <CAHcSuBpB46=uPKCS48LuFCqbZ1GeQau6_f8Bbbj5fs6LbJdE+Q@mail.gmail.com>
User-Agent: Alpine 2.20 (GSO 67 2015-01-07)
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(smtp.simplesystems.org [65.66.246.90]);
	Fri, 17 Mar 2017 09:53:47 -0500 (CDT)
Cc: TIFF mailing list <tiff@lists.maptools.org>
Subject: Re: [Tiff] TIFFSetErrorHandler vs TIFFSetErrorHandlerExt
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

On Fri, 17 Mar 2017, Dinesh Iyer wrote:

> Hi team,
> I need to do some custom error handling which requires me to pass in the
> pointer to my class that is doing the TIFF I/O. I need this because I need
> to deliver warnings/errors to my application through a specific mechanism.
>
> I noticed that TIFFSetErrorHandlerExt does allow me to pass that as the
> first argument. I was wondering if it is sufficient to set one of the error
> handlers or do I have to set both. The same applies for warning handlers as
> well.

These functions are redudant and both may be used at once.  If 
TIFFSetErrorHandler() was used, then its error handler will be called. 
If TIFFSetErrorHandlerExt() was used, then its error handler will be 
called.  They are called in succession.

This means that you can just use TIFFSetErrorHandlerExt() and be 
happy.

The main problem with these interfaces is that the internal storage 
location is shared across threads so threads can't use different 
handlers unless they serialize access to libtiff.

Bob
-- 
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
