c language functions

From: Rodrigo Barboza <rodrigombufrj(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: c language functions
Date: 2013-04-03 15:26:05
Message-ID: CANs8QJYY58rB+bprkSnxsSePJc2EazgUGpBs90Et_bd__9in5Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello.
I'm trying to create a generic add function.
I have defined a type my_uint and it needs a '+' operator.
This operator should work like normal int + int operation.
The function is defined expecting arguments (my_uint, anyelement).

I'm confused in retrieving the anyelement type, value and than do the add
operation and return the correct value and type.
I tried to use PG_GETARG_DATUM, but I don't know how to extract the value
from it (should it be a uint32, uint64, float or double).

Any tips?

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gavin Flower 2013-04-03 15:34:34 Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)
Previous Message Heikki Linnakangas 2013-04-03 15:24:26 Re: Regex with > 32k different chars causes a backend crash