cortoproject / corto

A hierarchical object store for connecting realtime machine data with web applications, historians & more
https://www.corto.io
MIT License
87 stars 14 forks source link

Rename event mask constants #614

Closed SanderMertens closed 7 years ago

SanderMertens commented 7 years ago

The eventMask has constants that allow applications to specify which events to observe. For example:

corto_observe(CORTO_ON_DEFINE|CORTO_ON_SCOPE).callback(cb);

Historically the eventMask was only used for the corto_observe function, and the ON prefix made sense to indicate it was an event. The eventMask has since however been used in multiple places to also communicate which event has taken place, which results in code like:

if (e->event & CORTO_ON_DEFINE) {
    ...
}

which doesn't look natural.

Therefore, the constants in eventMask will remove the ON_ prefix.