From: Michael Meskes <meskes@postgresql.org>
To: Edmund Bacon <ebacon@onesystem.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: ECPG and typedef struct
Date: Tue, 27 Jan 2004 18:53:54 +0100
Message-ID: <20040127175354.GA2167@1> (raw)
In-Reply-To: <1074537096.4164.117.camel@elb_lx.onesystem.ca>
References: <1074537096.4164.117.camel@elb_lx.onesystem.ca>
On Mon, Jan 19, 2004 at 11:31:36AM -0700, Edmund Bacon wrote:
> Is it still necessary to define SQL TYPEs twice?
It depends, but teh way you ask, yes.
> Is there some less maintenance-error-prone way to accomplish this? I
> know about the -c option to ecpg, but this doesn't help if I need to
> access the defined type from a .c file.
Why? Can't you just put it into a header file that is processed by ecpg
to create a C header and use "-c" for this? Okay, this does include the
ecpg headers also, but if that's the problem we could add an option
easily.
How about an option "parsing header file"?
> Ideally the C level typedef would be in a .h file somewhere and either
> #include-ed or EXEC SQL INCLUDE-ed into .c or .pgc file
Would it be okay to do this:
Write a *.pgh file, that is SQL-INCLUDE-ed in embedded sql files. For C
you'd call "ecpg -h" on that file, making ecpg produce a .h file, that
can be included by your C code.
Hmm, I think I'm going to implement that immediately. :-)
Michael
--
Michael Meskes
Email: Michael at Fam-Meskes dot De
ICQ: 179140304, AIM/Yahoo: michaelmeskes, Jabber: meskes@jabber.org
Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!
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: pgsql-interfaces@postgresql.org
Cc: meskes@postgresql.org, ebacon@onesystem.com
Subject: Re: ECPG and typedef struct
In-Reply-To: <20040127175354.GA2167@1>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox