find_thread_id PARAMS ((int num));  static void info_threads_command PARAMS ((char *, int));  static void restore_current_thread PARAMS ((int));  static void thread_apply_all_command PARAMS ((char *, int));  static void thread_apply_command PARAMS ((char *, int));  void init_thread_list () { struct thread_info *tp, *tpnext;  if (!thread_list) return;  for (tp = thread_list; tp; tp = tpnext) { tpnext = tp->next; free (tp); }  thread_list = NULL; highest_thread_num = 0; }  void add_thread (pid) int pid; { struct thread_info *tp;  tp = (struct thread_info *) xmalloc (sizeof (struct thread_info));  tp->pid = pid; tp->num = ++highest_thread_num; tp->prev_pc = 0; tp->prev_func_start = 0; tp->prev_func_name = NULL; tp->step_range_start = 0; tp->step_range_end = 0; tp->step_frame_address =0; tp->step_resume_breakpoint = 0; tp->through_sigtramp_breakpoint = 0; tp->handling_longjmp = 0; tp->trap_expected = 0; tp->another_trap = 0; tp->next = thread_list; thread_list = tp; }  static struct thread_info * find_thread_id (num) int num;
find_thread_id (int num)
find_thread_id PARAMS ((int num));static voidinfo_threads_command PARAMS ((char *, int));static voidrestore_current_thread PARAMS ((int));static voidthread_apply_all_command PARAMS ((char *, int));static voidthread_apply_command PARAMS ((char *, int));voidinit_thread_list (){  struct thread_info *tp, *tpnext;  if (!thread_list)    return;  for (tp = thread_list; tp; tp = tpnext)    {      tpnext = tp->next;      free (tp);    }  thread_list = NULL;  highest_thread_num = 0;}voidadd_thread (pid)     int pid;{  struct thread_info *tp;  tp = (struct thread_info *) xmalloc (sizeof (struct thread_info));  tp->pid = pid;  tp->num = ++highest_thread_num;  tp->prev_pc = 0;  tp->prev_func_start = 0;  tp->prev_func_name = NULL;  tp->step_range_start = 0;  tp->step_range_end = 0;  tp->step_frame_address =0;  tp->step_resume_breakpoint = 0;  tp->through_sigtramp_breakpoint = 0;  tp->handling_longjmp = 0;  tp->trap_expected = 0;  tp->another_trap = 0;  tp->next = thread_list;  thread_list = tp;}static struct thread_info *find_thread_id (num)    int num;{  struct thread_info *tp;  for (tp = thread_list; tp; tp = tp->next)    if (tp->num == num)      return tp;  return NULL;}