Return-Path: aoki
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA09830; Tue, 29 Jun 93 14:17:29 -0700
Message-Id: <9306292117.AA09830@postgres.Berkeley.EDU>
From: aoki@postgres.berkeley.edu (Paul M. Aoki)
Subject: Re: using "text" type arguments in c functions in postgres
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
In-Reply-To: Your message of Tue, 29 Jun 93 13:29:56 -0700 
	     <9306292032.AA24998@aic.hrl.hac.com> 
Date: Tue, 29 Jun 93 14:20:48 -0700
Sender: aoki@postgres.Berkeley.EDU
X-Mts: smtp

i assume you mean a user-defined function that will be included
into the backend.

lindaq@aic.hrl.hac.com writes:
> I'm trying to write a C function that takes in a composite
> type as its argument and returns a boolean.

composite types are accessed as described in the user manual,
src/doc/manual.ps.

> One of the
> attributes of my composite type is of type "text" and another
> is of type "text[]".  What C data types should I use in my
> code?  What C operators are available for these C data types?
> How can I find this information out in general?
> 
> Do I have to use the varlena data type somehow?

text is really implemented as struct varlena.  the builtin
operations on struct varlena are in src/utils/adt/varlena.c.
the definition is in tmp/c.h.

in general, code that implements most operations on builtin types 
are in src/utils/adt.  headers are either in src/utils or tmp/c.h.
(some (but not all) of them are installed in include/ by postgres 4.1).
--
  Paul M. Aoki  |  CS Div., Dept. of EECS, UCB  |  aoki@postgres.Berkeley.EDU
                |  Berkeley, CA 94720           |  ...!uunet!ucbvax!aoki
