agora inbox for [email protected]  
help / color / mirror / Atom feed
From: Andrew Chernow <[email protected]>
To: Tom Lane <[email protected]>
Cc: Merlin Moncure <[email protected]>
Cc: Andrew Dunstan <[email protected]>
Cc: Alvaro Herrera <[email protected]>
Cc: Patches (PostgreSQL) <[email protected]>
Subject: Re: libpq object hooks
Date: Fri, 16 May 2008 14:34:20 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>

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/



view thread (64+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: libpq object hooks
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox