News for hackers. Stuff that matters.
Re:List Processing in C by yason on Tuesday December 21, 2010 @05:56AM (#2027483)
It's not necessarily just ugly but plain idiomatic C. It's just C: a function pointer + userdata pointer.

All hooks, callbacks, etc. use this approach because that's what a closure is on a low enough level. And in C it looks like void()(void userdata).

Re:List Processing in C by timrobinson on Tuesday December 21, 2010 @06:23AM (#2027515)
My "ugly" comment comes from spending my career programming against APIs like this :)

    typedef BOOL (* WNDENUMPROC) (HWND, LPARAM);
    BOOL WINAPI EnumWindows(WNDENUMPROC lpEnumFunc, LPARAM lParam);