-init_words (void)
-{
- char *mode = get_string_resource ("mode", "Mode");
-
- program = get_string_resource ("program", "Program");
- filename = get_string_resource ("filename", "Filename");
- text = get_string_resource ("text", "Text");
-
- if (program) /* get stderr on stdout, so it shows up on the window */
- {
- orig_program = program;
- program = (char *) malloc (strlen (program) + 10);
- strcpy (program, "( ");
- strcat (program, orig_program);
- strcat (program, " ) 2>&1");
- }
-
- if (!mode || !strcmp (mode, "program"))
- getwordsfrom = FROM_PROGRAM;
- else if (!strcmp (mode, "file"))
- getwordsfrom = FROM_FILE;
- else if (!strcmp (mode, "string"))
- getwordsfrom = FROM_RESRC;
- else
- {
- fprintf (stderr,
- "%s: mode must be program, file, or string, not %s\n",
- progname, mode);
- exit (1);
- }
-
- if (getwordsfrom == FROM_PROGRAM && !program)
- {
- fprintf (stderr, "%s: no program specified.\n", progname);
- exit (1);
- }
- if (getwordsfrom == FROM_FILE && !filename)
- {
- fprintf (stderr, "%s: no file specified.\n", progname);
- exit (1);
- }
-
- words = get_words();
-}
-
-static int first_time = 1;
-
-static char *
-get_words (void)