#include "sl.h"#include "timefuncs.h" doublesec_realtime(void){ return 0.0;} u64intnanosec_monotonic(void){ return 0;} voidtimestr(double s, char *buf, int sz){ time_t tme = (time_t)s; struct tm tm; *buf = 0; if(localtime_r(&tme, &tm) != nil) strftime(buf, sz, "%a %b %e %H:%M:%S %Y", &tm);} doubleparsetime(const char *s){ return -1;} voidsleep_ms(int ms){ if(ms != 0){ struct timeval timeout; timeout.tv_sec = ms/1000; timeout.tv_usec = (ms % 1000) * 1000; select(0, nil, nil, nil, &timeout); }} voidsys_init(void){} static const u8int boot[] = {#include "sl.boot.h"}; intmain(int argc, char **argv){ setlocale(LC_NUMERIC, "C"); setlocale(LC_CTYPE, ""); slmain(boot, sizeof(boot), argc, argv);}
#include "sl.h"
#include "timefuncs.h"
double
sec_realtime(void)
{
return 0.0;
}
u64int
nanosec_monotonic(void)
{
return 0;
}
void
timestr(double s, char *buf, int sz)
{
time_t tme = (time_t)s;
struct tm tm;
*buf = 0;
if(localtime_r(&tme, &tm) != nil)
strftime(buf, sz, "%a %b %e %H:%M:%S %Y", &tm);
}
double
parsetime(const char *s)
{
return -1;
}
void
sleep_ms(int ms)
{
if(ms != 0){
struct timeval timeout;
timeout.tv_sec = ms/1000;
timeout.tv_usec = (ms % 1000) * 1000;
select(0, nil, nil, nil, &timeout);
}
}
void
sys_init(void){}
static const u8int boot[] = {
#include "sl.boot.h"
};
int
main(int argc, char **argv)
{
setlocale(LC_NUMERIC, "C");
setlocale(LC_CTYPE, "");
slmain(boot, sizeof(boot), argc, argv);
}