diff --git a/list_t/src/list_t/list_t.h b/list_t/src/list_t/list_t.h index 6c8134b..ffcc05c 100644 --- a/list_t/src/list_t/list_t.h +++ b/list_t/src/list_t/list_t.h @@ -37,6 +37,7 @@ void decrement_list_##type(struct main_list_##type * var_list);\ struct list_##type * search_first_occ_with_mov_from_curr_in_list_##type(struct main_list_##type *var_list, type value, int (*funcCmp)(type, type), struct list_##type * (*incr_or_decr_mov)(struct list_##type *));\ struct list_##type * search_first_occ_from_begin_in_list_##type(struct main_list_##type *var_list, type value, int (*funcCmp)(type, type));\ + struct list_##type * search_first_occ_from_end_in_list_##type(struct main_list_##type *var_list, type value, int (*funcCmp)(type, type));\ struct list_##type * pull_end_from_list_##type(struct main_list_##type *var_list);\ struct list_##type * pull_begin_from_list_##type(struct main_list_##type *var_list);\ void append_list_##type(struct main_list_##type *var_list, struct list_##type *list);\ @@ -364,6 +365,13 @@ GENERATE_LIST_ALL(TYPE_PTR) pthread_mutex_unlock(var_list->mut_list);\ return search_first_occ_with_mov_from_curr_in_list_##type(var_list, value, funcCmp, local_increment_list_##type);\ }\ + struct list_##type * search_first_occ_from_end_in_list_##type(struct main_list_##type *var_list, type value, int (*funcCmp)(type, type)){\ + pthread_mutex_lock(var_list->mut_list);\ + printf("debug: cur_index change to end");\ + var_list->current_list = var_list->end_list;\ + pthread_mutex_unlock(var_list->mut_list);\ + return search_first_occ_with_mov_from_curr_in_list_##type(var_list, value, funcCmp, local_decrement_list_##type);\ + }\ struct list_##type * pull_end_from_list_##type(struct main_list_##type *var_list){\ pthread_mutex_lock(var_list->mut_list);\ struct list_##type *ret = var_list->end_list;\