• 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

73 			    arguments are often repeated.  */
97 an initial segment and an endlessly repeated loop segment.
102 struct segment repeated; /* Endlessly repeated segment. */
174 ASSERT (list->repeated.count <= list->repeated.allocated);
176 for (i = 0; i < list->repeated.count; i++)
178 verify_element (&list->repeated.element[i]);
179 total_repcount += list->repeated.element[i].repcount;
181 ASSERT (total_repcount == list->repeated.length);
209 for (i = 0; i < list->repeated.count; i++)
210 free_element (&list->repeated.element[i]);
211 if (list->repeated.element != NULL)
212 free (list->repeated.element);
261 newlist->repeated.count = newlist->repeated.allocated = list->repeated.count;
263 if (list->repeated.count == 0)
264 newlist->repeated.element = NULL;
267 newlist->repeated.element =
268 XNMALLOC (newlist->repeated.allocated, struct format_arg);
269 for (i = 0; i < list->repeated.count; i++)
271 copy_element (&newlist->repeated.element[i],
272 &list->repeated.element[i]);
273 length += list->repeated.element[i].repcount;
276 ASSERT (length == list->repeated.length);
277 newlist->repeated.length = length;
320 n = list1->repeated.count;
321 if (n != list2->repeated.count)
325 const struct format_arg * e1 = &list1->repeated.element[i];
326 const struct format_arg * e2 = &list2->repeated.element[i];
368 /* Ensure list->repeated.allocated >= newcount. */
372 if (newcount > list->repeated.allocated)
374 list->repeated.allocated =
375 MAX (2 * list->repeated.allocated + 1, newcount);
376 list->repeated.element =
378 xrealloc (list->repeated.element,
379 list->repeated.allocated * sizeof (struct format_arg));
383 /* Ensure list->repeated.allocated > list->repeated.count. */
387 if (list->repeated.count >= list->repeated.allocated)
389 list->repeated.allocated =
390 MAX (2 * list->repeated.allocated + 1, list->repeated.count + 1);
391 list->repeated.element =
393 xrealloc (list->repeated.element,
394 list->repeated.allocated * sizeof (struct format_arg));
430 n = list->repeated.count;
433 && equal_element (&list->repeated.element[i],
434 &list->repeated.element[j-1]))
436 list->repeated.element[j-1].repcount +=
437 list->repeated.element[i].repcount;
438 free_element (&list->repeated.element[i]);
443 list->repeated.element[j] = list->repeated.element[i];
446 list->repeated.count = j;
449 if (list->repeated.count > 0)
454 n = list->repeated.count;
457 && equal_element (&list->repeated.element[0],
458 &list->repeated.element[n-1]))
460 repcount0_extra = list->repeated.element[n-1].repcount;
464 list->repeated.element[0].repcount incremented by repcount0_extra. */
472 if (!((list->repeated.element[i].repcount
474 == list->repeated.element[i+m].repcount)
475 && equal_element (&list->repeated.element[i],
476 &list->repeated.element[i+m])))
484 free_element (&list->repeated.element[i]);
485 if (n < list->repeated.count)
486 list->repeated.element[m] = list->repeated.element[n];
487 list->repeated.count = list->repeated.count - n + m;
488 list->repeated.length /= n / m;
495 if (list->repeated.count == 1)
499 &list->repeated.element[0]))
513 &list->repeated.element[list->repeated.count-1]))
517 list->repeated.element[list->repeated.count-1].repcount);
519 /* Add the element at the start of list->repeated. */
520 if (equal_element (&list->repeated.element[0],
521 &list->repeated.element[list->repeated.count-1]))
522 list->repeated.element[0].repcount += moved_repcount;
525 unsigned int newcount = list->repeated.count + 1;
528 list->repeated.element[i] = list->repeated.element[i-1];
529 list->repeated.count = newcount;
530 copy_element (&list->repeated.element[0],
531 &list->repeated.element[list->repeated.count-1]);
532 list->repeated.element[0].repcount = moved_repcount;
535 /* Remove the element from the end of list->repeated. */
536 list->repeated.element[list->repeated.count-1].repcount -=
538 if (list->repeated.element[list->repeated.count-1].repcount == 0)
540 free_element (&list->repeated.element[list->repeated.count-1]);
541 list->repeated.count--;
572 n = list->repeated.count;
574 if (list->repeated.element[i].type == FAT_LIST)
575 normalize_list (list->repeated.element[i].list);
602 list->repeated.count = 1;
603 list->repeated.allocated = 1;
604 list->repeated.element = XNMALLOC (1, struct format_arg);
605 list->repeated.element[0].repcount = 1;
606 list->repeated.element[0].presence = FCT_OPTIONAL;
607 list->repeated.element[0].type = FAT_OBJECT;
608 list->repeated.length = 1;
628 list->repeated.count = 0;
629 list->repeated.allocated = 0;
630 list->repeated.element = NULL;
631 list->repeated.length = 0;
644 return (list->initial.count == 0 && list->repeated.count == 0);
650 /* Unfold list->repeated m times, where m >= 1.
651 Assumes list->repeated.count > 0. */
660 unsigned int newcount = list->repeated.count * m;
662 i = list->repeated.count;
664 for (j = 0; j < list->repeated.count; j++, i++)
665 copy_element (&list->repeated.element[i], &list->repeated.element[j]);
666 list->repeated.count = newcount;
667 list->repeated.length = list->repeated.length * m;
672 Assumes list->repeated.count > 0. */
680 if (list->repeated.count == 1)
682 /* Instead of multiple copies of list->repeated.element[0], a single
689 copy_element (&list->initial.element[i], &list->repeated.element[0]);
696 unsigned int n = list->repeated.length;
702 /* Determine how many entries of list->repeated are needed for
708 s < list->repeated.count && t >= list->repeated.element[s].repcount;
709 t -= list->repeated.element[s].repcount, s++)
712 /* s must be < list->repeated.count, otherwise r would have been >= n. */
713 ASSERT (s < list->repeated.count);
716 q full copies of list->repeated,
717 plus the s first elements of list->repeated,
718 plus, if t > 0, a splitoff of list->repeated.element[s]. */
723 newcount = i + q * list->repeated.count + s + (t > 0 ? 1 : 0);
726 for (j = 0; j < list->repeated.count; j++, i++)
728 &list->repeated.element[j]);
730 copy_element (&list->initial.element[i], &list->repeated.element[j]);
734 &list->repeated.element[j]);
742 + q * list->repeated.length
743 + list->repeated[0..s-1].repcount + t
750 /* And rotate list->repeated. */
756 oldcount = list->repeated.count;
757 newcount = list->repeated.count + (t > 0 ? 1 : 0);
761 newelement[i] = list->repeated.element[j];
763 newelement[i] = list->repeated.element[j];
770 free (list->repeated.element);
771 list->repeated.element = newelement;
794 ASSERT (list->repeated.count > 0);
843 ASSERT (list->repeated.count > 0);
1041 /* Append list->repeated to list->initial, and clear list->repeated. */
1046 if (list->repeated.count > 0)
1048 /* Move list->repeated over to list->initial. */
1051 newcount = list->initial.count + list->repeated.count;
1054 for (j = 0; j < list->repeated.count; j++, i++)
1055 list->initial.element[i] = list->repeated.element[j];
1057 list->initial.length = list->initial.length + list->repeated.length;
1058 free (list->repeated.element);
1059 list->repeated.element = NULL;
1060 list->repeated.allocated = 0;
1061 list->repeated.count = 0;
1062 list->repeated.length = 0;
1067 The list consists only of an initial segment. The repeated segment is
1075 ASSERT (list->repeated.count == 0);
1121 if (list1->repeated.length > 0 && list2->repeated.length > 0)
1122 /* Step 1: Ensure list1->repeated.length == list2->repeated.length. */
1124 unsigned int n1 = list1->repeated.length;
1125 unsigned int n2 = list2->repeated.length;
1132 /* Now list1->repeated.length = list2->repeated.length = lcm(n1,n2). */
1135 if (list1->repeated.length > 0 || list2->repeated.length > 0)
1138 repeated segment, this means to ensure
1143 if (list1->repeated.length > 0)
1145 if (list2->repeated.length > 0)
1149 if (list1->repeated.length > 0 && list2->repeated.length > 0)
1152 ASSERT (list1->repeated.length == list2->repeated.length);
1161 result->repeated.count = 0;
1162 result->repeated.allocated = 0;
1163 result->repeated.element = NULL;
1164 result->repeated.length = 0;
1211 if (list1->repeated.count == 0 && list2->repeated.count == 0)
1230 else if (list1->repeated.count == 0)
1234 if ((c2 > 0 ? e2->presence : list2->repeated.element[0].presence)
1240 else if (list2->repeated.count == 0)
1244 if ((c1 > 0 ? e1->presence : list1->repeated.element[0].presence)
1254 /* Step 5: Elementwise intersection of list1->repeated, list2->repeated. */
1261 e1 = list1->repeated.element; c1 = list1->repeated.count;
1262 e2 = list2->repeated.element; c2 = list2->repeated.count;
1267 /* Ensure room in result->repeated. */
1269 re = &result->repeated.element[result->repeated.count];
1285 result->repeated.count++;
1286 result->repeated.length += re->repcount;
1328 : list->repeated.count > 0
1329 && list->repeated.element[0].presence == FCT_REQUIRED)
1483 if (list1->repeated.length > 0 && list2->repeated.length > 0)
1485 /* Step 1: Ensure list1->repeated.length == list2->repeated.length. */
1487 unsigned int n1 = list1->repeated.length;
1488 unsigned int n2 = list2->repeated.length;
1495 /* Now list1->repeated.length = list2->repeated.length = lcm(n1,n2). */
1507 ASSERT (list1->repeated.length == list2->repeated.length);
1509 else if (list1->repeated.length > 0)
1516 if (list1->repeated.element[0].presence == FCT_REQUIRED)
1520 else if (list2->repeated.length > 0)
1527 if (list2->repeated.element[0].presence == FCT_REQUIRED)
1538 result->repeated.count = 0;
1539 result->repeated.allocated = 0;
1540 result->repeated.element = NULL;
1541 result->repeated.length = 0;
1585 ASSERT (list2->repeated.count == 0);
1625 ASSERT (list1->repeated.count == 0);
1664 if (list1->repeated.length > 0 && list2->repeated.length > 0)
1665 /* Step 5: Elementwise union of list1->repeated, list2->repeated. */
1672 e1 = list1->repeated.element; c1 = list1->repeated.count;
1673 e2 = list2->repeated.element; c2 = list2->repeated.count;
1678 /* Ensure room in result->repeated. */
1680 re = &result->repeated.element[result->repeated.count];
1686 result->repeated.count++;
1687 result->repeated.length += re->repcount;
1704 else if (list1->repeated.length > 0)
1707 initial segment. Just copy the repeated segment of list1. */
1710 result->repeated.count = list1->repeated.count;
1711 result->repeated.allocated = result->repeated.count;
1712 result->repeated.element =
1713 XNMALLOC (result->repeated.allocated, struct format_arg);
1714 for (i = 0; i < list1->repeated.count; i++)
1715 copy_element (&result->repeated.element[i],
1716 &list1->repeated.element[i]);
1717 result->repeated.length = list1->repeated.length;
1719 else if (list2->repeated.length > 0)
1722 initial segment. Just copy the repeated segment of list2. */
1725 result->repeated.count = list2->repeated.count;
1726 result->repeated.allocated = result->repeated.count;
1727 result->repeated.element =
1728 XNMALLOC (result->repeated.allocated, struct format_arg);
1729 for (i = 0; i < list2->repeated.count; i++)
1730 copy_element (&result->repeated.element[i],
1731 &list2->repeated.element[i]);
1732 result->repeated.length = list2->repeated.length;
1756 : list->repeated.count > 0
1757 && list->repeated.element[0].presence == FCT_REQUIRED)
1832 /* Walk the list->repeated segment. */
1833 if (list->repeated.count == 0)
1837 s < list->repeated.count && t >= list->repeated.element[s].repcount;
1838 t -= list->repeated.element[s].repcount, s++)
1839 if (list->repeated.element[s].presence != FCT_REQUIRED)
1845 if (s < list->repeated.count)
1847 if (list->repeated.element[s].presence != FCT_REQUIRED)
1853 /* The list->repeated segment consists only of FCT_REQUIRED. So,
1854 regardless how many more passes through list->repeated would be
1873 if (list->repeated.count == 0 && list->initial.length <= n)
1911 if (list->repeated.count == 0 && list->initial.length <= n)
1919 : /* n >= list->initial.length */ list->repeated.element[0].presence);
1928 for (i = 0; i < list->repeated.count; i++)
1929 free_element (&list->repeated.element[i]);
1930 if (list->repeated.element != NULL)
1931 free (list->repeated.element);
1932 list->repeated.element = NULL;
1933 list->repeated.allocated = 0;
1934 list->repeated.count = 0;
1935 list->repeated.length = 0;
2037 /* Create an endless repeated list whose elements are lists constrained
2056 listlist->repeated.count = 1;
2057 listlist->repeated.allocated = 1;
2058 listlist->repeated.element = XNMALLOC (1, struct format_arg);
2059 listlist->repeated.element[0].repcount = 1;
2060 listlist->repeated.element[0].presence = FCT_OPTIONAL;
2061 listlist->repeated.element[0].type = FAT_LIST;
2062 listlist->repeated.element[0].list = sublist;
2063 listlist->repeated.length = 1;
2072 /* Create an endless repeated list which represents the union of a finite
2095 if (sublist->repeated.count == 0)
2111 unsigned int Lp = sublist->repeated.length;
2117 /* Concatenate the initial and the repeated segments into a single
2119 tmp.count = sublist->initial.count + sublist->repeated.count;
2124 for (j = 0; j < sublist->repeated.count; i++, j++)
2126 tmp.length = sublist->initial.length + sublist->repeated.length;
2151 list->repeated.count = 0;
2152 list->repeated.allocated = 0;
2153 list->repeated.element = NULL;
2154 list->repeated.length = 0;
2257 /* Now split off the repeated part. */
2260 if (newcount > list->repeated.allocated)
2262 list->repeated.allocated = newcount;
2263 list->repeated.element = XNMALLOC (newcount, struct format_arg);
2266 list->repeated.element[j] = list->initial.element[i];
2267 list->repeated.count = newcount;
2268 list->repeated.length = p;
3589 if (list->repeated.count > 0)
3592 for (i = 0; i < list->repeated.count; i++)
3593 for (j = 0; j < list->repeated.element[i].repcount; j++)
3596 print_element (&list->repeated.element[i]);