From: TJ O'Donnell <tjo@acm.org>
To: Jose Mendoza <unixos@prodigy.net.mx>
Cc: pgsql-sql@postgresql.org
Subject: Re: Function in C++
Date: Sat, 01 Jan 2005 11:20:36 -0800
Message-ID: <41D6F804.9060703@acm.org> (raw)
In-Reply-To: <0I9C00AKWDR2ER@smtp.prodigy.net.mx>
References: <0I9C00AKWDR2ER@smtp.prodigy.net.mx>
All I do is write a c interface with postgresql, using the
standard method described in the documentation. There are example
in the src code tree, too. The only "trick" is to declare
my c++ functions to be callable by c, like in this example:
extern "C" int oe_smarts_match(char *smi, char *sma)
{
.c++ code ...
}
Then my c interface code calls oe_smarts_match.
I hope this helps. Let me know if you need more details or examples.
TJ
Jose Mendoza wrote:
>
>
> I would like to have, only if it is possible, a small example of how can
> be that done. I have this problem now because I have a very light
> interface using the ODBC and with the same code I can connect to
> Postgresql (servers Linux) and SQLserver (servers Windows). And the
> libpq++ works in C++ if I reject the idea of use ODBC.
>
>
>
> Any help will be appreciated.
>
>
>
> Thans
>
>
>
> Jose Mendoza
>
> unixos@prodigy.net.mx <mailto:unixos@prodigy.net.mx>
>
>
>
>
>
>
>
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-sql@postgresql.org
Cc: tjo@acm.org, unixos@prodigy.net.mx
Subject: Re: Function in C++
In-Reply-To: <41D6F804.9060703@acm.org>
* 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