Signal handlers' argument order




Hello, all.

Just a little thought that occurred to me: why is user_data always the
_last_ argument of signal handlers instead of the first? After all,
user_data is the only argument that's _always_ there. And in my
experience, the user_data is used much more than the other args.

If user data was the first argument then, thanks to C calling conventions,
many different signals could be connected to a single handler that only
used the first argument (if even that). Currently, one has to have a
different handler for different signal types (say, "clicked" and
"delete_event"), because even if only the user data was used, it is at a
different position in both cases..

Of course I don't say that this should be changed now (as it would break
every existing app (though a smart script could probably fix them)), but
I'd like to know if there's some reason why the argument order is as it
is.

Anyone?


Lauri Alanko
la@iki.fi




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]