Lines Matching refs:te
202 struct timer_entry *te, *te2;
204 te = TAILQ_FIRST(&tmrs->head);
205 if (te == NULL)
208 te->timeout -= tmrs->res;
209 while (te->timeout <= 0) {
210 te2 = TAILQ_NEXT(te, next);
211 TAILQ_REMOVE(&tmrs->head, te, next);
212 te->func(te->id, te->arg);
213 free(te);
214 te = te2;
215 if (te == NULL)
224 struct timer_entry *te, *te2, *te3;
226 te = malloc(sizeof(struct timer_entry));
227 memset(te, 0, sizeof(struct timer_entry));
229 te->timeout = timeout;
230 te->func = func;
231 te->arg = arg;
232 te->id = id;
237 TAILQ_INSERT_HEAD(&tmrs->head, te, next);
238 } else if (te->timeout < te2->timeout) {
239 te2->timeout -= te->timeout;
240 TAILQ_INSERT_HEAD(&tmrs->head, te, next);
242 while (te->timeout >= te2->timeout) {
243 te->timeout -= te2->timeout;
245 if (te3 == NULL || te3->timeout > te->timeout)
249 TAILQ_INSERT_AFTER(&tmrs->head, te2, te, next);