--- gforth/Attic/primitives 1994/02/11 16:30:46 1.1 +++ gforth/Attic/primitives 1994/04/20 17:12:06 1.2 @@ -1,5 +1,5 @@ /* -$Id: primitives,v 1.1 1994/02/11 16:30:46 anton Exp $ +$Id: primitives,v 1.2 1994/04/20 17:12:06 pazsan Exp $ Copyright 1992 by the ANSI figForth Development Group WARNING: This file is processed by m4. Make sure your identifiers @@ -194,6 +194,10 @@ fflush(stdout); /* !! noecho */ n = key(); +key? -- n fig key_q +fflush(stdout); +n = key_query; + cr -- fig puts(""); @@ -591,6 +595,25 @@ wfileid=(Cell)popen(pname,mode[n]); pclose wfileid -- wior own wior=pclose((FILE *)wfileid); +time&date -- nyear nmonth nday nhour nmin nsec ansi time_and_date +struct timeval time1; +struct timezone zone1; +struct tm *ltime; +gettimeofday(&time1,&zone1); +ltime=localtime(&time1.tv_sec); +nyear =ltime->tm_year+1900; +nmonth=ltime->tm_mon; +nday =ltime->tm_mday; +nhour =ltime->tm_hour; +nmin =ltime->tm_min; +nsec =ltime->tm_sec; + +ms n -- ansi +struct timeval timeout; +timeout.tv_sec=n/1000; +timeout.tv_usec=1000*(n%1000); +(void)select(0,0,0,0,&timeout); + allocate u -- a_addr wior memory a_addr = (Cell *)malloc(u); wior = a_addr==NULL; /* !! define a return code */