Register user event functions?

Hi. I’m still working on that library =)

My lib needs to define a user event, for passing to the program using
it. The problem is: How can i avoid crashing with other user-defined
events ? Right now i use SIF_NUMEVENTS = SDL_NUMEVENTS - 1 and
SIF_EVENT = SIF_NUMEVENTS, so that users can use SIF_NUMEVENTS in
stead of SDL_NUMEVENTS. That works, but it would be better if SDL had
a “register user event” function that returned the next available
event… Is something like that planned for the future (or will be =) ?–
Trick


Linux User #229006 * http://counter.li.org

Trick wrote:

My lib needs to define a user event, for passing to the program using
it. The problem is: How can i avoid crashing with other user-defined
events

what prevents you from communicating user-defined event numbers between
your library and your user code? No registration is necessary

what prevents you from communicating user-defined event numbers
between your library and your user code? No registration is
necessary

Nothing prevents me from communicating that to my user code, or to
other’s who know about the lib. The problem is if multiple libraries
define user events. There is no way for one lib to know what user
events the other lib are defining, unless they know about each other,
which they in most cases don’t. In those cases, registration is
necessarry to avoid clashing.–
Trick


Linux User #229006 * http://counter.li.org

Why didn’t i think of that ? =)
Thank you!On Thursday 4. October 2001 14:35, Mattias Engdeg?rd wrote:

Trick (by way of Trick ) wrote:

Nothing prevents me from communicating that to my user code, or
to other’s who know about the lib. The problem is if multiple
libraries define user events.

not if the user tells the libs what numbers to use


Trick


Linux User #229006 * http://counter.li.org