version 1.15, 2010/09/29 21:30:28
|
version 1.16, 2010/09/29 21:31:24
|
Line 219 struct sitab {
|
Line 219 struct sitab {
|
long freqmsec; |
long freqmsec; |
enum enumsi esi; |
enum enumsi esi; |
unsigned long *tab; |
unsigned long *tab; |
|
struct timeval soon; |
union { |
union { |
struct { |
struct { |
int tablen; |
int tablen; |
Line 234 struct sitab {
|
Line 235 struct sitab {
|
int ibuf; |
int ibuf; |
char buf[256]; |
char buf[256]; |
} a; |
} a; |
struct { |
|
struct timeval next; |
|
} s; |
|
} u; |
} u; |
unsigned char descrnum[DESCR_LAST-DESCR_FIRST+1]; |
unsigned char descrnum[DESCR_LAST-DESCR_FIRST+1]; |
}; |
}; |
Line 2080 static void argloop(int f0)
|
Line 2078 static void argloop(int f0)
|
tabinold[i] = tabin[i]; |
tabinold[i] = tabin[i]; |
if (tmo != 0) { |
if (tmo != 0) { |
if (tabin[i] == 0) { |
if (tabin[i] == 0) { |
i = (st->u.s.next.tv_sec - tv.tv_sec) * 1000 |
i = (st->soon.tv_sec - tv.tv_sec) * 1000 |
+ (st->u.s.next.tv_usec - tv.tv_usec) / 1000; |
+ (st->soon.tv_usec - tv.tv_usec) / 1000; |
if (i <= 0) { |
if (i <= 0) { |
tmo = 0; |
tmo = 0; |
} else if ((tmo < 0) || (i < tmo)) { |
} else if ((tmo < 0) || (i < tmo)) { |
Line 2136 static void argloop(int f0)
|
Line 2134 static void argloop(int f0)
|
i = st->pid - TABLE_PID_FIRST; |
i = st->pid - TABLE_PID_FIRST; |
if ((tabinold[i] == 0) |
if ((tabinold[i] == 0) |
&& (tabin[i] < (TABBUF_SIZE-MAX_PSI_SIZE+1-2)) |
&& (tabin[i] < (TABBUF_SIZE-MAX_PSI_SIZE+1-2)) |
&& ((st->u.s.next.tv_sec < tv.tv_sec) |
&& ((st->soon.tv_sec < tv.tv_sec) |
|| ((st->u.s.next.tv_sec == tv.tv_sec) |
|| ((st->soon.tv_sec == tv.tv_sec) |
&& (st->u.s.next.tv_usec <= tv.tv_usec)))) { |
&& (st->soon.tv_usec <= tv.tv_usec)))) { |
if (st->freqmsec > 0) { |
if (st->freqmsec > 0) { |
i = (st->u.s.next.tv_sec - tv.tv_sec) * 1000 |
i = (st->soon.tv_sec - tv.tv_sec) * 1000 |
+ (st->u.s.next.tv_usec - tv.tv_usec) / 1000; |
+ (st->soon.tv_usec - tv.tv_usec) / 1000; |
if (i < -st->freqmsec) { |
if (i < -st->freqmsec) { |
st->u.s.next = tv; |
st->soon = tv; |
} else { |
} else { |
st->u.s.next.tv_sec += st->freqmsec / 1000; |
st->soon.tv_sec += st->freqmsec / 1000; |
st->u.s.next.tv_usec += (st->freqmsec % 1000) * 1000; |
st->soon.tv_usec += (st->freqmsec % 1000) * 1000; |
if (st->u.s.next.tv_usec > 1000000) { |
if (st->soon.tv_usec > 1000000) { |
st->u.s.next.tv_usec -= 1000000; |
st->soon.tv_usec -= 1000000; |
st->u.s.next.tv_sec += 1; |
st->soon.tv_sec += 1; |
} |
} |
} |
} |
} |
} |
Line 2212 static void argloop(int f0)
|
Line 2210 static void argloop(int f0)
|
free(newtab); |
free(newtab); |
newtab = NULL; |
newtab = NULL; |
} else { |
} else { |
newtab->u.s.next = tv; |
newtab->soon = tv; |
newtab->next = runtab; |
newtab->next = runtab; |
runtab = newtab; |
runtab = newtab; |
newtab = NULL; |
newtab = NULL; |