#include "llist.h"
Defines | |
#define | LIST1 1 |
#define | LIST2 2 |
Functions | |
lresult_s * | merge_lresult (struct lresult_s *list1_p, struct lresult_s *list2_p) |
void | free_lresult_list (struct lresult_s *list_head) |
int | cpy_result (struct result_s *dest_result_p, struct result_s *src_result_p) |
void | print_lresult_list (struct lresult_s *list_head) |
lresult_s * | create_list_head (struct result_s *result_p) |
void | push_list (struct lresult_s *list_head, struct result_s *result_p) |
lresult_s * | delete_list_head (struct lresult_s *list_head) |
#define LIST1 1 |
#define LIST2 2 |
Copy information from one result to another. If the src result has result data, copy that as well.
dest_result_p | Result which will be overwritten. | |
src_result_p | Result which will be used as the source. |
Allocate and fill in the attributes for a list head from a result.
result_p | Result information to be added to the list head. |
Attempts to delete the list_head. It could return NULL, which indicates that the list no longer exists.
list_head | Pointer to the head of a result list. |
void free_lresult_list | ( | struct lresult_s * | list_head | ) |
For every element in the result list, it frees the data of each list element and then frees the list element itself.
list_head | Result list to be freed. |
Takes two locally ordered linked lists and merges them into one sorted linked list which is returned. The ordering is based on the score and then secondly the result_id. The memory from the input result lists is freed.
list1_p | Locally ordered linked list 1. | |
list2_p | Locally ordered linked list 2. |
void print_lresult_list | ( | struct lresult_s * | list_head | ) |
Print result attributes and data of an entire result list.
list_head | The head pointer of a result list. |
Add an element to the result list.
list_head | A result list pointer, where the next pointer will point to the new element. | |
result_p | Result information to be added to the new element in the list. |