Lines Matching refs:list
1 /* Keyword list.
22 #include "keyword-list.h"
44 /* Copies a linear list, sharing the list elements. */
46 copy_list (Keyword_List *list)
50 while (list != NULL)
52 Keyword_List *new_cons = new Keyword_List (list->first());
55 list = list->rest();
61 /* Copies a linear list, sharing the list elements. */
63 copy_list (KeywordExt_List *list)
65 return static_cast<KeywordExt_List *> (copy_list (static_cast<Keyword_List *> (list)));
68 /* Deletes a linear list, keeping the list elements in memory. */
70 delete_list (Keyword_List *list)
72 while (list != NULL)
74 Keyword_List *rest = list->rest();
75 delete list;
76 list = rest;
83 /* Merges two sorted lists together to form one sorted list. */
119 /* Sorts a linear list, given a comparison function.
123 mergesort_list (Keyword_List *list, Keyword_Comparison less)
125 if (list == NULL || list->rest() == NULL)
127 return list;
130 /* Determine a list node in the middle. */
131 Keyword_List *middle = list;
132 for (Keyword_List *temp = list->rest();;)
143 /* Cut the list into two halves.
144 If the list has n elements, the left half has ceiling(n/2) elements
150 return merge (mergesort_list (list, less),
157 mergesort_list (KeywordExt_List *list,
162 (mergesort_list (static_cast<Keyword_List *> (list),
170 #include "keyword-list.icc"