Changeset f25b73d6 in mainline for tetris/tetris.c


Ignore:
Timestamp:
2006-05-29T17:09:10Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
79460ae
Parents:
854387b
Message:

Started porting tetris.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tetris/tetris.c

    r854387b rf25b73d6  
    5151
    5252#include <err.h>
    53 #include <signal.h>
     53//#include <signal.h>
    5454#include <stdio.h>
    5555#include <stdlib.h>
     
    6868long    fallrate;
    6969int     score;
    70 gid_t   gid, egid;
     70//gid_t gid, egid;
    7171char    key_msg[100];
    7272int     showpreview, classic;
     
    166166        keys = "jkl pq";
    167167
    168         gid = getgid();
    169         egid = getegid();
    170         setegid(gid);
     168//      gid = getgid();
     169//      egid = getegid();
     170//      setegid(gid);
    171171
    172172        classic = showpreview = 0;
    173         while ((ch = getopt(argc, argv, "ck:l:ps")) != -1)
    174                 switch(ch) {
    175                 case 'c':
    176                         /*
    177                          * this means:
    178                          *      - rotate the other way;
    179                          *      - no reverse video.
    180                          */
    181                         classic = 1;
    182                         break;
    183                 case 'k':
    184                         if (strlen(keys = optarg) != 6)
    185                                 usage();
    186                         break;
    187                 case 'l':
    188                         level = (int)strtonum(optarg, MINLEVEL, MAXLEVEL,
    189                             &errstr);
    190                         if (errstr)
    191                                 errx(1, "level must be from %d to %d",
    192                                     MINLEVEL, MAXLEVEL);
    193                         break;
    194                 case 'p':
    195                         showpreview = 1;
    196                         break;
    197                 case 's':
    198                         showscores(0);
    199                         exit(0);
    200                 default:
    201                         usage();
    202                 }
    203 
    204         argc -= optind;
    205         argv += optind;
    206 
    207         if (argc)
    208                 usage();
     173
     174/*      while ((ch = getopt(argc, argv, "ck:l:ps")) != -1) */
     175/*              switch(ch) { */
     176/*              case 'c': */
     177/*                      /\* */
     178/*                       * this means: */
     179/*                       *      - rotate the other way; */
     180/*                       *      - no reverse video. */
     181/*                       *\/ */
     182/*                      classic = 1; */
     183/*                      break; */
     184/*              case 'k': */
     185/*                      if (strlen(keys = optarg) != 6) */
     186/*                              usage(); */
     187/*                      break; */
     188/*              case 'l': */
     189/*                      level = (int)strtonum(optarg, MINLEVEL, MAXLEVEL, */
     190/*                          &errstr); */
     191/*                      if (errstr) */
     192/*                              errx(1, "level must be from %d to %d", */
     193/*                                  MINLEVEL, MAXLEVEL); */
     194/*                      break; */
     195/*              case 'p': */
     196/*                      showpreview = 1; */
     197/*                      break; */
     198/*              case 's': */
     199/*                      showscores(0); */
     200/*                      exit(0); */
     201/*              default: */
     202/*                      usage(); */
     203/*              } */
     204
     205/*      argc -= optind; */
     206/*      argv += optind; */
     207
     208/*      if (argc) */
     209/*              usage(); */
    209210
    210211        fallrate = 1000000 / level;
     
    228229                key_write[4], key_write[5]);
    229230
    230         (void)signal(SIGINT, onintr);
     231//      (void)signal(SIGINT, onintr);
    231232        scr_init();
    232233        setup_board();
     
    358359}
    359360
    360 void
    361 onintr(int signo)
    362 {
    363         scr_clear();            /* XXX signal race */
    364         scr_end();              /* XXX signal race */
    365         _exit(0);
    366 }
     361/* void */
     362/* onintr(int signo) */
     363/* { */
     364/*      scr_clear();            /\* XXX signal race *\/ */
     365/*      scr_end();              /\* XXX signal race *\/ */
     366/*      _exit(0); */
     367/* } */
    367368
    368369void
Note: See TracChangeset for help on using the changeset viewer.