Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 26F836330A6 for ; Mon, 6 Apr 2009 09:51:06 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 31525-02 for ; Mon, 6 Apr 2009 09:51:04 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from blu0-omc3-s29.blu0.hotmail.com (blu0-omc3-s29.blu0.hotmail.com [65.55.116.104]) by mail.postgresql.org (Postfix) with ESMTP id 47E6B632E69 for ; Mon, 6 Apr 2009 09:51:04 -0300 (ADT) Received: from BLU133-W31 ([65.55.116.72]) by blu0-omc3-s29.blu0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 6 Apr 2009 05:51:01 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_f40b0429-f01e-4709-bae0-4709a411e740_" X-Originating-IP: [131.173.79.102] From: eehab hamzeh To: Subject: Date: Mon, 6 Apr 2009 12:51:01 +0000 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 06 Apr 2009 12:51:01.0098 (UTC) FILETIME=[56A8DCA0:01C9B6B6] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.784 tagged_above=0 required=5 tests=HTML_IMAGE_ONLY_16=2.498, HTML_MESSAGE=0.001, MISSING_SUBJECT=1.285 X-Spam-Level: *** X-Archive-Number: 200904/74 X-Sequence-Number: 36568 --_f40b0429-f01e-4709-bae0-4709a411e740_ Content-Type: text/plain; charset="windows-1255" Content-Transfer-Encoding: 8bit Hello I am trying to build some functions using C language. these functions are mentioned in the postgresql documentation. http://www.postgresql.org/docs/8.3/interactive/xfunc-c.html Datum add_one_float8(PG_FUNCTION_ARGS) { /* The macros for FLOAT8 hide its pass-by-reference nature. */ float8 arg = PG_GETARG_FLOAT8(0); PG_RETURN_FLOAT8(arg + 1.0); } PG_FUNCTION_INFO_V1(makepoint); Datum makepoint(PG_FUNCTION_ARGS) { /* Here, the pass-by-reference nature of Point is not hidden. */ Point *pointx = PG_GETARG_POINT_P(0); Point *pointy = PG_GETARG_POINT_P(1); Point *new_point = (Point *) palloc(sizeof(Point)); new_point->x = pointx->x; new_point->y = pointy->y; PG_RETURN_POINT_P(new_point); } the only function that are work are the one with int32 variable. the other function bring errors and are not working any body can give directions kind regards ihab _________________________________________________________________ Show them the way! Add maps and directions to your party invites. http://www.microsoft.com/windows/windowslive/products/events.aspx --_f40b0429-f01e-4709-bae0-4709a411e740_ Content-Type: text/html; charset="windows-1255" Content-Transfer-Encoding: 8bit     Hello

I am trying to build some functions using C language. these functions are mentioned in the postgresql documentation.

http://www.postgresql.org/docs/8.3/interactive/xfunc-c.html

Datum
add_one_float8(PG_FUNCTION_ARGS)
{
/* The macros for FLOAT8 hide its pass-by-reference nature. */
float8 arg = PG_GETARG_FLOAT8(0);

PG_RETURN_FLOAT8(arg + 1.0);
}

PG_FUNCTION_INFO_V1(makepoint);

Datum
makepoint(PG_FUNCTION_ARGS)
{
/* Here, the pass-by-reference nature of Point is not hidden. */
Point *pointx = PG_GETARG_POINT_P(0);
Point *pointy = PG_GETARG_POINT_P(1);
Point *new_point = (Point *) palloc(sizeof(Point));

new_point->x = pointx->x;
new_point->y = pointy->y;

PG_RETURN_POINT_P(new_ point);
}

the only function that are work are the one with int32 variable.
the other function bring errors and are not working
any body can give directions


kind regards
ihab


See all the ways you can stay connected to friends and family --_f40b0429-f01e-4709-bae0-4709a411e740_--