/**********************************************************************
 * do_unpost.c  -- SS command for unposting a transaction
 * tty lucy client using SS library
 *
 * $Author: brlewis $
 * $Source: /afs/athena.mit.edu/astaff/project/lucydev/src/tty/do_unpost.c,v $
 * $Header: /afs/athena.mit.edu/astaff/project/lucydev/src/tty/do_unpost.c,v 1.1 91/09/24 14:48:26 brlewis Exp Locker: brlewis $
 *
 * Copyright 1991 by the Massachusetts Institute of Technology.
 *
 * For copying and distribution information, please see the file
 * <mit-copyright.h>.
 **********************************************************************/
#include <mit-copyright.h>

#ifndef lint
static char rcsid_do_unpost_c[] = "$Header: /afs/athena.mit.edu/astaff/project/lucydev/src/tty/do_unpost.c,v 1.1 91/09/24 14:48:26 brlewis Exp Locker: brlewis $";
#endif /* lint */

#include <stdio.h>
#include <ss/ss.h>
#include "lucy/lucy.h"
#include "lucy/memory.h"
#include "config.h"

void
do_unpost(argc, argv)
     int argc;
     char *argv[];
{
  long code;
  LMEETING *mtg;

  /* Check usage */
  if (argc < 2 || !atoi(argv[1])) {
    printf("Usage: %s number.\n");
    return;
  }

  /* Show what is about to be unposted */
  mtg = luv_curmtgp;
  luv_curmtgp = &luv_bmtg;
  do_show(2, argv);
  luv_curmtgp = mtg;  
  if (!say_yes("Is this what you want to unpost?", 0)) return;

  /* call luc_delete */
  code = luc_delete(&(luv_bmtg), atoi(argv[1]));
  if (code) {
    com_err(argv[0], code, "(%s)", luv_context);
    return;
  }
  printf("Unposted %s in the browser.\n", argv[1]);
#ifdef LOG_USAGE
      log_view("unpost");
#endif
  /* printf("If this was a mistake, type this:  repost %d", n); */
  return;
}
