diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d8cb7e4f82..2280c5fde1 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,42 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ +2007-06-23 11:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/rtl/gtchrmap.c + * harbour/source/rtl/gttrm/Makefile + * harbour/source/rtl/gttrm/gttrm.c + + set Id keyword property + + * harbour/source/common/expropt1.c + ! fixed typo in HB_TRACE() parameters + + * harbour/include/hbapicdp.h + * harbour/include/hbapirdd.h + * harbour/source/rtl/strcase.c + * harbour/source/rtl/is.c + * harbour/source/rtl/gtxwc/gtxwc.h + * harbour/source/rtl/gtxwc/gtxwc.c + * harbour/source/rtl/gtstd/gtstd.c + * harbour/source/rtl/gtsln/gtsln.c + * harbour/source/rtl/gtsln/gtsln.h + * harbour/source/rtl/gtpca/gtpca.c + * harbour/source/rtl/gtcgi/gtcgi.c + * harbour/source/rdd/dbfcdx/dbfcdx1.c + * harbour/source/vm/hvm.c + ! fixed compilation with HB_CDP_SUPPORT_OFF - I do not plan to + create such builds but now these macro allow to easy locate + CDP dependent code + + * harbour/include/hbextern.ch + * harbour/source/rtl/cdpapi.c + + added two prg functions for translations from/to UTF-8: + HB_STRTOUTF8( [, ] ) -> + HB_UTF8TOSTR( [, ] ) -> + is Harbour codepage id, f.e.: "EN", "ES", "ESWIN", + "PLISO", "PLMAZ", "PL852", "PLWIN", ... + When not given then default HVM codepage (set by HB_SETCODEPAGE()) + is used. + 2007-06-22 16:25 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/bin/pack_src.sh + added GTTRM to compressed file list diff --git a/harbour/include/hbapicdp.h b/harbour/include/hbapicdp.h index e124814d1b..9690165a31 100644 --- a/harbour/include/hbapicdp.h +++ b/harbour/include/hbapicdp.h @@ -53,9 +53,10 @@ #ifndef HB_APICDP_H_ #define HB_APICDP_H_ +#include + #ifndef HB_CDP_SUPPORT_OFF -#include #include "hbapi.h" #include "hbinit.h" @@ -197,7 +198,7 @@ HB_EXTERN_END #else -typedef PHB_CODEPAGE void * +typedef void * PHB_CODEPAGE; #endif /* HB_CDP_SUPPORT_OFF */ diff --git a/harbour/include/hbapirdd.h b/harbour/include/hbapirdd.h index 85c65d4ef1..e8d817a849 100644 --- a/harbour/include/hbapirdd.h +++ b/harbour/include/hbapirdd.h @@ -56,16 +56,10 @@ #include "hbapifs.h" #include "dbinfo.ch" /* Constants for SELF_ORDINFO, SELF_INFO(), SELF_RECINFO() */ #include "dbstruct.ch" /* Constants for SELF_FIELDINFO() */ -#ifndef HB_CDP_SUPPORT_OFF #include "hbapicdp.h" -#endif HB_EXTERN_BEGIN -#ifdef HB_CDP_SUPPORT_OFF - typedef void * PHB_CODEPAGE -#endif - #define HARBOUR_MAX_RDD_DRIVERNAME_LENGTH 32 #ifndef HARBOUR_MAX_RDD_ALIAS_LENGTH diff --git a/harbour/include/hbextern.ch b/harbour/include/hbextern.ch index 24f0ff84cd..3a99a6627e 100644 --- a/harbour/include/hbextern.ch +++ b/harbour/include/hbextern.ch @@ -348,6 +348,8 @@ EXTERNAL HB_LANGSELECT EXTERNAL HB_SETCODEPAGE EXTERNAL HB_TRANSLATE EXTERNAL HB_CDPLIST +EXTERNAL HB_STRTOUTF8 +EXTERNAL HB_UTF8TOSTR #endif EXTERNAL HB_OSNEWLINE EXTERNAL HB_PVALUE diff --git a/harbour/source/common/expropt1.c b/harbour/source/common/expropt1.c index 23938faa9c..f40a96f05b 100644 --- a/harbour/source/common/expropt1.c +++ b/harbour/source/common/expropt1.c @@ -443,7 +443,7 @@ HB_EXPR_PTR hb_compExprNewCodeBlock( char *string, ULONG ulLen, int iFlags, HB_C { HB_EXPR_PTR pExpr; - HB_TRACE(HB_TR_DEBUG, ("hb_compExprNewCodeBlock(%s,%d,%d,%p)",string, iLen, iFlags, HB_COMP_PARAM)); + HB_TRACE(HB_TR_DEBUG, ("hb_compExprNewCodeBlock(%s,%lu,%d,%p)",string, ulLen, iFlags, HB_COMP_PARAM)); pExpr = HB_COMP_EXPR_NEW( HB_ET_CODEBLOCK ); diff --git a/harbour/source/rdd/dbfcdx/dbfcdx1.c b/harbour/source/rdd/dbfcdx/dbfcdx1.c index 7ec3b3141e..692602cfc7 100644 --- a/harbour/source/rdd/dbfcdx/dbfcdx1.c +++ b/harbour/source/rdd/dbfcdx/dbfcdx1.c @@ -405,6 +405,8 @@ static void hb_cdxMakeSortTab( CDXAREAP pArea ) pArea->bCdxSortTab[pbSort[i]] = i; hb_xfree( pbSort ); } +#else + HB_SYMBOL_UNUSED( pArea ); #endif } @@ -654,6 +656,8 @@ static LPCDXKEY hb_cdxKeyPutItem( LPCDXKEY pKey, PHB_ITEM pItem, ULONG ulRec, LP #ifndef HB_CDP_SUPPORT_OFF if ( fTrans && pTag->uiType == 'C' ) hb_cdpnTranslate( ( char * ) pKey->val, hb_cdp_page, pTag->pIndex->pArea->cdPage, pKey->len ); +#else + HB_SYMBOL_UNUSED( fTrans ); #endif return pKey; } @@ -681,6 +685,8 @@ static PHB_ITEM hb_cdxKeyGetItem( LPCDXKEY pKey, PHB_ITEM pItem, LPCDXTAG pTag, pItem = hb_itemPutCPtr( pItem, pVal, pKey->len ); } else +#else + HB_SYMBOL_UNUSED( fTrans ); #endif { pItem = hb_itemPutCL( pItem, ( char * ) pKey->val, pKey->len ); diff --git a/harbour/source/rtl/cdpapi.c b/harbour/source/rtl/cdpapi.c index 03cb0e057c..d5935f852b 100644 --- a/harbour/source/rtl/cdpapi.c +++ b/harbour/source/rtl/cdpapi.c @@ -1040,5 +1040,49 @@ HB_FUNC( HB_CDPLIST ) } } +HB_FUNC( HB_STRTOUTF8 ) +{ + ULONG ulLen = hb_parclen( 1 ), ulDest = 0; + char * szString, * szDest = NULL; + + if( ulLen ) + { + PHB_CODEPAGE cdp = ISCHAR( 2 ) ? hb_cdpFind( hb_parc( 2 ) ) : hb_cdp_page; + if( cdp ) + { + szString = hb_parc( 1 ); + ulDest = hb_cdpStringInUTF8Length( cdp, FALSE, ( BYTE * ) szString, ulLen ); + szDest = ( char * ) hb_xgrab( ulDest + 1 ); + hb_cdpStrnToUTF8( cdp, FALSE, ( BYTE * ) szString, ulLen, ( BYTE * ) szDest ); + } + } + if( szDest ) + hb_retclen_buffer( szDest, ulDest ); + else + hb_retc( NULL ); +} + +HB_FUNC( HB_UTF8TOSTR ) +{ + ULONG ulLen = hb_parclen( 1 ), ulDest = 0; + char * szString, * szDest = NULL; + + if( ulLen ) + { + PHB_CODEPAGE cdp = ISCHAR( 2 ) ? hb_cdpFind( hb_parc( 2 ) ) : hb_cdp_page; + if( cdp ) + { + szString = hb_parc( 1 ); + ulDest = hb_cdpUTF8StringLength( ( BYTE * ) szString, ulLen ); + szDest = ( char * ) hb_xgrab( ulDest + 1 ); + hb_cdpUTF8ToStrn( cdp, FALSE, ( BYTE * ) szString, ulLen, ( BYTE * ) szDest, ulDest ); + } + } + + if( szDest ) + hb_retclen_buffer( szDest, ulDest ); + else + hb_retc( NULL ); +} #endif /* HB_CDP_SUPPORT_OFF */ diff --git a/harbour/source/rtl/gtcgi/gtcgi.c b/harbour/source/rtl/gtcgi/gtcgi.c index c3146ed71d..4667a8e015 100644 --- a/harbour/source/rtl/gtcgi/gtcgi.c +++ b/harbour/source/rtl/gtcgi/gtcgi.c @@ -234,6 +234,7 @@ static void hb_gt_cgi_WriteCon( BYTE * pText, ULONG ulLength ) { BYTE * buffer = NULL; +#ifndef HB_CDP_SUPPORT_OFF if( s_fDispTrans ) { buffer = ( BYTE * ) hb_xgrab( ulLength ); @@ -241,6 +242,7 @@ static void hb_gt_cgi_WriteCon( BYTE * pText, ULONG ulLength ) hb_cdpnTranslate( ( char * ) buffer, s_cdpHost, s_cdpTerm, ulLength ); pText = buffer; } +#endif hb_gt_cgi_termOut( pText, ulLength ); while( ulLength-- ) @@ -360,8 +362,10 @@ static void hb_gt_cgi_Redraw( int iRow, int iCol, int iSize ) } if( iLen ) { +#ifndef HB_CDP_SUPPORT_OFF if( s_fDispTrans ) hb_cdpnTranslate( ( char * ) s_sLineBuf, s_cdpHost, s_cdpTerm, iLen ); +#endif hb_gt_cgi_termOut( s_sLineBuf, iLen ); s_iCol = iCol; if( s_iCol > s_iLastCol ) diff --git a/harbour/source/rtl/gtchrmap.c b/harbour/source/rtl/gtchrmap.c index 5e6bea7f3e..df1ed20a27 100644 --- a/harbour/source/rtl/gtchrmap.c +++ b/harbour/source/rtl/gtchrmap.c @@ -1,5 +1,5 @@ /* - * $Id: chrmap.c,v 1.4 2007/05/03 14:11:30 druzus Exp $ + * $Id$ */ /* diff --git a/harbour/source/rtl/gtpca/gtpca.c b/harbour/source/rtl/gtpca/gtpca.c index 0154148714..76b30d4d97 100644 --- a/harbour/source/rtl/gtpca/gtpca.c +++ b/harbour/source/rtl/gtpca/gtpca.c @@ -854,8 +854,10 @@ static void hb_gt_pca_Redraw( int iRow, int iCol, int iSize ) iColor = bColor; else if( iColor != bColor ) { +#ifndef HB_CDP_SUPPORT_OFF if( s_fDispTrans ) hb_cdpnTranslate( ( char * ) s_sLineBuf, s_cdpHost, s_cdpTerm, iLen ); +#endif hb_gt_pca_AnsiPutStr( iRow, iCol, iColor, s_sLineBuf, iLen ); iCol += iLen; iLen = 0; @@ -867,8 +869,10 @@ static void hb_gt_pca_Redraw( int iRow, int iCol, int iSize ) } if( iLen ) { +#ifndef HB_CDP_SUPPORT_OFF if( s_fDispTrans ) hb_cdpnTranslate( ( char * ) s_sLineBuf, s_cdpHost, s_cdpTerm, iLen ); +#endif hb_gt_pca_AnsiPutStr( iRow, iCol, iColor, s_sLineBuf, iLen ); } } diff --git a/harbour/source/rtl/gtsln/gtsln.c b/harbour/source/rtl/gtsln/gtsln.c index fc16d856e8..7d8155ac6a 100644 --- a/harbour/source/rtl/gtsln/gtsln.c +++ b/harbour/source/rtl/gtsln/gtsln.c @@ -351,6 +351,7 @@ static void hb_sln_setCharTrans( PHB_CODEPAGE cdpHost, PHB_CODEPAGE cdpTerm, BOO HB_SYMBOL_UNUSED( cdpHost ); HB_SYMBOL_UNUSED( cdpTerm ); HB_SYMBOL_UNUSED( fBox ); + HB_SYMBOL_UNUSED( iSrc ); #endif /* build a conversion chars table */ diff --git a/harbour/source/rtl/gtsln/gtsln.h b/harbour/source/rtl/gtsln/gtsln.h index 931c234f3d..51da05b33b 100644 --- a/harbour/source/rtl/gtsln/gtsln.h +++ b/harbour/source/rtl/gtsln/gtsln.h @@ -62,10 +62,7 @@ #include "hbapierr.h" #include "hbapiitm.h" #include "inkey.ch" - -#ifndef HB_CDP_SUPPORT_OFF #include "hbapicdp.h" -#endif #if defined(HB_OS_DARWIN) || ( defined(HB_OS_LINUX) && defined(__WATCOMC__) ) #define REAL_UNIX_SYSTEM /* this is for slang.h to include some defs */ @@ -217,6 +214,8 @@ extern BOOL hb_sln_UnderXterm; extern unsigned char hb_sln_inputTab[ 256 ]; #ifndef HB_CDP_SUPPORT_OFF extern PHB_CODEPAGE hb_sln_cdpIN; +#else +# define hb_cdp_page NULL #endif /* delay for waiting on characters after ESC key */ diff --git a/harbour/source/rtl/gtstd/gtstd.c b/harbour/source/rtl/gtstd/gtstd.c index 233099a516..7c7152e9c0 100644 --- a/harbour/source/rtl/gtstd/gtstd.c +++ b/harbour/source/rtl/gtstd/gtstd.c @@ -610,8 +610,10 @@ static void hb_gt_std_Redraw( int iRow, int iCol, int iSize ) if( iLen ) { +#ifndef HB_CDP_SUPPORT_OFF if( s_fDispTrans ) hb_cdpnTranslate( ( char * ) s_sLineBuf, s_cdpHost, s_cdpTerm, iLen ); +#endif hb_gt_std_termOut( s_sLineBuf, iLen ); } s_iRow = iRow; diff --git a/harbour/source/rtl/gttrm/Makefile b/harbour/source/rtl/gttrm/Makefile index a825c7ee92..4edb8979a9 100644 --- a/harbour/source/rtl/gttrm/Makefile +++ b/harbour/source/rtl/gttrm/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile,v 1.3 2006/02/04 16:16:47 druzus Exp $ +# $Id$ # ROOT = ../../../ diff --git a/harbour/source/rtl/gttrm/gttrm.c b/harbour/source/rtl/gttrm/gttrm.c index 4c97336358..94078b5d7e 100644 --- a/harbour/source/rtl/gttrm/gttrm.c +++ b/harbour/source/rtl/gttrm/gttrm.c @@ -285,10 +285,12 @@ typedef struct BOOL fPosAnswer; +#ifndef HB_CDP_SUPPORT_OFF PHB_CODEPAGE cdpHost; PHB_CODEPAGE cdpOut; PHB_CODEPAGE cdpIn; PHB_CODEPAGE cdpEN; +#endif BOOL fUTF8; BOOL fDispTrans; BYTE keyTransTbl[ 256 ]; @@ -669,6 +671,9 @@ static void hb_gt_trm_termOutTrans( BYTE * pStr, int iLen, int iAttr ) { if( s_termState.iOutBufSize ) { +#ifdef HB_CDP_SUPPORT_OFF + HB_SYMBOL_UNUSED( iAttr ); +#else PHB_CODEPAGE cdp = NULL; if( s_termState.fUTF8 ) @@ -700,6 +705,7 @@ static void hb_gt_trm_termOutTrans( BYTE * pStr, int iLen, int iAttr ) } } else +#endif { if( s_termState.fDispTrans ) { @@ -1381,6 +1387,7 @@ again: s_termState.key_flag = 0; } +#ifndef HB_CDP_SUPPORT_OFF if( nKey > 0 && nKey <= 255 && s_termState.fUTF8 && s_termState.cdpIn ) { USHORT uc = 0; @@ -1401,7 +1408,7 @@ again: } } } - +#endif if( nKey > 0 && nKey <= 255 && s_termState.keyTransTbl[nKey] ) nKey = s_termState.keyTransTbl[nKey]; /* @@ -2604,8 +2611,10 @@ static void hb_gt_trm_SetTerm( void ) hb_gt_chrmapinit( s_termState.charmap, szTerm ); +#ifndef HB_CDP_SUPPORT_OFF s_termState.cdpHost = s_termState.cdpOut = s_termState.cdpIn = NULL; s_termState.cdpEN = hb_cdpFind( "EN" ); +#endif s_termState.fDispTrans = FALSE; add_efds( s_termState.hFilenoStdin, O_RDONLY, NULL, NULL ); diff --git a/harbour/source/rtl/gtxwc/gtxwc.c b/harbour/source/rtl/gtxwc/gtxwc.c index ef828c3696..fb0fd6def9 100644 --- a/harbour/source/rtl/gtxwc/gtxwc.c +++ b/harbour/source/rtl/gtxwc/gtxwc.c @@ -1854,10 +1854,12 @@ static void hb_gt_xwc_ProcessKey( PXWND_DEF wnd, XKeyEvent *evt) } if( n > 0 ) { +#ifndef HB_CDP_SUPPORT_OFF if( wnd->inCDP && wnd->hostCDP && wnd->inCDP != wnd->hostCDP ) { hb_cdpnTranslate( (char *) buf, wnd->inCDP, wnd->hostCDP, n ); } +#endif #ifdef XWC_DEBUG buf[n] = '\0'; printf( "keySymISO=%lx keystr=[%s]\r\n", outISO, buf ); fflush(stdout); @@ -2123,6 +2125,7 @@ static void hb_gt_xwc_WndProc( PXWND_DEF wnd, XEvent *evt ) if( XGetTextProperty( wnd->dpy, wnd->window, &text, evt->xselection.property ) != 0 ) { +#ifndef HB_CDP_SUPPORT_OFF if( evt->xselection.target == s_atomUTF8String && text.format == 8 ) { #ifdef XWC_DEBUG @@ -2138,7 +2141,9 @@ static void hb_gt_xwc_WndProc( PXWND_DEF wnd, XEvent *evt ) wnd->ClipboardTime = evt->xselection.time; wnd->ClipboardRcvd = TRUE; } - else if( evt->xselection.target == s_atomString && text.format == 8 ) + else +#endif + if( evt->xselection.target == s_atomString && text.format == 8 ) { #ifdef XWC_DEBUG printf( "String='%s'\r\n", text.value ); fflush(stdout); @@ -2147,8 +2152,10 @@ static void hb_gt_xwc_WndProc( PXWND_DEF wnd, XEvent *evt ) hb_xfree( wnd->ClipboardData ); wnd->ClipboardData = ( unsigned char * ) hb_xgrab( text.nitems + 1 ); memcpy( wnd->ClipboardData, text.value, text.nitems ); +#ifndef HB_CDP_SUPPORT_OFF if( wnd->inCDP && wnd->hostCDP && wnd->inCDP != wnd->hostCDP ) hb_cdpnTranslate( ( char * ) wnd->ClipboardData, wnd->inCDP, wnd->hostCDP, text.nitems ); +#endif wnd->ClipboardData[ text.nitems ] = '\0'; wnd->ClipboardSize = text.nitems; wnd->ClipboardTime = evt->xselection.time; @@ -2214,6 +2221,7 @@ static void hb_gt_xwc_WndProc( PXWND_DEF wnd, XEvent *evt ) } else if( req->target == s_atomString ) { +#ifndef HB_CDP_SUPPORT_OFF if( wnd->inCDP && wnd->hostCDP && wnd->inCDP != wnd->hostCDP ) { BYTE * pBuffer = ( BYTE * ) hb_xgrab( wnd->ClipboardSize + 1 ); @@ -2225,12 +2233,14 @@ static void hb_gt_xwc_WndProc( PXWND_DEF wnd, XEvent *evt ) hb_xfree( pBuffer ); } else +#endif { XChangeProperty( wnd->dpy, req->requestor, req->property, s_atomString, 8, PropModeReplace, wnd->ClipboardData, wnd->ClipboardSize ); } } +#ifndef HB_CDP_SUPPORT_OFF else if( req->target == s_atomUTF8String ) { ULONG ulLen = hb_cdpStringInUTF8Length( wnd->hostCDP, FALSE, wnd->ClipboardData, wnd->ClipboardSize ); @@ -2245,6 +2255,7 @@ static void hb_gt_xwc_WndProc( PXWND_DEF wnd, XEvent *evt ) pBuffer, ulLen ); hb_xfree( pBuffer ); } +#endif else { respond.xselection.property = None; @@ -2964,7 +2975,9 @@ static PXWND_DEF hb_gt_xwc_CreateWndDef( void ) wnd->fInit = wnd->fData = FALSE; hb_gt_xwc_SetScrBuff( wnd, XWC_DEFAULT_COLS, XWC_DEFAULT_ROWS ); wnd->fWinResize = FALSE; +#ifndef HB_CDP_SUPPORT_OFF wnd->hostCDP = hb_cdp_page; +#endif wnd->cursorType = SC_NORMAL; /* Window Title */ diff --git a/harbour/source/rtl/gtxwc/gtxwc.h b/harbour/source/rtl/gtxwc/gtxwc.h index 0de2aeb938..9b5014ab35 100644 --- a/harbour/source/rtl/gtxwc/gtxwc.h +++ b/harbour/source/rtl/gtxwc/gtxwc.h @@ -68,10 +68,7 @@ #include "hbapierr.h" #include "inkey.ch" #include "hbgfxdef.ch" - -#ifndef HB_CDP_SUPPORT_OFF #include "hbapicdp.h" -#endif #include #include diff --git a/harbour/source/rtl/is.c b/harbour/source/rtl/is.c index f38f0e1b5b..6be51d5170 100644 --- a/harbour/source/rtl/is.c +++ b/harbour/source/rtl/is.c @@ -67,9 +67,12 @@ HB_FUNC( ISALPHA ) { if( isalpha( ( unsigned char ) * szString ) ) hb_retl( TRUE ); - else if( hb_cdp_page->nChars && szString[0] && - ( strchr( hb_cdp_page->CharsUpper,* szString ) || strchr( hb_cdp_page->CharsLower,* szString ) ) ) +#ifndef HB_CDP_SUPPORT_OFF + else if( hb_cdp_page->nChars && szString[0] && + ( strchr( hb_cdp_page->CharsUpper,* szString ) || + strchr( hb_cdp_page->CharsLower,* szString ) ) ) hb_retl( TRUE ); +#endif else hb_retl( FALSE ); } @@ -99,8 +102,11 @@ HB_FUNC( ISUPPER ) { if( isupper( ( unsigned char ) * szString ) ) hb_retl( TRUE ); - else if( hb_cdp_page->nChars && szString[0] && strchr( hb_cdp_page->CharsUpper,* szString ) ) +#ifndef HB_CDP_SUPPORT_OFF + else if( hb_cdp_page->nChars && szString[0] && + strchr( hb_cdp_page->CharsUpper, * szString ) ) hb_retl( TRUE ); +#endif else hb_retl( FALSE ); } @@ -118,8 +124,11 @@ HB_FUNC( ISLOWER ) { if( islower( ( unsigned char ) * szString ) ) hb_retl( TRUE ); - else if( hb_cdp_page->nChars && szString[0] && strchr( hb_cdp_page->CharsLower,* szString ) ) +#ifndef HB_CDP_SUPPORT_OFF + else if( hb_cdp_page->nChars && szString[0] && + strchr( hb_cdp_page->CharsLower,* szString ) ) hb_retl( TRUE ); +#endif else hb_retl( FALSE ); } diff --git a/harbour/source/rtl/strcase.c b/harbour/source/rtl/strcase.c index 700dc1f31e..6b9facbc57 100644 --- a/harbour/source/rtl/strcase.c +++ b/harbour/source/rtl/strcase.c @@ -64,10 +64,12 @@ char * hb_strLower( char * szText, ULONG ulLen ) HB_TRACE(HB_TR_DEBUG, ("hb_strLower(%s, %lu)", szText, ulLen)); +#ifndef HB_CDP_SUPPORT_OFF if( hb_cdp_page->nChars ) for( i = 0; i < ulLen; i++ ) szText[ i ] = (char) hb_cdp_page->s_lower[szText[i]&255]; else +#endif for( i = 0; i < ulLen; i++ ) szText[ i ] = tolower( (unsigned char) szText[ i ] ); @@ -81,10 +83,12 @@ char * hb_strUpper( char * szText, ULONG ulLen ) HB_TRACE(HB_TR_DEBUG, ("hb_strUpper(%s, %lu)", szText, ulLen)); +#ifndef HB_CDP_SUPPORT_OFF if( hb_cdp_page->nChars ) for( i = 0; i < ulLen; i++ ) szText[ i ] = (char) hb_cdp_page->s_upper[szText[i]&255]; else +#endif for( i = 0; i < ulLen; i++ ) szText[ i ] = toupper( (unsigned char) szText[ i ] ); @@ -94,18 +98,22 @@ char * hb_strUpper( char * szText, ULONG ulLen ) /* converts iChar to upper case */ int hb_charUpper( int iChar ) { +#ifndef HB_CDP_SUPPORT_OFF if( hb_cdp_page->nChars ) return (unsigned char) hb_cdp_page->s_upper[ (unsigned char) iChar ]; else +#endif return toupper( (unsigned char) iChar ); } /* converts iChar to lower case */ int hb_charLower( int iChar ) { +#ifndef HB_CDP_SUPPORT_OFF if( hb_cdp_page->nChars ) return (unsigned char) hb_cdp_page->s_lower[ (unsigned char) iChar ]; else +#endif return tolower( (unsigned char) iChar ); } diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index 32c13a0303..89c5c6059d 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -567,8 +567,9 @@ HB_EXPORT int hb_vmQuit( void ) hb_setRelease(); /* releases Sets */ hb_vmReleaseLocalSymbols(); /* releases the local modules linked list */ hb_dynsymRelease(); /* releases the dynamic symbol table */ +#ifndef HB_CDP_SUPPORT_OFF hb_cdpReleaseAll(); /* releases codepages */ - +#endif hb_itemClear( hb_stackReturnItem() ); /* release all known garbage */