home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.uni-stuttgart.de/pub/systems/acorn/
/
Acorn.tar
/
Acorn
/
acornet
/
dev
/
oberon
/
potsrc.spk
/
lib
/
Core
/
c
/
_OS
< prev
next >
Wrap
Text File
|
1995-02-21
|
2KB
|
112 lines
/* This code is generated by pOt. */
#include <pOtRTL.h>
#include <stddef.h>
#include <string.h>
#include <time.h>
#include <limits.h>
#ifdef __linux__
#ifndef CLK_TCK
#define CLK_TCK 100
#endif
#endif
#ifdef __sun__
#include <sys/param.h>
#include <sys/types.h>
#include <sys/times.h>
#include <unistd.h>
#define CLK_TCK HZ
static struct tms tm;
static clock_t clock()
{
times(&tm);
return tm.tms_utime + tm.tms_stime;
}
#endif
#ifdef __riscos
#include "hi.OS"
#else
#include "OS.hi"
#endif
extern void pOt__gc pOt__ARGS((void));
static struct {void *next, *vars[0x1L];} pOt__gc_ptrs = {pOt_NIL,{
pOt_NIL
}};
static struct {void *next, *vars[0x1L];} pOt__gc_strs = {&pOt__gc_ptrs,{
pOt_NIL
}};
extern pOt_LONGINT pOt_Time_OS()
{
pOt_LONGINT pOt__retval;
struct {void*next;} pOt__gc_ptrs;
pOt__gc_ptrs.next = pOt__gc_root;
pOt__retval = (clock()*300)/CLK_TCK;
goto pOt__Epilogue;
pOt__halt(__FILE__,__LINE__,0x11);
pOt__Epilogue:;
pOt__gc_root=(struct pOt__tag_gc_node*)pOt__gc_ptrs.next;
return pOt__retval;
}
extern void pOt_GetClock_OS(pOt_date, pOt_time)
pOt_LONGINT *pOt_date; pOt_LONGINT *pOt_time;
{
pOt_LONGINT pOt_tm;
struct {void*next;} pOt__gc_ptrs;
pOt__gc_ptrs.next = pOt__gc_root;
pOt_tm = time(NULL);
*pOt_date = pOt_tm/86400L;
*pOt_time = pOt_tm%86400L;
pOt__Epilogue:;
pOt__gc_root=(struct pOt__tag_gc_node*)pOt__gc_ptrs.next;
}
extern void pOt_GetParFile_OS(pOt_fname)
pOt__DynArr *pOt_fname;
{
struct {void*next;} pOt__gc_ptrs;
pOt__gc_ptrs.next = pOt__gc_root;
if(strlen(pOt__parfilename) < (*(pOt__ArrTypDsc**)pOt_fname)->nofel) {
strcpy((char*)(pOt_fname + 1), pOt__parfilename);
} else pOt__halt(__FILE__,__LINE__,3);
pOt__Epilogue:;
pOt__gc_root=(struct pOt__tag_gc_node*)pOt__gc_ptrs.next;
}
extern void pOt_GC_OS()
{
struct {void*next;} pOt__gc_ptrs;
pOt__gc_ptrs.next = pOt__gc_root;
pOt__gc();
pOt__Epilogue:;
pOt__gc_root=(struct pOt__tag_gc_node*)pOt__gc_ptrs.next;
}
void pOt_OS__body()
{
static int pOt__OS_loaded=0;
if(!pOt__OS_loaded){
pOt__OS_loaded=1;
pOt__gc_ptrs.next=pOt__gc_root;
pOt__gc_root=(struct pOt__tag_gc_node*)&pOt__gc_strs;
pOt__Epilogue:;
}
}