/**************************************************
  generates a generic mainfile for lotos prototypes
**************************************************/

/***********************************
  (C) Copyright 1995 dit/upm
  Distributed under the conditions stated in the
  TOPO General Public License (see file LICENSE)
 ***********************************
 $Log: gtm.c,v $
 * Revision 1.1  1995/01/17  10:01:55  lotos
 * Initial revision
 *
***********************************/

#ifndef lint
static char rcsid[]= "$Id: gtm.c,v 1.1 1995/01/17 10:01:55 lotos Exp $";
#endif

/* KJT 20/01/23: added headers */
#include <stdio.h>
#include <stdlib.h>

/* KJT 20/01/23: added "int" type and parameters */
int main (argc, argv)
  int   argc;
  char* argv[];
{
  printf ("/* #define USE_rand     /* */\n");
  printf ("#define USE_random      /* */\n");
  printf ("/* #define USE_lrand48  /* */\n");
  printf ("\n");
  printf ("#include \"lotos.hh\"\n");
  printf ("\n");
  printf ("main (argc, argv)\n");
  printf ("  int argc;\n");
  printf ("  char* argv[];\n");
  printf ("{\n");
  printf ("  int count;\n");
  printf ("  void **param;\n");
  printf ("\n");
  printf ("#ifdef USE_rand\n");
  printf ("  int rand();\n");
  printf ("  konfig.random= rand;\n");
  printf ("  srand (getpid ());\n");
  printf ("#endif\n");
  printf ("\n");
  printf ("#ifdef USE_random\n");
  printf ("  long random();\n");
  printf ("  konfig.random= random;\n");
  printf ("  srandom (getpid ());\n");
  printf ("#endif\n");
  printf ("\n");
  printf ("#ifdef USE_lrand48\n");
  printf ("  long lrand48 ();\n");
  printf ("  konfig.random= lrand48;\n");
  printf ("  srand48 ((long)getpid ());\n");
  printf ("#endif\n");
  printf ("\n");
  printf ("  konfig.trace= 1;\n");
  printf ("  ldcinit ();\n");
  printf ("  cmd2lbc (argc, argv, &count, &param);\n");
  printf ("  lbcinit (count, param);\n");
  printf ("  exit (sch ());\n");
  printf ("}\n");

  exit (0);
  return 0;
}
