Re: Function in C++

From: TJ O'Donnell <tjo(at)acm(dot)org>
To: Jose Mendoza <unixos(at)prodigy(dot)net(dot)mx>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Function in C++
Date: 2005-01-01 19:20:36
Message-ID: 41D6F804.9060703@acm.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


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(at)prodigy(dot)net(dot)mx <mailto:unixos(at)prodigy(dot)net(dot)mx>
>
>
>
>
>
>
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Miles Keaton 2005-01-02 10:05:18 one table being used for two purposes with foreign key for each?
Previous Message Michael Fuhr 2004-12-31 19:41:18 Re: Formatting an Interval