Re: libpq object hooks
От | Andrew Chernow |
---|---|
Тема | Re: libpq object hooks |
Дата | |
Msg-id | 482B1480.1070705@esilo.com обсуждение исходный текст |
Ответ на | Re: libpq object hooks ("Merlin Moncure" <mmoncure@gmail.com>) |
Ответы |
Re: libpq object hooks
|
Список | pgsql-patches |
Merlin Moncure wrote: > On Wed, May 14, 2008 at 10:44 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote: >> I'm wondering why the hooks need names at all. AFAICS all that >> libpq needs to know about a hook is a callback function address >> and a void * passthrough pointer. > > For reference...here is what libpqtypes has to do to bind via the > hooking interface: > http://libpqtypes.esilo.com/browse_source.html?file=hooks.c > > Are you proposing something substantially different (not my handle > suggestion)? How would it work exactly? > > merlin > > It is important to see how "NON-hook-callback" functions in libpqtypes make use of the hook data. PQparamCreate must get a pointer to the conn hook data http://libpqtypes.esilo.com/browse_source.html?file=param.c#line24 PQgetf must get a pointer to the result hook data http://libpqtypes.esilo.com/browse_source.html?file=exec.c#line65 These are NOT hook callbacks. The hook data is NOT isolated to callback functions. It is memory that is publically accessible, outside hook implementations. -- Andrew Chernow eSilo, LLC every bit counts http://www.esilo.com/
В списке pgsql-patches по дате отправления: