int timer_init(int max);
int timer_pending(void);
int timer_expired(void);
int timer_add(struct bc_timer *bct, long timeout);
void timer_remove(struct bc_timer *bct);
#endif
I an using Xcode and I am not getting any other info then a error.
/
*-----------------------------------------------------------------------
---
* Local Data
*-----------------------------------------------------------------------
---*/
static struct bc_timer **timer_list;
static int timer_max;
/
*-----------------------------------------------------------------------
---*
*-----------------------------------------------------------------------
---*/
int
timer_pending(void)
{
int i;
for (i = 0; i < timer_max; i++) {
if (timer_list[i]) {
return 1;
}
}
return 0;
}
/
*-----------------------------------------------------------------------
---*
*-----------------------------------------------------------------------
---*/
int
timer_expired(void)
{
struct bc_timer *bct;
int i;
struct timeval tn;
(void)gettimeofday(&tn, NULL);
for (i = 0; i < timer_max; i++) {
bct = timer_list[i];
if (bct) {
if ((bct->tv.tv_sec <= tn.tv_sec) && (bct->tv.tv_usec <=
tn.tv_usec)) {
timer_list[i] = NULL;
(bct->function)(bct->data);
}
}
}
return 1;
}
/
*-----------------------------------------------------------------------
---*
* timeout in msec
*-----------------------------------------------------------------------
---*/
int
timer_add(struct bc_timer *bct, long timeout)
{
int i;
struct timeval tn;
(void)gettimeofday(&tn, NULL);
for (i = 0; i < timer_max; i++) {
if (timer_list[i] == NULL) {
timer_list[i] = bct;
bct->tv.tv_sec = tn.tv_sec + (timeout/1000);
bct->tv.tv_usec = tn.tv_usec; // TODO + (timeout%1000)*10;
return 0;
}
}
return -1;
}
I'm attempting to compile this code but is stops at "int
timer_pending(void);" can you help me find the problem ?
In all of your recent mail, you have neglected to tell us much
beyond "it doesn't work". Perhaps you would not mind letting us in
on the exact problems you are finding? We normally have other
things to do than try to guess what problem you are seeing.
Regards,
Justin
--
Justin C. Walker, Curmudgeon-At-Large
Institute for General Semantics
--------
"Weaseling out of things is what separates us from the animals.
Well, except the weasel."
- Homer J Simpson
--------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Unix-porting mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/unix-porting/email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Unix-porting mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/unix-porting/email@hidden