/**********************************************************************
 * lucy_list.c -- show-question routine for lucy
 *
 * $Source: /afs/athena.mit.edu/astaff/project/lucydev/src/RCS/lucy_show.c,v $
 * $Author: brlewis $
 * $Header: /afs/athena.mit.edu/astaff/project/lucydev/src/RCS/lucy_show.c,v 1.1 90/12/18 15:11:38 brlewis Exp Locker: brlewis $
 *
 * Copyright 1990 by the Massachusetts Institute of Technology.
 * For copying and distribution information, see the file
 * "mit-copyright.h".
 **********************************************************************/
#include "mit-copyright.h"

#ifndef lint
static char rcsid_lucy_show_c[] = "$Header: /afs/athena.mit.edu/astaff/project/lucydev/src/RCS/lucy_show.c,v 1.1 90/12/18 15:11:38 brlewis Exp Locker: brlewis $";
#endif /* lint */

#include <stdio.h>
#include "lucy/lucy.h"
tfile unix_tfile();		/* XXX should be in discuss .h file */

void
lucy_show(argc, argv)
     int argc;
     char *argv[];
{
  long code;
  tfile tfstdout;
  FILE *fp;
  lucy_qident i;
  name_blk *nb;
  lucyqlist l;
  char filename[32], call[64];

  i = atoi(argv[1]);		/* XXX error check */

  strcpy(filename, "/tmp/question_");
  strcat(filename, argv[1]);
  fp = fopen(filename, "w"); /* XXX error check */
  code = lucy_chain_to_file(i, fp, 0);
  fclose(fp);
  if (code) {
    com_err(argv[0], code, "");
    return;
  }
  strcpy(call, "more ");
  strcat(call, filename);
  system(call);
  return;
}
