2015-06-26 14:18 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* include/harbour.hbx
  * src/rtl/cdpapihb.c
    + added new PRG function:
          hb_cdpIsCharIdx( [ <cCdpID> ] [, <lNewMode>] ) -> <lPrevMode>
      It returns .T. when given codepage uses custom character indexes
      instead of byte indexes.
      If <cCdpID> is not specified then current HVM codepage is used.
      Optional logical parameter <lNewMode> allows to enable/disable
      custom character indexes in codepages which have such functionality,
      i.e. UTF8, BIG5, CP950.

  * src/rtl/rtlshort.c
    * removed __QUITCANCEL() - this function does not exist in Cl*pper.
This commit is contained in:
Przemysław Czerpak
2015-06-26 14:18:23 +02:00
parent 6349d223b4
commit aa76a355db
4 changed files with 36 additions and 1 deletions

View File

@@ -10,6 +10,21 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2015-06-26 14:18 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/harbour.hbx
* src/rtl/cdpapihb.c
+ added new PRG function:
hb_cdpIsCharIdx( [ <cCdpID> ] [, <lNewMode>] ) -> <lPrevMode>
It returns .T. when given codepage uses custom character indexes
instead of byte indexes.
If <cCdpID> is not specified then current HVM codepage is used.
Optional logical parameter <lNewMode> allows to enable/disable
custom character indexes in codepages which have such functionality,
i.e. UTF8, BIG5, CP950.
* src/rtl/rtlshort.c
* removed __QUITCANCEL() - this function does not exist in Cl*pper.
2015-06-25 16:25 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/pp/ppcore.c
! fixed compilation of initial files passed without path

View File

@@ -339,6 +339,7 @@ DYNAMIC hb_CDay
DYNAMIC hb_cdpCharMax
DYNAMIC hb_cdpExists
DYNAMIC hb_cdpInfo
DYNAMIC hb_cdpIsCharIdx
DYNAMIC hb_cdpIsUTF8
DYNAMIC hb_cdpList
DYNAMIC hb_cdpOS

View File

@@ -112,6 +112,26 @@ HB_FUNC( HB_CDPINFO )
hb_retc( cdp ? cdp->info : NULL );
}
HB_FUNC( HB_CDPISCHARIDX )
{
const char * id = hb_parc( 1 );
PHB_CODEPAGE cdp = id ? hb_cdpFindExt( id ) : hb_vmCDP();
HB_BOOL fResult = HB_FALSE;
if( cdp )
{
fResult = HB_CDP_ISCHARIDX( cdp );
if( HB_CDP_ISCUSTOM( cdp ) && HB_ISLOG( 2 ) )
{
if( hb_parl( 1 ) )
cdp->type |= HB_CDP_TYPE_CHARIDX;
else
cdp->type &= ~HB_CDP_TYPE_CHARIDX;
}
}
hb_retl( fResult );
}
HB_FUNC( HB_CDPCHARMAX )
{
hb_retnl( ( 1 << ( ( int ) ( hb_cdpIsUTF8( hb_cdpFindExt( hb_parc( 1 ) ) ) ? sizeof( HB_WCHAR ) : sizeof( HB_UCHAR ) ) * 8 ) ) - 1 );

View File

@@ -70,7 +70,6 @@ HB_FUNC_TRANSLATE( __CAPMETRI, __CAPMETRICS )
HB_FUNC_TRANSLATE( __LABELFOR, __LABELFORM )
HB_FUNC_TRANSLATE( __MXRELEAS, __MXRELEASE )
HB_FUNC_TRANSLATE( __NONOALER, __NONOALERT )
HB_FUNC_TRANSLATE( __QUITCANC, __QUITCANCEL )
HB_FUNC_TRANSLATE( __REPORTFO, __REPORTFORM )
HB_FUNC_TRANSLATE( __SETCENTU, __SETCENTURY )
HB_FUNC_TRANSLATE( __SETFORMA, __SETFORMAT )