Lines Matching refs:k
85 el_key_t *fk, *k; in il_shift() local
89 k = il[icurr]; in il_shift()
90 while (k->time < t) { in il_shift()
91 fk = k; in il_shift()
92 fn = k->notice; in il_shift()
100 k = il[(icurr + DU - 1) % DU]; in il_shift()
101 if (k->time < INFINITY - DT) { in il_shift()
102 nt = k->time + DT; /* next key time */ in il_shift()
106 while (k->time < nt) { in il_shift()
107 k = k->right; in il_shift()
109 n = k->notice->pred; in il_shift()
122 fk->count = k->count - c + 1; in il_shift()
123 fk->left = k->left; in il_shift()
124 fk->right = k; in il_shift()
125 k->left->right = fk; in il_shift()
126 k->left = fk; in il_shift()
127 k->count = c; in il_shift()
137 k = il[icurr]; in il_shift()
165 el_key_t *k, *kleft; in el_init() local
197 k = (el_key_t *)malloc(sizeof (el_key_t)); in el_init()
198 if (k == NULL) { in el_init()
201 k->time = LB; in el_init()
202 k->count = 1; in el_init()
203 k->notice = n; in el_init()
204 k->left = NULL; in el_init()
205 kleft = k; in el_init()
207 n->key = k; in el_init()
230 k = (el_key_t *)malloc(sizeof (el_key_t)); in el_init()
231 if (k == NULL) { in el_init()
234 k->time = t; in el_init()
235 k->count = 1; in el_init()
236 k->notice = n; in el_init()
237 k->left = kleft; in el_init()
238 kleft->right = k; in el_init()
239 kleft = k; in el_init()
241 n->key = k; in el_init()
243 il[i] = k; in el_init()
259 k = (el_key_t *)malloc(sizeof (el_key_t)); in el_init()
260 if (k == NULL) { in el_init()
263 k->time = INFINITY; /* the end of the world */ in el_init()
264 k->count = 1; in el_init()
265 k->notice = n; in el_init()
266 k->left = kleft; in el_init()
267 k->right = NULL; in el_init()
268 kleft->right = k; in el_init()
270 n->key = k; in el_init()
273 il[DU] = k; in el_init()
305 el_key_t *k; in el_add() local
357 k = (il[i])->left; in el_add()
358 while (k->time > t) { in el_add()
359 k = k->left; in el_add()
361 k = k->right; in el_add()
364 if (k->count == NLIM) { in el_add()
371 k->count = NLIM / 2; in el_add()
372 x = k->notice; in el_add()
379 y->right = k; in el_add()
380 y->left = k->left; in el_add()
381 k->left->right = y; in el_add()
382 k->left = y; in el_add()
389 k = y; in el_add()
405 n = k->notice; in el_add()
415 k->count ++; in el_add()
466 el_key_t *k, *kl, *kr; in el_remove() local
484 k = n->key; in el_remove()
485 if (k != NULL && k->count == 1) { in el_remove()
487 k->left->right = k->right; in el_remove()
488 k->right->left = k->left; in el_remove()
489 free(k); in el_remove()
491 if (k != NULL) { in el_remove()
492 k->notice = n->pred; in el_remove()
493 k->notice->key = k; in el_remove()
494 k->time = k->notice->time; in el_remove()
497 k = n2->key; in el_remove()
498 while (k == NULL) { in el_remove()
500 k = n2->key; in el_remove()
503 k->count --; in el_remove()
505 kl = k->left; in el_remove()
506 kr = k->right; in el_remove()
508 (kl->count + k->count) <= NLIM) { in el_remove()
510 k->count += kl->count; in el_remove()
511 k->left = kl->left; in el_remove()
512 k->left->right = k; in el_remove()
515 } else if (!k->notice->isdummy && in el_remove()
516 (kr->count + k->count) <= NLIM) { in el_remove()
518 kr->count += k->count; in el_remove()
519 kr->left = k->left; in el_remove()
521 k->notice->key = NULL; in el_remove()
522 free(k); in el_remove()
567 el_key_t *k; in el_first() local
581 k = n->key; in el_first()
582 k->count --; in el_first()
585 if (k->count == 0) { in el_first()
586 k->left->right = k->right; in el_first()
587 k->right->left = k->left; in el_first()
588 free(k); in el_first()