/*
  Sample C program that calls VAXTPU.  This program uses TPU$EDIT to provide
  the names of the input and output files
*/

#include descrip

int return_status;

static $DESCRIPTOR (command_prefix, "TPU/NOJOURNAL/NOCOMMAND/OUTPUT=");
static $DESCRIPTOR (input_file, "infile.dat");
static $DESCRIPTOR (output_file, "outfile.dat");
static $DESCRIPTOR (space_desc, " ");

char command_line [100];
static $DESCRIPTOR (command_desc, command_line);

main (argc, argv)
    int argc;
    char *argv[];

    {
    /*
      Build the command line for VAXTPU.  Note that the command verb
      is "TPU" instead of "EDIT/TPU".  The string we construct in the
      buffer command_line will be
        "TPU/NOJOURNAL/NOCOMMAND/OUTPUT=outfile.dat infile.dat"
    */

    return_status = STR$CONCAT (&command_desc,
                                &command_prefix,
                                &output_file,
                                &space_desc,
                                &input_file);
    if (! return_status)
        exit (return_status);

    /*
      Now call VAXTPU to edit the file
    */
    return_status = TPU$TPU (&command_desc);
    exit (return_status);
    }
