Category : Files from Magazines
Archive   : CUJ9303.ZIP
Filename : 1103086A

 
Output of file : 1103086A contained in archive : CUJ9303.ZIP
// SIM.CPP
#include "sim.hpp"
#include ...

extern coroutine* CURRENT;
extern coroutine* MAINC;
process* MAINP=NULL;
chain SQS;

void initProcesses(void)
{ if (MAINP == NULL)
{ MAINP=new process();
SQS.put(MAINP,0);
delete MAINC;
MAINC=CURRENT=(coroutine*)MAINP;
}
}

process* mainProcess(void)
{ return(MAINP); }

process* currentProcess(void)
{ return((process *) CURRENT); }

float currentTime(void)
{ return( ((process*)CURRENT)->time ); }

void hold(float interval)
{ if (interval > 0)
{ SQS.get(CURRENT);
((process *)CURRENT)->time+=interval;
SQS.put(CURRENT,
((process *)CURRENT)->time);
resume((coroutine*)SQS.first());
}
}

void passivate(void)
{ SQS.get(CURRENT);
if (SQS.first() == NULL)
FATAL("Sequence Set is empty");
resume((coroutine *)SQS.first());
}

void activate(process *p,float time)
{ if (p == CURRENT)
hold(time - currentTime());
else
{ SQS.get(p);
p->time= ((time > currentTime())?
time : currentTime());
SQS.put(p,p->time);
}
}

void cancel(process *p)
{ SQS.get(p);
if (p == CURRENT)
{ if (SQS.first() == NULL)
FATAL("Sequence Set is empty");
resume((coroutine *)SQS.first());
}
}

void process::superMain(void)
{ main();
passivate();
FATAL("terminated process activated");}



  3 Responses to “Category : Files from Magazines
Archive   : CUJ9303.ZIP
Filename : 1103086A

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/