Changeset 5618 for trunk/src/shlwapi/string_odin.cpp
- Timestamp:
- Apr 28, 2001, 3:33:49 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/shlwapi/string_odin.cpp
r4081 r5618 1 /* $Id: string_odin.cpp,v 1. 1 2000-08-24 09:32:44sandervl Exp $ */1 /* $Id: string_odin.cpp,v 1.2 2001-04-28 13:32:21 sandervl Exp $ */ 2 2 3 3 /* … … 200 200 ODINFUNCTION2(LPSTR, StrChrIA, 201 201 LPCSTR, lpStart, 202 CHAR, wMatch)202 WORD, wMatch) 203 203 { 204 204 LPSTR lpRes; … … 250 250 251 251 /***************************************************************************** 252 * Name : StrStrIA253 * Purpose : Finds the first occurrence of a substring within a string. The254 * comparison is not case sensitive.255 * Parameters: LPCSTR lpFirst256 * LPCSTR lpSrch257 * Variables :258 * Result : Returns the address of the first occurrence of the matching259 * substring if successful, or NULL otherwise.260 * Remark : SHELL32.261 * Status : COMPLETELY IMPLEMENTED UNTESTED UNKNOWN262 *263 * Author : Patrick Haller [Wed, 1999/12/29 09:00]264 *****************************************************************************/265 266 ODINFUNCTION2(LPSTR, StrStrIA,267 LPCSTR, lpFirst,268 LPCSTR, lpSrch)269 {270 char ch = lpSrch[0]; // look for 1st character271 LONG lLen = lstrlenA(lpSrch); // length of search string272 int iRes; // comparsion result273 274 do275 {276 lpFirst = StrChrIA(lpFirst, // find first matching character277 ch);278 if (NULL == lpFirst) // not found279 return NULL;280 281 iRes = StrCmpNIA((LPSTR)lpFirst, // compare search string282 (LPSTR)lpSrch,283 lLen);284 285 if (0 == iRes) // Found!286 return (LPSTR)lpFirst;287 288 lpFirst = CharNextA(lpFirst); // skip to next character289 }290 while (*lpFirst != 0); // safe termination291 292 return NULL; // default result293 }294 295 296 297 /*****************************************************************************298 * Name : StrStrIW299 * Purpose : Finds the first occurrence of a substring within a string. The300 * comparison is not case sensitive.301 * Parameters: LPCWSTR lpFirst302 * LPCWSTR lpSrch303 * Variables :304 * Result : Returns the address of the first occurrence of the matching305 * substring if successful, or NULL otherwise.306 * Remark : SHELL32.307 * Status : COMPLETELY IMPLEMENTED UNTESTED UNKNOWN308 *309 * Author : Patrick Haller [Wed, 1999/12/29 09:00]310 *****************************************************************************/311 312 ODINFUNCTION2(LPWSTR, StrStrIW,313 LPCWSTR, lpFirst,314 LPCWSTR, lpSrch)315 {316 WCHAR ch = lpSrch[0]; // look for 1st character317 LONG lLen = lstrlenW(lpSrch); // length of search string318 int iRes; // comparsion result319 320 do321 {322 lpFirst = StrChrIW(lpFirst, // find first matching character323 ch);324 if (NULL == lpFirst) // not found325 return NULL;326 327 iRes = StrCmpNIW((LPWSTR)lpFirst, // compare search string328 (LPWSTR)lpSrch,329 lLen);330 331 if (0 == iRes) // Found!332 return (LPWSTR)lpFirst;333 334 lpFirst = CharNextW(lpFirst); // skip to next character335 }336 while (*lpFirst != 0); // safe termination337 338 return NULL; // default result339 }340 341 342 343 344 345 346 /*****************************************************************************347 252 * Name : StrCpyA 348 253 * Purpose : copy a string
Note:
See TracChangeset
for help on using the changeset viewer.