50 data = next =
nullptr;
55 data = next =
nullptr;
60 data = next =
nullptr;
89 void internal_deep_clear (
90 void (*zapper) (
void *));
105 last = from_list->last;
108 void assign_to_sublist(
116 const void *,
const void *));
125 bool add_sorted(
int comparator(
const void*,
const void*),
126 bool unique,
void* new_data);
133 void set_subtract(
int comparator(
const void*,
const void*),
bool unique,
153 bool ex_current_was_last;
155 bool ex_current_was_cycle_pt;
159 bool started_cycling;
171 CLIST *list_to_iterate);
174 CLIST *list_to_iterate);
176 void add_after_then_move(
179 void add_after_stay_put(
182 void add_before_then_move(
185 void add_before_stay_put(
191 void add_list_before(
201 return current->data;
211 void *move_to_first();
213 void *move_to_last();
215 void mark_cycle_pt();
222 return list->
empty ();
245 const void *,
const void *));
257 CLIST *list_to_iterate) {
259 if (!list_to_iterate)
261 "list_to_iterate is nullptr");
264 list = list_to_iterate;
266 current = list->First ();
267 next = current !=
nullptr ? current->next :
nullptr;
269 started_cycling =
false;
270 ex_current_was_last =
false;
271 ex_current_was_cycle_pt =
false;
300 "new_data is nullptr");
304 new_element->data = new_data;
306 if (list->
empty ()) {
307 new_element->next = new_element;
308 list->last = new_element;
309 prev = next = new_element;
312 new_element->next = next;
315 current->next = new_element;
317 if (current == list->last)
318 list->last = new_element;
321 prev->next = new_element;
322 if (ex_current_was_last)
323 list->last = new_element;
324 if (ex_current_was_cycle_pt)
325 cycle_pt = new_element;
328 current = new_element;
347 "new_data is nullptr");
351 new_element->data = new_data;
353 if (list->
empty ()) {
354 new_element->next = new_element;
355 list->last = new_element;
356 prev = next = new_element;
357 ex_current_was_last =
false;
361 new_element->next = next;
364 current->next = new_element;
367 if (current == list->last)
368 list->last = new_element;
371 prev->next = new_element;
372 if (ex_current_was_last) {
373 list->last = new_element;
374 ex_current_was_last =
false;
397 "new_data is nullptr");
401 new_element->data = new_data;
403 if (list->
empty ()) {
404 new_element->next = new_element;
405 list->last = new_element;
406 prev = next = new_element;
409 prev->next = new_element;
411 new_element->next = current;
415 new_element->next = next;
416 if (ex_current_was_last)
417 list->last = new_element;
418 if (ex_current_was_cycle_pt)
419 cycle_pt = new_element;
422 current = new_element;
441 "new_data is nullptr");
445 new_element->data = new_data;
447 if (list->
empty ()) {
448 new_element->next = new_element;
449 list->last = new_element;
450 prev = next = new_element;
451 ex_current_was_last =
true;
455 prev->next = new_element;
457 new_element->next = current;
462 new_element->next = next;
463 if (ex_current_was_last)
464 list->last = new_element;
484 "list_to_add is nullptr");
487 if (!list_to_add->
empty ()) {
488 if (list->
empty ()) {
489 list->last = list_to_add->last;
491 next = list->First ();
492 ex_current_was_last =
true;
497 current->next = list_to_add->First ();
498 if (current == list->last)
499 list->last = list_to_add->last;
500 list_to_add->last->next = next;
501 next = current->next;
504 prev->next = list_to_add->First ();
505 if (ex_current_was_last) {
506 list->last = list_to_add->last;
507 ex_current_was_last =
false;
509 list_to_add->last->next = next;
513 list_to_add->last =
nullptr;
531 "list_to_add is nullptr");
534 if (!list_to_add->
empty ()) {
535 if (list->
empty ()) {
536 list->last = list_to_add->last;
538 current = list->First ();
539 next = current->next;
540 ex_current_was_last =
false;
543 prev->next = list_to_add->First ();
545 list_to_add->last->next = current;
548 list_to_add->last->next = next;
549 if (ex_current_was_last)
550 list->last = list_to_add->last;
551 if (ex_current_was_cycle_pt)
552 cycle_pt = prev->next;
554 current = prev->next;
555 next = current->next;
557 list_to_add->last =
nullptr;
571 void *extracted_data;
584 prev = next = list->last =
nullptr;
588 if (current == list->last) {
590 ex_current_was_last =
true;
592 ex_current_was_last =
false;
596 ex_current_was_cycle_pt = (current == cycle_pt);
597 extracted_data = current->data;
600 return extracted_data;
616 current = list->First ();
618 next = current !=
nullptr ? current->next :
nullptr;
619 return current !=
nullptr ? current->data :
nullptr;
642 ex_current_was_cycle_pt =
TRUE;
643 started_cycling =
FALSE;
660 return ((list->
empty ()) || (current == list->First ()) || ((current ==
nullptr) &&
661 (prev == list->last) &&
662 !ex_current_was_last));
679 return ((list->
empty ()) || (current == list->last) || ((current ==
nullptr) &&
680 (prev == list->last) &&
681 ex_current_was_last));
697 return ((list->
empty ()) || ((current == cycle_pt) && started_cycling));
727 const void *,
const void *)) {
733 list->
sort (comparator);
756 "new_data is nullptr");
769 new_element->data = new_data;
771 new_element->next = list->last->next;
772 list->last->next = new_element;
773 list->last = new_element;
785 #define QUOTE_IT(parm) #parm 819 #define CLISTIZEH_A(CLASSNAME) \ 821 extern DLLSYM void CLASSNAME##_c1_zapper( \ 825 *CLASSNAME##_c1_copier( \ 828 #define CLISTIZEH_B(CLASSNAME) \ 839 class DLLSYM CLASSNAME##_CLIST : public CLIST { \ 841 CLASSNAME##_CLIST() : CLIST() {} \ 845 const CLASSNAME##_CLIST &) \ 847 DONT_CONSTRUCT_LIST_BY_COPY.error(QUOTE_IT(CLASSNAME##_CLIST), ABORT, \ 853 CLIST::internal_deep_clear(&CLASSNAME##_c1_zapper); \ 857 const CLASSNAME##_CLIST &) { \ 858 DONT_ASSIGN_LISTS.error(QUOTE_IT(CLASSNAME##_CLIST), ABORT, nullptr); \ 861 #define CLISTIZEH_C(CLASSNAME) \ 876 class DLLSYM CLASSNAME##_C_IT : public CLIST_ITERATOR { \ 878 CLASSNAME##_C_IT() : CLIST_ITERATOR() {} \ 880 CLASSNAME##_C_IT(CLASSNAME##_CLIST *list) : CLIST_ITERATOR(list) {} \ 882 CLASSNAME *data() { return (CLASSNAME *)CLIST_ITERATOR::data(); } \ 884 CLASSNAME *data_relative(int8_t offset) { \ 885 return (CLASSNAME *)CLIST_ITERATOR::data_relative(offset); \ 888 CLASSNAME *forward() { return (CLASSNAME *)CLIST_ITERATOR::forward(); } \ 890 CLASSNAME *extract() { return (CLASSNAME *)CLIST_ITERATOR::extract(); } \ 892 CLASSNAME *move_to_first() { \ 893 return (CLASSNAME *)CLIST_ITERATOR::move_to_first(); \ 896 CLASSNAME *move_to_last() { \ 897 return (CLASSNAME *)CLIST_ITERATOR::move_to_last(); \ 901 #define CLISTIZEH(CLASSNAME) \ 903 CLISTIZEH_A(CLASSNAME) \ 905 CLISTIZEH_B(CLASSNAME) \ 907 CLISTIZEH_C(CLASSNAME) 913 #define CLISTIZE(CLASSNAME) \ 925 DLLSYM void CLASSNAME##_c1_zapper( \ 928 delete (CLASSNAME *)link; \
void add_list_before(CLIST *list_to_add)
void shallow_copy(CLIST *from_list)
void assign_to_sublist(CLIST_ITERATOR *start_it, CLIST_ITERATOR *end_it)
void sort(int comparator(const void *, const void *))
void add_before_then_move(void *new_data)
void add_after_stay_put(void *new_data)
void sort(int comparator(const void *, const void *))
void set_to_list(CLIST *list_to_iterate)
const ERRCODE BAD_PARAMETER
const ERRCODE NULL_CURRENT
void add_list_after(CLIST *list_to_add)
void add_before_stay_put(void *new_data)
void operator=(const CLIST_LINK &)
void add_after_then_move(void *new_data)
CLIST_LINK(const CLIST_LINK &)
void add_to_end(void *new_data)
void error(const char *caller, TessErrorLogCode action, const char *format,...) const