Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id D8F442E0187 for ; Mon, 19 May 2008 05:34:41 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 35543-01-2 for ; Mon, 19 May 2008 05:34:32 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from omr9.networksolutionsemail.com (omr9.networksolutionsemail.com [205.178.146.59]) by developer.postgresql.org (Postfix) with ESMTP id 6ECE72E00D1 for ; Mon, 19 May 2008 03:47:58 -0300 (ADT) Received: from mail.networksolutionsemail.com (ns-omr9.mgt.hosting.dc2.netsol.com [10.49.6.72]) by omr9.networksolutionsemail.com (8.13.6/8.13.6) with SMTP id m4J6lvdR030071 for ; Mon, 19 May 2008 02:47:57 -0400 Received: (qmail 3527 invoked by uid 78); 19 May 2008 06:47:57 -0000 Received: from unknown (HELO webmail39) (205.178.146.50) by ns-omr9.lb.hosting.dc2.netsol.com with SMTP; 19 May 2008 06:47:57 -0000 Received: from 24.175.78.74 (clarkhorse@clarktx.com [24.175.78.74]) by webmail39 (Netsol 11.2.30) with WEBMAIL id 23841; Mon, 19 May 2008 06:47:57 +0000 From: clarkhorse@clarktx.com To: "Jonah H. Harris" , clarkhorse@clarktx.com Cc: pgsql-interfaces@postgresql.org Importance: Normal Sensitivity: Normal Message-ID: X-Mailer: Network Solutions Webmail, Build 11.2.30 X-Originating-IP: [24.175.78.74] X-Forwarded-For: [(null)] Date: Mon, 19 May 2008 06:47:57 +0000 Subject: Re: Newbie problem with from database in C MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="--=_vm_0011_W7951027752_23841_1211179677" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.6 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001, RCVD_NUMERIC_HELO=2.599 X-Spam-Level: ** X-Archive-Number: 200805/17 X-Sequence-Number: 6741 ----=_vm_0011_W7951027752_23841_1211179677 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable -----Original Message----- From: Jonah H. Harris [mailto:jonah.harris@gmail.com] Sent: Sunday, May 18, 2008 09:52 PM To: clarkhorse@clarktx.com Cc: pgsql-interfaces@postgresql.org Subject: Re: [INTERFACES] Newbie problem with from database in C On Sun, May 18, 2008 at 9:13 PM, wrote:> characters are fine so far. I h= ave placed the code I am using below.> Would appreciate it if someone cou= ld tell me what is wrong or provide me> with a reference on how to do thi= s properly. IIRC, you need to convert from network byte order: idno =3D ntohl(*((int32 *) PQgetvalue(result, row, 0))); after adding this code line I get client3z.c:140: warning: assignment makes pointer from integer without a = cast I also added #include ----=_vm_0011_W7951027752_23841_1211179677 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
&nb= sp;
-----Original Message-----
From: Jonah H. Harris [mailto:jo= nah.harris@gmail.com]
Sent: Sunday, May 18, 2008 09:52 PM
To: clarkhorse@clarktx.com
Cc: pgsql-interfaces@postgresql= .org
Subject: Re: [INTERFACES] Newbie problem with from databas= e in C

On Sun, May 18, 2008 at 9:13 PM, wrote: > characters are fine so far. I have placed the code I am using below= . > Would appreciate it if someone could tell me what is wrong or provid= e me > with a reference on how to do this properly.
 IIRC, you need= to convert from network byte order:
idno =3D ntohl(*((int32 *) PQgetvalue(result, row, 0)));

after= adding this code line I get
client3z.c:140: warning: assignment makes= pointer from integer without a cast

I also added
#include <= ;endian.h>
----=_vm_0011_W7951027752_23841_1211179677--