Changeset f25b73d6 in mainline
- 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
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
init/init.c
r854387b rf25b73d6 45 45 #include <ipc/fb.h> 46 46 #include <async.h> 47 #include < time.h>47 #include <sys/time.h> 48 48 49 49 int a; -
libc/generic/time.c
r854387b rf25b73d6 27 27 */ 28 28 29 #include < time.h>29 #include <sys/time.h> 30 30 #include <unistd.h> 31 31 #include <ipc/ipc.h> -
libc/include/async.h
r854387b rf25b73d6 4 4 #include <ipc/ipc.h> 5 5 #include <psthread.h> 6 #include < time.h>6 #include <sys/time.h> 7 7 8 8 typedef ipc_callid_t aid_t; -
libc/include/time.h
r854387b rf25b73d6 30 30 #define __libc_TIME_H__ 31 31 32 #include <types.h>33 34 #define DST_NONE 035 36 typedef sysarg_t time_t;37 typedef sysarg_t suseconds_t;38 39 struct timeval {40 time_t tv_sec; /* seconds */41 suseconds_t tv_usec; /* microseconds */42 };43 44 struct timezone {45 int tz_minuteswest; /* minutes W of Greenwich */46 int tz_dsttime; /* type of dst correction */47 };48 49 int gettimeofday(struct timeval *tv, struct timezone *tz);50 51 32 #endif -
tetris/Makefile
r854387b rf25b73d6 1 # $OpenBSD: Makefile,v 1.7 2002/05/31 03:46:35 pjanzen Exp $ 1 LIBC_PREFIX = ../libc 2 SOFTINT_PREFIX = ../softint 3 include $(LIBC_PREFIX)/Makefile.toolchain 2 4 3 PROG= tetris 4 SRCS= input.c screen.c shapes.c scores.c tetris.c 5 MAN= tetris.6 6 DPADD= ${LIBCURSES} 7 LDADD= -lcurses 8 BINMODE=2555 5 LIBS = $(LIBC_PREFIX)/libc.a 9 6 10 beforeinstall: 11 @if [ ! -f ${DESTDIR}/var/games/tetris.scores ]; then \ 12 ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 664 \ 13 /dev/null ${DESTDIR}/var/games/tetris.scores ; \ 14 else \ 15 true ; \ 16 fi 7 OUTPUT = tetris 8 SOURCES = shapes.c tetris.c scores.c input.c screen.c 9 OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) 17 10 18 .include <bsd.prog.mk> 11 .PHONY: all clean depend disasm 12 13 all: $(OUTPUT) 14 15 -include Makefile.depend 16 17 depend: 18 $(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend 19 20 $(OUTPUT): $(OBJECTS) $(LIBS) 21 $(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map 22 23 clean: 24 -rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend *.o 25 disasm: 26 $(OBJDUMP) -d $(OUTPUT) >$(OUTPUT).disasm 27 28 %.o: %.S 29 $(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ 30 31 %.o: %.s 32 $(AS) $(AFLAGS) $< -o $@ 33 34 %.o: %.c 35 $(CC) $(DEFS) $(CFLAGS) -c $< -o $@ -
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 -
tetris/tetris.h
r854387b rf25b73d6 168 168 169 169 extern int score; /* the obvious thing */ 170 extern gid_t gid, egid;170 //extern gid_t gid, egid; 171 171 172 172 extern char key_msg[100];
Note:
See TracChangeset
for help on using the changeset viewer.