From: Klaus S. <sin...@us...> - 2006-11-27 19:39:59
|
Update of /cvsroot/bidwatcher/bidwatcher In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25100 Modified Files: Tag: STABLE_1_3 helpers.cpp Log Message: changed numbering of token to speed up parsing: frequently tokens first Index: helpers.cpp =================================================================== RCS file: /cvsroot/bidwatcher/bidwatcher/Attic/helpers.cpp,v retrieving revision 1.90.2.75 retrieving revision 1.90.2.76 diff -u -d -r1.90.2.75 -r1.90.2.76 --- helpers.cpp 24 Nov 2006 12:00:04 -0000 1.90.2.75 +++ helpers.cpp 27 Nov 2006 19:39:49 -0000 1.90.2.76 @@ -55,27 +55,26 @@ const char * const CheckPrice="0123456789.$,"; // Characters allowed in a price -const char * const SearchOps[2][21]={{ // new <- old - "Starting bid", // 1 <- 3 - "Quantity", // 2 <- 4 - "Item location", // 3 <- 7 - "High bid", // 4 <- 11 - "This is a ", // 5 <- 13 - "Current bid", // 6 <- 16 - "Starting bid", // 7 <- 17 - "History", // 8 <- 22 - "Winning bid:", // 9 <- 23 - "Winning bidder:", // 10 <- 24 - "Sold for", // 11 <- 25 - "Buyer:", // 13 <- 26 - "Bidding has ended", // 13 <- 27 - "(Approximately", // 14 <- 30 - "Ended:", // 15 <- 31 - "Shipping, payment details and return policy", // 16 <- 32 - "price:", // 17 <- 35 - "Score:", // 18 <- 37 - "Seller:", // 19 <- 38 - "End time:", // 20 <- 39 +const char * const SearchOps[2][20]={{ // new <- new <- old + "(Approximately", // 1 <- 14 <- 30 + "Starting bid", // 2 <- 1 <- 3 + "Shipping, payment details and return policy", // 3 <- 16 <- 32 + "Current bid", // 4 <- 6 <- 16 + "Item location", // 5 <- 3 <- 7 + "Seller:", // 6 <- 19 <- 38 + "Score:", // 7 <- 18 <- 37 + "History", // 8 <- 8 <- 22 + "End time:", // 9 <- 20 <- 39 + "High bid", // 10 <- 4 <- 11 + "price:", // 11 <- 17 <- 35 + "Ended:", // 12 <- 15 <- 31 + "Bidding has ended", // 13 <- 13 <- 27 + "Quantity", // 14 <- 2 <- 4 + "Winning bid:", // 15 <- 9 <- 23 + "Winning bidder:", // 16 <- 10 <- 24 + "This is a ", // 17 <- 5 <- 13 + "Buyer:", // 18 <- 12 <- 26 + "Sold for", // 19 <- 11 <- 25 "*"}, /* eBay Motors */ { "Currently", // 1 @@ -1293,14 +1292,13 @@ case TYPE_EBAYMOTORS: //non-car auctions are the same case TYPE_EBAY: switch (matchedPhrase) { - case 16: // shipping + handling + case 3: // shipping + handling getShipHandling32(streamBuff, LineBuffer.buf(), LineBuffer.size(), Shipping, ShippingCur, sizeof(Shipping) / sizeof(Shipping[0])); break; - case 6: - case 7: - case 9: - case 11: // "Sold for" + case 4: + case 15: + case 19: // "Sold for" if (!bid_flag) { DPRINTF(DLOW, ("LDCB: %s\n", LineBuffer.buf())); if (!parseprice(LineBuffer.buf(), this, FALSE)) @@ -1324,14 +1322,14 @@ } break; - case 1: // Starting bid: EUR 1.99 + case 2: // Starting bid: EUR 1.99 if (!FirstBid && !first_flag) { parseprice(LineBuffer.buf(), this, TRUE); if (!CurrentBid) CurrentBid = FirstBid; } break; - case 14: + case 1: if (!strstr(LineBuffer.buf(), "(Approximately")) break; if (!FirstBid && !first_flag && strnzcmp(LineBuffer.buf(), "(Approximately")) { @@ -1348,7 +1346,7 @@ } break; - case 17: // "price:" + case 11: // "price:" DPRINTF(DLOW, ("This is a BuyItNow\n")); if (!buynow_flag) { buynow_flag = 1; @@ -1381,7 +1379,7 @@ } break; - case 2: // quantity + case 14: // quantity if (!Quantity && !quant_flag) { quant_flag=1; if (strchr(LineBuffer.buf(), ':')) @@ -1428,7 +1426,7 @@ ended_early =1; // if the item has ended it is obviously not endless. break; - case 3: // location + case 5: // location if (!Location[0]) { char *p; if (!strchr(LineBuffer.buf(), ',')) { @@ -1448,7 +1446,7 @@ } } break; - case 20: // "End time:" + case 9: // "End time:" // has 3 possibilities of string: // 1. "End time:10 hours 7 mins" // " (Mar-08-06 12:52:47 PST)" @@ -1467,7 +1465,7 @@ EndsValue = CalcEndsValue(Ends); } break; - case 15: // "Ended:" looks like this: + case 12: // "Ended:" looks like this: // Ended: Nov-16-06 13:43:36 PST if (!Ends[0]) { char *p; @@ -1481,7 +1479,7 @@ isEndless = 0; } break; - case 19: // Seller: + case 6: // Seller: //Line looks currently like this 2006-09-21: "Seller: somename( 55) " if (!Seller[0]) { char *p; @@ -1541,7 +1539,7 @@ STRNZCPY(Feedbackn,"NONE"); } break; - case 18: // Score: + case 7: // Score: // Example: Score: 1762 | 99.9% Positive // Example: Score: Private | 97.0% Positive if (!Feedbackn[0]) { @@ -1598,9 +1596,9 @@ DPRINTF(DLOW, ("Score: Feedbackn= >%s<\n", Feedbackn)); } break; - case 4: // high bidder id - case 10: - case 12: // "Buyer:" + case 10: // high bidder id + case 16: + case 18: // "Buyer:" if (!HighBidder[0]) { char *p; p = strchr(LineBuffer.buf(), ':'); @@ -1654,12 +1652,12 @@ } break; - //case 12: idx=GetLineOfData(idx, 1024, LineBuffer.buf(), Buff); + //case ??: idx=GetLineOfData(idx, 1024, LineBuffer.buf(), Buff); // CheckBadChars(LineBuffer.buf(), CheckPrice); // STRNZCPY(BidInc, LineBuffer.buf()); // break; - case 5: // dutch auction + case 17: // dutch auction if (strncmp(LineBuffer.buf(), "This is a private listing.", 26) == 0) break; streamBuff.getline(LineBuffer.buf(), LineBuffer.size(), '\n'); |