Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1449 → Rev 1447

/uspace/trunk/init/init.c
44,7 → 44,7
#include <kbd.h>
#include <ipc/fb.h>
#include <async.h>
#include <sys/time.h>
#include <time.h>
 
int a;
atomic_t ftx;
/uspace/trunk/libc/include/async.h
3,7 → 3,7
 
#include <ipc/ipc.h>
#include <psthread.h>
#include <sys/time.h>
#include <time.h>
 
typedef ipc_callid_t aid_t;
 
/uspace/trunk/libc/include/time.h
29,4 → 29,23
#ifndef __libc_TIME_H__
#define __libc_TIME_H__
 
#include <types.h>
 
#define DST_NONE 0
 
typedef sysarg_t time_t;
typedef sysarg_t suseconds_t;
 
struct timeval {
time_t tv_sec; /* seconds */
suseconds_t tv_usec; /* microseconds */
};
 
struct timezone {
int tz_minuteswest; /* minutes W of Greenwich */
int tz_dsttime; /* type of dst correction */
};
 
int gettimeofday(struct timeval *tv, struct timezone *tz);
 
#endif
/uspace/trunk/libc/include/sys/time.h
File deleted
/uspace/trunk/libc/generic/time.c
26,7 → 26,7
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#include <ipc/ipc.h>
#include <stdio.h>
/uspace/trunk/tetris/tetris.h
167,7 → 167,7
#define PRE_PENALTY 0.75
 
extern int score; /* the obvious thing */
//extern gid_t gid, egid;
extern gid_t gid, egid;
 
extern char key_msg[100];
extern int showpreview;
/uspace/trunk/tetris/tetris.c
50,7 → 50,7
#include <sys/types.h>
 
#include <err.h>
//#include <signal.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
67,7 → 67,7
const struct shape *nextshape;
long fallrate;
int score;
//gid_t gid, egid;
gid_t gid, egid;
char key_msg[100];
int showpreview, classic;
 
165,49 → 165,48
 
keys = "jkl pq";
 
// gid = getgid();
// egid = getegid();
// setegid(gid);
gid = getgid();
egid = getegid();
setegid(gid);
 
classic = showpreview = 0;
while ((ch = getopt(argc, argv, "ck:l:ps")) != -1)
switch(ch) {
case 'c':
/*
* this means:
* - rotate the other way;
* - no reverse video.
*/
classic = 1;
break;
case 'k':
if (strlen(keys = optarg) != 6)
usage();
break;
case 'l':
level = (int)strtonum(optarg, MINLEVEL, MAXLEVEL,
&errstr);
if (errstr)
errx(1, "level must be from %d to %d",
MINLEVEL, MAXLEVEL);
break;
case 'p':
showpreview = 1;
break;
case 's':
showscores(0);
exit(0);
default:
usage();
}
 
/* while ((ch = getopt(argc, argv, "ck:l:ps")) != -1) */
/* switch(ch) { */
/* case 'c': */
/* /\* */
/* * this means: */
/* * - rotate the other way; */
/* * - no reverse video. */
/* *\/ */
/* classic = 1; */
/* break; */
/* case 'k': */
/* if (strlen(keys = optarg) != 6) */
/* usage(); */
/* break; */
/* case 'l': */
/* level = (int)strtonum(optarg, MINLEVEL, MAXLEVEL, */
/* &errstr); */
/* if (errstr) */
/* errx(1, "level must be from %d to %d", */
/* MINLEVEL, MAXLEVEL); */
/* break; */
/* case 'p': */
/* showpreview = 1; */
/* break; */
/* case 's': */
/* showscores(0); */
/* exit(0); */
/* default: */
/* usage(); */
/* } */
argc -= optind;
argv += optind;
 
/* argc -= optind; */
/* argv += optind; */
if (argc)
usage();
 
/* if (argc) */
/* usage(); */
 
fallrate = 1000000 / level;
 
for (i = 0; i <= 5; i++) {
228,7 → 227,7
key_write[0], key_write[1], key_write[2], key_write[3],
key_write[4], key_write[5]);
 
// (void)signal(SIGINT, onintr);
(void)signal(SIGINT, onintr);
scr_init();
setup_board();
 
358,13 → 357,13
exit(0);
}
 
/* void */
/* onintr(int signo) */
/* { */
/* scr_clear(); /\* XXX signal race *\/ */
/* scr_end(); /\* XXX signal race *\/ */
/* _exit(0); */
/* } */
void
onintr(int signo)
{
scr_clear(); /* XXX signal race */
scr_end(); /* XXX signal race */
_exit(0);
}
 
void
usage(void)
/uspace/trunk/tetris/Makefile
1,35 → 1,18
LIBC_PREFIX = ../libc
SOFTINT_PREFIX = ../softint
include $(LIBC_PREFIX)/Makefile.toolchain
# $OpenBSD: Makefile,v 1.7 2002/05/31 03:46:35 pjanzen Exp $
 
LIBS = $(LIBC_PREFIX)/libc.a
PROG= tetris
SRCS= input.c screen.c shapes.c scores.c tetris.c
MAN= tetris.6
DPADD= ${LIBCURSES}
LDADD= -lcurses
BINMODE=2555
 
OUTPUT = tetris
SOURCES = shapes.c tetris.c scores.c input.c screen.c
OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
beforeinstall:
@if [ ! -f ${DESTDIR}/var/games/tetris.scores ]; then \
${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 664 \
/dev/null ${DESTDIR}/var/games/tetris.scores ; \
else \
true ; \
fi
 
.PHONY: all clean depend disasm
 
all: $(OUTPUT)
 
-include Makefile.depend
 
depend:
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend
 
$(OUTPUT): $(OBJECTS) $(LIBS)
$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
 
clean:
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend *.o
disasm:
$(OBJDUMP) -d $(OUTPUT) >$(OUTPUT).disasm
 
%.o: %.S
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@
 
%.o: %.s
$(AS) $(AFLAGS) $< -o $@
 
%.o: %.c
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@
.include <bsd.prog.mk>