ext/iodine/fio.c
/** Removes a callback from the list of callbacks to be called for the event. */
Removes a callback from the list of callbacks to be called for the event.
Removes a callback from the list of callbacks to be called for the event .
int fio_state_callback_remove(callback_type_e c_type, void (*func)(void *),
                              void *arg) {
  if ((int)c_type < 0 || c_type > FIO_CALL_NEVER)
    return -1;
  fio_lock(&callback_collection[c_type].lock);
  FIO_LS_EMBD_FOR(&callback_collection[c_type].callbacks, pos) {
    callback_data_s *tmp = (FIO_LS_EMBD_OBJ(callback_data_s, node, pos));
    if (tmp->func == func && tmp->arg == arg) {
      fio_ls_embd_remove(&tmp->node);
      free(tmp);
      goto success;
    }
  }
  fio_unlock(&callback_collection[c_type].lock);
  return -1;
success:
  fio_unlock(&callback_collection[c_type].lock);
  return -0;
}
int fio_state_callback_remove ( callback_type_e c_type , void ( * func ) ( void * ) , void * arg ) { if ( ( int ) c_type < 0 || c_type > FIO_CALL_NEVER ) return -1 ; fio_lock ( & callback_collection [ c_type ] . lock ) ; FIO_LS_EMBD_FOR ( & callback_collection [ c_type ] . callbacks , pos ) { callback_data_s * tmp = ( FIO_LS_EMBD_OBJ ( callback_data_s , node , pos ) ) ; if ( tmp -> func == func && tmp -> arg == arg ) { fio_ls_embd_remove ( & tmp -> node ) ; free ( tmp ) ; goto success ; } } fio_unlock ( & callback_collection [ c_type ] . lock ) ; return -1 ; success : fio_unlock ( & callback_collection [ c_type ] . lock ) ; return -0 ; }
Removes a callback from the list of callbacks to be called for the event.
Removes a callback from the list of callbacks to be called for the event .