home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ssvpar.zip / SSDBCS.INL < prev    next >
Text File  |  1994-12-14  |  1KB  |  50 lines

  1. /*---------------------------------------------------------------------------
  2.  
  3.                Copyright (c) 1994 SandStone Software Inc.
  4.                           All rights reserved
  5.  
  6. ----------------------------------------------------------------------------*/
  7. #if defined( __OS2__)
  8.  
  9.    SSInline SSBooleanValue SSDbcsInfo::isLeadByte( char qchByte)
  10.       {
  11.       if ( isascii( qchByte)) return SSFalse;
  12.       char* zpchLead = oachDbcs;
  13.       while ( *zpchLead)
  14.          {
  15.          if ( qchByte >= *zpchLead && qchByte <= *( zpchLead + 1))
  16.             return SSTrue;
  17.          zpchLead += 2;
  18.          }
  19.  
  20.       return SSFalse;
  21.       }
  22.  
  23. #else
  24.  
  25.    extern "C"
  26.       {
  27.       int _far _pascal IsDBCSLeadByte( unsigned char);
  28.       }
  29.  
  30.    SSInline SSBooleanValue SSDbcsInfo::isLeadByte( char qchByte)
  31.       {
  32.       return IsDBCSLeadByte( qchByte) ? SSTrue : SSFalse;
  33.       }
  34.  
  35. #endif
  36.  
  37.    SSInline SSDbcsInfo::SSDbcsInfo( void)
  38.       {
  39.       memset( oachDbcs, 0, sizeof oachDbcs);
  40.       set();
  41.       }
  42.  
  43.    SSInline SSUnsigned32 SSDbcsInfo::asUnsigned32( const char* qpchDbcs)
  44.       {
  45.       unsigned long zulCurrent = *qpchDbcs & 0x000000ff;
  46.       zulCurrent <<= 8;
  47.       zulCurrent |= *( qpchDbcs + 1);
  48.       return zulCurrent;
  49.       }
  50.