Changeset 4309:4c11b1ab0498 in roaraudio
- Timestamp:
- 09/07/10 04:05:19 (14 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/notify.c
r4308 r4309 161 161 struct roar_subscriber * cur, * old; 162 162 163 ROAR_DBG("roar_notify_core_subscribe(core=%p, event=%p, cb=%p, userdata=%p) = ?", core, event, cb, userdata); 164 163 165 _CKRCORE(NULL); 164 166 165 167 if ( event == NULL || cb == NULL ) { 168 ROAR_DBG("roar_notify_core_subscribe(core=%p, event=%p, cb=%p, userdata=%p) = NULL // errno = EINVAL", core, event, cb, userdata); 166 169 roar_errno = ROAR_ERROR_INVAL; 167 170 return NULL; … … 169 172 170 173 if ( (subs = roar_mm_malloc(sizeof(struct roar_subscriber))) == NULL ) { 174 ROAR_DBG("roar_notify_core_subscribe(core=%p, event=%p, cb=%p, userdata=%p) = NULL // errno = ENOMEM?", core, event, cb, userdata); 171 175 return NULL; 172 176 } … … 197 201 } 198 202 203 ROAR_DBG("roar_notify_core_subscribe(core=%p, event=%p, cb=%p, userdata=%p) = %p", core, event, cb, userdata, subs); 199 204 return subs; 200 205 } … … 205 210 _CKICORE(); 206 211 207 if ( subscriber ) {212 if ( subscriber == NULL ) { 208 213 roar_errno = ROAR_ERROR_INVAL; 209 214 return -1; … … 234 239 _CKICORE(); 235 240 236 if ( event ) {241 if ( event == NULL ) { 237 242 roar_errno = ROAR_ERROR_INVAL; 238 243 return -1; … … 240 245 241 246 cur = core->lists[_hash_event(core, event)]; 247 ROAR_DBG("roar_notify_core_emit(core=%p, event=%p): cur=%p", core, event, cur); 242 248 243 249 while (cur != NULL) { 250 ROAR_DBG("roar_notify_core_emit(core=%p, event=%p): cur=%p", core, event, cur); 251 252 // test if we can skip this one: 253 if ( !( (cur->event == ROAR_NOTIFY_SPECIAL || cur->event == event->event) && 254 (cur->emitter == -1 || cur->emitter == event->emitter) && 255 (cur->target == -1 || cur->target == event->target) && 256 (cur->target_type == -1 || cur->target_type == event->target_type) 257 ) ) { 258 cur = cur->next; 259 continue; 260 } 261 244 262 if ( cur->cb == NULL ) { 245 263 ROAR_ERR("roar_notify_core_emit(core=%p, event=%p): cur=%p, cb is set NULL, bad.", core, event, cur);
Note: See TracChangeset
for help on using the changeset viewer.