| 316 | // that goes with the matched string, or -1 if the string is not found. |
| 317 | |
| 318 | int SzLookup(CONST StrLook *rgStrLook, CONST char *sz) |
| 319 | { |
| 320 | CONST char *pch1, *pch2; |
| 321 | int irg; |
| 322 | |
| 323 | for (irg = 0; rgStrLook[irg].isz >= 0; irg++) { |
| 324 | for (pch1 = sz, pch2 = rgStrLook[irg].sz; |
| 325 | *pch1 && ChCap(*pch1) == ChCap(*pch2); pch1++, pch2++) |
| 326 | ; |
| 327 | if (*pch1 == chNull && (*pch2 == chNull || pch1 - sz >= 3)) |
| 328 | return rgStrLook[irg].isz; |
| 329 | } |
| 330 | return -1; |
| 331 | } |
| 332 | |
| 333 | |
| 334 | // Return whether a zero terminated string is a substring of another string, |