/* test if two files qualify for the same "group"; if not then rank them by * size and then other factors depending on settings */ gint rm_file_cmp(const RmFile *file_a, const RmFile *file_b) { gint result = SIGN_DIFF(file_a->file_size, file_b->file_size); RmCfg *cfg = file_a->session->cfg; if(result == 0) { result = (cfg->match_basename) ? rm_file_basenames_cmp(file_a, file_b) : 0; } if(result == 0) { result = (cfg->match_with_extension) ? rm_file_cmp_with_extension(file_a, file_b) : 0; } if(result == 0) { result = (cfg->match_without_extension) ? rm_file_cmp_without_extension(file_a, file_b) : 0; } return result; }
/** * @brief prioritiser function for basic elevator algorithm **/ gint rm_mds_elevator_cmp(const RmMDSTask *task_a, const RmMDSTask *task_b) { return (2 * SIGN_DIFF(task_a->dev, task_b->dev) + 1 * SIGN_DIFF(task_a->offset, task_b->offset)); }