Lines Matching refs:current
48 current, /* Current element */ member
242 a->current = -1; in cupsArrayClear()
296 if (a->current >= 0 && a->current < a->num_elements) in cupsArrayCurrent()
297 return (a->elements[a->current]); in cupsArrayCurrent()
379 da->current = a->current; in cupsArrayDup()
445 int current, /* Current element */ in cupsArrayFind() local
474 current = a->current; in cupsArrayFind()
479 current = a->hash[hash]; in cupsArrayFind()
481 if (current < 0 || current >= a->num_elements) in cupsArrayFind()
482 current = a->current; in cupsArrayFind()
487 current = a->current; in cupsArrayFind()
491 current = cups_array_find(a, e, current, &diff); in cupsArrayFind()
505 while (current > 0 && !(*(a->compare))(e, a->elements[current - 1], in cupsArrayFind()
507 current --; in cupsArrayFind()
510 a->current = current; in cupsArrayFind()
513 a->hash[hash] = current; in cupsArrayFind()
515 return (a->elements[current]); in cupsArrayFind()
523 a->current = -1; in cupsArrayFind()
550 a->current = 0; in cupsArrayFirst()
571 return (a->current); in cupsArrayGetIndex()
604 a->current = n; in cupsArrayIndex()
664 a->current = a->num_elements - 1; in cupsArrayLast()
754 a->current = -1; in cupsArrayNew3()
831 if (a->current < a->num_elements) in cupsArrayNext()
832 a->current ++; in cupsArrayNext()
864 if (a->current >= 0) in cupsArrayPrev()
865 a->current --; in cupsArrayPrev()
888 current; /* Current element */ in cupsArrayRemove() local
906 current = cups_array_find(a, e, a->current, &diff); in cupsArrayRemove()
917 (a->freefunc)(a->elements[current], a->data); in cupsArrayRemove()
919 if (current < a->num_elements) in cupsArrayRemove()
920 memmove(a->elements + current, a->elements + current + 1, in cupsArrayRemove()
921 (size_t)(a->num_elements - current) * sizeof(void *)); in cupsArrayRemove()
923 if (current <= a->current) in cupsArrayRemove()
924 a->current --; in cupsArrayRemove()
926 if (current < a->insert) in cupsArrayRemove()
928 else if (current == a->insert) in cupsArrayRemove()
932 if (current <= a->saved[i]) in cupsArrayRemove()
958 a->current = a->saved[a->num_saved]; in cupsArrayRestore()
960 if (a->current >= 0 && a->current < a->num_elements) in cupsArrayRestore()
961 return (a->elements[a->current]); in cupsArrayRestore()
988 a->saved[a->num_saved] = a->current; in cupsArraySave()
1023 current; /* Current element */ in cups_array_add() local
1084 current = 0; /* Insert at beginning */ in cups_array_add()
1086 current = a->num_elements; /* Append to the end */ in cups_array_add()
1094 current = cups_array_find(a, e, a->insert, &diff); in cups_array_add()
1102 current ++; in cups_array_add()
1119 while (current > 0 && !(*(a->compare))(e, a->elements[current - 1], in cups_array_add()
1121 current --; in cups_array_add()
1131 current ++; in cups_array_add()
1133 while (current < a->num_elements && in cups_array_add()
1134 !(*(a->compare))(e, a->elements[current], a->data)); in cups_array_add()
1143 if (current < a->num_elements) in cups_array_add()
1149 memmove(a->elements + current + 1, a->elements + current, in cups_array_add()
1150 (size_t)(a->num_elements - current) * sizeof(void *)); in cups_array_add()
1152 if (a->current >= current) in cups_array_add()
1153 a->current ++; in cups_array_add()
1156 if (a->saved[i] >= current) in cups_array_add()
1159 DEBUG_printf(("9cups_array_add: insert element at index " CUPS_LLFMT, CUPS_LLCAST current)); in cups_array_add()
1163 DEBUG_printf(("9cups_array_add: append element at " CUPS_LLFMT, CUPS_LLCAST current)); in cups_array_add()
1168 if ((a->elements[current] = (a->copyfunc)(e, a->data)) == NULL) in cups_array_add()
1175 a->elements[current] = e; in cups_array_add()
1178 a->insert = current; in cups_array_add()
1181 for (current = 0; current < a->num_elements; current ++) in cups_array_add()
1182 …tf(("9cups_array_add: a->elements[" CUPS_LLFMT "]=%p", CUPS_LLCAST current, a->elements[current])); in cups_array_add()
1203 current, /* Current element */ in cups_array_find() local
1268 current = (left + right) / 2; in cups_array_find()
1269 diff = (*(a->compare))(e, a->elements[current], a->data); in cups_array_find()
1272 left, right, current, diff)); in cups_array_find()
1277 right = current; in cups_array_find()
1279 left = current; in cups_array_find()
1290 current = left; in cups_array_find()
1294 current = right; in cups_array_find()
1308 for (current = 0; current < a->num_elements; current ++) in cups_array_find()
1309 if (a->elements[current] == e) in cups_array_find()
1320 DEBUG_printf(("8cups_array_find: Returning %d, diff=%d", current, diff)); in cups_array_find()
1324 return (current); in cups_array_find()