list: ad search from end list
This commit is contained in:
@@ -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;\
|
||||
|
||||
Reference in New Issue
Block a user