Re: How can I return a pointer to a use structure from a function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Chongbing Liu <cliu(at)cs(dot)nmsu(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: How can I return a pointer to a use structure from a function
Date: 2003-12-19 20:41:07
Message-ID: 11672.1071866467@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Chongbing Liu <cliu(at)cs(dot)nmsu(dot)edu> writes:
> If I want the XXX_in function (for my own data type)
> to return a pointer to a particular structure, what
> micro should I use?

You can just use PG_RETURN_POINTER if you're feeling lazy.
PG_RETURN_TEXT_P and other wrappers around PG_RETURN_POINTER
exist mainly as a simple form of documentation. If you like
that kind of documentation you can define your own GET and RETURN
macros for your own datatype (look in fmgr.h for examples).
If you don't, don't bother.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2003-12-19 20:49:43 Re: PostgreSQL speakers needed for OSCON 2004
Previous Message Manfred Spraul 2003-12-19 20:12:02 Re: Issue with Linux+Pentium SMP Context Switching