+static void
+start_timer (text_data *d)
+{
+ XtAppContext app = XtDisplayToApplicationContext (d->dpy);
+
+# ifdef DEBUG
+ fprintf (stderr, "%s: textclient: relaunching in %d\n", progname,
+ (int) d->subproc_relaunch_delay);
+# endif
+ if (d->pipe_timer)
+ XtRemoveTimeOut (d->pipe_timer);
+ d->pipe_timer =
+ XtAppAddTimeOut (app, d->subproc_relaunch_delay,
+ relaunch_generator_timer,
+ (XtPointer) d);
+}
+
+
+static void
+close_pipe (text_data *d)
+{
+ if (d->pid)
+ {
+# ifdef DEBUG
+ fprintf (stderr, "%s: textclient: kill %d\n", progname, d->pid);
+# endif
+ kill (d->pid, SIGTERM);
+ }
+ d->pid = 0;
+
+ if (d->pipe_id)
+ XtRemoveInput (d->pipe_id);
+ d->pipe_id = 0;
+
+ if (d->pipe)
+ {
+# ifdef DEBUG
+ fprintf (stderr, "%s: textclient: pclose\n", progname);
+# endif
+ pclose (d->pipe);
+ }
+ d->pipe = 0;
+
+
+}
+
+