• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/timemachine/gettext-0.17/gettext-tools/src/

Lines Matching refs:repeated

76 			    arguments are often repeated.  */
100 an initial segment and an endlessly repeated loop segment.
105 struct segment repeated; /* Endlessly repeated segment. */
177 ASSERT (list->repeated.count <= list->repeated.allocated);
179 for (i = 0; i < list->repeated.count; i++)
181 verify_element (&list->repeated.element[i]);
182 total_repcount += list->repeated.element[i].repcount;
184 ASSERT (total_repcount == list->repeated.length);
212 for (i = 0; i < list->repeated.count; i++)
213 free_element (&list->repeated.element[i]);
214 if (list->repeated.element != NULL)
215 free (list->repeated.element);
264 newlist->repeated.count = newlist->repeated.allocated = list->repeated.count;
266 if (list->repeated.count == 0)
267 newlist->repeated.element = NULL;
270 newlist->repeated.element =
271 XNMALLOC (newlist->repeated.allocated, struct format_arg);
272 for (i = 0; i < list->repeated.count; i++)
274 copy_element (&newlist->repeated.element[i],
275 &list->repeated.element[i]);
276 length += list->repeated.element[i].repcount;
279 ASSERT (length == list->repeated.length);
280 newlist->repeated.length = length;
323 n = list1->repeated.count;
324 if (n != list2->repeated.count)
328 const struct format_arg * e1 = &list1->repeated.element[i];
329 const struct format_arg * e2 = &list2->repeated.element[i];
371 /* Ensure list->repeated.allocated >= newcount. */
375 if (newcount > list->repeated.allocated)
377 list->repeated.allocated =
378 MAX (2 * list->repeated.allocated + 1, newcount);
379 list->repeated.element =
381 xrealloc (list->repeated.element,
382 list->repeated.allocated * sizeof (struct format_arg));
386 /* Ensure list->repeated.allocated > list->repeated.count. */
390 if (list->repeated.count >= list->repeated.allocated)
392 list->repeated.allocated =
393 MAX (2 * list->repeated.allocated + 1, list->repeated.count + 1);
394 list->repeated.element =
396 xrealloc (list->repeated.element,
397 list->repeated.allocated * sizeof (struct format_arg));
433 n = list->repeated.count;
436 && equal_element (&list->repeated.element[i],
437 &list->repeated.element[j-1]))
439 list->repeated.element[j-1].repcount +=
440 list->repeated.element[i].repcount;
441 free_element (&list->repeated.element[i]);
446 list->repeated.element[j] = list->repeated.element[i];
449 list->repeated.count = j;
452 if (list->repeated.count > 0)
457 n = list->repeated.count;
460 && equal_element (&list->repeated.element[0],
461 &list->repeated.element[n-1]))
463 repcount0_extra = list->repeated.element[n-1].repcount;
467 list->repeated.element[0].repcount incremented by repcount0_extra. */
475 if (!((list->repeated.element[i].repcount
477 == list->repeated.element[i+m].repcount)
478 && equal_element (&list->repeated.element[i],
479 &list->repeated.element[i+m])))
487 free_element (&list->repeated.element[i]);
488 if (n < list->repeated.count)
489 list->repeated.element[m] = list->repeated.element[n];
490 list->repeated.count = list->repeated.count - n + m;
491 list->repeated.length /= n / m;
498 if (list->repeated.count == 1)
502 &list->repeated.element[0]))
516 &list->repeated.element[list->repeated.count-1]))
520 list->repeated.element[list->repeated.count-1].repcount);
522 /* Add the element at the start of list->repeated. */
523 if (equal_element (&list->repeated.element[0],
524 &list->repeated.element[list->repeated.count-1]))
525 list->repeated.element[0].repcount += moved_repcount;
528 unsigned int newcount = list->repeated.count + 1;
531 list->repeated.element[i] = list->repeated.element[i-1];
532 list->repeated.count = newcount;
533 copy_element (&list->repeated.element[0],
534 &list->repeated.element[list->repeated.count-1]);
535 list->repeated.element[0].repcount = moved_repcount;
538 /* Remove the element from the end of list->repeated. */
539 list->repeated.element[list->repeated.count-1].repcount -=
541 if (list->repeated.element[list->repeated.count-1].repcount == 0)
543 free_element (&list->repeated.element[list->repeated.count-1]);
544 list->repeated.count--;
575 n = list->repeated.count;
577 if (list->repeated.element[i].type == FAT_LIST)
578 normalize_list (list->repeated.element[i].list);
605 list->repeated.count = 1;
606 list->repeated.allocated = 1;
607 list->repeated.element = XNMALLOC (1, struct format_arg);
608 list->repeated.element[0].repcount = 1;
609 list->repeated.element[0].presence = FCT_OPTIONAL;
610 list->repeated.element[0].type = FAT_OBJECT;
611 list->repeated.length = 1;
631 list->repeated.count = 0;
632 list->repeated.allocated = 0;
633 list->repeated.element = NULL;
634 list->repeated.length = 0;
647 return (list->initial.count == 0 && list->repeated.count == 0);
653 /* Unfold list->repeated m times, where m >= 1.
654 Assumes list->repeated.count > 0. */
663 unsigned int newcount = list->repeated.count * m;
665 i = list->repeated.count;
667 for (j = 0; j < list->repeated.count; j++, i++)
668 copy_element (&list->repeated.element[i], &list->repeated.element[j]);
669 list->repeated.count = newcount;
670 list->repeated.length = list->repeated.length * m;
675 Assumes list->repeated.count > 0. */
683 if (list->repeated.count == 1)
685 /* Instead of multiple copies of list->repeated.element[0], a single
692 copy_element (&list->initial.element[i], &list->repeated.element[0]);
699 unsigned int n = list->repeated.length;
705 /* Determine how many entries of list->repeated are needed for
711 s < list->repeated.count && t >= list->repeated.element[s].repcount;
712 t -= list->repeated.element[s].repcount, s++)
715 /* s must be < list->repeated.count, otherwise r would have been >= n. */
716 ASSERT (s < list->repeated.count);
719 q full copies of list->repeated,
720 plus the s first elements of list->repeated,
721 plus, if t > 0, a splitoff of list->repeated.element[s]. */
726 newcount = i + q * list->repeated.count + s + (t > 0 ? 1 : 0);
729 for (j = 0; j < list->repeated.count; j++, i++)
731 &list->repeated.element[j]);
733 copy_element (&list->initial.element[i], &list->repeated.element[j]);
737 &list->repeated.element[j]);
745 + q * list->repeated.length
746 + list->repeated[0..s-1].repcount + t
753 /* And rotate list->repeated. */
759 oldcount = list->repeated.count;
760 newcount = list->repeated.count + (t > 0 ? 1 : 0);
764 newelement[i] = list->repeated.element[j];
766 newelement[i] = list->repeated.element[j];
773 free (list->repeated.element);
774 list->repeated.element = newelement;
797 ASSERT (list->repeated.count > 0);
846 ASSERT (list->repeated.count > 0);
1054 /* Append list->repeated to list->initial, and clear list->repeated. */
1059 if (list->repeated.count > 0)
1061 /* Move list->repeated over to list->initial. */
1064 newcount = list->initial.count + list->repeated.count;
1067 for (j = 0; j < list->repeated.count; j++, i++)
1068 list->initial.element[i] = list->repeated.element[j];
1070 list->initial.length = list->initial.length + list->repeated.length;
1071 free (list->repeated.element);
1072 list->repeated.element = NULL;
1073 list->repeated.allocated = 0;
1074 list->repeated.count = 0;
1075 list->repeated.length = 0;
1080 The list consists only of an initial segment. The repeated segment is
1088 ASSERT (list->repeated.count == 0);
1134 if (list1->repeated.length > 0 && list2->repeated.length > 0)
1135 /* Step 1: Ensure list1->repeated.length == list2->repeated.length. */
1137 unsigned int n1 = list1->repeated.length;
1138 unsigned int n2 = list2->repeated.length;
1145 /* Now list1->repeated.length = list2->repeated.length = lcm(n1,n2). */
1148 if (list1->repeated.length > 0 || list2->repeated.length > 0)
1151 repeated segment, this means to ensure
1156 if (list1->repeated.length > 0)
1158 if (list2->repeated.length > 0)
1162 if (list1->repeated.length > 0 && list2->repeated.length > 0)
1165 ASSERT (list1->repeated.length == list2->repeated.length);
1174 result->repeated.count = 0;
1175 result->repeated.allocated = 0;
1176 result->repeated.element = NULL;
1177 result->repeated.length = 0;
1224 if (list1->repeated.count == 0 && list2->repeated.count == 0)
1243 else if (list1->repeated.count == 0)
1247 if ((c2 > 0 ? e2->presence : list2->repeated.element[0].presence)
1253 else if (list2->repeated.count == 0)
1257 if ((c1 > 0 ? e1->presence : list1->repeated.element[0].presence)
1267 /* Step 5: Elementwise intersection of list1->repeated, list2->repeated. */
1274 e1 = list1->repeated.element; c1 = list1->repeated.count;
1275 e2 = list2->repeated.element; c2 = list2->repeated.count;
1280 /* Ensure room in result->repeated. */
1282 re = &result->repeated.element[result->repeated.count];
1298 result->repeated.count++;
1299 result->repeated.length += re->repcount;
1341 : list->repeated.count > 0
1342 && list->repeated.element[0].presence == FCT_REQUIRED)
1506 if (list1->repeated.length > 0 && list2->repeated.length > 0)
1508 /* Step 1: Ensure list1->repeated.length == list2->repeated.length. */
1510 unsigned int n1 = list1->repeated.length;
1511 unsigned int n2 = list2->repeated.length;
1518 /* Now list1->repeated.length = list2->repeated.length = lcm(n1,n2). */
1530 ASSERT (list1->repeated.length == list2->repeated.length);
1532 else if (list1->repeated.length > 0)
1539 if (list1->repeated.element[0].presence == FCT_REQUIRED)
1543 else if (list2->repeated.length > 0)
1550 if (list2->repeated.element[0].presence == FCT_REQUIRED)
1561 result->repeated.count = 0;
1562 result->repeated.allocated = 0;
1563 result->repeated.element = NULL;
1564 result->repeated.length = 0;
1608 ASSERT (list2->repeated.count == 0);
1648 ASSERT (list1->repeated.count == 0);
1687 if (list1->repeated.length > 0 && list2->repeated.length > 0)
1688 /* Step 5: Elementwise union of list1->repeated, list2->repeated. */
1695 e1 = list1->repeated.element; c1 = list1->repeated.count;
1696 e2 = list2->repeated.element; c2 = list2->repeated.count;
1701 /* Ensure room in result->repeated. */
1703 re = &result->repeated.element[result->repeated.count];
1709 result->repeated.count++;
1710 result->repeated.length += re->repcount;
1727 else if (list1->repeated.length > 0)
1730 initial segment. Just copy the repeated segment of list1. */
1733 result->repeated.count = list1->repeated.count;
1734 result->repeated.allocated = result->repeated.count;
1735 result->repeated.element =
1736 XNMALLOC (result->repeated.allocated, struct format_arg);
1737 for (i = 0; i < list1->repeated.count; i++)
1738 copy_element (&result->repeated.element[i],
1739 &list1->repeated.element[i]);
1740 result->repeated.length = list1->repeated.length;
1742 else if (list2->repeated.length > 0)
1745 initial segment. Just copy the repeated segment of list2. */
1748 result->repeated.count = list2->repeated.count;
1749 result->repeated.allocated = result->repeated.count;
1750 result->repeated.element =
1751 XNMALLOC (result->repeated.allocated, struct format_arg);
1752 for (i = 0; i < list2->repeated.count; i++)
1753 copy_element (&result->repeated.element[i],
1754 &list2->repeated.element[i]);
1755 result->repeated.length = list2->repeated.length;
1779 : list->repeated.count > 0
1780 && list->repeated.element[0].presence == FCT_REQUIRED)
1855 /* Walk the list->repeated segment. */
1856 if (list->repeated.count == 0)
1860 s < list->repeated.count && t >= list->repeated.element[s].repcount;
1861 t -= list->repeated.element[s].repcount, s++)
1862 if (list->repeated.element[s].presence != FCT_REQUIRED)
1868 if (s < list->repeated.count)
1870 if (list->repeated.element[s].presence != FCT_REQUIRED)
1876 /* The list->repeated segment consists only of FCT_REQUIRED. So,
1877 regardless how many more passes through list->repeated would be
1896 if (list->repeated.count == 0 && list->initial.length <= n)
1934 if (list->repeated.count == 0 && list->initial.length <= n)
1942 : /* n >= list->initial.length */ list->repeated.element[0].presence);
1951 for (i = 0; i < list->repeated.count; i++)
1952 free_element (&list->repeated.element[i]);
1953 if (list->repeated.element != NULL)
1954 free (list->repeated.element);
1955 list->repeated.element = NULL;
1956 list->repeated.allocated = 0;
1957 list->repeated.count = 0;
1958 list->repeated.length = 0;
2060 /* Create an endless repeated list whose elements are lists constrained
2079 listlist->repeated.count = 1;
2080 listlist->repeated.allocated = 1;
2081 listlist->repeated.element = XNMALLOC (1, struct format_arg);
2082 listlist->repeated.element[0].repcount = 1;
2083 listlist->repeated.element[0].presence = FCT_OPTIONAL;
2084 listlist->repeated.element[0].type = FAT_LIST;
2085 listlist->repeated.element[0].list = sublist;
2086 listlist->repeated.length = 1;
2095 /* Create an endless repeated list which represents the union of a finite
2118 if (sublist->repeated.count == 0)
2134 unsigned int Lp = sublist->repeated.length;
2140 /* Concatenate the initial and the repeated segments into a single
2142 tmp.count = sublist->initial.count + sublist->repeated.count;
2147 for (j = 0; j < sublist->repeated.count; i++, j++)
2149 tmp.length = sublist->initial.length + sublist->repeated.length;
2174 list->repeated.count = 0;
2175 list->repeated.allocated = 0;
2176 list->repeated.element = NULL;
2177 list->repeated.length = 0;
2280 /* Now split off the repeated part. */
2283 if (newcount > list->repeated.allocated)
2285 list->repeated.allocated = newcount;
2286 list->repeated.element = XNMALLOC (newcount, struct format_arg);
2289 list->repeated.element[j] = list->initial.element[i];
2290 list->repeated.count = newcount;
2291 list->repeated.length = p;
3512 if (list->repeated.count > 0)
3515 for (i = 0; i < list->repeated.count; i++)
3516 for (j = 0; j < list->repeated.element[i].repcount; j++)
3519 print_element (&list->repeated.element[i]);