Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 61FC42E002D for ; Fri, 16 May 2008 15:34:40 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 09769-06 for ; Fri, 16 May 2008 15:34:32 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.esilo.com (ns1.esilo.com [63.150.152.211]) by developer.postgresql.org (Postfix) with ESMTP id EC3492E0035 for ; Fri, 16 May 2008 15:34:33 -0300 (ADT) Received: from [10.0.0.84] (fwext-esilo-jupiter.esilo.com [64.135.45.146]) (authenticated bits=0) by mail.esilo.com (8.13.1/8.13.1) with ESMTP id m4GIYM6M015947; Fri, 16 May 2008 14:34:27 -0400 Message-ID: <482DD3AC.9020207@esilo.com> Date: Fri, 16 May 2008 14:34:20 -0400 From: Andrew Chernow User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Tom Lane CC: Merlin Moncure , Andrew Dunstan , Alvaro Herrera , "Patches (PostgreSQL)" Subject: Re: libpq object hooks References: <482AD896.4000504@dunslane.net> <19342.1210776271@sss.pgh.pa.us> <6044.1210867771@sss.pgh.pa.us> <482C77E5.1060500@esilo.com> <9458.1210875556@sss.pgh.pa.us> <482C82BA.3090100@esilo.com> <9867.1210877054@sss.pgh.pa.us> <482CD76E.6000202@esilo.com> <17177.1210949948@sss.pgh.pa.us> In-Reply-To: <17177.1210949948@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/336 X-Sequence-Number: 6362 Tom Lane wrote: > > typedef void (*PGeventProc) (PGeventId eventId, const void *eventInfo, > void *passthrough); > > int PQregisterEventProc(PGconn *conn, PGeventProc proc, void *passthrough); > > > The above prototypes will work and we will add our 'event instance pointer' to the event info structures. Should have a patch shortly. libpqtypes doesn't need a passthrough/user-pointer. The object events/hooks allocate memory when the object is created "part of a conn/result object instance", it is not supplied by the API user registering the event/hook callback. I think this is where some confusion has been occurring, there are two different pointers: user pointer and event instance pointer. BTW, PQeventData and PQresultEventData return the event instance pointer, not the passthrough. At least that is how we were using these functions, being how our previous patches do not include a passthrough/user-pointer feature because libpqtypes didn't need it. -- Andrew Chernow eSilo, LLC every bit counts http://www.esilo.com/