+ return (t->type == output_termcap || t->type == output_msdos_raw) ? t : NULL;
+}
+
+/* Return an active (not suspended) text-based terminal device that uses
+ the tty device with the given NAME, or NULL if the named terminal device
+ is not opened. */
+
+struct terminal *
+get_named_terminal (const char *name)
+{
+ struct terminal *t;
+
+ eassert (name);
+
+ for (t = terminal_list; t; t = t->next_terminal)
+ {
+ if ((t->type == output_termcap || t->type == output_msdos_raw)
+ && !strcmp (t->display_info.tty->name, name)
+ && TERMINAL_ACTIVE_P (t))
+ return t;
+ }
+ return NULL;