제 실력으로는 너무 어려워서 해석을 못 하겠습니다.
pos에 83,hsec에 100을 넣었을때 어떤 값이 반환되나요?
알기쉬운 해석 부탁드립니다.
unsigned long Time2HSec(struct time ct)
{
return
_Time2HSec(ct.ti_hour % 24,
ct.ti_min % 60,
ct.ti_sec % 60,
ct.ti_hund %100);
}
int WaitHTime(int pos, long hsec)
{
static unsigned long TS[100],TE[100];
struct time t1,t2;
static int TA[100],init=0;
if(EmerGenCy){ TA[pos]=0; return 0;}
if(pos<0 || pos>99) return 0;
if(!init) for(init=0; init<100; init++) TA[init]=0;
if(!hsec) {TA[pos]=0; return 0;}
disable();
if(!TA[pos]) {gettime(&t1); TS[pos]=Time2HSec(t1)+hsec; TA[pos]=-1;}
gettime(&t2); TE[pos]=Time2HSec(t2);
if((long)(TS[pos]-TE[pos])>4320000L) TE[pos]+=24L*60L*60L*100L;
if(TS[pos]<=TE[pos]) TA[pos]=0;
enable();
return TA[pos];
}
|