-static void
-subproc_cb (XtPointer closure, int *source, XtInputId *id)
-{
- m_state *state = (m_state *) closure;
- state->input_available_p = True;
-}
-
-static void
-launch_text_generator (m_state *state)
-{
- XtAppContext app = XtDisplayToApplicationContext (state->dpy);
- char *oprogram = get_string_resource (state->dpy, "program", "Program");
- char *program = (char *) malloc (strlen (oprogram) + 10);
- strcpy (program, "( ");
- strcat (program, oprogram);
- strcat (program, " ) 2>&1");
-
- if ((state->pipe = popen (program, "r")))
- {
- state->pipe_id =
- XtAppAddInput (app, fileno (state->pipe),
- (XtPointer) (XtInputReadMask | XtInputExceptMask),
- subproc_cb, (XtPointer) state);
- }
- else
- {
- perror (program);
- }
-}
-
-
-static void
-relaunch_generator_timer (XtPointer closure, XtIntervalId *id)
-{
- m_state *state = (m_state *) closure;
- launch_text_generator (state);
-}