-#define get_thread(inf) ((struct thread_info *)(inf))
-
-void
-add_inferior_to_list (struct inferior_list *list,
- struct inferior_list_entry *new_inferior)
-{
- new_inferior->next = NULL;
- if (list->tail != NULL)
- list->tail->next = new_inferior;
- else
- list->head = new_inferior;
- list->tail = new_inferior;
-}
-
-/* Invoke ACTION for each inferior in LIST. */
-
-void
-for_each_inferior (struct inferior_list *list,
- void (*action) (struct inferior_list_entry *))
-{
- struct inferior_list_entry *cur = list->head, *next;
-
- while (cur != NULL)
- {
- next = cur->next;
- (*action) (cur);
- cur = next;
- }
-}
-
-/* Invoke ACTION for each inferior in LIST, passing DATA to ACTION. */
-
-void
-for_each_inferior_with_data (struct inferior_list *list,
- void (*action) (struct inferior_list_entry *,
- void *),
- void *data)
-{
- struct inferior_list_entry *cur = list->head, *next;
-
- while (cur != NULL)
- {
- next = cur->next;
- (*action) (cur, data);
- cur = next;
- }
-}
-
-void
-remove_inferior (struct inferior_list *list,
- struct inferior_list_entry *entry)
-{
- struct inferior_list_entry **cur;
-
- if (list->head == entry)
- {
- list->head = entry->next;
- if (list->tail == entry)
- list->tail = list->head;
- return;
- }
-
- cur = &list->head;
- while (*cur && (*cur)->next != entry)
- cur = &(*cur)->next;
-
- if (*cur == NULL)
- return;
-
- (*cur)->next = entry->next;
-
- if (list->tail == entry)
- list->tail = *cur;
-}