/*  
 *    SCCS ID: %Z%%M% %I% %E% SST
 *
 *    Copyright (c) 1992-1993 Mark Soloway.  All rights reserved.
 *    See SST_LEGAL_NOTICE file for terms of the license. 
 */  

#include <unistd.h>
  
#include "TreeManager_server.h"
#include "TTC.h"

void main (int /* argc */, char ** /* argv */)
{
  int                 mark;
  Tt_status           status;
  TreeManager_server  tree (status);
  TTMessage          *message;

  mark = tt_mark ();
  message = tree.receiveAsynchronousMessage (status);
  if (message) delete message;
  tt_release (mark);

  if (status > TT_WRN_LAST) {
    printf ("ToolTalk error while processing start message: %d\n", status);
  }

  for (; status < TT_WRN_LAST;) {
    mark = tt_mark ();
    message = tree.waitForMessage (status);
    delete message;

    if ((status > TT_WRN_LAST) && (status != TT_ERR_OBJID)) {
      printf ("ToolTalk error while processing message: %d\n", status);
    }

    tt_release (mark);
  }

  exit (0);
}
