pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Function in C++
2+ messages / 2 participants
[nested] [flat]

* Function in C++
@ 2004-12-26 18:23 Jose Mendoza <unixos@prodigy.net.mx>
  2005-01-01 19:20 ` Re: Function in C++ TJ O'Donnell <tjo@acm.org>
  0 siblings, 1 reply; 2+ messages in thread

From: Jose Mendoza @ 2004-12-26 18:23 UTC (permalink / raw)
  To: pgsql-sql

 

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

 

 

 

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Function in C++
  2004-12-26 18:23 Function in C++ Jose Mendoza <unixos@prodigy.net.mx>
@ 2005-01-01 19:20 ` TJ O'Donnell <tjo@acm.org>
  0 siblings, 0 replies; 2+ messages in thread

From: TJ O'Donnell @ 2005-01-01 19:20 UTC (permalink / raw)
  To: Jose Mendoza <unixos@prodigy.net.mx>; +Cc: 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@prodigy.net.mx <mailto:unixos@prodigy.net.mx>
> 
>  
> 
>  
> 
>  
> 



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2005-01-01 19:20 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-12-26 18:23 Function in C++ Jose Mendoza <unixos@prodigy.net.mx>
2005-01-01 19:20 ` TJ O'Donnell <tjo@acm.org>

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