Lines Matching defs:te
200 struct timer_entry *te, *te2;
202 te = TAILQ_FIRST(&tmrs->head);
203 if (te == NULL)
206 te->timeout -= tmrs->res;
207 while (te->timeout <= 0) {
208 te2 = TAILQ_NEXT(te, next);
209 TAILQ_REMOVE(&tmrs->head, te, next);
210 te->func(te->id, te->arg);
211 free(te);
212 te = te2;
213 if (te == NULL)
222 struct timer_entry *te, *te2, *te3;
224 te = malloc(sizeof(struct timer_entry));
225 memset(te, 0, sizeof(struct timer_entry));
227 te->timeout = timeout;
228 te->func = func;
229 te->arg = arg;
230 te->id = id;
235 TAILQ_INSERT_HEAD(&tmrs->head, te, next);
236 } else if (te->timeout < te2->timeout) {
237 te2->timeout -= te->timeout;
238 TAILQ_INSERT_HEAD(&tmrs->head, te, next);
240 while (te->timeout >= te2->timeout) {
241 te->timeout -= te2->timeout;
243 if (te3 == NULL || te3->timeout > te->timeout)
247 TAILQ_INSERT_AFTER(&tmrs->head, te2, te, next);