Received: from antares.mcs.anl.gov (mcs.anl.gov [140.221.9.6]) by hub.org (8.9.3/8.9.3) with SMTP id MAA01318 for ; Mon, 17 May 1999 12:59:23 -0400 (EDT) (envelope-from selkovjr@xnet.com) Received: from xnet.com (selkovjr@selkovjr.xnet.com [205.243.141.67]) by antares.mcs.anl.gov (8.6.10/8.6.10) with ESMTP id LAA10439; Mon, 17 May 1999 11:58:48 -0500 Message-Id: <199905171658.LAA10439@antares.mcs.anl.gov> To: tolik@icomm.ru (Anatoly K. Lasareff), pgsql-general@postgreSQL.org From: selkovjr.mcs.anl.gov@mcs.anl.gov Subject: Re: [GENERAL] Trying to make functions in 'C' In-Reply-To: Your message of "17 May 1999 10:46:56 +0400." <87n1z46vmn.fsf@tolikus.hq.aaanet.ru> Date: Mon, 17 May 1999 12:00:00 -0400 Sender: selkovjr@xnet.com > >>>>> "fb" == fabian baena writes: > > fb> I'm tying to learn how to make function in 'C'. > fb> I'm trying to compile a program I made in 'C'. > fb> The function I made looks like this: > > fb> #include "postgres.h" > > fb> int > fb> add_one(int arg) > fb> { > fb> return arg + 1; > fb> } > > Pehaps not 'int', but 'int4' in argument and return type? Except this > I think your example is right. As far as return types, make sure you get what you want by checking how types are typedef'ed in postgres.h The safest way to add your own code would be what Fabian is trying to accomplish -- by using the prototypes from tutorial. --Gene