Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 8BF0A633A49 for ; Tue, 27 Oct 2009 02:10:35 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 18585-07 for ; Tue, 27 Oct 2009 05:10:23 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.postnewspapers.com.au (202-89-185-120.static.dsl.amnet.net.au [202.89.185.120]) by mail.postgresql.org (Postfix) with ESMTP id 6C8036338C7 for ; Tue, 27 Oct 2009 02:10:24 -0300 (ADT) Received: from [10.0.0.53] (wallace.localnet [10.0.0.53]) by mail.postnewspapers.com.au (Postfix) with ESMTP id B3EFE1E0442; Tue, 27 Oct 2009 13:10:21 +0800 (WST) Subject: Re: Implementing Frontend/Backend Protocol TCP/IP From: Craig Ringer To: Alvaro Herrera Cc: Raimon Fernandez , pgsql-general@postgresql.org In-Reply-To: <20091026231516.GN8812@alvh.no-ip.org> References: <92781008-8A70-42CE-A49B-6EE67103FACB@montx.com> <20091026231516.GN8812@alvh.no-ip.org> Content-Type: multipart/alternative; boundary="=-9vsec4ssUM3TRmKSesMg" Date: Tue, 27 Oct 2009 13:10:21 +0800 Message-Id: <1256620221.1709.18.camel@wallace.localnet> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.52 tagged_above=-10 required=5 tests=AWL=-0.781, BAYES_20=-0.74, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200910/1007 X-Sequence-Number: 154701 --=-9vsec4ssUM3TRmKSesMg Content-Type: text/plain Content-Transfer-Encoding: 7bit On Mon, 2009-10-26 at 20:15 -0300, Alvaro Herrera wrote: > Raimon Fernandez wrote: > > > > > > Hello, > > > > > > I'm trying to implement the front-end protocol with TCP from > > REALbasic to PostgreSQL. > > That sounds the most difficult way to do it. Can't you just embed > libpq? +1 Almost all languages support some kind of C bindings or provide a dlopen-like mechanism to dynamically call C functions from shared libraries. RealBasic appears to have fairly dynamic, dlopen-style bindings. I'm sure you can find more information in the manual, but here's an example of some syntax: http://forums.realsoftware.com/viewtopic.php?t=5050 You'll have to do a bit more work to produce bindings for libpq, though, especially if you have to produce bindings for any data types (C structures). If all you have to bind is function calls, and you can handle any libpq-specific structures as opaque void pointers then it shouldn't be too hard to just bind the function calls you need. -- Craig Ringer --=-9vsec4ssUM3TRmKSesMg Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 7bit On Mon, 2009-10-26 at 20:15 -0300, Alvaro Herrera wrote:
Raimon Fernandez wrote:
> 
> 
> Hello,
> 
> 
> I'm trying to implement the front-end protocol with TCP from
> REALbasic to PostgreSQL.

That sounds the most difficult way to do it.  Can't you just embed
libpq?

+1

Almost all languages support some kind of C bindings or provide a dlopen-like mechanism to dynamically call C functions from shared libraries.

RealBasic appears to have fairly dynamic, dlopen-style bindings. I'm sure you can find more information in the manual, but here's an example of some syntax:

http://forums.realsoftware.com/viewtopic.php?t=5050

You'll have to do a bit more work to produce bindings for libpq, though, especially if you have to produce bindings for any data types (C structures). If all you have to bind is function calls, and you can handle any libpq-specific structures as opaque void pointers then it shouldn't be too hard to just bind the function calls you need.

--
Craig Ringer --=-9vsec4ssUM3TRmKSesMg--