home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume10 / logo / part01 / main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-06-23  |  1.1 KB  |  60 lines

  1.  
  2. /*  This provides the outermost framework of LOGO, calling the parser to
  3.  *    begin with, and then thereafter whenever an interrupt or error occurs.
  4.  *    Copyright (C) 1979, The Children's Museum, Boston, Mass.
  5.  *    Written by Douglas B. Klunder.
  6.  */
  7.  
  8. #include "logo.h"
  9.  
  10. char editfile[30];
  11. extern char *getbpt;
  12. #ifndef NOTURTLE
  13. extern int turtdes;
  14. extern struct display *mydpy;
  15. #endif
  16. #ifdef SETCURSOR
  17. #include <sgtty.h>
  18. struct sgttyb tty;
  19. #endif
  20.  
  21. main(argc,argv)
  22. int argc;
  23. char *argv[];
  24. {
  25.     int i[2];
  26.     char tbuff[BUFSIZ];
  27.  
  28.     setbuf(stdout,tbuff);
  29.     time(i);
  30.     SRAND(i[1]+i[0]);
  31.     sprintf(editfile,"/tmp/logo%u",(short)getpid());
  32. #ifdef SETCURSOR
  33.     gtty(1,&tty);
  34. #endif
  35.     if (argc>1)
  36.         getbpt = argv[1];
  37.     else
  38.         printf("\nWelcome to Children's Museum/LSRHS LOGO\n?");
  39.     fflush(stdout);
  40.     while (enter()==1) {
  41.         yyprompt(1);
  42.     }
  43.     cboff();
  44. #ifdef SETCURSOR
  45.     stty(1,&tty);
  46. #endif
  47. #ifndef NOTURTLE
  48. #ifdef FLOOR
  49.     if (turtdes>0)
  50.         printf("Please\007 unplug the turtle\007 and put it\007 away.\n");
  51. #endif
  52.     if (turtdes<0) {
  53.         printf(mydpy->finish);
  54.         (*mydpy->outfn)();
  55.     }
  56. #endif
  57.     unlink(editfile);
  58. }
  59.  
  60.