Changeset f25b73d6 in mainline for tetris/tetris.c
- Timestamp:
- 2006-05-29T17:09:10Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 79460ae
- Parents:
- 854387b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tetris/tetris.c
r854387b rf25b73d6 51 51 52 52 #include <err.h> 53 #include <signal.h>53 //#include <signal.h> 54 54 #include <stdio.h> 55 55 #include <stdlib.h> … … 68 68 long fallrate; 69 69 int score; 70 gid_t gid, egid;70 //gid_t gid, egid; 71 71 char key_msg[100]; 72 72 int showpreview, classic; … … 166 166 keys = "jkl pq"; 167 167 168 gid = getgid();169 egid = getegid();170 setegid(gid);168 // gid = getgid(); 169 // egid = getegid(); 170 // setegid(gid); 171 171 172 172 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(); */ 209 210 210 211 fallrate = 1000000 / level; … … 228 229 key_write[4], key_write[5]); 229 230 230 (void)signal(SIGINT, onintr);231 // (void)signal(SIGINT, onintr); 231 232 scr_init(); 232 233 setup_board(); … … 358 359 } 359 360 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 /* } */ 367 368 368 369 void
Note:
See TracChangeset
for help on using the changeset viewer.