Host library for controlling a WiConnect enabled Wi-Fi module.
Dependents: wiconnect-ota_example wiconnect-web_setup_example wiconnect-test-console wiconnect-tcp_server_example ... more
Diff: doc/html/_string_util_8h_source.html
- Revision:
- 21:17bb3eddcbae
- Parent:
- 17:7268f365676b
- Child:
- 26:8067e3d463d3
diff -r 7b67c3f94de9 -r 17bb3eddcbae doc/html/_string_util_8h_source.html --- a/doc/html/_string_util_8h_source.html Sat Aug 23 05:57:52 2014 -0700 +++ b/doc/html/_string_util_8h_source.html Tue Aug 26 16:38:19 2014 -0700 @@ -374,110 +374,119 @@ <div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  <span class="keyword">static</span> <span class="keywordtype">bool</span> strToUint32(<span class="keyword">const</span> <span class="keywordtype">char</span> *str, uint32_t *uint32Ptr)</div> <div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  {</div> <div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  intmax_t r;</div> -<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  <span class="keywordtype">bool</span> result = StringUtil::parseInt(str, &r, 0, UINT_MAX);</div> +<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  <span class="keywordtype">bool</span> result = StringUtil::parseInt(str, &r, 0, UINT32_MAX);</div> <div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  *uint32Ptr = (uint32_t)r;</div> <div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  <span class="keywordflow">return</span> result;</div> <div class="line"><a name="l00304"></a><span class="lineno"> 304</span>  }</div> <div class="line"><a name="l00305"></a><span class="lineno"> 305</span> </div> <div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  <span class="comment">/*************************************************************************************************/</span></div> -<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>  <span class="keyword">static</span> <span class="keywordtype">bool</span> strToInt32(<span class="keyword">const</span> <span class="keywordtype">char</span> *str, int32_t *int32Ptr)</div> +<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>  <span class="keyword">static</span> <span class="keywordtype">bool</span> strToUint16(<span class="keyword">const</span> <span class="keywordtype">char</span> *str, uint16_t *uint16Ptr)</div> <div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  {</div> <div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  intmax_t r;</div> -<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  <span class="keywordtype">bool</span> result = StringUtil::parseInt(str, &r, INT_MIN, INT_MAX);</div> -<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  *int32Ptr = (int32_t)r;</div> +<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  <span class="keywordtype">bool</span> result = StringUtil::parseInt(str, &r, 0, UINT16_MAX);</div> +<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  *uint16Ptr = (uint16_t)r;</div> <div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  <span class="keywordflow">return</span> result;</div> <div class="line"><a name="l00313"></a><span class="lineno"> 313</span>  }</div> <div class="line"><a name="l00314"></a><span class="lineno"> 314</span> </div> <div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  <span class="comment">/*************************************************************************************************/</span></div> -<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  <span class="comment">// uint32 hex string to uint32</span></div> -<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  <span class="keyword">static</span> <span class="keywordtype">bool</span> strHexToUint32(<span class="keyword">const</span> <span class="keywordtype">char</span> *strHex, uint32_t *uint32Ptr)</div> -<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  {</div> -<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>  intmax_t r;</div> -<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  <span class="keywordtype">bool</span> result = StringUtil::parseHex(strHex, &r, 0, UINT_MAX);</div> -<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  *uint32Ptr = (uint32_t)r;</div> -<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>  <span class="keywordflow">return</span> result;</div> -<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  }</div> -<div class="line"><a name="l00324"></a><span class="lineno"> 324</span> </div> -<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>  <span class="comment">/*************************************************************************************************/</span></div> -<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>  <span class="keyword">static</span> <span class="keywordtype">char</span> *strtok_r(<span class="keywordtype">char</span> *str, <span class="keyword">const</span> <span class="keywordtype">char</span> *delim, <span class="keywordtype">char</span> **nextp)</div> +<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  <span class="keyword">static</span> <span class="keywordtype">bool</span> strToInt32(<span class="keyword">const</span> <span class="keywordtype">char</span> *str, int32_t *int32Ptr)</div> +<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  {</div> +<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  intmax_t r;</div> +<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>  <span class="keywordtype">bool</span> result = StringUtil::parseInt(str, &r, INT32_MIN, INT32_MAX);</div> +<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  *int32Ptr = (int32_t)r;</div> +<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  <span class="keywordflow">return</span> result;</div> +<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>  }</div> +<div class="line"><a name="l00323"></a><span class="lineno"> 323</span> </div> +<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  <span class="comment">/*************************************************************************************************/</span></div> +<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>  <span class="comment">// uint32 hex string to uint32</span></div> +<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>  <span class="keyword">static</span> <span class="keywordtype">bool</span> strHexToUint32(<span class="keyword">const</span> <span class="keywordtype">char</span> *strHex, uint32_t *uint32Ptr)</div> <div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  {</div> -<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>  <span class="keywordtype">char</span> *ret;</div> -<div class="line"><a name="l00329"></a><span class="lineno"> 329</span> </div> -<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>  <span class="keywordflow">if</span> (str == NULL)</div> -<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>  {</div> -<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>  str = *nextp;</div> -<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>  }</div> -<div class="line"><a name="l00334"></a><span class="lineno"> 334</span> </div> -<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>  str += strspn(str, delim);</div> -<div class="line"><a name="l00336"></a><span class="lineno"> 336</span> </div> -<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  <span class="keywordflow">if</span> (*str == <span class="charliteral">'\0'</span>)</div> -<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>  {</div> -<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  <span class="keywordflow">return</span> NULL;</div> -<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>  }</div> -<div class="line"><a name="l00341"></a><span class="lineno"> 341</span> </div> -<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  ret = str;</div> +<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>  intmax_t r;</div> +<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  <span class="keywordtype">bool</span> result = StringUtil::parseHex(strHex, &r, 0, UINT32_MAX);</div> +<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>  *uint32Ptr = (uint32_t)r;</div> +<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>  <span class="keywordflow">return</span> result;</div> +<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>  }</div> +<div class="line"><a name="l00333"></a><span class="lineno"> 333</span> </div> +<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>  <span class="comment">/*************************************************************************************************/</span></div> +<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>  <span class="keyword">static</span> <span class="keywordtype">char</span> *strtok_r(<span class="keywordtype">char</span> *str, <span class="keyword">const</span> <span class="keywordtype">char</span> *delim, <span class="keywordtype">char</span> **nextp)</div> +<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>  {</div> +<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  <span class="keywordtype">char</span> *ret;</div> +<div class="line"><a name="l00338"></a><span class="lineno"> 338</span> </div> +<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  <span class="keywordflow">if</span> (str == NULL)</div> +<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>  {</div> +<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  str = *nextp;</div> +<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  }</div> <div class="line"><a name="l00343"></a><span class="lineno"> 343</span> </div> -<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>  str += strcspn(str, delim);</div> +<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>  str += strspn(str, delim);</div> <div class="line"><a name="l00345"></a><span class="lineno"> 345</span> </div> -<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>  <span class="keywordflow">if</span> (*str)</div> +<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>  <span class="keywordflow">if</span> (*str == <span class="charliteral">'\0'</span>)</div> <div class="line"><a name="l00347"></a><span class="lineno"> 347</span>  {</div> -<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  *str++ = <span class="charliteral">'\0'</span>;</div> +<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  <span class="keywordflow">return</span> NULL;</div> <div class="line"><a name="l00349"></a><span class="lineno"> 349</span>  }</div> <div class="line"><a name="l00350"></a><span class="lineno"> 350</span> </div> -<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  *nextp = str;</div> +<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  ret = str;</div> <div class="line"><a name="l00352"></a><span class="lineno"> 352</span> </div> -<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>  <span class="keywordflow">return</span> ret;</div> -<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>  }</div> -<div class="line"><a name="l00355"></a><span class="lineno"> 355</span> </div> -<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>  <span class="comment">/*************************************************************************************************/</span></div> -<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  <span class="keyword">static</span> <span class="keywordtype">int</span> strncasecmp(<span class="keyword">const</span> <span class="keywordtype">char</span> *s1, <span class="keyword">const</span> <span class="keywordtype">char</span> *s2, <span class="keywordtype">int</span> n)</div> -<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>  {</div> -<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  <span class="keywordflow">if</span> (n == 0)</div> -<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  <span class="keywordflow">return</span> 0;</div> +<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>  str += strcspn(str, delim);</div> +<div class="line"><a name="l00354"></a><span class="lineno"> 354</span> </div> +<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>  <span class="keywordflow">if</span> (*str)</div> +<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>  {</div> +<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  *str++ = <span class="charliteral">'\0'</span>;</div> +<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>  }</div> +<div class="line"><a name="l00359"></a><span class="lineno"> 359</span> </div> +<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  *nextp = str;</div> <div class="line"><a name="l00361"></a><span class="lineno"> 361</span> </div> -<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>  <span class="keywordflow">while</span> (n-- != 0 && tolower(*s1) == tolower(*s2))</div> -<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>  {</div> -<div class="line"><a name="l00364"></a><span class="lineno"> 364</span>  <span class="keywordflow">if</span> (n == 0 || *s1 == <span class="charliteral">'\0'</span> || *s2 == <span class="charliteral">'\0'</span>)</div> -<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>  <span class="keywordflow">break</span>;</div> -<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  s1++;</div> -<div class="line"><a name="l00367"></a><span class="lineno"> 367</span>  s2++;</div> -<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>  }</div> -<div class="line"><a name="l00369"></a><span class="lineno"> 369</span> </div> -<div class="line"><a name="l00370"></a><span class="lineno"> 370</span>  <span class="keywordflow">return</span> tolower(*(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *) s1) - tolower(*(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *) s2);</div> -<div class="line"><a name="l00371"></a><span class="lineno"> 371</span>  }</div> -<div class="line"><a name="l00372"></a><span class="lineno"> 372</span> </div> -<div class="line"><a name="l00373"></a><span class="lineno"> 373</span>  <span class="comment">/*************************************************************************************************/</span></div> -<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>  <span class="keyword">static</span> <span class="keywordtype">int</span> strcasecmp(<span class="keyword">const</span> <span class="keywordtype">char</span> *s1, <span class="keyword">const</span> <span class="keywordtype">char</span> *s2)</div> -<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>  {</div> -<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>  <span class="keyword">register</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *p1 = (<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *) s1;</div> -<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>  <span class="keyword">register</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *p2 = (<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *) s2;</div> -<div class="line"><a name="l00378"></a><span class="lineno"> 378</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> c1, c2;</div> -<div class="line"><a name="l00379"></a><span class="lineno"> 379</span> </div> -<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  <span class="keywordflow">if</span> (p1 == p2)</div> -<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>  <span class="keywordflow">return</span> 0;</div> -<div class="line"><a name="l00382"></a><span class="lineno"> 382</span> </div> -<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>  <span class="keywordflow">do</span></div> -<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>  {</div> -<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>  c1 = tolower (*p1);</div> -<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>  c2 = tolower (*p2);</div> -<div class="line"><a name="l00387"></a><span class="lineno"> 387</span> </div> -<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>  <span class="keywordflow">if</span> (c1 == <span class="charliteral">'\0'</span>)</div> -<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>  <span class="keywordflow">break</span>;</div> -<div class="line"><a name="l00390"></a><span class="lineno"> 390</span> </div> -<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>  ++p1;</div> -<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>  ++p2;</div> -<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>  }</div> -<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>  <span class="keywordflow">while</span> (c1 == c2);</div> -<div class="line"><a name="l00395"></a><span class="lineno"> 395</span> </div> -<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>  <span class="keywordflow">if</span> (UCHAR_MAX <= INT_MAX)</div> -<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>  <span class="keywordflow">return</span> c1 - c2;</div> -<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>  <span class="keywordflow">else</span></div> -<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>  <span class="comment">/* On machines where 'char' and 'int' are types of the same size, the</span></div> -<div class="line"><a name="l00400"></a><span class="lineno"> 400</span> <span class="comment"> difference of two 'unsigned char' values - including the sign bit -</span></div> -<div class="line"><a name="l00401"></a><span class="lineno"> 401</span> <span class="comment"> doesn't fit in an 'int'. */</span></div> -<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>  <span class="keywordflow">return</span> (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);</div> -<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>  }</div> -<div class="line"><a name="l00404"></a><span class="lineno"> 404</span> };</div> +<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>  <span class="keywordflow">return</span> ret;</div> +<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>  }</div> +<div class="line"><a name="l00364"></a><span class="lineno"> 364</span> </div> +<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>  <span class="comment">/*************************************************************************************************/</span></div> +<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  <span class="keyword">static</span> <span class="keywordtype">int</span> strncasecmp(<span class="keyword">const</span> <span class="keywordtype">char</span> *s1, <span class="keyword">const</span> <span class="keywordtype">char</span> *s2, <span class="keywordtype">int</span> n)</div> +<div class="line"><a name="l00367"></a><span class="lineno"> 367</span>  {</div> +<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>  <span class="keywordflow">if</span> (n == 0)</div> +<div class="line"><a name="l00369"></a><span class="lineno"> 369</span>  <span class="keywordflow">return</span> 0;</div> +<div class="line"><a name="l00370"></a><span class="lineno"> 370</span> </div> +<div class="line"><a name="l00371"></a><span class="lineno"> 371</span>  <span class="keywordflow">while</span> (n-- != 0 && tolower(*s1) == tolower(*s2))</div> +<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>  {</div> +<div class="line"><a name="l00373"></a><span class="lineno"> 373</span>  <span class="keywordflow">if</span> (n == 0 || *s1 == <span class="charliteral">'\0'</span> || *s2 == <span class="charliteral">'\0'</span>)</div> +<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>  <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>  s1++;</div> +<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>  s2++;</div> +<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>  }</div> +<div class="line"><a name="l00378"></a><span class="lineno"> 378</span> </div> +<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>  <span class="keywordflow">return</span> tolower(*(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *) s1) - tolower(*(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *) s2);</div> +<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  }</div> +<div class="line"><a name="l00381"></a><span class="lineno"> 381</span> </div> +<div class="line"><a name="l00382"></a><span class="lineno"> 382</span>  <span class="comment">/*************************************************************************************************/</span></div> +<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>  <span class="keyword">static</span> <span class="keywordtype">int</span> strcasecmp(<span class="keyword">const</span> <span class="keywordtype">char</span> *s1, <span class="keyword">const</span> <span class="keywordtype">char</span> *s2)</div> +<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>  {</div> +<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>  <span class="keyword">register</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *p1 = (<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *) s1;</div> +<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>  <span class="keyword">register</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *p2 = (<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *) s2;</div> +<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> c1, c2;</div> +<div class="line"><a name="l00388"></a><span class="lineno"> 388</span> </div> +<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>  <span class="keywordflow">if</span> (p1 == p2)</div> +<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>  <span class="keywordflow">return</span> 0;</div> +<div class="line"><a name="l00391"></a><span class="lineno"> 391</span> </div> +<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>  <span class="keywordflow">do</span></div> +<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>  {</div> +<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>  c1 = tolower (*p1);</div> +<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>  c2 = tolower (*p2);</div> +<div class="line"><a name="l00396"></a><span class="lineno"> 396</span> </div> +<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>  <span class="keywordflow">if</span> (c1 == <span class="charliteral">'\0'</span>)</div> +<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>  <span class="keywordflow">break</span>;</div> +<div class="line"><a name="l00399"></a><span class="lineno"> 399</span> </div> +<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>  ++p1;</div> +<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  ++p2;</div> +<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>  }</div> +<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>  <span class="keywordflow">while</span> (c1 == c2);</div> +<div class="line"><a name="l00404"></a><span class="lineno"> 404</span> </div> +<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>  <span class="keywordflow">if</span> (UCHAR_MAX <= INT_MAX)</div> +<div class="line"><a name="l00406"></a><span class="lineno"> 406</span>  <span class="keywordflow">return</span> c1 - c2;</div> +<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>  <span class="keywordflow">else</span></div> +<div class="line"><a name="l00408"></a><span class="lineno"> 408</span>  <span class="comment">/* On machines where 'char' and 'int' are types of the same size, the</span></div> +<div class="line"><a name="l00409"></a><span class="lineno"> 409</span> <span class="comment"> difference of two 'unsigned char' values - including the sign bit -</span></div> +<div class="line"><a name="l00410"></a><span class="lineno"> 410</span> <span class="comment"> doesn't fit in an 'int'. */</span></div> +<div class="line"><a name="l00411"></a><span class="lineno"> 411</span>  <span class="keywordflow">return</span> (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);</div> +<div class="line"><a name="l00412"></a><span class="lineno"> 412</span>  }</div> +<div class="line"><a name="l00413"></a><span class="lineno"> 413</span> };</div> <div class="ttc" id="class_string_util_html"><div class="ttname"><a href="class_string_util.html">StringUtil</a></div><div class="ttdef"><b>Definition:</b> <a href="_string_util_8h_source.html#l00045">StringUtil.h:45</a></div></div> <div class="ttc" id="group__api__core__macro_html_ga77baa56c8d3584b953f0a2626e6844ad"><div class="ttname"><a href="group__api__core__macro.html#ga77baa56c8d3584b953f0a2626e6844ad">ARRAY_COUNT</a></div><div class="ttdeci">#define ARRAY_COUNT(x)</div><div class="ttdoc">Return number of elements in static array x. </div><div class="ttdef"><b>Definition:</b> <a href="_wiconnect_types_8h_source.html#l00084">WiconnectTypes.h:84</a></div></div> </div><!-- fragment --></div><!-- contents -->