Home | History | Annotate | Download | only in collationperf

Lines Matching refs:Line

20 //      A file of names is required as input, one per line.  It must be in utf-8 or utf-16 format,
102 // Command line option variables
104 // on the command line by the user.
138 // Definitions for the command line options
187 // struct Line
189 // Each line from the source file (containing a name, presumably) gets
192 struct Line {
203 Line *gFileLines; // Ptr to array of Line structs, one per line in the file.
208 Line **gSortedLines;
209 Line **gRandomLines;
216 // ProcessOptions() Function to read the command line options.
278 int t = strcmp((*(Line **)a)->icuSortKey, (*(Line **)b)->icuSortKey);
286 t = ucol_strcoll(gCol, (*(Line **)a)->name, (*(Line **)a)->len, (*(Line **)b)->name, (*(Line **)b)->len);
296 t = ucol_strcoll(gCol, (*(Line **)a)->name, -1, (*(Line **)b)->name, -1);
306 t = CompareStringW(gWinLCID, 0, (*(Line **)a)->name, -1, (*(Line **)b)->name, -1);
314 t = strcoll((*(Line **)a)->unixName, (*(Line **)b)->unixName);
322 t = CompareStringW(gWinLCID, 0, (*(Line **)a)->name, (*(Line **)a)->len, (*(Line **)b)->name, (*(Line **)b)->len);
329 int t = strcmp((*(Line **)a)->winSortKey, (*(Line **)b)->winSortKey);
342 char *ask = (*(Line **)a)->icuSortKey;
343 char *bsk = (*(Line **)b)->icuSortKey;
370 int line;
386 for (line=0; line < gNumFileLines; line++) {
388 len = gFileLines[line].len;
392 gFileLines[line].name, len,
393 (unsigned short *)gFileLines[line].winSortKey, 5000); // TODO something with length.
401 for (line=0; line < gNumFileLines; line++) {
403 len = gFileLines[line].len;
406 t = ucol_getSortKey(gCol, gFileLines[line].name, len, (unsigned char *)gFileLines[line].icuSortKey, 5000);
414 for (line=0; line < gNumFileLines; line++) {
416 t = strxfrm(gFileLines[line].unixSortKey, gFileLines[line].unixName, 5000);
435 for (line=0; line<gNumFileLines; line++) {
436 totalChars += u_strlen(gFileLines[line].name);
438 totalKeyLen += strlen(gFileLines[line].winSortKey);
441 totalKeyLen += strlen(gFileLines[line].icuSortKey);
444 totalKeyLen += strlen(gFileLines[line].unixSortKey);
467 int line;
496 for (line=0; line < gNumFileLines; line++) {
506 r = (*pf)((gSortedLines[line])->name, (gSortedLines[guess])->name);
529 for (line=0; line < gNumFileLines; line++) {
533 lineLen = (gSortedLines[line])->len;
546 ri = strcmp((gSortedLines[line])->icuSortKey, (gSortedLines[guess])->icuSortKey);
557 r = ucol_strcoll(gCol, (gSortedLines[line])->name, lineLen, (gSortedLines[guess])->name, guessLen);
580 for (line=0; line < gNumFileLines; line++) {
584 lineLen = (gSortedLines[line])->len;
596 r = strcmp((gSortedLines[line])->winSortKey, (gSortedLines[guess])->winSortKey);
607 r = CompareStringW(gWinLCID, 0, (gSortedLines[line])->name, lineLen, (gSortedLines[guess])->name, guessLen);
619 if (r == 1) // line < guess
621 else // line > guess
636 for (line=0; line < gNumFileLines; line++) {
647 r = strcmp((gSortedLines[line])->unixSortKey, (gSortedLines[guess])->unixSortKey);
654 r = strcoll((gSortedLines[line])->unixName, (gSortedLines[guess])->unixName);
665 if (r < 0) // line < guess
667 else // line > guess
699 Line **sortBuf = new Line *[gNumFileLines];
712 memcpy(sortBuf, gRandomLines, gNumFileLines * sizeof(Line *));
713 qsort(sortBuf, gNumFileLines, sizeof(Line *), WinstrcmpK);
719 memcpy(sortBuf, gRandomLines, gNumFileLines * sizeof(Line *));
720 qsort(sortBuf, gNumFileLines, sizeof(Line *), WinstrcmpL);
727 memcpy(sortBuf, gRandomLines, gNumFileLines * sizeof(Line *));
728 qsort(sortBuf, gNumFileLines, sizeof(Line *), Winstrcmp);
734 memcpy(sortBuf, gRandomLines, gNumFileLines * sizeof(Line *));
735 qsort(sortBuf, gNumFileLines, sizeof(Line *), ICUstrcmpK);
741 memcpy(sortBuf, gRandomLines, gNumFileLines * sizeof(Line *));
742 qsort(sortBuf, gNumFileLines, sizeof(Line *), ICUstrcmpL);
749 memcpy(sortBuf, gRandomLines, gNumFileLines * sizeof(Line *));
750 qsort(sortBuf, gNumFileLines, sizeof(Line *), ICUstrcmp);
756 memcpy(sortBuf, gRandomLines, gNumFileLines * sizeof(Line *));
757 qsort(sortBuf, gNumFileLines, sizeof(Line *), UNIXstrcmp);
1160 int line;
1172 for (line=0; line < gNumFileLines; line++) {
1176 gFileLines[line].name,
1184 gFileLines[line].unixName = new char[sizeNeeded+1];
1186 gFileLines[line].unixName, // ptr to target buffer.
1188 gFileLines[line].name,
1195 gFileLines[line].unixName[sizeNeeded] = 0;
1368 // openRulesCollator - Command line specified a rules file. Read it in
1415 // Main -- process command line, read in and pre-process the test file,
1529 // Lines go onto heap buffers. Global index array to line starts is created.
1539 gFileLines = new Line[MAXLINES];
1556 // Watch for CR, LF, EOF; these finish off a line.
1561 if (f.eof() || c == 0x0a || c==0x2028) { // Unipad inserts 2028 line separators!
1585 fprintf(stderr, "Warning - file line longer than 1023 chars truncated.\n");
1605 int line;
1608 for (line=0; line<gNumFileLines; line++) {
1609 t = ucol_getSortKey(gCol, gFileLines[line].name, -1, (unsigned char *)buf, sizeof(buf));
1610 gFileLines[line].icuSortKey = new char[t];
1613 t = ucol_getSortKey(gCol, gFileLines[line].name, -1, (unsigned char *)gFileLines[line].icuSortKey , t);
1617 memcpy(gFileLines[line].icuSortKey, buf, t);
1626 for (line=0; line<gNumFileLines; line++) {
1627 t=LCMapStringW(gWinLCID, LCMAP_SORTKEY, gFileLines[line].name, -1, buf, sizeof(buf));
1628 gFileLines[line].winSortKey = new char[t];
1630 t = LCMapStringW(gWinLCID, LCMAP_SORTKEY, gFileLines[line].name, -1, (unsigned short *)(gFileLines[line].winSortKey), t);
1634 memcpy(gFileLines[line].winSortKey, buf, t);
1642 for (line=0; line<gNumFileLines; line++) {
1643 t=strxfrm((char *)buf, gFileLines[line].unixName, sizeof(buf));
1644 gFileLines[line].unixSortKey = new char[t];
1646 t = strxfrm(gFileLines[line].unixSortKey, gFileLines[line].unixName, sizeof(buf));
1650 memcpy(gFileLines[line].unixSortKey, buf, t);
1661 for (line=0; line<gNumFileLines; line++) {
1663 UChar c = gFileLines[line].name[i];
1676 UCollationElements *CEiter = ucol_openElements(gCol, gFileLines[line].name, -1, &status);
1696 unsigned char c = gFileLines[line].icuSortKey[i];
1714 gSortedLines = new Line *[gNumFileLines];
1720 qsort(gSortedLines, gNumFileLines, sizeof(Line *), Winstrcmp);
1723 qsort(gSortedLines, gNumFileLines, sizeof(Line *), UNIXstrcmp);
1727 qsort(gSortedLines, gNumFileLines, sizeof(Line *), ICUstrcmp);
1734 gRandomLines = new Line *[gNumFileLines];
1738 qsort(gRandomLines, gNumFileLines, sizeof(Line *), ICURandomCmp);