>From: Jacob Salomon <jake@apparel.net>
>Date: Fri, 14 Feb 1997 10:23:52 GMT
>X-Informix-List-Id: <news.33919>
>
>> [...] drop into C (ESQL/C) code passing the blob (by reference, not
>> value!) as an argument, and therefore using poplocator() in the C
>> code [...]
>
>You have, however, just opened another can of worms, worthy of a
>separate thread: How would I pass a blob locator structure to a C
>function by reference? I was never aware of any syntax for doing this.
You can't avoid doing this -- when you pass a blob into an I4GL function,
it is passed by reference, not by value (as everything else is). In the C
code, there is a poplocator() call to get the locator:
/* In fglsys.h */
extern void poplocator(loc_t **p);
Note that you pass the address of a pointer to a locator structure:
i4gl_play_with_blob(int i)
{
loc_t *blob;
if (i != 1)
fgl_fatal("i4gl_play_with_blob", 1, -1318);
poplocator(&blob);
...
}
There is no way to return a blob -- there is no retlocator() call!
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>