3 Jul
2002
3 Jul
'02
1:48 a.m.
Alastair Reid wrote:
[...] 3 wrapper functions more or less like this:
static int x; static int y; void wrap_getyx(WINDOW *win) { getyx(win,x,y); } int getx(void) { return x; } int gety(void) { return y; } [...]
Uh, oh! Don't even try this if you ever want to be thread-safe! :-}
or what GreenCard used to do which is more or less [...]
Much better, and a two-element array would be even easier (see the FFI's marshaling utitlities) and more portable (structure layout is an ABI issue) here. Cheers, S.