string_ex.c
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:23k
源码类别:

DVD

开发平台:

Others

  1. /* **************************************************************************************
  2.  *  Copyright (c) 2000 ZORAN Corporation, All Rights Reserved
  3.  *  THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
  4.  *
  5.  *  File: "string_ex.c"                                            4/12/01
  6.  *
  7.  * Description:
  8.  * ============
  9.  * Special (non-ANSI) string operations
  10.  * 
  11.  * Log:
  12.  * ====
  13.  * $Revision: 2 $
  14.  * Last Modified by $Author: Leslie $ at $Modtime: 03-01-07 16:14 $ 
  15.  ****************************************************************************************
  16.  * Updates:
  17.  ****************************************************************************************
  18.  * $Log: /SourceCode/I64_Common/I64_Reference/Services/string_ex.c $
  19.  * 
  20.  * 2     03-01-10 12:25 Leslie
  21.  * Added _wcsnicmp(), _wcs2str(), _str2wcs()
  22.  * 
  23.  * 7     23/04/02 9:38 Nirm
  24.  * - Added dependency in "Config.h".
  25.  * 
  26.  * 6     4/10/02 4:59a Tomasp
  27.  * Added C locale table.
  28.  * 
  29.  * 5     4/10/02 4:41a Tomasp
  30.  * Added function for replacing unprintable characters.
  31.  * 
  32.  * 2     1/13/02 18:18 Ettim
  33.  * Moved the _isSimilarStrings() function to this file
  34.  * 
  35.  * 1     12/26/01 18:54 Ettim
  36.  * After updating nav_svcd.c & pe_cd.c
  37.  * 
  38.  * 3     17/04/01 15:02 Nirm
  39.  * Fixed a bug in _strnicmp().
  40.  * 
  41.  * 2     15/04/01 10:38 Nirm
  42.  * Fixed a bug in _strnicmp().
  43.  * 
  44.  * 1     12/04/01 18:45 Nirm
  45.  * Added string_ex_API.
  46.  **************************************************************************************** */
  47. #include "Config.h" // Global Configuration - do not remove!
  48. //Leslie_0521_2004_C: Following lines will block the release code comilation. We need them for both Debug and Release Projects
  49. //#if defined(_DEBUG) || defined(D_RELEASE_TRACE_ENABLED) // ZKR GL051004
  50. #include "IncludeSysDefs.h"
  51. #include "Includemath-macro.h"
  52. #include "Includestring_ex.h"
  53. /*
  54.  * The "C" locale ctype array
  55. */
  56. CONST unsigned char CharType[ 257 ] =
  57. {
  58.     0x00,                                /* 0xffff (-1) EOF */
  59.     _IS_CTL,                             /* 0x00 */
  60.     _IS_CTL,                             /* 0x01 */
  61.     _IS_CTL,                             /* 0x02 */
  62.     _IS_CTL,                             /* 0x03 */
  63.     _IS_CTL,                             /* 0x04 */
  64.     _IS_CTL,                             /* 0x05 */
  65.     _IS_CTL,                             /* 0x06 */
  66.     _IS_CTL,                             /* 0x07 */
  67.     _IS_CTL,                             /* 0x08 */
  68.     _IS_SP | _IS_CTL,                    /* 0x09 */
  69.     _IS_SP | _IS_CTL,                    /* 0x0a */
  70.     _IS_SP | _IS_CTL,                    /* 0x0b */
  71.     _IS_SP | _IS_CTL,                    /* 0x0c */
  72.     _IS_SP | _IS_CTL,                    /* 0x0d */
  73.     _IS_CTL,                             /* 0x0e */
  74.     _IS_CTL,                             /* 0x0f */
  75.     _IS_CTL,                             /* 0x10 */
  76.     _IS_CTL,                             /* 0x11 */
  77.     _IS_CTL,                             /* 0x12 */
  78.     _IS_CTL,                             /* 0x13 */
  79.     _IS_CTL,                             /* 0x14 */
  80.     _IS_CTL,                             /* 0x15 */
  81.     _IS_CTL,                             /* 0x16 */
  82.     _IS_CTL,                             /* 0x17 */
  83.     _IS_CTL,                             /* 0x18 */
  84.     _IS_CTL,                             /* 0x19 */
  85.     _IS_CTL,                             /* 0x1a */
  86.     _IS_CTL,                             /* 0x1b */
  87.     _IS_CTL,                             /* 0x1c */
  88.     _IS_CTL,                             /* 0x1d */
  89.     _IS_CTL,                             /* 0x1e */
  90.     _IS_CTL,                             /* 0x1f */
  91.     _IS_SP | _IS_BLK,                    /* 0x20 */
  92.     _IS_PUN,                             /* 0x21 */
  93.     _IS_PUN,                             /* 0x22 */
  94.     _IS_PUN,                             /* 0x23 */
  95.     _IS_PUN,                             /* 0x24 */
  96.     _IS_PUN,                             /* 0x25 */
  97.     _IS_PUN,                             /* 0x26 */
  98.     _IS_PUN,                             /* 0x27 */
  99.     _IS_PUN,                             /* 0x28 */
  100.     _IS_PUN,                             /* 0x29 */
  101.     _IS_PUN,                             /* 0x2a */
  102.     _IS_PUN,                             /* 0x2b */
  103.     _IS_PUN,                             /* 0x2c */
  104.     _IS_PUN,                             /* 0x2d */
  105.     _IS_PUN,                             /* 0x2e */
  106.     _IS_PUN,                             /* 0x2f */
  107.     _IS_DIG | _IS_HEX,                   /* 0x30 */
  108.     _IS_DIG | _IS_HEX,                   /* 0x31 */
  109.     _IS_DIG | _IS_HEX,                   /* 0x32 */
  110.     _IS_DIG | _IS_HEX,                   /* 0x33 */
  111.     _IS_DIG | _IS_HEX,                   /* 0x34 */
  112.     _IS_DIG | _IS_HEX,                   /* 0x35 */
  113.     _IS_DIG | _IS_HEX,                   /* 0x36 */
  114.     _IS_DIG | _IS_HEX,                   /* 0x37 */
  115.     _IS_DIG | _IS_HEX,                   /* 0x38 */
  116.     _IS_DIG | _IS_HEX,                   /* 0x39 */
  117.     _IS_PUN,                             /* 0x3a */
  118.     _IS_PUN,                             /* 0x3b */
  119.     _IS_PUN,                             /* 0x3c */
  120.     _IS_PUN,                             /* 0x3d */
  121.     _IS_PUN,                             /* 0x3e */
  122.     _IS_PUN,                             /* 0x3f */
  123.     _IS_PUN,                             /* 0x40 */
  124.     _IS_UPP | _IS_HEX,                   /* 0x41 */
  125.     _IS_UPP | _IS_HEX,                   /* 0x42 */
  126.     _IS_UPP | _IS_HEX,                   /* 0x43 */
  127.     _IS_UPP | _IS_HEX,                   /* 0x44 */
  128.     _IS_UPP | _IS_HEX,                   /* 0x45 */
  129.     _IS_UPP | _IS_HEX,                   /* 0x46 */
  130.     _IS_UPP,                             /* 0x47 */
  131.     _IS_UPP,                             /* 0x48 */
  132.     _IS_UPP,                             /* 0x49 */
  133.     _IS_UPP,                             /* 0x4a */
  134.     _IS_UPP,                             /* 0x4b */
  135.     _IS_UPP,                             /* 0x4c */
  136.     _IS_UPP,                             /* 0x4d */
  137.     _IS_UPP,                             /* 0x4e */
  138.     _IS_UPP,                             /* 0x4f */
  139.     _IS_UPP,                             /* 0x50 */
  140.     _IS_UPP,                             /* 0x51 */
  141.     _IS_UPP,                             /* 0x52 */
  142.     _IS_UPP,                             /* 0x53 */
  143.     _IS_UPP,                             /* 0x54 */
  144.     _IS_UPP,                             /* 0x55 */
  145.     _IS_UPP,                             /* 0x56 */
  146.     _IS_UPP,                             /* 0x57 */
  147.     _IS_UPP,                             /* 0x58 */
  148.     _IS_UPP,                             /* 0x59 */
  149.     _IS_UPP,                             /* 0x5a */
  150.     _IS_PUN,                             /* 0x5b */
  151.     _IS_PUN,                             /* 0x5c */
  152.     _IS_PUN,                             /* 0x5d */
  153.     _IS_PUN,                             /* 0x5e */
  154.     _IS_PUN,                             /* 0x5f */
  155.     _IS_PUN,                             /* 0x60 */
  156.     _IS_LOW | _IS_HEX,                   /* 0x61 */
  157.     _IS_LOW | _IS_HEX,                   /* 0x62 */
  158.     _IS_LOW | _IS_HEX,                   /* 0x63 */
  159.     _IS_LOW | _IS_HEX,                   /* 0x64 */
  160.     _IS_LOW | _IS_HEX,                   /* 0x65 */
  161.     _IS_LOW | _IS_HEX,                   /* 0x66 */
  162.     _IS_LOW,                             /* 0x67 */
  163.     _IS_LOW,                             /* 0x68 */
  164.     _IS_LOW,                             /* 0x69 */
  165.     _IS_LOW,                             /* 0x6a */
  166.     _IS_LOW,                             /* 0x6b */
  167.     _IS_LOW,                             /* 0x6c */
  168.     _IS_LOW,                             /* 0x6d */
  169.     _IS_LOW,                             /* 0x6e */
  170.     _IS_LOW,                             /* 0x6f */
  171.     _IS_LOW,                             /* 0x70 */
  172.     _IS_LOW,                             /* 0x71 */
  173.     _IS_LOW,                             /* 0x72 */
  174.     _IS_LOW,                             /* 0x73 */
  175.     _IS_LOW,                             /* 0x74 */
  176.     _IS_LOW,                             /* 0x75 */
  177.     _IS_LOW,                             /* 0x76 */
  178.     _IS_LOW,                             /* 0x77 */
  179.     _IS_LOW,                             /* 0x78 */
  180.     _IS_LOW,                             /* 0x79 */
  181.     _IS_LOW,                             /* 0x7a */
  182.     _IS_PUN,                             /* 0x7b */
  183.     _IS_PUN,                             /* 0x7c */
  184.     _IS_PUN,                             /* 0x7d */
  185.     _IS_PUN,                             /* 0x7e */
  186.     _IS_CTL,                             /* 0x7f */
  187.     0x00,                                /* 0x80 */
  188.     0x00,                                /* 0x81 */
  189.     0x00,                                /* 0x82 */
  190.     0x00,                                /* 0x83 */
  191.     0x00,                                /* 0x84 */
  192.     0x00,                                /* 0x85 */
  193.     0x00,                                /* 0x86 */
  194.     0x00,                                /* 0x87 */
  195.     0x00,                                /* 0x88 */
  196.     0x00,                                /* 0x89 */
  197.     0x00,                                /* 0x8a */
  198.     0x00,                                /* 0x8b */
  199.     0x00,                                /* 0x8c */
  200.     0x00,                                /* 0x8d */
  201.     0x00,                                /* 0x8e */
  202.     0x00,                                /* 0x8f */
  203.     0x00,                                /* 0x90 */
  204.     0x00,                                /* 0x91 */
  205.     0x00,                                /* 0x92 */
  206.     0x00,                                /* 0x93 */
  207.     0x00,                                /* 0x94 */
  208.     0x00,                                /* 0x95 */
  209.     0x00,                                /* 0x96 */
  210.     0x00,                                /* 0x97 */
  211.     0x00,                                /* 0x98 */
  212.     0x00,                                /* 0x99 */
  213.     0x00,                                /* 0x9a */
  214.     0x00,                                /* 0x9b */
  215.     0x00,                                /* 0x9c */
  216.     0x00,                                /* 0x9d */
  217.     0x00,                                /* 0x9e */
  218.     0x00,                                /* 0x9f */
  219.     0x00,                                /* 0xa0 */
  220.     0x00,                                /* 0xa1 */
  221.     0x00,                                /* 0xa2 */
  222.     0x00,                                /* 0xa3 */
  223.     0x00,                                /* 0xa4 */
  224.     0x00,                                /* 0xa5 */
  225.     0x00,                                /* 0xa6 */
  226.     0x00,                                /* 0xa7 */
  227.     0x00,                                /* 0xa8 */
  228.     0x00,                                /* 0xa9 */
  229.     0x00,                                /* 0xaa */
  230.     0x00,                                /* 0xab */
  231.     0x00,                                /* 0xac */
  232.     0x00,                                /* 0xad */
  233.     0x00,                                /* 0xae */
  234.     0x00,                                /* 0xaf */
  235.     0x00,                                /* 0xb0 */
  236.     0x00,                                /* 0xb1 */
  237.     0x00,                                /* 0xb2 */
  238.     0x00,                                /* 0xb3 */
  239.     0x00,                                /* 0xb4 */
  240.     0x00,                                /* 0xb5 */
  241.     0x00,                                /* 0xb6 */
  242.     0x00,                                /* 0xb7 */
  243.     0x00,                                /* 0xb8 */
  244.     0x00,                                /* 0xb9 */
  245.     0x00,                                /* 0xba */
  246.     0x00,                                /* 0xbb */
  247.     0x00,                                /* 0xbc */
  248.     0x00,                                /* 0xbd */
  249.     0x00,                                /* 0xbe */
  250.     0x00,                                /* 0xbf */
  251.     0x00,                                /* 0xc0 */
  252.     0x00,                                /* 0xc1 */
  253.     0x00,                                /* 0xc2 */
  254.     0x00,                                /* 0xc3 */
  255.     0x00,                                /* 0xc4 */
  256.     0x00,                                /* 0xc5 */
  257.     0x00,                                /* 0xc6 */
  258.     0x00,                                /* 0xc7 */
  259.     0x00,                                /* 0xc8 */
  260.     0x00,                                /* 0xc9 */
  261.     0x00,                                /* 0xca */
  262.     0x00,                                /* 0xcb */
  263.     0x00,                                /* 0xcc */
  264.     0x00,                                /* 0xcd */
  265.     0x00,                                /* 0xce */
  266.     0x00,                                /* 0xcf */
  267.     0x00,                                /* 0xd0 */
  268.     0x00,                                /* 0xd1 */
  269.     0x00,                                /* 0xd2 */
  270.     0x00,                                /* 0xd3 */
  271.     0x00,                                /* 0xd4 */
  272.     0x00,                                /* 0xd5 */
  273.     0x00,                                /* 0xd6 */
  274.     0x00,                                /* 0xd7 */
  275.     0x00,                                /* 0xd8 */
  276.     0x00,                                /* 0xd9 */
  277.     0x00,                                /* 0xda */
  278.     0x00,                                /* 0xdb */
  279.     0x00,                                /* 0xdc */
  280.     0x00,                                /* 0xdd */
  281.     0x00,                                /* 0xde */
  282.     0x00,                                /* 0xdf */
  283.     0x00,                                /* 0xe0 */
  284.     0x00,                                /* 0xe1 */
  285.     0x00,                                /* 0xe2 */
  286.     0x00,                                /* 0xe3 */
  287.     0x00,                                /* 0xe4 */
  288.     0x00,                                /* 0xe5 */
  289.     0x00,                                /* 0xe6 */
  290.     0x00,                                /* 0xe7 */
  291.     0x00,                                /* 0xe8 */
  292.     0x00,                                /* 0xe9 */
  293.     0x00,                                /* 0xea */
  294.     0x00,                                /* 0xeb */
  295.     0x00,                                /* 0xec */
  296.     0x00,                                /* 0xed */
  297.     0x00,                                /* 0xee */
  298.     0x00,                                /* 0xef */
  299.     0x00,                                /* 0xf0 */
  300.     0x00,                                /* 0xf1 */
  301.     0x00,                                /* 0xf2 */
  302.     0x00,                                /* 0xf3 */
  303.     0x00,                                /* 0xf4 */
  304.     0x00,                                /* 0xf5 */
  305.     0x00,                                /* 0xf6 */
  306.     0x00,                                /* 0xf7 */
  307.     0x00,                                /* 0xf8 */
  308.     0x00,                                /* 0xf9 */
  309.     0x00,                                /* 0xfa */
  310.     0x00,                                /* 0xfb */
  311.     0x00,                                /* 0xfc */
  312.     0x00,                                /* 0xfd */
  313.     0x00,                                /* 0xfe */
  314.     0x00                                 /* 0xff */
  315. };
  316. /////////////////////////////////////////////////////////////////////////////
  317. // _strnicmp()
  318. //
  319. // Description: Compares two single-byte strings in a case-insensitive fashion.
  320. //
  321. // Input: string1 - Points to a constant NULL-terminated string
  322. // string2 - Points to a constant NULL-terminated string
  323. // count - The maximal number of characters to compare
  324. // Output: None
  325. // In/Out: None
  326. // Return: Zero if the two strings match;
  327. // Negative if string1 < string2
  328. // Positive if string1 > string2
  329. //
  330. // Remarks:
  331. // The comparison is done lexicographically.
  332. int _strnicmp(const char *string1, const char *string2, int count)
  333. {
  334. unsigned int uPos= 0;
  335. int iAllowedDifference= ('A' - 'a');
  336. int iResult= 0;
  337. while ((uPos < count) && (0 != string1[uPos]) && (0 != string2[uPos])) {
  338. iResult= (string1[uPos] - string2[uPos]);
  339. if ((0 != iResult) && (iAllowedDifference != iResult) && (iAllowedDifference != -iResult))
  340. break;
  341. else
  342. iResult= 0;
  343. uPos++;
  344. }
  345. // Check if a match was found
  346. if ((0 == iResult) && (uPos != count)) {
  347. // The strings match, but are of different length - no real match
  348. if ((0 == string1[uPos]) && (0 != string2[uPos]))
  349. iResult= -1;
  350. else if ((0 == string2[uPos]) && (0 != string1[uPos]))
  351. iResult= 1;
  352. }
  353. return iResult;
  354. }
  355. /////////////////////////////////////////////////////////////////////////////
  356. // _wcsnicmp()
  357. //
  358. // Description: Compares two wide-character strings in a case-insensitive fashion.
  359. //
  360. // Input: wstring1 - Points to a constant NULL-terminated string
  361. // wstring2 - Points to a constant NULL-terminated string
  362. // count - The maximal number of characters to compare
  363. // Output: None
  364. // In/Out: None
  365. // Return: Zero if the two strings match;
  366. // Negative if string1 < string2
  367. // Positive if string1 > string2
  368. //
  369. // Remarks:
  370. // The comparison is done lexicographically.
  371. int _wcsnicmp(const wchar_t *wstring1, const wchar_t *wstring2, size_t count)
  372. {
  373. unsigned int uPos= 0;
  374. int iAllowedDifference= ('A' - 'a');
  375. int iResult= 0;
  376. while ((uPos < count) && (0 != wstring1[uPos]) && (0 != wstring2[uPos])) {
  377. iResult= (wstring1[uPos] - wstring2[uPos]);
  378. // MikeX_0203_2005: check the string must be character.
  379. if ((0 != iResult) && (((iAllowedDifference != iResult) && (iAllowedDifference != -iResult)) ||
  380. (((*wstring1<'a')||(*wstring1>'z'))&&((*wstring1<'A')||(*wstring1>'Z')))
  381. || (((*wstring2<'a')||(*wstring2>'z'))&&((*wstring2<'A')||(*wstring2>'Z')))) )
  382. break;
  383. else
  384. iResult= 0;
  385. uPos++;
  386. }
  387. // Check if a match was found
  388. if ((0 == iResult) && (uPos != count)) {
  389. // The strings match, but are of different length - no real match
  390. if ((0 == wstring1[uPos]) && (0 != wstring2[uPos]))
  391. iResult= -1;
  392. else if ((0 == wstring2[uPos]) && (0 != wstring1[uPos]))
  393. iResult= 1;
  394. }
  395. return iResult;
  396. }
  397. /////////////////////////////////////////////////////////////////////////////
  398. // _str2wcs()
  399. //
  400. // Description: Converts a single-byte string into a wide-character string.
  401. //
  402. // Input: pszSource - Points to the single-byte string to convert
  403. // cbDestSize - The size of the destination buffer, in bytes
  404. // Output: pszDest - Points to a wide-character buffer to receive the result
  405. // In/Out: None
  406. // Return: The destination buffer.
  407. //
  408. // Remarks:
  409. // - The source string and destination buffer must NOT point to the same
  410. //   physical memory.
  411. // - The source string is assumed to be ANSI-ASCII, and is converted 
  412. //   into UNICODE CS-0.
  413. // - The destination buffer must be at least twice the size of the
  414. //   source-string, in order to accomodate for the entire result.
  415. // - If the destination buffer is smaller than required, then only the
  416. //   portion of the source-string that fits into the buffer will be
  417. //   produced.
  418. // - The result is NULL-terminated.
  419. LPWSTR _str2wcs(LPCSTR pszSource, LPWSTR pszDest, unsigned int cbDestSize)
  420. {
  421. unsigned int uPos;
  422. // Copy the source string to the destination, one character at a time
  423. for (uPos=0; uPos < ((cbDestSize / sizeof(WCHAR)) - 1); uPos++) {
  424. if (0 == pszSource[uPos])
  425. break;
  426. pszDest[uPos]= (WCHAR)pszSource[uPos];
  427. }
  428. // NULL-terminate the destination
  429. pszDest[uPos]= 0;
  430. return pszDest;
  431. }
  432. /////////////////////////////////////////////////////////////////////////////
  433. // _wcs2str()
  434. //
  435. // Description: Converts a wide-character string into a single-byte string.
  436. //
  437. // Input: pszSource - Points to the wide-character string to convert
  438. // cbDestSize - The size of the destination buffer, in bytes
  439. // Output: pszDest - Points to a character buffer to receive the result
  440. // In/Out: None
  441. // Return: The destination buffer.
  442. //
  443. // Remarks:
  444. // - The source string and destination buffer must may point to the same
  445. //   physical memory.
  446. // - The source string is assumed to be UNICODE CS-0, and is converted 
  447. //   into ANSI-ASCII.
  448. // - The destination buffer must be at least half the size of the
  449. //   source-string (in bytes), in order to accomodate for the entire result.
  450. // - If the destination buffer is smaller than required, then only the
  451. //   portion of the source-string that fits into the buffer will be
  452. //   produced.
  453. // - The result is NULL-terminated.
  454. LPSTR _wcs2str(LPCWSTR pszSource, LPSTR pszDest, unsigned int cbDestSize)
  455. {
  456. unsigned int uPos;
  457. // Convert each wide-character into a single-byte by taking the LS Byte
  458. for (uPos=0; uPos < (cbDestSize - 1); uPos++) {
  459. if (0 == pszSource[uPos])
  460. break;
  461. pszDest[uPos]= (char)(pszSource[uPos] & 0xFF);
  462. }
  463. // NULL-terminate the destination
  464. pszDest[uPos]= 0;
  465. return pszDest;
  466. }
  467. /////////////////////////////////////////////////////////////////////////////
  468. // _isSimilarStrings()
  469. //
  470. // Description: Compares a string against a reference-string, to determine 
  471. // their similarity.
  472. //
  473. // Input: pszString - Points to a constant NULL-terminated string to test
  474. // pszRefString - Points to a constant NULL-terminated string, which
  475. // is the reference to test against.
  476. // Output: None
  477. // In/Out: None
  478. // Return: TRUE if the supplied string is similar to the reference-string;
  479. // FALSE otherwise.
  480. //
  481. // Remarks:
  482. // - The comparison is case-sensitive;
  483. // - Similarity is determined by a predefined tolerance.
  484. // - Two strings are considered similar if they have at least 
  485. //   SIMILARITY_TOLERANCE consecutive characters which are identical.
  486. #define SIMILARITY_TOLERANCE 3
  487. BOOL _isSimilarStrings(LPCSTR pszString, LPCSTR pszRefString)
  488. {
  489. UINT16 uRefLength= strlen(pszRefString);
  490. UINT16 uCurrPos;
  491. LPCSTR pszStrPos= pszString;
  492. // First of all, try a perfect match
  493. if (0 == strncmp(pszString, pszRefString, SIMILARITY_TOLERANCE))
  494. return TRUE;
  495. // Try partial matching (similarity only)
  496. for (uCurrPos=0; uCurrPos < (uRefLength - SIMILARITY_TOLERANCE + 1); uCurrPos++) {
  497. if (0 == strncmp(pszStrPos++, pszRefString++, SIMILARITY_TOLERANCE))
  498. return TRUE;
  499. }
  500. return FALSE;
  501. }
  502. /////////////////////////////////////////////////////////////////////////////
  503. // convertStringToPrintable ()
  504. //
  505. // Description: function replaces all non printable characters in string
  506. // with character defined by NON_PRINTABLE_CHARACTER macro
  507. //
  508. // Input: None
  509. // Output: None
  510. // In/Out: pszString - pointer to NULL-terminated string
  511. // Return: None
  512. // Remarks:
  513. void convertStringToPrintable (LPSTR pszString)
  514. {
  515. LPSTR pszName;
  516.   for (pszName = pszString;*pszName;pszName++)
  517.    {
  518.     if (!IsPrint(*((unsigned char*)pszName)))
  519.       *pszName = NON_PRINTABLE_CHARACTER;
  520.    }
  521. }
  522. //Leslie_0521_2004_C: Comment Out
  523. //#endif // #if defined(_DEBUG) || defined(D_RELEASE_TRACE_ENABLED) // ZKR GL051004