Lines Matching refs:list
1 /* Keyword list.
24 #include "keyword-list.h"
46 /* Copies a linear list, sharing the list elements. */
48 copy_list (Keyword_List *list)
52 while (list != NULL)
54 Keyword_List *new_cons = new Keyword_List (list->first());
57 list = list->rest();
63 /* Copies a linear list, sharing the list elements. */
65 copy_list (KeywordExt_List *list)
67 return static_cast<KeywordExt_List *> (copy_list (static_cast<Keyword_List *> (list)));
70 /* Deletes a linear list, keeping the list elements in memory. */
72 delete_list (Keyword_List *list)
74 while (list != NULL)
76 Keyword_List *rest = list->rest();
77 delete list;
78 list = rest;
85 /* Merges two sorted lists together to form one sorted list. */
121 /* Sorts a linear list, given a comparison function.
125 mergesort_list (Keyword_List *list, Keyword_Comparison less)
127 if (list == NULL || list->rest() == NULL)
129 return list;
132 /* Determine a list node in the middle. */
133 Keyword_List *middle = list;
134 for (Keyword_List *temp = list->rest();;)
145 /* Cut the list into two halves.
146 If the list has n elements, the left half has ceiling(n/2) elements
152 return merge (mergesort_list (list, less),
159 mergesort_list (KeywordExt_List *list,
164 (mergesort_list (static_cast<Keyword_List *> (list),
172 #include "keyword-list.icc"