Reading from a REFCURSOR in a C language function

Vlad Arkhipov <arhipov@dc.baikal.ru>

From: Vlad Arkhipov <arhipov@dc.baikal.ru>
To: pgsql-hackers@postgresql.org
Date: 2011-04-05T07:24:36Z
Lists: pgsql-hackers
Hi,

I'm trying to write a C language function that has a REFCURSOR argument. 
Could anyone please give me an example of reading from a cursor in C code?