postgresql c function

compiled and installed a user defined C function for postgresql.
(posgresql/create_c_raster_function)
Tried to create a simple callback function for postgis mapAlgebra but
failed. I don't know how to get the arguments. Tried to lookup the
solution in the Postgis source code but didn't find it. I believe that
I'm limited by my knowledge of C at this point.