Changeset 5335:dba934a2d1e0 in roaraudio for libroar


Ignore:
Timestamp:
12/09/11 18:13:39 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

cleanup and updates to roardl API

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/roardl.c

    r5321 r5335  
    538538 
    539539int                      roar_dl_appsched_trigger(struct roar_dl_lhandle * lhandle, enum roar_dl_appsched_trigger trigger) { 
     540 int (*func)  (struct roar_dl_librarypara * para) = NULL; 
    540541 int ret; 
    541542 
     
    553554#define _trig(lname,uname) \ 
    554555  case ROAR_DL_APPSCHED_ ## uname :             \ 
    555     if ( lhandle->lib->appsched->lname == NULL ) {   \ 
    556      roar_err_set(ROAR_ERROR_NOENT);            \ 
    557      return -1;                                 \ 
    558     }                                           \ 
    559     roar_dl_context_restore(lhandle);           \ 
    560     ret = lhandle->lib->appsched->lname(lhandle->para); \ 
    561     roar_dl_context_store(lhandle);             \ 
    562     return ret;                                 \ 
     556    func = lhandle->lib->appsched->lname;       \ 
    563557   break; 
    564558  _trig(init, INIT); 
    565559  _trig(free, FREE); 
    566560  _trig(update, UPDATE); 
    567  } 
    568  
    569  roar_err_set(ROAR_ERROR_BADRQC); 
    570  return -1; 
     561  _trig(tick, TICK); 
     562  _trig(wait, WAIT); 
     563// use ifndef here so warnings of unhandled enum values will be shown in DEBUG mode. 
     564#ifndef DEBUG 
     565  default: 
     566    roar_err_set(ROAR_ERROR_BADRQC); 
     567    return -1; 
     568   break; 
     569#endif 
     570 } 
     571 
     572 if ( func == NULL ) { 
     573  roar_err_set(ROAR_ERROR_NOENT); 
     574  return -1; 
     575 } 
     576 
     577 roar_dl_context_restore(lhandle); 
     578 ret = func(lhandle->para); 
     579 roar_dl_context_store(lhandle); 
     580 return ret; 
    571581} 
    572582 
Note: See TracChangeset for help on using the changeset viewer.