diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ba907d8652..b81961ba1c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,46 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-12-02 01:55 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/vm/itemapi.c + * src/vm/hvm.c + * src/vm/set.c + * src/rtl/gtdos/gtdos.c + * src/rtl/gtwin/gtwin.c + * src/rtl/gtxwc/gtxwc.h + * src/rtl/gtxwc/gtxwc.c + * src/rtl/gtcrs/gtcrs.c + * src/rtl/gtcrs/gtcrs.h + * src/rtl/gtstd/gtstd.c + * src/rtl/gttrm/gttrm.c + * src/rtl/gtcgi/gtcgi.c + * src/rtl/hbgtcore.c + * src/rtl/gtsln/gtsln.c + * src/rtl/gtsln/kbsln.c + * src/rtl/gtsln/gtsln.h + * src/rtl/gtpca/gtpca.c + * src/rtl/gtwvt/gtwvt.c + * src/rdd/dbfntx/dbfntx1.c + * src/rdd/hbdbsort.c + * src/rdd/sdf1.c + * src/rdd/dbfnsx/dbfnsx1.c + * src/rdd/dbfcdx/dbfcdx1.c + * src/rdd/delim1.c + * src/rdd/dbf1.c + * src/rdd/hsx/hsx.c + * src/rdd/dbffpt/dbffpt1.c + * doc/en-EN/lang.txt + * include/hbrdddbf.h + * include/hbapicdp.h + * include/hbextern.ch + * contrib/xhb/dbf2txt.c + * contrib/gtqtc/gtqtc.cpp + * contrib/gtwvg/gtwvg.c + * contrib/gtwvg/wvggui.c + * contrib/hbbmcdx/bmdbfcdx.c + * examples/hbdoc/examples/core_es/lang.txt + - Deleted HB_CDP_SUPPORT_OFF. + 2009-12-01 08:24 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbide/hbide.ch * contrib/hbide/hbide.prg @@ -44,11 +84,11 @@ * harbour/contrib/hbcairo/paths.c * harbour/contrib/hbcairo/text.c * harbour/contrib/hbcairo/tests/table.prg - * added some error check. If function parameters are invalid C level + * added some error check. If function parameters are invalid C level functions is not called with invalid (NULL) pointers. - * changed cairo_text_extent() to return an array of .c structure - members instead of returning multiple values using parameters - passed by reference. In the future I'll try to follow this way + * changed cairo_text_extent() to return an array of .c structure + members instead of returning multiple values using parameters + passed by reference. In the future I'll try to follow this way to return structures. 2009-12-01 16:39 UTC+0200 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt) diff --git a/harbour/contrib/gtqtc/gtqtc.cpp b/harbour/contrib/gtqtc/gtqtc.cpp index dbc97fbe8d..ff72e9354c 100644 --- a/harbour/contrib/gtqtc/gtqtc.cpp +++ b/harbour/contrib/gtqtc/gtqtc.cpp @@ -204,7 +204,6 @@ static PHB_GTWVT hb_gt_wvt_New( PHB_GT pGT, int iCmdShow ) pWVT->bResizing = FALSE; pWVT->bAlreadySizing = FALSE; -#ifndef HB_CDP_SUPPORT_OFF pWVT->hostCDP = hb_vmCDP(); #if defined( UNICODE ) pWVT->inCDP = hb_vmCDP(); @@ -215,7 +214,6 @@ static PHB_GTWVT hb_gt_wvt_New( PHB_GT pGT, int iCmdShow ) for( i = 0; i < 256; ++i ) pWVT->chrTransTbl[ i ] = pWVT->keyTransTbl[ i ] = ( BYTE ) i; } -#endif #endif return pWVT; @@ -769,7 +767,6 @@ static BOOL hb_gt_wvt_SetDispCP( PHB_GT pGT, const char * pszTermCDP, const char { HB_GTSUPER_SETDISPCP( pGT, pszTermCDP, pszHostCDP, fBox ); -#ifndef HB_CDP_SUPPORT_OFF # if defined( UNICODE ) /* * We are displaying text in U16 so pszTermCDP is unimportant. @@ -812,7 +809,6 @@ static BOOL hb_gt_wvt_SetDispCP( PHB_GT pGT, const char * pszTermCDP, const char } } # endif -#endif return TRUE; } @@ -821,7 +817,6 @@ static BOOL hb_gt_wvt_SetKeyCP( PHB_GT pGT, const char * pszTermCDP, const char { HB_GTSUPER_SETKEYCP( pGT, pszTermCDP, pszHostCDP ); -#ifndef HB_CDP_SUPPORT_OFF # if defined( UNICODE ) /* * We are receiving WM_CHAR events in U16 so pszTermCDP is unimportant. @@ -858,7 +853,6 @@ static BOOL hb_gt_wvt_SetKeyCP( PHB_GT pGT, const char * pszTermCDP, const char pWVT->inCDP = cdpTerm; } # endif -#endif return TRUE; } diff --git a/harbour/contrib/gtwvg/gtwvg.c b/harbour/contrib/gtwvg/gtwvg.c index f1628836c5..75d9866fcc 100644 --- a/harbour/contrib/gtwvg/gtwvg.c +++ b/harbour/contrib/gtwvg/gtwvg.c @@ -412,7 +412,6 @@ static PHB_GTWVT hb_gt_wvt_New( PHB_GT pGT, HINSTANCE hInstance, int iCmdShow ) pWVT->pPP->bRowCols = FALSE; pWVT->pPP->iWndType = 0; -#ifndef HB_CDP_SUPPORT_OFF pWVT->hostCDP = hb_vmCDP(); #if defined( UNICODE ) pWVT->inCDP = hb_vmCDP(); @@ -424,8 +423,6 @@ static PHB_GTWVT hb_gt_wvt_New( PHB_GT pGT, HINSTANCE hInstance, int iCmdShow ) pWVT->chrTransTbl[ i ] = pWVT->keyTransTbl[ i ] = ( BYTE ) i; } #endif -#endif - /* GUI Related members initialized */ hb_wvt_gtCreateObjects( pWVT ); @@ -4032,7 +4029,6 @@ static BOOL hb_gt_wvt_SetDispCP( PHB_GT pGT, const char * pszTermCDP, const char { HB_GTSUPER_SETDISPCP( pGT, pszTermCDP, pszHostCDP, fBox ); -#ifndef HB_CDP_SUPPORT_OFF # if defined( UNICODE ) /* * We are displaying text in U16 so pszTermCDP is unimportant. @@ -4075,7 +4071,6 @@ static BOOL hb_gt_wvt_SetDispCP( PHB_GT pGT, const char * pszTermCDP, const char } } # endif -#endif return TRUE; } @@ -4084,7 +4079,6 @@ static BOOL hb_gt_wvt_SetKeyCP( PHB_GT pGT, const char * pszTermCDP, const char { HB_GTSUPER_SETKEYCP( pGT, pszTermCDP, pszHostCDP ); -#ifndef HB_CDP_SUPPORT_OFF # if defined( UNICODE ) /* * We are receiving WM_CHAR events in U16 so pszTermCDP is unimportant. @@ -4121,7 +4115,6 @@ static BOOL hb_gt_wvt_SetKeyCP( PHB_GT pGT, const char * pszTermCDP, const char pWVT->inCDP = cdpTerm; } # endif -#endif return TRUE; } diff --git a/harbour/contrib/gtwvg/wvggui.c b/harbour/contrib/gtwvg/wvggui.c index 8d90b4799e..1de293185b 100644 --- a/harbour/contrib/gtwvg/wvggui.c +++ b/harbour/contrib/gtwvg/wvggui.c @@ -307,7 +307,6 @@ static PHB_GTWVT hb_gt_wvt_New( PHB_GT pGT, HINSTANCE hInstance, int iCmdShow ) pWVT->pPP->bRowCols = FALSE; pWVT->pPP->iWndType = 0; -#ifndef HB_CDP_SUPPORT_OFF pWVT->hostCDP = hb_vmCDP(); #if defined( UNICODE ) pWVT->inCDP = hb_vmCDP(); @@ -317,7 +316,6 @@ static PHB_GTWVT hb_gt_wvt_New( PHB_GT pGT, HINSTANCE hInstance, int iCmdShow ) for( i = 0; i < 256; ++i ) pWVT->chrTransTbl[ i ] = pWVT->keyTransTbl[ i ] = ( BYTE ) i; } -#endif #endif pWVT->bResizing = FALSE; pWVT->width = 600; diff --git a/harbour/contrib/hbbmcdx/bmdbfcdx.c b/harbour/contrib/hbbmcdx/bmdbfcdx.c index f77d304cf0..e306ecad7e 100644 --- a/harbour/contrib/hbbmcdx/bmdbfcdx.c +++ b/harbour/contrib/hbbmcdx/bmdbfcdx.c @@ -80,7 +80,6 @@ /* #define HB_CDX_DBGCODE_EXT #define HB_CDX_DSPDBG_INFO -#define HB_CDP_SUPPORT_OFF #define HB_CDX_DBGTIME #define HB_CDX_DBGUPDT */ @@ -98,10 +97,8 @@ #include "rddsys.ch" #include "hbregex.h" -#ifndef HB_CDP_SUPPORT_OFF - /* for nation sorting support */ - #include "hbapicdp.h" -#endif +/* for nation sorting support */ +#include "hbapicdp.h" /* * Tag->fRePos = TURE means that rootPage->...->childLeafPage path is @@ -400,7 +397,6 @@ static HB_ERRCODE hb_cdxErrorRT( CDXAREAP pArea, HB_ERRCODE uiGenCode, HB_ERRCOD */ static void hb_cdxMakeSortTab( CDXAREAP pArea ) { -#ifndef HB_CDP_SUPPORT_OFF if( pArea->dbfarea.area.cdPage && pArea->dbfarea.area.cdPage->sort && !pArea->bCdxSortTab ) { int i, j, l; @@ -432,9 +428,6 @@ static void hb_cdxMakeSortTab( CDXAREAP pArea ) pArea->bCdxSortTab[pbSort[i]] = i; hb_xfree( pbSort ); } -#else - HB_SYMBOL_UNUSED( pArea ); -#endif } /* @@ -567,7 +560,6 @@ static int hb_cdxValCompare( LPCDXTAG pTag, BYTE * val1, BYTE len1, if( pTag->uiType == 'C' ) { -#ifndef HB_CDP_SUPPORT_OFF if( pTag->pIndex->pArea->bCdxSortTab ) { BYTE * pSort = pTag->pIndex->pArea->bCdxSortTab; @@ -578,10 +570,8 @@ static int hb_cdxValCompare( LPCDXTAG pTag, BYTE * val1, BYTE len1, iPos++; } } - else -#endif - if( iLimit > 0 ) - iResult = memcmp( val1, val2, iLimit ); + else if( iLimit > 0 ) + iResult = memcmp( val1, val2, iLimit ); if( iResult == 0 ) { @@ -726,12 +716,9 @@ static LPCDXKEY hb_cdxKeyPutItem( LPCDXKEY pKey, PHB_ITEM pItem, ULONG ulRec, LP pKey->mode = ( USHORT ) iMode; if( pTag->uiType == 'C' ) { -#ifndef HB_CDP_SUPPORT_OFF if( fTrans ) hb_cdpnTranslate( ( char * ) pKey->val, hb_vmCDP(), pTag->pIndex->pArea->dbfarea.area.cdPage, pKey->len ); -#else - HB_SYMBOL_UNUSED( fTrans ); -#endif + if( pTag->IgnoreCase ) hb_strUpper( ( char * ) pKey->val, pKey->len ); } @@ -750,7 +737,6 @@ static PHB_ITEM hb_cdxKeyGetItem( LPCDXKEY pKey, PHB_ITEM pItem, LPCDXTAG pTag, switch( pTag->uiType ) { case 'C': -#ifndef HB_CDP_SUPPORT_OFF if( fTrans && pTag->pIndex->pArea->dbfarea.area.cdPage != hb_vmCDP() ) { char * pVal = ( char * ) hb_xgrab( pKey->len + 1 ); @@ -761,9 +747,6 @@ static PHB_ITEM hb_cdxKeyGetItem( LPCDXKEY pKey, PHB_ITEM pItem, LPCDXTAG pTag, pItem = hb_itemPutCLPtr( pItem, pVal, pKey->len ); } else -#else - HB_SYMBOL_UNUSED( fTrans ); -#endif { pItem = hb_itemPutCL( pItem, ( char * ) pKey->val, pKey->len ); } @@ -813,9 +796,7 @@ static LPCDXKEY hb_cdxKeyEval( LPCDXKEY pKey, LPCDXTAG pTag ) { CDXAREAP pArea = pTag->pIndex->pArea; PHB_ITEM pItem; -#ifndef HB_CDP_SUPPORT_OFF PHB_CODEPAGE cdpTmp = hb_cdpSelect( pArea->dbfarea.area.cdPage ); -#endif if( pTag->nField ) { @@ -840,9 +821,7 @@ static LPCDXKEY hb_cdxKeyEval( LPCDXKEY pKey, LPCDXTAG pTag ) hb_rddSelectWorkAreaNumber( iCurrArea ); } -#ifndef HB_CDP_SUPPORT_OFF hb_cdpSelect( cdpTmp ); -#endif return pKey; } @@ -5553,13 +5532,12 @@ static BOOL hb_cdxDBOISkipWild( CDXAREAP pArea, LPCDXTAG pTag, BOOL fForward, return fForward ? pArea->dbfarea.fPositioned : !pArea->dbfarea.area.fBof; } -#ifndef HB_CDP_SUPPORT_OFF if( pArea->dbfarea.area.cdPage != hb_vmCDP() ) { szPattern = szFree = hb_strdup( szPattern ); hb_cdpTranslate( szFree, hb_vmCDP(), pArea->dbfarea.area.cdPage ); } -#endif + while( iFixed < pTag->uiLen && szPattern[ iFixed ] && szPattern[ iFixed ] != '*' && szPattern[ iFixed ] != '?' ) { @@ -5686,7 +5664,6 @@ static BOOL hb_cdxDBOISkipWild( CDXAREAP pArea, LPCDXTAG pTag, BOOL fForward, static BOOL hb_cdxRegexMatch( CDXAREAP pArea, PHB_REGEX pRegEx, LPCDXKEY pKey ) { char * szKey = ( char * ) pKey->val; -#ifndef HB_CDP_SUPPORT_OFF char szBuff[ CDX_MAXKEY + 1 ]; if( pArea->dbfarea.area.cdPage != hb_vmCDP() ) @@ -5695,9 +5672,7 @@ static BOOL hb_cdxRegexMatch( CDXAREAP pArea, PHB_REGEX pRegEx, LPCDXKEY pKey ) hb_cdpnTranslate( szBuff, pArea->dbfarea.area.cdPage, hb_vmCDP(), pKey->len ); szKey = szBuff; } -#else - HB_SYMBOL_UNUSED( pArea ); -#endif + return hb_regexMatch( pRegEx, szKey, pKey->len, FALSE ); } @@ -10118,9 +10093,7 @@ static void hb_cdxTagDoIndex( LPCDXTAG pTag, BOOL fReindex ) PHB_ITEM pForItem, pWhileItem = NULL, pEvalItem = NULL, pItem = NULL; ULONG ulRecCount, ulRecNo = pArea->dbfarea.ulRecNo; LONG lStep = 0; -#ifndef HB_CDP_SUPPORT_OFF PHB_CODEPAGE cdpTmp = hb_cdpSelect( pArea->dbfarea.area.cdPage ); -#endif if( pArea->dbfarea.area.lpdbOrdCondInfo ) { @@ -10402,9 +10375,7 @@ static void hb_cdxTagDoIndex( LPCDXTAG pTag, BOOL fReindex ) hb_cdxSortFree( pSort ); pArea->pSort = NULL; -#ifndef HB_CDP_SUPPORT_OFF hb_cdpSelect( cdpTmp ); -#endif } #define __PRG_SOURCE__ __FILE__ diff --git a/harbour/contrib/xhb/dbf2txt.c b/harbour/contrib/xhb/dbf2txt.c index 29c0e014c5..214a664c5e 100644 --- a/harbour/contrib/xhb/dbf2txt.c +++ b/harbour/contrib/xhb/dbf2txt.c @@ -86,11 +86,7 @@ static char * hb_strescape( const char * szInput, int lLen, const char * cDelim } /* Export field values to text file */ -#ifndef HB_CDP_SUPPORT_OFF static BOOL hb_ExportVar( HB_FHANDLE handle, PHB_ITEM pValue, const char * cDelim, PHB_CODEPAGE cdp ) -#else -static BOOL hb_ExportVar( HB_FHANDLE handle, PHB_ITEM pValue, const char * cDelim ) -#endif { switch( hb_itemType( pValue ) ) { @@ -102,10 +98,9 @@ static BOOL hb_ExportVar( HB_FHANDLE handle, PHB_ITEM pValue, const char * cDeli szStrEsc = hb_strescape( hb_itemGetCPtr( pValue ), hb_itemGetCLen( pValue ), cDelim ); -#ifndef HB_CDP_SUPPORT_OFF if( cdp ) hb_cdpnTranslate( szStrEsc, hb_vmCDP(), cdp, strlen( szStrEsc ) ); -#endif + szString = hb_xstrcpy( NULL, cDelim, szStrEsc, cDelim, NULL ); /* FWrite( handle, szString ) */ @@ -167,9 +162,7 @@ HB_FUNC( DBF2TEXT ) HB_FHANDLE handle = ( HB_FHANDLE ) hb_parnint( 5 ); const char * cSep = hb_parc( 6 ); int nCount = hb_parni( 7 ); -#ifndef HB_CDP_SUPPORT_OFF PHB_CODEPAGE cdp = hb_cdpFind( hb_parcx( 8 ) ); -#endif AREAP pArea = ( AREAP ) hb_rddGetCurrentWorkAreaPointer(); @@ -239,11 +232,7 @@ HB_FUNC( DBF2TEXT ) hb_fsWriteLarge( handle, cSep, iSepLen ); SELF_GETVALUE( pArea, ui, pTmp ); -#ifndef HB_CDP_SUPPORT_OFF bWriteSep = hb_ExportVar( handle, pTmp, cDelim, cdp ); -#else - bWriteSep = hb_ExportVar( handle, pTmp, cDelim ); -#endif hb_itemClear( pTmp ); } } @@ -266,11 +255,7 @@ HB_FUNC( DBF2TEXT ) hb_fsWriteLarge( handle, cSep, iSepLen ); SELF_GETVALUE( pArea, ( USHORT ) iPos, pTmp ); -#ifndef HB_CDP_SUPPORT_OFF bWriteSep = hb_ExportVar( handle, pTmp, cDelim, cdp ); -#else - bWriteSep = hb_ExportVar( handle, pTmp, cDelim ); -#endif hb_itemClear( pTmp ); } } diff --git a/harbour/doc/en-EN/lang.txt b/harbour/doc/en-EN/lang.txt index 35ddf86efa..ab0effcbdc 100644 --- a/harbour/doc/en-EN/lang.txt +++ b/harbour/doc/en-EN/lang.txt @@ -383,9 +383,6 @@ * R * $COMPLIANCE$ * This function is a Harbour Extension. - * - * This function is only visible if src/rtl/cdpapi.c was compiled - * without the HB_CDP_SUPPORT_OFF flag. * $PLATFORMS$ * All * $FILES$ @@ -445,9 +442,6 @@ * R * $COMPLIANCE$ * This function is a Harbour Extension. - * - * This function is only visible if src/rtl/cdpapi.c was compiled - * without the HB_CDP_SUPPORT_OFF flag. * $PLATFORMS$ * All * $FILES$ diff --git a/harbour/examples/hbdoc/examples/core_es/lang.txt b/harbour/examples/hbdoc/examples/core_es/lang.txt index 3336b552ec..13c39b6682 100644 --- a/harbour/examples/hbdoc/examples/core_es/lang.txt +++ b/harbour/examples/hbdoc/examples/core_es/lang.txt @@ -76,7 +76,7 @@ * $SYNTAX$ * HB_LANGMESSAGE( ) --> cMensaje * $ARGUMENTS$ - * es el código numérico del mensaje + * es el código numérico del mensaje * $RETURNS$ * HB_LANGMESSAGE() devuelve el texto asociado con el código . * $DESCRIPTION$ @@ -275,7 +275,7 @@ * Todas * $FILES$ * La librer¡a asociada es lang - * Nota: el nombre de la extensi¢n de la librer¡a, puede cambiar con + * Nota: el nombre de la extensi¢n de la librer¡a, puede cambiar con * el sistema operativo (.lib .o , etc.) * $SEEALSO$ * HB_LANGSELECT(),NATIONMSG() @@ -328,11 +328,11 @@ * $RETURNS$ * El identificador anterior de Lenguaje * $DESCRIPTION$ - * HB_SETCODEPAGE() establece el código de página activo usado por - * Harbour para ordenar y comparar cadenas. El código de página por + * HB_SETCODEPAGE() establece el código de página activo usado por + * Harbour para ordenar y comparar cadenas. El código de página por * defecto usa el orden ASCII del idioma inglés (cLang == "EN"). * - * NOTA: Usted debe solicitar a través del comando 'REQUEST' cada + * NOTA: Usted debe solicitar a través del comando 'REQUEST' cada * módulo de código de página que Ud. intente usar. * Por ejemplo: para usar el código de página Ruso: RU866, Ud. debe * agregar lo siguiente a su programa: @@ -356,9 +356,6 @@ * R * $COMPLIANCE$ * Esta funci¢n es una Extensi¢n de Harbour. - * - * Esta funci¢n es solamente visible si source/rtl/cdpapi.c fué - * compilado sin la bandera: HB_CDP_SUPPORT_OFF * $PLATFORMS$ * Todas * $FILES$ @@ -376,34 +373,34 @@ * $ONELINER$ * Traduce una cadena de un código de página a otro. * $SYNTAX$ - * HB_TRANSLATE( , [], [] ) + * HB_TRANSLATE( , [], [] ) * --> cTextoDest * $ARGUMENTS$ * Es la cadena original a traducir. * - * Es la ID opcional del código de página de la cadena - * original. Si no es especificada, es usado el código de + * Es la ID opcional del código de página de la cadena + * original. Si no es especificada, es usado el código de * página por defecto. * * Es la ID opcional del código de página de la cadena de - * destino. Si no es especificada, es usado el código de + * destino. Si no es especificada, es usado el código de * página por defecto. * $RETURNS$ * HB_TRANSLATE() devuelve la cadena de destino convertida a partir de * la cadena original. * $DESCRIPTION$ - * HB_TRANSLATE() trata de convertir la cadena original desde un código + * HB_TRANSLATE() trata de convertir la cadena original desde un código * de página a otro. Si el código de página no es reconocido, ó no es * enlazado, el código de página por defecto, es usado. * HB_TRANSLATE() es generalmente usado para convertir entre los códigos * de página de DOS y Windows, para un mismo idioma. * - * NOTA: Si el código de página de origen y el código de página de + * NOTA: Si el código de página de origen y el código de página de * destino, no tienen el mismo número de caracteres, la traducción - * no puede ser realizada y la cadena de destino es una copia de + * no puede ser realizada y la cadena de destino es una copia de * la cadena de origen. * - * NOTA: Usted debe solicitar a través del comando 'REQUEST' cada + * NOTA: Usted debe solicitar a través del comando 'REQUEST' cada * módulo de código de página que Ud. intente usar. * Por ejemplo: para usar el código de página Ruso: RU866, Ud. debe * agregar lo siguiente a su programa: @@ -422,9 +419,6 @@ * R * $COMPLIANCE$ * Esta funci¢n es una Extensi¢n de Harbour. - * - * Esta funci¢n es solamente visible si source/rtl/cdpapi.c fué - * compilado sin la bandera: HB_CDP_SUPPORT_OFF * $PLATFORMS$ * Todas * $FILES$ @@ -433,6 +427,3 @@ * HB_LANGSELECT(),HB_SETCODEPAGE(),NATIONMSG(),REQUEST * $END$ */ - - - diff --git a/harbour/include/hbapicdp.h b/harbour/include/hbapicdp.h index a11a35978d..a7838c4efa 100644 --- a/harbour/include/hbapicdp.h +++ b/harbour/include/hbapicdp.h @@ -54,8 +54,6 @@ #ifndef HB_APICDP_H_ #define HB_APICDP_H_ -#ifndef HB_CDP_SUPPORT_OFF - #include "hbapi.h" #include "hbinit.h" @@ -388,11 +386,4 @@ extern HB_EXPORT void hb_cdpnTranslate( char *, PHB_CODEPAGE, PHB_CODEPA HB_EXTERN_END -#else - -typedef void * PHB_CODEPAGE; -typedef USHORT HB_WCHAR; - -#endif /* HB_CDP_SUPPORT_OFF */ - #endif /* HB_APICDP_H_ */ diff --git a/harbour/include/hbextern.ch b/harbour/include/hbextern.ch index fcba07c36c..0ac4203227 100644 --- a/harbour/include/hbextern.ch +++ b/harbour/include/hbextern.ch @@ -836,7 +836,6 @@ EXTERNAL HB_LANGNAME EXTERNAL HB_LANGSELECT EXTERNAL HB_LANGERRMSG EXTERNAL HB_LANGMESSAGE -#ifndef HB_CDP_SUPPORT_OFF EXTERNAL HB_CDPLIST EXTERNAL HB_CDPUNIID EXTERNAL HB_CDPINFO @@ -857,7 +856,6 @@ EXTERNAL HB_UTF8SUBSTR EXTERNAL HB_UTF8STRTRAN EXTERNAL HB_UTF8CHR EXTERNAL HB_UTF8ASC -#endif EXTERNAL HB_ASCIIUPPER EXTERNAL HB_ASCIILOWER EXTERNAL HB_ASCIIISALPHA diff --git a/harbour/include/hbrdddbf.h b/harbour/include/hbrdddbf.h index b43a7e8fb4..841670e18f 100644 --- a/harbour/include/hbrdddbf.h +++ b/harbour/include/hbrdddbf.h @@ -249,9 +249,7 @@ extern HB_EXPORT HB_ERRCODE hb_dbfGetEGcode( HB_ERRCODE errCode ); extern HB_EXPORT BOOL hb_dbfLockIdxFile( PHB_FILE pFile, BYTE bScheme, USHORT usMode, HB_FOFFSET *pPoolPos ); extern HB_EXPORT BOOL hb_dbfLockIdxGetData( BYTE bScheme, HB_FOFFSET *ulPos, HB_FOFFSET *ulPool ); -#ifndef HB_CDP_SUPPORT_OFF extern HB_EXPORT void hb_dbfTranslateRec( DBFAREAP pArea, BYTE * pBuffer, PHB_CODEPAGE cdp_src, PHB_CODEPAGE cdp_dest ); -#endif HB_EXTERN_END diff --git a/harbour/src/rdd/dbf1.c b/harbour/src/rdd/dbf1.c index 452ec624bb..aa049dccfb 100644 --- a/harbour/src/rdd/dbf1.c +++ b/harbour/src/rdd/dbf1.c @@ -67,9 +67,7 @@ #include "rddsys.ch" #include "hbsxdef.ch" -#ifndef HB_CDP_SUPPORT_OFF -# include "hbapicdp.h" -#endif +#include "hbapicdp.h" static USHORT s_uiRddId = ( USHORT ) -1; @@ -1810,7 +1808,6 @@ static HB_ERRCODE hb_dbfGetValue( DBFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem { case HB_FT_STRING: ulLen = pField->uiLen; -#ifndef HB_CDP_SUPPORT_OFF if( ( pField->uiFlags & HB_FF_BINARY ) == 0 ) { pszVal = hb_cdpnDup( ( const char * ) pArea->pRecord + pArea->pFieldOffset[ uiIndex ], @@ -1818,7 +1815,6 @@ static HB_ERRCODE hb_dbfGetValue( DBFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem hb_itemPutCLPtr( pItem, pszVal, ulLen ); } else -#endif { pszVal = ( char * ) pArea->pRecord + pArea->pFieldOffset[ uiIndex ]; hb_itemPutCL( pItem, pszVal, ulLen ); @@ -1834,12 +1830,10 @@ static HB_ERRCODE hb_dbfGetValue( DBFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem if( ulLen > ( ULONG ) pField->uiLen ) ulLen = pField->uiLen; } -#ifndef HB_CDP_SUPPORT_OFF if( ( pField->uiFlags & HB_FF_BINARY ) == 0 ) pszVal = hb_cdpnDup( ( const char * ) pArea->pRecord + pArea->pFieldOffset[ uiIndex ], &ulLen, pArea->area.cdPage, hb_vmCDP() ); else -#endif pszVal = ( char * ) pArea->pRecord + pArea->pFieldOffset[ uiIndex ]; hb_itemPutCLPtr( pItem, pszVal, ulLen ); @@ -2269,7 +2263,6 @@ static HB_ERRCODE hb_dbfPutValue( DBFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem if( pField->uiType == HB_FT_STRING ) { -#ifndef HB_CDP_SUPPORT_OFF if( ( pField->uiFlags & HB_FF_BINARY ) == 0 ) { hb_cdpnDup2( pszPtr, ulSize, @@ -2277,7 +2270,6 @@ static HB_ERRCODE hb_dbfPutValue( DBFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem &ulLen, hb_vmCDP(), pArea->area.cdPage ); } else -#endif { if( ulLen > ulSize ) ulLen = ulSize; @@ -2290,7 +2282,6 @@ static HB_ERRCODE hb_dbfPutValue( DBFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem } else if( pField->uiType == HB_FT_VARLENGTH ) { -#ifndef HB_CDP_SUPPORT_OFF if( ( pField->uiFlags & HB_FF_BINARY ) == 0 ) { if( ulLen > ( ULONG ) sizeof( szBuffer ) ) @@ -2299,7 +2290,6 @@ static HB_ERRCODE hb_dbfPutValue( DBFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem hb_vmCDP(), pArea->area.cdPage ); } else -#endif { if( ulLen > ulSize ) ulLen = ulSize; @@ -3141,7 +3131,6 @@ static HB_ERRCODE hb_dbfCreate( DBFAREAP pArea, LPDBOPENINFO pCreateInfo ) } pArea->ulMemoBlockSize = 0; -#ifndef HB_CDP_SUPPORT_OFF if( pCreateInfo->cdpId ) { pArea->area.cdPage = hb_cdpFindExt( pCreateInfo->cdpId ); @@ -3150,7 +3139,6 @@ static HB_ERRCODE hb_dbfCreate( DBFAREAP pArea, LPDBOPENINFO pCreateInfo ) } else pArea->area.cdPage = hb_vmCDP(); -#endif pItem = hb_itemNew( NULL ); if( SELF_RDDINFO( SELF_RDDNODE( &pArea->area ), RDDI_PENDINGPASSWORD, @@ -3721,7 +3709,7 @@ static HB_ERRCODE hb_dbfOpen( DBFAREAP pArea, LPDBOPENINFO pOpenInfo ) if( !pArea->bLockType ) pArea->bLockType = DB_DBFLOCK_CLIP; } -#ifndef HB_CDP_SUPPORT_OFF + if( pOpenInfo->cdpId ) { pArea->area.cdPage = hb_cdpFindExt( pOpenInfo->cdpId ); @@ -3730,7 +3718,7 @@ static HB_ERRCODE hb_dbfOpen( DBFAREAP pArea, LPDBOPENINFO pOpenInfo ) } else pArea->area.cdPage = hb_vmCDP(); -#endif + pArea->fShared = pOpenInfo->fShared; pArea->fReadonly = pOpenInfo->fReadonly; /* Force exclusive mode @@ -4385,7 +4373,6 @@ static HB_ERRCODE hb_dbfPack( DBFAREAP pArea ) return SELF_GOTO( ( AREAP ) pArea, 1 ); } -#ifndef HB_CDP_SUPPORT_OFF void hb_dbfTranslateRec( DBFAREAP pArea, BYTE * pBuffer, PHB_CODEPAGE cdp_src, PHB_CODEPAGE cdp_dest ) { char * pTmpBuf = NULL; @@ -4425,7 +4412,6 @@ void hb_dbfTranslateRec( DBFAREAP pArea, BYTE * pBuffer, PHB_CODEPAGE cdp_src, P if( pTmpBuf != NULL ) hb_xfree( pTmpBuf ); } -#endif /* * Physically reorder a database. @@ -4518,12 +4504,12 @@ static HB_ERRCODE hb_dbfSort( DBFAREAP pArea, LPDBSORTINFO pSortInfo ) /* Copy data */ memcpy( pBuffer, pArea->pRecord, pArea->uiRecordLen ); -#ifndef HB_CDP_SUPPORT_OFF + if( pArea->area.cdPage != hb_vmCDP() ) { hb_dbfTranslateRec( pArea, pBuffer, pArea->area.cdPage, hb_vmCDP() ); } -#endif + pBuffer += pArea->uiRecordLen; uiCount++; } diff --git a/harbour/src/rdd/dbfcdx/dbfcdx1.c b/harbour/src/rdd/dbfcdx/dbfcdx1.c index ea0193e2aa..84fff7ea09 100644 --- a/harbour/src/rdd/dbfcdx/dbfcdx1.c +++ b/harbour/src/rdd/dbfcdx/dbfcdx1.c @@ -64,7 +64,6 @@ /* #define HB_CDX_DBGCODE_EXT #define HB_CDX_DSPDBG_INFO -#define HB_CDP_SUPPORT_OFF #define HB_CDX_DBGTIME #define HB_CDX_DBGUPDT */ @@ -226,7 +225,6 @@ static HB_ERRCODE hb_cdxErrorRT( CDXAREAP pArea, */ static void hb_cdxMakeSortTab( CDXAREAP pArea ) { -#ifndef HB_CDP_SUPPORT_OFF if( pArea->dbfarea.area.cdPage && pArea->dbfarea.area.cdPage->sort && !( pArea->fSortCDP || pArea->bCdxSortTab ) ) { @@ -267,9 +265,6 @@ static void hb_cdxMakeSortTab( CDXAREAP pArea ) hb_xfree( pbSort ); } } -#else - HB_SYMBOL_UNUSED( pArea ); -#endif } /* @@ -402,7 +397,6 @@ static int hb_cdxValCompare( LPCDXTAG pTag, BYTE * val1, BYTE len1, if( pTag->uiType == 'C' ) { -#ifndef HB_CDP_SUPPORT_OFF if( pTag->pIndex->pArea->bCdxSortTab ) { BYTE * pSort = pTag->pIndex->pArea->bCdxSortTab; @@ -421,10 +415,8 @@ static int hb_cdxValCompare( LPCDXTAG pTag, BYTE * val1, BYTE len1, ( const char * ) val2, ( ULONG ) iLimit, pTag->pIndex->pArea->dbfarea.area.cdPage, 0 ); } - else -#endif - if( iLimit > 0 ) - iResult = memcmp( val1, val2, iLimit ); + else if( iLimit > 0 ) + iResult = memcmp( val1, val2, iLimit ); if( iResult == 0 ) { @@ -514,7 +506,6 @@ static LPCDXKEY hb_cdxKeyPutItem( LPCDXKEY pKey, PHB_ITEM pItem, ULONG ulRec, LP switch( hb_cdxItemType( pItem ) ) { case 'C': -#ifndef HB_CDP_SUPPORT_OFF if( fTrans && hb_vmCDP() != pTag->pIndex->pArea->dbfarea.area.cdPage ) { ulLen = pTag->uiLen; @@ -540,9 +531,6 @@ static LPCDXKEY hb_cdxKeyPutItem( LPCDXKEY pKey, PHB_ITEM pItem, ULONG ulRec, LP } } else -#else - HB_SYMBOL_UNUSED( fTrans ); -#endif { ulLen = hb_itemGetCLen( pItem ); if( ulLen > ( ULONG ) pTag->uiLen ) @@ -624,7 +612,6 @@ static PHB_ITEM hb_cdxKeyGetItem( LPCDXKEY pKey, PHB_ITEM pItem, LPCDXTAG pTag, switch( pTag->uiType ) { case 'C': -#ifndef HB_CDP_SUPPORT_OFF if( fTrans ) { ULONG ulLen = pKey->len; @@ -633,9 +620,6 @@ static PHB_ITEM hb_cdxKeyGetItem( LPCDXKEY pKey, PHB_ITEM pItem, LPCDXTAG pTag, pItem = hb_itemPutCLPtr( pItem, pszVal, ulLen ); } else -#else - HB_SYMBOL_UNUSED( fTrans ); -#endif { pItem = hb_itemPutCL( pItem, ( char * ) pKey->val, pKey->len ); } @@ -688,9 +672,7 @@ static LPCDXKEY hb_cdxKeyEval( LPCDXKEY pKey, LPCDXTAG pTag ) { CDXAREAP pArea = pTag->pIndex->pArea; PHB_ITEM pItem; -#ifndef HB_CDP_SUPPORT_OFF PHB_CODEPAGE cdpTmp = hb_cdpSelect( pArea->dbfarea.area.cdPage ); -#endif if( pTag->nField ) { @@ -715,9 +697,7 @@ static LPCDXKEY hb_cdxKeyEval( LPCDXKEY pKey, LPCDXTAG pTag ) hb_rddSelectWorkAreaNumber( iCurrArea ); } -#ifndef HB_CDP_SUPPORT_OFF hb_cdpSelect( cdpTmp ); -#endif return pKey; } @@ -5432,12 +5412,11 @@ static BOOL hb_cdxDBOISkipWild( CDXAREAP pArea, LPCDXTAG pTag, BOOL fForward, return fForward ? pArea->dbfarea.fPositioned : !pArea->dbfarea.area.fBof; } -#ifndef HB_CDP_SUPPORT_OFF if( pArea->dbfarea.area.cdPage != hb_vmCDP() ) { szPattern = szFree = hb_cdpDup( szPattern, hb_vmCDP(), pArea->dbfarea.area.cdPage ); } -#endif + while( iFixed < pTag->uiLen && szPattern[ iFixed ] && szPattern[ iFixed ] != '*' && szPattern[ iFixed ] != '?' ) { @@ -5565,7 +5544,6 @@ static BOOL hb_cdxRegexMatch( CDXAREAP pArea, PHB_REGEX pRegEx, LPCDXKEY pKey ) { char * szKey = ( char * ) pKey->val; ULONG ulLen = pKey->len; -#ifndef HB_CDP_SUPPORT_OFF char szBuff[ CDX_MAXKEY + 1 ]; if( pArea->dbfarea.area.cdPage != hb_vmCDP() ) @@ -5576,9 +5554,7 @@ static BOOL hb_cdxRegexMatch( CDXAREAP pArea, PHB_REGEX pRegEx, LPCDXKEY pKey ) szBuff[ ulLen ] = '\0'; szKey = szBuff; } -#else - HB_SYMBOL_UNUSED( pArea ); -#endif + return hb_regexMatch( pRegEx, szKey, ulLen, FALSE ); } @@ -9336,9 +9312,7 @@ static void hb_cdxTagDoIndex( LPCDXTAG pTag, BOOL fReindex ) PHB_ITEM pForItem, pWhileItem = NULL, pEvalItem = NULL, pItem = NULL; ULONG ulRecCount, ulRecNo = pArea->dbfarea.ulRecNo; LONG lStep = 0; -#ifndef HB_CDP_SUPPORT_OFF PHB_CODEPAGE cdpTmp = hb_cdpSelect( pArea->dbfarea.area.cdPage ); -#endif if( pArea->dbfarea.area.lpdbOrdCondInfo ) { @@ -9620,9 +9594,7 @@ static void hb_cdxTagDoIndex( LPCDXTAG pTag, BOOL fReindex ) hb_cdxSortFree( pSort ); pArea->pSort = NULL; -#ifndef HB_CDP_SUPPORT_OFF hb_cdpSelect( cdpTmp ); -#endif } diff --git a/harbour/src/rdd/dbffpt/dbffpt1.c b/harbour/src/rdd/dbffpt/dbffpt1.c index 9b9809f59d..c54af87542 100644 --- a/harbour/src/rdd/dbffpt/dbffpt1.c +++ b/harbour/src/rdd/dbffpt/dbffpt1.c @@ -78,9 +78,7 @@ #include "hbsxfunc.h" #include "rddsys.ch" -#ifndef HB_CDP_SUPPORT_OFF -# include "hbapicdp.h" -#endif +#include "hbapicdp.h" #define FPT_DIRECT_TRANS( p ) ( hb_vmCDP() != ( p )->area.cdPage ) @@ -1112,14 +1110,12 @@ static ULONG hb_fptCountSMTItemLength( FPTAREAP pArea, PHB_ITEM pItem, case HB_IT_MEMO: case HB_IT_STRING: ulLen = hb_itemGetCLen( pItem ); -#ifndef HB_CDP_SUPPORT_OFF if( fTrans ) { ulLen = hb_cdpnDup2Len( hb_itemGetCPtr( pItem ), ulLen, 0xFFFF, hb_vmCDP(), pArea->area.cdPage ); } else -#endif { if( ulLen > 0xFFFF ) ulLen = 0xFFFF; @@ -1245,7 +1241,6 @@ static ULONG hb_fptStoreSMTItem( FPTAREAP pArea, PHB_ITEM pItem, BYTE ** bBufPtr if( ulLen > 0 ) { u = 0xFFFF; -#ifndef HB_CDP_SUPPORT_OFF if( fTrans ) { hb_cdpnDup2( hb_itemGetCPtr( pItem ), ulLen, @@ -1254,7 +1249,6 @@ static ULONG hb_fptStoreSMTItem( FPTAREAP pArea, PHB_ITEM pItem, BYTE ** bBufPtr ulLen = u; } else -#endif { if( ulLen > u ) ulLen = u; @@ -1352,14 +1346,12 @@ static HB_ERRCODE hb_fptReadRawSMTItem( FPTAREAP pArea, PHB_ITEM pItem, HB_FOFFS return EDBF_READ; } *pfOffset += ulLen; -#ifndef HB_CDP_SUPPORT_OFF if( fTrans && ulLen > 0 ) { ULONG ulSize = ulLen + 1; hb_cdpnDup3( pBuffer, ulLen, pBuffer, &ulLen, &pBuffer, &ulSize, pArea->area.cdPage, hb_vmCDP() ); } -#endif hb_itemPutCLPtr( pItem, pBuffer, ulLen ); break; @@ -1459,14 +1451,12 @@ static HB_ERRCODE hb_fptReadSMTItem( FPTAREAP pArea, BYTE ** pbMemoBuf, BYTE * b { char * pszStr = ( char * ) ( *pbMemoBuf ); *pbMemoBuf += ulLen; -#ifndef HB_CDP_SUPPORT_OFF if( fTrans && ulLen > 0 ) { pszStr = hb_cdpnDup( pszStr, &ulLen, pArea->area.cdPage, hb_vmCDP() ); hb_itemPutCLPtr( pItem, pszStr, ulLen ); } else -#endif hb_itemPutCL( pItem, pszStr, ulLen ); } break; @@ -1562,14 +1552,12 @@ static ULONG hb_fptCountSixItemLength( FPTAREAP pArea, PHB_ITEM pItem, ulLen = hb_itemGetCLen( pItem ); /* only 2 bytes (SHORT) for SIX compatibility */ u = pArea->uiMemoVersion == DB_MEMOVER_SIX ? 0xFFFF : ULONG_MAX; -#ifndef HB_CDP_SUPPORT_OFF if( fTrans && ulLen > 0 ) { ulLen = hb_cdpnDup2Len( hb_itemGetCPtr( pItem ), ulLen, u, hb_vmCDP(), pArea->area.cdPage ); } else -#endif { if( ulLen > u ) ulLen = u; @@ -1673,7 +1661,6 @@ static ULONG hb_fptStoreSixItem( FPTAREAP pArea, PHB_ITEM pItem, BYTE ** bBufPtr { /* only 2 bytes (SHORT) for SIX compatibility */ u = pArea->uiMemoVersion == DB_MEMOVER_SIX ? 0xFFFF : ULONG_MAX; -#ifndef HB_CDP_SUPPORT_OFF if( fTrans ) { hb_cdpnDup2( hb_itemGetCPtr( pItem ), ulLen, @@ -1682,7 +1669,6 @@ static ULONG hb_fptStoreSixItem( FPTAREAP pArea, PHB_ITEM pItem, BYTE ** bBufPtr ulLen = u; } else -#endif { if( ulLen > u ) ulLen = u; @@ -1743,7 +1729,6 @@ static HB_ERRCODE hb_fptReadSixItem( FPTAREAP pArea, BYTE ** pbMemoBuf, BYTE * b if( bBufEnd - (*pbMemoBuf) >= ( LONG ) ulLen ) { char * pszStr = ( char * ) ( *pbMemoBuf ); -#ifndef HB_CDP_SUPPORT_OFF if( fTrans && ulLen > 0 ) { ULONG ulSize = ulLen; @@ -1751,7 +1736,6 @@ static HB_ERRCODE hb_fptReadSixItem( FPTAREAP pArea, BYTE ** pbMemoBuf, BYTE * b hb_itemPutCLPtr( pItem, pszStr, ulSize ); } else -#endif hb_itemPutCL( pItem, pszStr, ulLen ); } else @@ -1826,14 +1810,12 @@ static ULONG hb_fptCountFlexItemLength( FPTAREAP pArea, PHB_ITEM pItem, case HB_IT_MEMO: case HB_IT_STRING: ulLen = hb_itemGetCLen( pItem ); -#ifndef HB_CDP_SUPPORT_OFF if( fTrans ) { ulLen = hb_cdpnDup2Len( hb_itemGetCPtr( pItem ), ulLen, 0xFFFF, hb_vmCDP(), pArea->area.cdPage ); } else -#endif { if( ulLen > 0xFFFF ) ulLen = 0xFFFF; @@ -1893,7 +1875,6 @@ static void hb_fptStoreFlexItem( FPTAREAP pArea, PHB_ITEM pItem, BYTE ** bBufPtr { *(*bBufPtr)++ = FPTIT_FLEXAR_STR; u = 0xFFFF; -#ifndef HB_CDP_SUPPORT_OFF if( fTrans ) { hb_cdpnDup2( hb_itemGetCPtr( pItem ), ulLen, @@ -1902,7 +1883,6 @@ static void hb_fptStoreFlexItem( FPTAREAP pArea, PHB_ITEM pItem, BYTE ** bBufPtr ulLen = u; } else -#endif { if( ulLen > u ) ulLen = u; @@ -2309,14 +2289,12 @@ static HB_ERRCODE hb_fptReadFlexItem( FPTAREAP pArea, BYTE ** pbMemoBuf, BYTE * { char * pszStr = ( char * ) ( *pbMemoBuf ); *pbMemoBuf += ulLen; -#ifndef HB_CDP_SUPPORT_OFF if( fTrans && ulLen > 0 ) { pszStr = hb_cdpnDup( pszStr, &ulLen, pArea->area.cdPage, hb_vmCDP() ); hb_itemPutCLPtr( pItem, pszStr, ulLen ); } else -#endif hb_itemPutCL( pItem, pszStr, ulLen ); } else @@ -2646,7 +2624,6 @@ static HB_ERRCODE hb_fptGetMemo( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem, } else if( pArea->bMemoType == DB_MEMO_DBT ) { -#ifndef HB_CDP_SUPPORT_OFF if( fTrans && ulSize != 0 ) { ULONG ulBufSize = ulSize + 1; @@ -2654,7 +2631,6 @@ static HB_ERRCODE hb_fptGetMemo( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem, &pBuffer, &ulBufSize, pArea->area.cdPage, hb_vmCDP() ); } -#endif hb_itemPutCLPtr( pItem, pBuffer, ulSize ); hb_itemSetCMemo( pItem ); pBuffer = NULL; @@ -2663,7 +2639,6 @@ static HB_ERRCODE hb_fptGetMemo( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem, { if( ulType == SMT_IT_CHAR ) { -#ifndef HB_CDP_SUPPORT_OFF if( fTrans && ulSize != 0 ) { ULONG ulBufSize = ulSize + 1; @@ -2671,7 +2646,6 @@ static HB_ERRCODE hb_fptGetMemo( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem, &pBuffer, &ulBufSize, pArea->area.cdPage, hb_vmCDP() ); } -#endif hb_itemPutCLPtr( pItem, pBuffer, ulSize ); hb_itemSetCMemo( pItem ); pBuffer = NULL; @@ -2748,7 +2722,6 @@ static HB_ERRCODE hb_fptGetMemo( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem, hb_itemPutND( pItem, 0.0 /* HB_GET_LE_DOUBLE( pBuffer ) */ ); break; case FPTIT_TEXT: -#ifndef HB_CDP_SUPPORT_OFF if( fTrans && ulSize != 0 ) { ULONG ulBufSize = ulSize + 1; @@ -2756,7 +2729,6 @@ static HB_ERRCODE hb_fptGetMemo( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem, &pBuffer, &ulBufSize, pArea->area.cdPage, hb_vmCDP() ); } -#endif hb_itemPutCLPtr( pItem, pBuffer, ulSize ); hb_itemSetCMemo( pItem ); pBuffer = NULL; @@ -2938,7 +2910,6 @@ static HB_ERRCODE hb_fptPutMemo( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem, ulType = FPTIT_TEXT; ulSize = hb_itemGetCLen( pItem ); bBufPtr = ( BYTE *) hb_itemGetCPtr( pItem ); -#ifndef HB_CDP_SUPPORT_OFF if( ulSize > 0 && fTrans ) { bBufPtr = bBufAlloc = ( BYTE * ) @@ -2949,7 +2920,6 @@ static HB_ERRCODE hb_fptPutMemo( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem, { ulType = SMT_IT_CHAR; } -#endif } else if( pArea->bMemoType == DB_MEMO_DBT ) { @@ -3261,7 +3231,6 @@ static HB_ERRCODE hb_fptGetVarField( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pI if( uiType <= pField->uiLen - 2 ) { -#ifndef HB_CDP_SUPPORT_OFF if( ulLen > 0 && ( pField->uiFlags & HB_FF_BINARY ) == 0 && hb_vmCDP() != pArea->area.cdPage ) { @@ -3269,7 +3238,6 @@ static HB_ERRCODE hb_fptGetVarField( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pI pArea->area.cdPage, hb_vmCDP() ); } else -#endif pString = ( const char * ) pFieldBuf; } else @@ -3285,7 +3253,6 @@ static HB_ERRCODE hb_fptGetVarField( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pI pPtr += uiVLen; } errCode = hb_fptReadRawBlock( pArea, ( BYTE * ) pPtr, FS_ERROR, ulBlock, ulSize ); -#ifndef HB_CDP_SUPPORT_OFF if( errCode == HB_SUCCESS && ulLen > 0 && ( pField->uiFlags & HB_FF_BINARY ) == 0 && hb_vmCDP() != pArea->area.cdPage ) @@ -3294,7 +3261,6 @@ static HB_ERRCODE hb_fptGetVarField( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pI pString = hb_cdpnDup3( pString, ulLen, pAlloc, &ulLen, &pAlloc, &ulSize, pArea->area.cdPage, hb_vmCDP() ); } -#endif } if( errCode == HB_SUCCESS ) @@ -3646,7 +3612,6 @@ static HB_ERRCODE hb_fptPutVarField( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pI pBlock = ( BYTE * ) hb_itemGetCPtr( pItem ); if( ulLen > HB_VF_CHAR ) ulLen = HB_VF_CHAR; -#ifndef HB_CDP_SUPPORT_OFF if( ulLen > 0 && ( pField->uiFlags & HB_FF_BINARY ) == 0 && hb_vmCDP() != pArea->area.cdPage ) { @@ -3656,7 +3621,6 @@ static HB_ERRCODE hb_fptPutVarField( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pI if( ulLen > HB_VF_CHAR ) ulLen = HB_VF_CHAR; } -#endif uiType = ( USHORT ) ulLen; if( uiType <= pField->uiLen - 2 ) { diff --git a/harbour/src/rdd/dbfnsx/dbfnsx1.c b/harbour/src/rdd/dbfnsx/dbfnsx1.c index 9975106f0f..942775bab3 100644 --- a/harbour/src/rdd/dbfnsx/dbfnsx1.c +++ b/harbour/src/rdd/dbfnsx/dbfnsx1.c @@ -659,7 +659,6 @@ static LPKEYINFO hb_nsxKeyPutItem( LPKEYINFO pKey, PHB_ITEM pItem, ULONG ulRecNo switch( hb_nsxItemType( pItem ) ) { case 'C': -#ifndef HB_CDP_SUPPORT_OFF if( fTrans ) { len = pTag->KeyLength; @@ -668,9 +667,6 @@ static LPKEYINFO hb_nsxKeyPutItem( LPKEYINFO pKey, PHB_ITEM pItem, ULONG ulRecNo hb_vmCDP(), pTag->pIndex->pArea->dbfarea.area.cdPage ); } else -#else - HB_SYMBOL_UNUSED( fTrans ); -#endif { len = hb_itemGetCLen( pItem ); if( len > ( ULONG ) pTag->KeyLength ) @@ -726,7 +722,6 @@ static PHB_ITEM hb_nsxKeyGetItem( PHB_ITEM pItem, LPKEYINFO pKey, switch( pTag->KeyType ) { case 'C': -#ifndef HB_CDP_SUPPORT_OFF if( fTrans ) { ULONG ulLen = pTag->KeyLength; @@ -735,9 +730,6 @@ static PHB_ITEM hb_nsxKeyGetItem( PHB_ITEM pItem, LPKEYINFO pKey, pItem = hb_itemPutCLPtr( pItem, pszVal, ulLen ); } else -#else - HB_SYMBOL_UNUSED( fTrans ); -#endif { pItem = hb_itemPutCL( pItem, ( char * ) pKey->val, pTag->KeyLength ); } @@ -779,9 +771,7 @@ static LPKEYINFO hb_nsxEvalKey( LPKEYINFO pKey, LPTAGINFO pTag ) { NSXAREAP pArea = pTag->pIndex->pArea; PHB_ITEM pItem; -#ifndef HB_CDP_SUPPORT_OFF PHB_CODEPAGE cdpTmp = hb_cdpSelect( pArea->dbfarea.area.cdPage ); -#endif if( pTag->nField ) { @@ -806,9 +796,7 @@ static LPKEYINFO hb_nsxEvalKey( LPKEYINFO pKey, LPTAGINFO pTag ) hb_rddSelectWorkAreaNumber( iCurrArea ); } -#ifndef HB_CDP_SUPPORT_OFF hb_cdpSelect( cdpTmp ); -#endif return pKey; } @@ -871,13 +859,11 @@ static int hb_nsxValCompare( LPTAGINFO pTag, UCHAR * val1, int len1, { if( iLimit > 0 ) { -#ifndef HB_CDP_SUPPORT_OFF if( pTag->pIndex->pArea->dbfarea.area.cdPage->sort ) iResult = hb_cdpcmp( ( const char * ) val1, ( ULONG ) iLimit, ( const char * ) val2, ( ULONG ) iLimit, pTag->pIndex->pArea->dbfarea.area.cdPage, 0 ); else -#endif iResult = memcmp( val1, val2, iLimit ); } @@ -4602,12 +4588,10 @@ static BOOL hb_nsxOrdSkipWild( LPTAGINFO pTag, BOOL fForward, PHB_ITEM pWildItm return fForward ? !pArea->dbfarea.area.fEof : !pArea->dbfarea.area.fBof; } -#ifndef HB_CDP_SUPPORT_OFF if( pArea->dbfarea.area.cdPage != hb_vmCDP() ) { szPattern = szFree = hb_cdpDup( szPattern, hb_vmCDP(), pArea->dbfarea.area.cdPage ); } -#endif while( iFixed < pTag->KeyLength && szPattern[ iFixed ] && szPattern[ iFixed ] != '*' && szPattern[ iFixed ] != '?' ) { @@ -4710,7 +4694,6 @@ static BOOL hb_nsxOrdSkipWild( LPTAGINFO pTag, BOOL fForward, PHB_ITEM pWildItm static BOOL hb_nsxRegexMatch( LPTAGINFO pTag, PHB_REGEX pRegEx, const char * szKey ) { ULONG ulLen = pTag->KeyLength; -#ifndef HB_CDP_SUPPORT_OFF char szBuff[ NSX_MAXKEYLEN + 1 ]; if( pTag->pIndex->pArea->dbfarea.area.cdPage != hb_vmCDP() ) @@ -4721,9 +4704,6 @@ static BOOL hb_nsxRegexMatch( LPTAGINFO pTag, PHB_REGEX pRegEx, const char * szK szBuff[ ulLen ] = '\0'; szKey = szBuff; } -#else - HB_SYMBOL_UNUSED( pTag ); -#endif return hb_regexMatch( pRegEx, szKey, ulLen, FALSE ); } @@ -5812,9 +5792,7 @@ static HB_ERRCODE hb_nsxTagCreate( LPTAGINFO pTag, BOOL fReindex ) char szBuffer[ NSX_MAXKEYLEN ]; int iRecBuff = 0, iRecBufSize, iRec; double d; -#ifndef HB_CDP_SUPPORT_OFF PHB_CODEPAGE cdpTmp = hb_cdpSelect( pArea->dbfarea.area.cdPage ); -#endif pForItem = pTag->pForItem; if( pTag->nField ) @@ -6017,9 +5995,7 @@ static HB_ERRCODE hb_nsxTagCreate( LPTAGINFO pTag, BOOL fReindex ) hb_itemRelease( pItem ); pArea->lpCurTag = pSaveTag; -#ifndef HB_CDP_SUPPORT_OFF hb_cdpSelect( cdpTmp ); -#endif } hb_nsxSortFree( pSort, TRUE ); diff --git a/harbour/src/rdd/dbfntx/dbfntx1.c b/harbour/src/rdd/dbfntx/dbfntx1.c index 3fa8298833..105d68e630 100644 --- a/harbour/src/rdd/dbfntx/dbfntx1.c +++ b/harbour/src/rdd/dbfntx/dbfntx1.c @@ -145,9 +145,7 @@ #include "hbrddntx.h" #include "rddsys.ch" #include "hbregex.h" -#ifndef HB_CDP_SUPPORT_OFF - #include "hbapicdp.h" -#endif +#include "hbapicdp.h" #ifdef HB_NTX_DEBUG_DISP static ULONG s_rdNO = 0; @@ -440,7 +438,6 @@ static LPKEYINFO hb_ntxKeyPutItem( LPKEYINFO pKey, PHB_ITEM pItem, ULONG ulRecNo switch( hb_ntxItemType( pItem ) ) { case 'C': -#ifndef HB_CDP_SUPPORT_OFF if( fTrans ) { len = pTag->KeyLength; @@ -449,9 +446,6 @@ static LPKEYINFO hb_ntxKeyPutItem( LPKEYINFO pKey, PHB_ITEM pItem, ULONG ulRecNo hb_vmCDP(), pTag->Owner->Owner->dbfarea.area.cdPage ); } else -#else - HB_SYMBOL_UNUSED( fTrans ); -#endif { len = hb_itemGetCLen( pItem ); if( len > ( ULONG ) pTag->KeyLength ) @@ -520,7 +514,6 @@ static PHB_ITEM hb_ntxKeyGetItem( PHB_ITEM pItem, LPKEYINFO pKey, switch( pTag->KeyType ) { case 'C': -#ifndef HB_CDP_SUPPORT_OFF if( fTrans ) { ULONG ulLen = pTag->KeyLength; @@ -529,9 +522,6 @@ static PHB_ITEM hb_ntxKeyGetItem( PHB_ITEM pItem, LPKEYINFO pKey, pItem = hb_itemPutCLPtr( pItem, pszVal, ulLen ); } else -#else - HB_SYMBOL_UNUSED( fTrans ); -#endif { pItem = hb_itemPutCL( pItem, pKey->key, pTag->KeyLength ); } @@ -645,9 +635,7 @@ static LPKEYINFO hb_ntxEvalKey( LPKEYINFO pKey, LPTAGINFO pTag ) { NTXAREAP pArea = pTag->Owner->Owner; PHB_ITEM pItem; -#ifndef HB_CDP_SUPPORT_OFF PHB_CODEPAGE cdpTmp = hb_cdpSelect( pArea->dbfarea.area.cdPage ); -#endif if( pTag->nField ) { @@ -672,9 +660,7 @@ static LPKEYINFO hb_ntxEvalKey( LPKEYINFO pKey, LPTAGINFO pTag ) hb_rddSelectWorkAreaNumber( iCurrArea ); } -#ifndef HB_CDP_SUPPORT_OFF hb_cdpSelect( cdpTmp ); -#endif return pKey; } @@ -693,11 +679,9 @@ static int hb_ntxValCompare( LPTAGINFO pTag, const char* val1, int len1, { if( iLimit > 0 ) { -#ifndef HB_CDP_SUPPORT_OFF if( pTag->Owner->Owner->dbfarea.area.cdPage->sort ) iResult = hb_cdpcmp( val1, ( ULONG ) iLimit, val2, ( ULONG ) iLimit, pTag->Owner->Owner->dbfarea.area.cdPage, 0 ); else -#endif iResult = memcmp( val1, val2, iLimit ); } @@ -4237,12 +4221,11 @@ static BOOL hb_ntxOrdSkipWild( LPTAGINFO pTag, BOOL fForward, PHB_ITEM pWildItm return fForward ? !pArea->dbfarea.area.fEof : !pArea->dbfarea.area.fBof; } -#ifndef HB_CDP_SUPPORT_OFF if( pArea->dbfarea.area.cdPage != hb_vmCDP() ) { szPattern = szFree = hb_cdpDup( szPattern, hb_vmCDP(), pArea->dbfarea.area.cdPage ); } -#endif + while( iFixed < pTag->KeyLength && szPattern[ iFixed ] && szPattern[ iFixed ] != '*' && szPattern[ iFixed ] != '?' ) { @@ -4344,7 +4327,6 @@ static BOOL hb_ntxOrdSkipWild( LPTAGINFO pTag, BOOL fForward, PHB_ITEM pWildItm static BOOL hb_ntxRegexMatch( LPTAGINFO pTag, PHB_REGEX pRegEx, char * szKey ) { ULONG ulLen = pTag->KeyLength; -#ifndef HB_CDP_SUPPORT_OFF char szBuff[ NTX_MAX_KEY + 1 ]; if( pTag->Owner->Owner->dbfarea.area.cdPage != hb_vmCDP() ) @@ -4355,9 +4337,7 @@ static BOOL hb_ntxRegexMatch( LPTAGINFO pTag, PHB_REGEX pRegEx, char * szKey ) szBuff[ ulLen ] = '\0'; szKey = szBuff; } -#else - HB_SYMBOL_UNUSED( pTag ); -#endif + return hb_regexMatch( pRegEx, szKey, ulLen, FALSE ); } @@ -5332,9 +5312,7 @@ static HB_ERRCODE hb_ntxTagCreate( LPTAGINFO pTag, BOOL fReindex ) BYTE * pSaveRecBuff = pArea->dbfarea.pRecord; char szBuffer[ NTX_MAX_KEY ]; int iRecBuff = 0, iRecBufSize, iRec; -#ifndef HB_CDP_SUPPORT_OFF PHB_CODEPAGE cdpTmp = hb_cdpSelect( pArea->dbfarea.area.cdPage ); -#endif pForItem = pTag->pForItem; if( pTag->nField ) @@ -5538,9 +5516,7 @@ static HB_ERRCODE hb_ntxTagCreate( LPTAGINFO pTag, BOOL fReindex ) hb_itemRelease( pItem ); pArea->lpCurTag = pSaveTag; -#ifndef HB_CDP_SUPPORT_OFF hb_cdpSelect( cdpTmp ); -#endif } hb_ntxSortFree( pSort, TRUE ); diff --git a/harbour/src/rdd/delim1.c b/harbour/src/rdd/delim1.c index fdf15b1692..fe5639baa4 100644 --- a/harbour/src/rdd/delim1.c +++ b/harbour/src/rdd/delim1.c @@ -555,7 +555,6 @@ static HB_ERRCODE hb_delimGetValue( DELIMAREAP pArea, USHORT uiIndex, PHB_ITEM p switch( pField->uiType ) { case HB_FT_STRING: -#ifndef HB_CDP_SUPPORT_OFF if( ( pField->uiFlags & HB_FF_BINARY ) == 0 ) { ULONG ulLen = pField->uiLen; @@ -564,7 +563,6 @@ static HB_ERRCODE hb_delimGetValue( DELIMAREAP pArea, USHORT uiIndex, PHB_ITEM p hb_itemPutCLPtr( pItem, pszVal, ulLen ); } else -#endif { hb_itemPutCL( pItem, ( char * ) pArea->pRecord + pArea->pFieldOffset[ uiIndex ], pField->uiLen ); @@ -662,7 +660,6 @@ static HB_ERRCODE hb_delimPutValue( DELIMAREAP pArea, USHORT uiIndex, PHB_ITEM p { if( pField->uiType == HB_FT_STRING ) { -#ifndef HB_CDP_SUPPORT_OFF if( ( pField->uiFlags & HB_FF_BINARY ) == 0 ) { ulSize = pField->uiLen; @@ -671,7 +668,6 @@ static HB_ERRCODE hb_delimPutValue( DELIMAREAP pArea, USHORT uiIndex, PHB_ITEM p &ulSize, hb_vmCDP(), pArea->area.cdPage ); } else -#endif { ulSize = hb_itemGetCLen( pItem ); if( ulSize > ( ULONG ) pField->uiLen ) @@ -1261,7 +1257,7 @@ static HB_ERRCODE hb_delimCreate( DELIMAREAP pArea, LPDBOPENINFO pCreateInfo ) pArea->fShared = FALSE; /* pCreateInfo->fShared; */ pArea->fReadonly = FALSE; /* pCreateInfo->fReadonly */ -#ifndef HB_CDP_SUPPORT_OFF + if( pCreateInfo->cdpId ) { pArea->area.cdPage = hb_cdpFindExt( pCreateInfo->cdpId ); @@ -1270,7 +1266,6 @@ static HB_ERRCODE hb_delimCreate( DELIMAREAP pArea, LPDBOPENINFO pCreateInfo ) } else pArea->area.cdPage = hb_vmCDP(); -#endif pFileName = hb_fsFNameSplit( pCreateInfo->abName ); if( hb_setGetDefExtension() && ! pFileName->szExtension ) @@ -1349,7 +1344,7 @@ static HB_ERRCODE hb_delimOpen( DELIMAREAP pArea, LPDBOPENINFO pOpenInfo ) pArea->fShared = TRUE; /* pOpenInfo->fShared; */ pArea->fReadonly = TRUE; /* pOpenInfo->fReadonly; */ -#ifndef HB_CDP_SUPPORT_OFF + if( pOpenInfo->cdpId ) { pArea->area.cdPage = hb_cdpFindExt( pOpenInfo->cdpId ); @@ -1358,7 +1353,6 @@ static HB_ERRCODE hb_delimOpen( DELIMAREAP pArea, LPDBOPENINFO pOpenInfo ) } else pArea->area.cdPage = hb_vmCDP(); -#endif uiFlags = ( pArea->fReadonly ? FO_READ : FO_READWRITE ) | ( pArea->fShared ? FO_DENYNONE : FO_EXCLUSIVE ); diff --git a/harbour/src/rdd/hbdbsort.c b/harbour/src/rdd/hbdbsort.c index bc50bbc4f0..7796c94a94 100644 --- a/harbour/src/rdd/hbdbsort.c +++ b/harbour/src/rdd/hbdbsort.c @@ -240,12 +240,10 @@ void hb_dbQSortComplete( LPDBQUICKSORT pQuickSort ) /* Remove deleted flag */ pQuickSort->pSwapBufferA[ 0 ] = ' '; -#ifndef HB_CDP_SUPPORT_OFF if( pArea->cdPage != hb_vmCDP() ) { hb_dbfTranslateRec( ( DBFAREAP ) pArea, ( BYTE * ) pQuickSort->pSwapBufferA, hb_vmCDP(), pArea->cdPage ); } -#endif /* Append a new record and copy data */ if( SELF_APPEND( pArea, TRUE ) == HB_FAILURE || diff --git a/harbour/src/rdd/hsx/hsx.c b/harbour/src/rdd/hsx/hsx.c index caf0385611..ab60bccc70 100644 --- a/harbour/src/rdd/hsx/hsx.c +++ b/harbour/src/rdd/hsx/hsx.c @@ -227,9 +227,7 @@ #include "hbvm.h" #include "hbthread.h" #include "hbset.h" -#ifndef HB_CDP_SUPPORT_OFF #include "hbapicdp.h" -#endif /* error codes */ #define HSX_SUCCESSFALSE 0 /* operation finished successfully with false value */ @@ -424,7 +422,6 @@ static int hb_hsxHashVal( int c1, int c2, int iKeyBits, if( fNoCase ) { -#ifndef HB_CDP_SUPPORT_OFF if( iFilter == 3 ) { PHB_CODEPAGE cdp = hb_vmCDP(); @@ -432,7 +429,6 @@ static int hb_hsxHashVal( int c1, int c2, int iKeyBits, c2 = ( UCHAR ) cdp->upper[ c2 ]; } else -#endif { if( c1 >= 'a' && c1 <= 'z' ) c1 -= 'a' - 'A'; @@ -514,7 +510,6 @@ static int hb_hsxStrCmp( const char * pSub, ULONG ulSub, const char * pStr, ULON c2 = ( UCHAR ) pStr[ ul ]; if( fNoCase ) { -#ifndef HB_CDP_SUPPORT_OFF if( iFilter == 3 ) { PHB_CODEPAGE cdp = hb_vmCDP(); @@ -522,7 +517,6 @@ static int hb_hsxStrCmp( const char * pSub, ULONG ulSub, const char * pStr, ULON c2 = ( UCHAR ) cdp->upper[ c2 ]; } else -#endif { if( c1 >= 'a' && c1 <= 'z' ) c1 -= 'a' - 'A'; @@ -540,8 +534,6 @@ static int hb_hsxStrCmp( const char * pSub, ULONG ulSub, const char * pStr, ULON c2 &= 0x7F; if( c2 < 0x20 || c2 == 0x7f ) c2 = ' '; } -#elif defined( HB_CDP_SUPPORT_OFF ) - HB_SYMBOL_UNUSED( iFilter ); #endif fResult = ( c1 == c2 ); } diff --git a/harbour/src/rdd/sdf1.c b/harbour/src/rdd/sdf1.c index cab16b34f7..14a5cb7b83 100644 --- a/harbour/src/rdd/sdf1.c +++ b/harbour/src/rdd/sdf1.c @@ -378,7 +378,6 @@ static HB_ERRCODE hb_sdfGetValue( SDFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem switch( pField->uiType ) { case HB_FT_STRING: -#ifndef HB_CDP_SUPPORT_OFF if( ( pField->uiFlags & HB_FF_BINARY ) == 0 ) { ULONG ulLen = pField->uiLen; @@ -387,7 +386,6 @@ static HB_ERRCODE hb_sdfGetValue( SDFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem hb_itemPutCLPtr( pItem, pszVal, ulLen ); } else -#endif { hb_itemPutCL( pItem, ( char * ) pArea->pRecord + pArea->pFieldOffset[ uiIndex ], pField->uiLen ); @@ -491,7 +489,6 @@ static HB_ERRCODE hb_sdfPutValue( SDFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem { if( pField->uiType == HB_FT_STRING ) { -#ifndef HB_CDP_SUPPORT_OFF if( ( pField->uiFlags & HB_FF_BINARY ) == 0 ) { ulSize = pField->uiLen; @@ -500,7 +497,6 @@ static HB_ERRCODE hb_sdfPutValue( SDFAREAP pArea, USHORT uiIndex, PHB_ITEM pItem &ulSize, hb_vmCDP(), pArea->area.cdPage ); } else -#endif { ulSize = hb_itemGetCLen( pItem ); if( ulSize > ( ULONG ) pField->uiLen ) @@ -1002,7 +998,7 @@ static HB_ERRCODE hb_sdfCreate( SDFAREAP pArea, LPDBOPENINFO pCreateInfo ) pArea->fShared = FALSE; /* pCreateInfo->fShared; */ pArea->fReadonly = FALSE; /* pCreateInfo->fReadonly */ -#ifndef HB_CDP_SUPPORT_OFF + if( pCreateInfo->cdpId ) { pArea->area.cdPage = hb_cdpFindExt( pCreateInfo->cdpId ); @@ -1011,7 +1007,6 @@ static HB_ERRCODE hb_sdfCreate( SDFAREAP pArea, LPDBOPENINFO pCreateInfo ) } else pArea->area.cdPage = hb_vmCDP(); -#endif pFileName = hb_fsFNameSplit( pCreateInfo->abName ); if( hb_setGetDefExtension() && ! pFileName->szExtension ) @@ -1090,7 +1085,7 @@ static HB_ERRCODE hb_sdfOpen( SDFAREAP pArea, LPDBOPENINFO pOpenInfo ) pArea->fShared = TRUE; /* pOpenInfo->fShared; */ pArea->fReadonly = TRUE; /* pOpenInfo->fReadonly; */ -#ifndef HB_CDP_SUPPORT_OFF + if( pOpenInfo->cdpId ) { pArea->area.cdPage = hb_cdpFindExt( pOpenInfo->cdpId ); @@ -1099,7 +1094,6 @@ static HB_ERRCODE hb_sdfOpen( SDFAREAP pArea, LPDBOPENINFO pOpenInfo ) } else pArea->area.cdPage = hb_vmCDP(); -#endif uiFlags = ( pArea->fReadonly ? FO_READ : FO_READWRITE ) | ( pArea->fShared ? FO_DENYNONE : FO_EXCLUSIVE ); diff --git a/harbour/src/rtl/gtcgi/gtcgi.c b/harbour/src/rtl/gtcgi/gtcgi.c index da9325a937..5b743c6560 100644 --- a/harbour/src/rtl/gtcgi/gtcgi.c +++ b/harbour/src/rtl/gtcgi/gtcgi.c @@ -231,7 +231,6 @@ static BOOL hb_gt_cgi_SetDispCP( PHB_GT pGT, const char *pszTermCDP, const char HB_GTSUPER_SETDISPCP( pGT, pszTermCDP, pszHostCDP, fBox ); -#ifndef HB_CDP_SUPPORT_OFF if( !pszHostCDP ) pszHostCDP = hb_cdpID(); if( !pszTermCDP ) @@ -246,7 +245,6 @@ static BOOL hb_gt_cgi_SetDispCP( PHB_GT pGT, const char *pszTermCDP, const char pGTCGI->fDispTrans = pGTCGI->cdpTerm && pGTCGI->cdpHost && pGTCGI->cdpTerm != pGTCGI->cdpHost; } -#endif return TRUE; } @@ -256,7 +254,6 @@ static void hb_gt_cgi_WriteCon( PHB_GT pGT, const char * szText, ULONG ulLength { PHB_GTCGI pGTCGI = HB_GTCGI_GET( pGT ); -#ifndef HB_CDP_SUPPORT_OFF if( pGTCGI->fDispTrans ) { ULONG ulLen = ulLength; @@ -266,7 +263,6 @@ static void hb_gt_cgi_WriteCon( PHB_GT pGT, const char * szText, ULONG ulLength hb_xfree( buffer ); } else -#endif hb_gt_cgi_termOut( pGTCGI, szText, ulLength ); while( ulLength-- ) @@ -387,7 +383,6 @@ static void hb_gt_cgi_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) } if( iLen ) { -#ifndef HB_CDP_SUPPORT_OFF if( pGTCGI->fDispTrans ) { ULONG ulLen = iLen; @@ -397,7 +392,6 @@ static void hb_gt_cgi_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) hb_xfree( buffer ); } else -#endif hb_gt_cgi_termOut( pGTCGI, pGTCGI->sLineBuf, iLen ); pGTCGI->iCol = iCol; diff --git a/harbour/src/rtl/gtcrs/gtcrs.c b/harbour/src/rtl/gtcrs/gtcrs.c index 3e883af0ee..e804e8a3d2 100644 --- a/harbour/src/rtl/gtcrs/gtcrs.c +++ b/harbour/src/rtl/gtcrs/gtcrs.c @@ -2827,7 +2827,6 @@ static BOOL hb_gt_crs_SetDispCP( PHB_GT pGT, const char *pszTermCDP, const char { HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_SetDispCP(%p,%s,%s,%d)", pGT, pszTermCDP, pszHostCDP, (int) fBox ) ); -#ifndef HB_CDP_SUPPORT_OFF HB_GTSUPER_SETDISPCP( pGT, pszTermCDP, pszHostCDP, fBox ); if( !pszHostCDP ) @@ -2838,9 +2837,6 @@ static BOOL hb_gt_crs_SetDispCP( PHB_GT pGT, const char *pszTermCDP, const char setDispTrans( s_ioBase, hb_cdpFind( pszHostCDP ), hb_cdpFind( pszTermCDP ), fBox ? 1 : 0 ); return TRUE; -#else - return HB_GTSUPER_SETDISPCP( pGT, pszTermCDP, pszHostCDP, fBox ); -#endif } /* *********************************************************************** */ @@ -2849,7 +2845,6 @@ static BOOL hb_gt_crs_SetKeyCP( PHB_GT pGT, const char *pszTermCDP, const char * { HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_SetKeyCP(%p,%s,%s)", pGT, pszTermCDP, pszHostCDP ) ); -#ifndef HB_CDP_SUPPORT_OFF HB_GTSUPER_SETKEYCP( pGT, pszTermCDP, pszHostCDP ); if( !pszHostCDP ) @@ -2860,9 +2855,6 @@ static BOOL hb_gt_crs_SetKeyCP( PHB_GT pGT, const char *pszTermCDP, const char * setKeyTrans( s_ioBase, hb_cdpFind( pszTermCDP ), hb_cdpFind( pszHostCDP ) ); return TRUE; -#else - return HB_GTSUPER_SETKEYCP( pGT, pszTermCDP, pszHostCDP ); -#endif } /* *********************************************************************** */ diff --git a/harbour/src/rtl/gtcrs/gtcrs.h b/harbour/src/rtl/gtcrs/gtcrs.h index ec8cdaf349..ce4b80aa7a 100644 --- a/harbour/src/rtl/gtcrs/gtcrs.h +++ b/harbour/src/rtl/gtcrs/gtcrs.h @@ -61,9 +61,7 @@ #include "hbapiitm.h" #include "hbapierr.h" -#ifndef HB_CDP_SUPPORT_OFF -# include "hbapicdp.h" -#endif +#include "hbapicdp.h" #if defined( HB_OS_HPUX ) # define _XOPEN_SOURCE_EXTENDED diff --git a/harbour/src/rtl/gtdos/gtdos.c b/harbour/src/rtl/gtdos/gtdos.c index d2f2653203..5748ac898b 100644 --- a/harbour/src/rtl/gtdos/gtdos.c +++ b/harbour/src/rtl/gtdos/gtdos.c @@ -1248,7 +1248,6 @@ static BOOL hb_gt_dos_SetDispCP( PHB_GT pGT, const char *pszTermCDP, const char HB_GTSUPER_SETDISPCP( pGT, pszTermCDP, pszHostCDP, fBox ); -#ifndef HB_CDP_SUPPORT_OFF if( !pszHostCDP ) pszHostCDP = hb_cdpID(); @@ -1265,12 +1264,6 @@ static BOOL hb_gt_dos_SetDispCP( PHB_GT pGT, const char *pszTermCDP, const char s_charTransRev[ i ] = ( BYTE ) hb_cdpTranslateChar( i, FALSE, cdpTerm, cdpHost ); } -#else - HB_SYMBOL_UNUSED( cdpTerm ); - HB_SYMBOL_UNUSED( cdpHost ); - for( i = 0; i < 256; i++ ) - s_charTransRev[ i ] = s_charTrans[ i ] = ( BYTE ) i; -#endif return TRUE; } @@ -1286,7 +1279,6 @@ static BOOL hb_gt_dos_SetKeyCP( PHB_GT pGT, const char *pszTermCDP, const char * HB_GTSUPER_SETKEYCP( pGT, pszTermCDP, pszHostCDP ); -#ifndef HB_CDP_SUPPORT_OFF if( !pszHostCDP ) pszHostCDP = hb_cdpID(); @@ -1301,12 +1293,6 @@ static BOOL hb_gt_dos_SetKeyCP( PHB_GT pGT, const char *pszTermCDP, const char * s_keyTrans[ i ] = ( BYTE ) hb_cdpTranslateChar( i, FALSE, cdpTerm, cdpHost ); } -#else - HB_SYMBOL_UNUSED( cdpTerm ); - HB_SYMBOL_UNUSED( cdpHost ); - for( i = 0; i < 256; i++ ) - s_keyTrans[ i ] = ( BYTE ) i; -#endif return TRUE; } diff --git a/harbour/src/rtl/gtpca/gtpca.c b/harbour/src/rtl/gtpca/gtpca.c index 465d3b8fed..c3fcb88c65 100644 --- a/harbour/src/rtl/gtpca/gtpca.c +++ b/harbour/src/rtl/gtpca/gtpca.c @@ -779,7 +779,6 @@ static BOOL hb_gt_pca_SetDispCP( PHB_GT pGT, const char *pszTermCDP, const char HB_GTSUPER_SETDISPCP( pGT, pszTermCDP, pszHostCDP, fBox ); -#ifndef HB_CDP_SUPPORT_OFF if( !pszHostCDP ) pszHostCDP = hb_cdpID(); if( !pszTermCDP ) @@ -791,7 +790,6 @@ static BOOL hb_gt_pca_SetDispCP( PHB_GT pGT, const char *pszTermCDP, const char s_cdpHost = hb_cdpFind( pszHostCDP ); s_fDispTrans = s_cdpTerm && s_cdpHost && s_cdpTerm != s_cdpHost; } -#endif return TRUE; } @@ -802,14 +800,12 @@ static BOOL hb_gt_pca_SetKeyCP( PHB_GT pGT, const char *pszTermCDP, const char * HB_GTSUPER_SETKEYCP( pGT, pszTermCDP, pszHostCDP ); -#ifndef HB_CDP_SUPPORT_OFF if( !pszHostCDP ) pszHostCDP = hb_cdpID(); if( !pszTermCDP ) pszTermCDP = pszHostCDP; hb_gt_pca_setKeyTrans( hb_cdpFind( pszTermCDP ), hb_cdpFind( pszHostCDP ) ); -#endif return TRUE; } @@ -832,7 +828,6 @@ static void hb_gt_pca_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) iColor2 = iColor; else if( iColor2 != iColor ) { -#ifndef HB_CDP_SUPPORT_OFF if( s_fDispTrans ) { ULONG ulLen = iLen; @@ -843,7 +838,6 @@ static void hb_gt_pca_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) hb_gt_pca_AnsiPutStr( iRow, iCol, iColor2, buffer, ulLen ); } else -#endif hb_gt_pca_AnsiPutStr( iRow, iCol, iColor2, s_sLineBuf, iLen ); iCol += iLen; @@ -856,7 +850,6 @@ static void hb_gt_pca_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) } if( iLen ) { -#ifndef HB_CDP_SUPPORT_OFF if( s_fDispTrans ) { ULONG ulLen = iLen; @@ -867,7 +860,6 @@ static void hb_gt_pca_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) hb_gt_pca_AnsiPutStr( iRow, iCol, iColor2, buffer, ulLen ); } else -#endif hb_gt_pca_AnsiPutStr( iRow, iCol, iColor2, s_sLineBuf, iLen ); } } diff --git a/harbour/src/rtl/gtsln/gtsln.c b/harbour/src/rtl/gtsln/gtsln.c index f4cee5c314..3e4f0e5a64 100644 --- a/harbour/src/rtl/gtsln/gtsln.c +++ b/harbour/src/rtl/gtsln/gtsln.c @@ -103,9 +103,7 @@ static SLsmg_Char_Type s_outboxTab[ 256 ]; /* to convert input characters */ unsigned char hb_sln_inputTab[ 256 ]; -#ifndef HB_CDP_SUPPORT_OFF PHB_CODEPAGE hb_sln_cdpIN; -#endif static BOOL s_fActive = FALSE; @@ -350,22 +348,16 @@ static void hb_sln_setCharTrans( PHB_CODEPAGE cdpHost, PHB_CODEPAGE cdpTerm, BOO { int i, iDst; -#if defined( HB_CDP_SUPPORT_OFF ) - HB_SYMBOL_UNUSED( cdpHost ); - HB_SYMBOL_UNUSED( cdpTerm ); - HB_SYMBOL_UNUSED( fBox ); -#elif !defined( HB_SLN_UNICODE ) +#if !defined( HB_SLN_UNICODE ) HB_SYMBOL_UNUSED( cdpTerm ); #endif /* build a conversion chars table */ for( i = 0; i < 256; i++ ) { -#ifndef HB_CDP_SUPPORT_OFF if( hb_sln_Is_Unicode ) iDst = hb_cdpGetU16( cdpHost, TRUE, ( BYTE ) i ); else -#endif iDst = i; if( iDst < 32 ) @@ -392,7 +384,6 @@ static void hb_sln_setCharTrans( PHB_CODEPAGE cdpHost, PHB_CODEPAGE cdpTerm, BOO memcpy( s_outboxTab, s_outputTab, sizeof( s_outputTab ) ); -#ifndef HB_CDP_SUPPORT_OFF if( cdpHost ) { for( i = 0; i < 256; ++i ) @@ -413,7 +404,6 @@ static void hb_sln_setCharTrans( PHB_CODEPAGE cdpHost, PHB_CODEPAGE cdpTerm, BOO } } } -#endif } } @@ -423,17 +413,10 @@ static void hb_sln_setKeyTrans( PHB_CODEPAGE cdpHost, PHB_CODEPAGE cdpTerm ) char *p; int i; -#ifndef HB_CDP_SUPPORT_OFF for ( i = 0; i < 256; i++ ) hb_sln_inputTab[ i ] = ( unsigned char ) hb_cdpTranslateChar( i, FALSE, cdpTerm, cdpHost ); hb_sln_cdpIN = cdpTerm ? cdpTerm : cdpHost; -#else - HB_SYMBOL_UNUSED( cdpHost ); - HB_SYMBOL_UNUSED( cdpTerm ); - for ( i = 0; i < 256; i++ ) - hb_sln_inputTab[ i ] = ( unsigned char ) i; -#endif /* init national chars */ p = hb_getenv( hb_NationCharsEnvName ); @@ -955,7 +938,6 @@ static BOOL hb_gt_sln_SetDispCP( PHB_GT pGT, const char * pszTermCDP, const char { HB_GTSUPER_SETDISPCP( pGT, pszTermCDP, pszHostCDP, fBox ); -#ifndef HB_CDP_SUPPORT_OFF { PHB_CODEPAGE cdpTerm = NULL, cdpHost = NULL; @@ -969,7 +951,6 @@ static BOOL hb_gt_sln_SetDispCP( PHB_GT pGT, const char * pszTermCDP, const char hb_sln_setCharTrans( cdpHost, cdpTerm, fBox ); } -#endif return TRUE; } @@ -980,7 +961,6 @@ static BOOL hb_gt_sln_SetKeyCP( PHB_GT pGT, const char * pszTermCDP, const char { HB_GTSUPER_SETKEYCP( pGT, pszTermCDP, pszHostCDP ); -#ifndef HB_CDP_SUPPORT_OFF { PHB_CODEPAGE cdpTerm = NULL, cdpHost = NULL; @@ -994,7 +974,6 @@ static BOOL hb_gt_sln_SetKeyCP( PHB_GT pGT, const char * pszTermCDP, const char hb_sln_setKeyTrans( cdpHost, cdpTerm ); } -#endif return TRUE; } diff --git a/harbour/src/rtl/gtsln/gtsln.h b/harbour/src/rtl/gtsln/gtsln.h index 05b9aa91fb..de7d05ab08 100644 --- a/harbour/src/rtl/gtsln/gtsln.h +++ b/harbour/src/rtl/gtsln/gtsln.h @@ -214,11 +214,7 @@ extern BOOL hb_sln_Is_Unicode; extern BOOL hb_sln_UnderLinuxConsole; 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_vmCDP() NULL -#endif /* delay for waiting on characters after ESC key */ extern int hb_sln_escDelay; diff --git a/harbour/src/rtl/gtsln/kbsln.c b/harbour/src/rtl/gtsln/kbsln.c index 5d40d77c6a..cba91bff0b 100644 --- a/harbour/src/rtl/gtsln/kbsln.c +++ b/harbour/src/rtl/gtsln/kbsln.c @@ -422,7 +422,7 @@ int hb_gt_sln_ReadKey( PHB_GT pGT, int iEventMask ) return tmp; } -#if !defined( HB_CDP_SUPPORT_OFF ) && ( defined( HB_SLN_UTF8 ) || defined( HB_SLN_UNICODE ) ) +#if ( defined( HB_SLN_UTF8 ) || defined( HB_SLN_UNICODE ) ) if ( hb_sln_Is_Unicode && ch < 256 ) { int n = 0; diff --git a/harbour/src/rtl/gtstd/gtstd.c b/harbour/src/rtl/gtstd/gtstd.c index 1afcdc7af6..58362c3c96 100644 --- a/harbour/src/rtl/gtstd/gtstd.c +++ b/harbour/src/rtl/gtstd/gtstd.c @@ -532,7 +532,6 @@ static BOOL hb_gt_std_SetDispCP( PHB_GT pGT, const char *pszTermCDP, const char HB_GTSUPER_SETDISPCP( pGT, pszTermCDP, pszHostCDP, fBox ); -#ifndef HB_CDP_SUPPORT_OFF if( !pszHostCDP ) pszHostCDP = hb_cdpID(); if( !pszTermCDP ) @@ -546,7 +545,7 @@ static BOOL hb_gt_std_SetDispCP( PHB_GT pGT, const char *pszTermCDP, const char pGTSTD->fDispTrans = pGTSTD->cdpTerm && pGTSTD->cdpHost && pGTSTD->cdpTerm != pGTSTD->cdpHost; } -#endif + return TRUE; } @@ -556,7 +555,6 @@ static BOOL hb_gt_std_SetKeyCP( PHB_GT pGT, const char *pszTermCDP, const char * HB_GTSUPER_SETKEYCP( pGT, pszTermCDP, pszHostCDP ); -#ifndef HB_CDP_SUPPORT_OFF if( !pszHostCDP ) pszHostCDP = hb_cdpID(); if( !pszTermCDP ) @@ -564,7 +562,7 @@ static BOOL hb_gt_std_SetKeyCP( PHB_GT pGT, const char *pszTermCDP, const char * hb_gt_std_setKeyTrans( HB_GTSTD_GET( pGT ), hb_cdpFind( pszTermCDP ), hb_cdpFind( pszHostCDP ) ); -#endif + return TRUE; } @@ -695,7 +693,6 @@ static void hb_gt_std_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) if( iLen ) { -#ifndef HB_CDP_SUPPORT_OFF if( pGTSTD->fDispTrans ) { ULONG ulLen = iLen; @@ -706,7 +703,6 @@ static void hb_gt_std_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) hb_gt_std_termOut( pGTSTD, buffer, ulLen ); } else -#endif hb_gt_std_termOut( pGTSTD, pGTSTD->sLineBuf, iLen ); } pGTSTD->iRow = iRow; diff --git a/harbour/src/rtl/gttrm/gttrm.c b/harbour/src/rtl/gttrm/gttrm.c index 16dcacbac0..16f5b9f0eb 100644 --- a/harbour/src/rtl/gttrm/gttrm.c +++ b/harbour/src/rtl/gttrm/gttrm.c @@ -322,11 +322,10 @@ typedef struct _HB_GTTRM BOOL fPosAnswer; -#ifndef HB_CDP_SUPPORT_OFF PHB_CODEPAGE cdpHost; PHB_CODEPAGE cdpBox; PHB_CODEPAGE cdpIn; -#endif + BOOL fUTF8; UCHAR keyTransTbl[ 256 ]; int charmap[ 256 ]; @@ -725,9 +724,6 @@ static void hb_gt_trm_termOutTrans( PHB_GTTRM pTerm, const char * pStr, int iLen { if( pTerm->iOutBufSize ) { -#ifdef HB_CDP_SUPPORT_OFF - HB_SYMBOL_UNUSED( iAttr ); -#else PHB_CODEPAGE cdp = NULL; if( pTerm->fUTF8 ) @@ -761,7 +757,6 @@ static void hb_gt_trm_termOutTrans( PHB_GTTRM pTerm, const char * pStr, int iLen } } else -#endif { hb_gt_trm_termOut( pTerm, pStr, iLen ); } @@ -1465,7 +1460,6 @@ again: pTerm->key_flag = 0; } -#ifndef HB_CDP_SUPPORT_OFF if( nKey > 0 && nKey <= 255 && pTerm->fUTF8 && pTerm->cdpIn ) { USHORT uc = 0; @@ -1486,7 +1480,7 @@ again: } } } -#endif + if( nKey > 0 && nKey <= 255 && pTerm->keyTransTbl[nKey] ) nKey = pTerm->keyTransTbl[nKey]; /* @@ -3052,10 +3046,9 @@ static void hb_gt_trm_SetTerm( PHB_GTTRM pTerm ) hb_gt_chrmapinit( pTerm->charmap, szTerm, pTerm->terminal_type == TERM_XTERM ); -#ifndef HB_CDP_SUPPORT_OFF pTerm->cdpHost = pTerm->cdpIn = NULL; pTerm->cdpBox = hb_cdpFind( "EN" ); -#endif + add_efds( pTerm, pTerm->hFilenoStdin, O_RDONLY, NULL, NULL ); init_keys( pTerm ); mouse_init( pTerm ); @@ -3461,7 +3454,6 @@ static BOOL hb_gt_trm_SetDispCP( PHB_GT pGT, const char *pszTermCDP, const char HB_GTSUPER_SETDISPCP( pGT, pszTermCDP, pszHostCDP, fBox ); -#ifndef HB_CDP_SUPPORT_OFF if( !pszHostCDP ) pszHostCDP = hb_cdpID(); if( !pszTermCDP ) @@ -3470,7 +3462,7 @@ static BOOL hb_gt_trm_SetDispCP( PHB_GT pGT, const char *pszTermCDP, const char hb_gt_trm_SetDispTrans( HB_GTTRM_GET( pGT ), hb_cdpFind( pszHostCDP ), hb_cdpFind( pszTermCDP ), fBox ? 1 : 0 ); -#endif + return TRUE; } @@ -3480,7 +3472,6 @@ static BOOL hb_gt_trm_SetKeyCP( PHB_GT pGT, const char *pszTermCDP, const char * HB_GTSUPER_SETKEYCP( pGT, pszTermCDP, pszHostCDP ); -#ifndef HB_CDP_SUPPORT_OFF if( !pszHostCDP ) pszHostCDP = hb_cdpID(); if( !pszTermCDP ) @@ -3488,7 +3479,7 @@ static BOOL hb_gt_trm_SetKeyCP( PHB_GT pGT, const char *pszTermCDP, const char * hb_gt_trm_SetKeyTrans( HB_GTTRM_GET( pGT ), hb_cdpFind( pszTermCDP ), hb_cdpFind( pszHostCDP ) ); -#endif + return TRUE; } diff --git a/harbour/src/rtl/gtwin/gtwin.c b/harbour/src/rtl/gtwin/gtwin.c index b548f5ca42..71d2ee3bb3 100644 --- a/harbour/src/rtl/gtwin/gtwin.c +++ b/harbour/src/rtl/gtwin/gtwin.c @@ -84,9 +84,7 @@ #include "hbapiitm.h" #include "hbapierr.h" -#ifndef HB_CDP_SUPPORT_OFF -# include "hbapicdp.h" -#endif +#include "hbapicdp.h" #if !defined( __LCC__ ) # include @@ -180,7 +178,6 @@ static DWORD s_cNumRead; /* Ok to use DWORD here, because this is spec static DWORD s_cNumIndex; /* ...to the Windows API, which defines DWORD, etc. */ static WORD s_wRepeated = 0; /* number of times the event (key) was repeated */ static INPUT_RECORD s_irInBuf[ INPUT_BUFFER_LEN ]; -#if !defined( HB_CDP_SUPPORT_OFF ) #if defined( UNICODE ) static PHB_CODEPAGE s_cdpHost; static PHB_CODEPAGE s_cdpBox; @@ -190,7 +187,6 @@ static BYTE s_charTransRev[ 256 ]; static BYTE s_charTrans[ 256 ]; static BYTE s_keyTrans[ 256 ]; #endif -#endif static int s_altisdown = 0; static int s_altnum = 0; static int s_mouseLast; /* Last mouse button to be pressed */ @@ -590,10 +586,7 @@ static void hb_gt_win_xGetScreenContents( PHB_GT pGT, SMALL_RECT * psrWin ) i = iRow * _GetScreenWidth() + psrWin->Left; for( iCol = psrWin->Left; iCol <= psrWin->Right; ++iCol ) { -#if defined( HB_CDP_SUPPORT_OFF ) - HB_GTSELF_PUTSCRCHAR( pGT, iRow, iCol, ( UCHAR ) s_pCharInfoScreen[ i ].Attributes, 0, - ( UCHAR ) s_pCharInfoScreen[ i ].Char.AsciiChar ); -#elif defined( UNICODE ) +#if defined( UNICODE ) HB_WCHAR wc = s_pCharInfoScreen[ i ].Char.UnicodeChar; unsigned char uc; BYTE bAttr = 0; @@ -715,7 +708,7 @@ static void hb_gt_win_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil s_bSpecialKeyHandling = FALSE; s_bAltKeyHandling = TRUE; -#if !defined( HB_CDP_SUPPORT_OFF ) && defined( UNICODE ) +#if defined( UNICODE ) s_cdpHost = s_cdpIn = hb_vmCDP(); s_cdpBox = hb_cdpFind( "EN" ); #endif @@ -1267,9 +1260,7 @@ static int hb_gt_win_ReadKey( PHB_GT pGT, int iEventMask ) #if defined( UNICODE ) ch = s_irInBuf[ s_cNumIndex ].Event.KeyEvent.uChar.UnicodeChar; -# if !defined( HB_CDP_SUPPORT_OFF ) ch = hb_cdpGetChar( s_cdpIn, FALSE, ( USHORT ) ch ); -# endif #else ch = s_irInBuf[ s_cNumIndex ].Event.KeyEvent.uChar.AsciiChar; #endif @@ -1398,7 +1389,7 @@ static int hb_gt_win_ReadKey( PHB_GT pGT, int iEventMask ) } /* national codepage translation */ -#if !defined( HB_CDP_SUPPORT_OFF ) && !defined( UNICODE ) +#if !defined( UNICODE ) if( ch > 0 && ch <= 255 ) ch = s_keyTrans[ ch ]; #endif @@ -1488,7 +1479,6 @@ static BOOL hb_gt_win_SetDispCP( PHB_GT pGT, const char *pszTermCDP, const char HB_GTSUPER_SETDISPCP( pGT, pszTermCDP, pszHostCDP, fBox ); -#ifndef HB_CDP_SUPPORT_OFF # if defined( UNICODE ) /* * We are displaying text in U16 so pszTermCDP is unimportant. @@ -1530,7 +1520,6 @@ static BOOL hb_gt_win_SetDispCP( PHB_GT pGT, const char *pszTermCDP, const char } } # endif -#endif return TRUE; } @@ -1544,7 +1533,6 @@ static BOOL hb_gt_win_SetKeyCP( PHB_GT pGT, const char *pszTermCDP, const char * HB_GTSUPER_SETKEYCP( pGT, pszTermCDP, pszHostCDP ); -#ifndef HB_CDP_SUPPORT_OFF # if defined( UNICODE ) /* * We are receiving WM_CHAR events in U16 so pszTermCDP is unimportant. @@ -1580,7 +1568,6 @@ static BOOL hb_gt_win_SetKeyCP( PHB_GT pGT, const char *pszTermCDP, const char * hb_cdpTranslateChar( i, FALSE, cdpTerm, cdpHost ); } # endif -#endif return TRUE; } @@ -1611,7 +1598,7 @@ static BOOL hb_gt_win_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) break; } case HB_GTI_BOXCP: -#if !defined( HB_CDP_SUPPORT_OFF ) && defined( UNICODE ) +#if defined( UNICODE ) pInfo->pResult = hb_itemPutC( pInfo->pResult, s_cdpBox ? s_cdpBox->id : NULL ); if( hb_itemType( pInfo->pNewVal ) & HB_IT_STRING ) @@ -1780,9 +1767,7 @@ static void hb_gt_win_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) { if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol++, &iColor, &bAttr, &usChar ) ) break; -#if defined( HB_CDP_SUPPORT_OFF ) - s_pCharInfoScreen[ i ].Char.UnicodeChar = usChar; -#elif defined( UNICODE ) +#if defined( UNICODE ) s_pCharInfoScreen[ i ].Char.UnicodeChar = hb_cdpGetU16( bAttr & HB_GT_ATTR_BOX ? s_cdpBox : s_cdpHost, TRUE, ( UCHAR ) usChar ); diff --git a/harbour/src/rtl/gtwvt/gtwvt.c b/harbour/src/rtl/gtwvt/gtwvt.c index 3904ce8b59..2820f3715b 100644 --- a/harbour/src/rtl/gtwvt/gtwvt.c +++ b/harbour/src/rtl/gtwvt/gtwvt.c @@ -335,7 +335,6 @@ static PHB_GTWVT hb_gt_wvt_New( PHB_GT pGT, HINSTANCE hInstance, int iCmdShow ) pWVT->bResizing = FALSE; pWVT->bAlreadySizing = FALSE; -#ifndef HB_CDP_SUPPORT_OFF pWVT->hostCDP = hb_vmCDP(); #if defined( UNICODE ) pWVT->inCDP = hb_vmCDP(); @@ -346,7 +345,6 @@ static PHB_GTWVT hb_gt_wvt_New( PHB_GT pGT, HINSTANCE hInstance, int iCmdShow ) for( i = 0; i < 256; ++i ) pWVT->chrTransTbl[ i ] = pWVT->keyTransTbl[ i ] = ( BYTE ) i; } -#endif #endif return pWVT; @@ -2957,7 +2955,6 @@ static BOOL hb_gt_wvt_SetDispCP( PHB_GT pGT, const char * pszTermCDP, const char { HB_GTSUPER_SETDISPCP( pGT, pszTermCDP, pszHostCDP, fBox ); -#ifndef HB_CDP_SUPPORT_OFF # if defined( UNICODE ) /* * We are displaying text in U16 so pszTermCDP is unimportant. @@ -3000,7 +2997,6 @@ static BOOL hb_gt_wvt_SetDispCP( PHB_GT pGT, const char * pszTermCDP, const char } } # endif -#endif return TRUE; } @@ -3009,7 +3005,6 @@ static BOOL hb_gt_wvt_SetKeyCP( PHB_GT pGT, const char * pszTermCDP, const char { HB_GTSUPER_SETKEYCP( pGT, pszTermCDP, pszHostCDP ); -#ifndef HB_CDP_SUPPORT_OFF # if defined( UNICODE ) /* * We are receiving WM_CHAR events in U16 so pszTermCDP is unimportant. @@ -3046,7 +3041,6 @@ static BOOL hb_gt_wvt_SetKeyCP( PHB_GT pGT, const char * pszTermCDP, const char pWVT->inCDP = cdpTerm; } # endif -#endif return TRUE; } diff --git a/harbour/src/rtl/gtxwc/gtxwc.c b/harbour/src/rtl/gtxwc/gtxwc.c index 8e87732dd4..cd9c2ae767 100644 --- a/harbour/src/rtl/gtxwc/gtxwc.c +++ b/harbour/src/rtl/gtxwc/gtxwc.c @@ -221,65 +221,6 @@ static const ClipKeyCode extKeyTab[CLIP_EXTKEY_COUNT] = { {0, 0, HB_BREAK_FLAG, 0} /* 29 */ }; -#ifdef HB_CDP_SUPPORT_OFF -static const UnixBoxChar boxTranslate[] ={ - { 16, HB_GTXVG_ARROW_R}, - { 17, HB_GTXVG_ARROW_L}, - { 30, HB_GTXVG_ARROW_U}, - { 31, HB_GTXVG_ARROW_D}, - { 176, HB_GTXVG_FILLER1}, - { 177, HB_GTXVG_FILLER2}, - { 178, HB_GTXVG_FILLER3}, - { 179, HB_GTXWC_SNG_VRT}, - { 180, HB_GTXWC_SNG_VR}, - { 181, HB_GTXWC_SNG_V_DBL_R}, - { 182, HB_GTXWC_DBL_V_SNG_R}, - { 183, HB_GTXWC_SNG_R_DBL_T}, - { 184, HB_GTXWC_DBL_R_SNG_T}, - { 185, HB_GTXWC_DBL_VR}, - { 186, HB_GTXWC_DBL_VRT}, - { 187, HB_GTXWC_DBL_RT}, - { 188, HB_GTXWC_DBL_RB}, - { 189, HB_GTXWC_SNG_R_DBL_B}, - { 190, HB_GTXWC_DBL_R_SNG_B}, - { 191, HB_GTXWC_SNG_RT}, - { 192, HB_GTXWC_SNG_LB}, - { 193, HB_GTXWC_SNG_BU}, - { 194, HB_GTXWC_SNG_TD}, - { 195, HB_GTXWC_SNG_VL}, - { 196, HB_GTXWC_SNG_HOR}, - { 197, HB_GTXWC_SNG_CRS}, - { 198, HB_GTXWC_SNG_V_DBL_L}, - { 199, HB_GTXWC_DBL_V_SNG_L}, - { 200, HB_GTXWC_DBL_LB}, - { 201, HB_GTXWC_DBL_LT}, - { 202, HB_GTXWC_DBL_BU}, - { 203, HB_GTXWC_DBL_TD}, - { 204, HB_GTXWC_DBL_VL}, - { 205, HB_GTXWC_DBL_HOR}, - { 206, HB_GTXWC_DBL_CRS}, - { 207, HB_GTXWC_DBL_B_SNG_U}, - { 208, HB_GTXWC_SNG_B_DBL_U}, - { 209, HB_GTXWC_DBL_T_SNG_D}, - { 210, HB_GTXWC_SNG_T_DBL_D}, - { 211, HB_GTXWC_DBL_L_SNG_B}, - { 212, HB_GTXWC_SNG_L_DBL_B}, - { 213, HB_GTXWC_SNG_L_DBL_T}, - { 214, HB_GTXWC_DBL_L_SNG_T}, - { 215, HB_GTXWC_DBL_SNG_CRS}, - { 216, HB_GTXWC_SNG_DBL_CRS}, - { 217, HB_GTXWC_SNG_RB}, - { 218, HB_GTXWC_SNG_LT}, - { 219, HB_GTXVG_FULL}, - { 220, HB_GTXVG_FULL_B}, - { 221, HB_GTXVG_FULL_L}, - { 222, HB_GTXVG_FULL_R}, - { 223, HB_GTXVG_FULL_T}, - { 254, HB_GTXVG_SQUARE} -}; -#define XWC_BOX_CHARS (sizeof(boxTranslate) / sizeof(UnixBoxChar)) -#endif - /* these are standard PC console colors in RGB */ static const int rgb_values[] = { 0x000000, /* black "rgb:00/00/00" */ @@ -1596,20 +1537,8 @@ static void hb_gt_xwc_BuildCharTrans( PXWND_DEF wnd ) for( i = 0; i < 256; i++ ) { -#ifndef HB_CDP_SUPPORT_OFF usCh16 = hb_cdpGetU16( wnd->hostCDP, TRUE, ( BYTE ) i ); -#else - int j; - usCh16 = ( USHORT ) i; - for( j = 0; j < (int) XWC_BOX_CHARS; j++ ) - { - if( boxTranslate[j].c == usCh16 ) - { - usCh16 = boxTranslate[j].u16; - break; - } - } -#endif + wnd->charTrans[ i ].type = CH_CHAR; wnd->charTrans[ i ].u.ch16 = usCh16; wnd->charTrans[ i ].size = 0; @@ -1896,16 +1825,12 @@ static void hb_gt_xwc_ProcessKey( PXWND_DEF wnd, XKeyEvent *evt) } if( n > 0 ) { -#ifndef HB_CDP_SUPPORT_OFF unsigned char keystr[ 32 ]; ULONG u = sizeof( keystr ); hb_cdpnDup2( ( const char * ) buf, n, ( char * ) keystr, &u, wnd->inCDP, wnd->hostCDP ); n = ( int ) u; -#else - unsigned char * keystr = buf; -#endif #ifdef XWC_DEBUG keystr[n] = '\0'; @@ -2175,7 +2100,6 @@ 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 @@ -2189,7 +2113,6 @@ static void hb_gt_xwc_WndProc( PXWND_DEF wnd, XEvent *evt ) wnd->ClipboardRcvd = TRUE; } else -#endif if( evt->xselection.target == s_atomString && text.format == 8 ) { #ifdef XWC_DEBUG @@ -2199,15 +2122,9 @@ static void hb_gt_xwc_WndProc( PXWND_DEF wnd, XEvent *evt ) hb_xfree( wnd->ClipboardData ); wnd->ClipboardSize = text.nitems; -#ifndef HB_CDP_SUPPORT_OFF wnd->ClipboardData = ( unsigned char * ) hb_cdpnDup( ( const char * ) text.value, &wnd->ClipboardSize, wnd->inCDP, wnd->hostCDP ); -#else - wnd->ClipboardData = ( unsigned char * ) hb_xgrab( text.nitems + 1 ); - memcpy( wnd->ClipboardData, text.value, text.nitems ); - wnd->ClipboardData[ text.nitems ] = '\0'; -#endif wnd->ClipboardTime = evt->xselection.time; wnd->ClipboardRcvd = TRUE; } @@ -2276,7 +2193,6 @@ 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 ) { ULONG ulLen = wnd->ClipboardSize; @@ -2290,14 +2206,12 @@ 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 = wnd->ClipboardSize; @@ -2313,7 +2227,6 @@ static void hb_gt_xwc_WndProc( PXWND_DEF wnd, XEvent *evt ) pBuffer, ulLen ); hb_xfree( pBuffer ); } -#endif else { respond.xselection.property = None; @@ -3134,11 +3047,9 @@ static PXWND_DEF hb_gt_xwc_CreateWndDef( PHB_GT pGT ) wnd->fResizable = TRUE; wnd->fClosable = TRUE; wnd->fWinResize = FALSE; -#ifndef HB_CDP_SUPPORT_OFF wnd->hostCDP = hb_vmCDP(); wnd->utf8CDP = hb_cdpFind( "UTF8" ); wnd->boxCDP = hb_cdpFind( "EN" ); -#endif wnd->cursorType = SC_NORMAL; /* Window Title */ @@ -3787,7 +3698,6 @@ static BOOL hb_gt_xwc_SetDispCP( PHB_GT pGT, const char * pszTermCDP, const char HB_GTSUPER_SETDISPCP( pGT, pszTermCDP, pszHostCDP, fBox ); -#ifndef HB_CDP_SUPPORT_OFF /* * We are displaying text in U16 so pszTermCDP is unimportant. * We only have to know what is the internal application codepage @@ -3813,7 +3723,6 @@ static BOOL hb_gt_xwc_SetDispCP( PHB_GT pGT, const char * pszTermCDP, const char } } } -#endif return TRUE; } @@ -3825,7 +3734,6 @@ static BOOL hb_gt_xwc_SetKeyCP( PHB_GT pGT, const char * pszTermCDP, const char HB_GTSUPER_SETKEYCP( pGT, pszTermCDP, pszHostCDP ); -#ifndef HB_CDP_SUPPORT_OFF /* * Basic Xlib api has no function to return character key val in * unicode so far. We can use some nonstandard extension or try @@ -3845,7 +3753,6 @@ static BOOL hb_gt_xwc_SetKeyCP( PHB_GT pGT, const char * pszTermCDP, const char HB_GTXWC_GET( pGT )->inCDP = cdpTerm; } } -#endif return TRUE; } diff --git a/harbour/src/rtl/gtxwc/gtxwc.h b/harbour/src/rtl/gtxwc/gtxwc.h index 54d6d34b1c..91d08e569f 100644 --- a/harbour/src/rtl/gtxwc/gtxwc.h +++ b/harbour/src/rtl/gtxwc/gtxwc.h @@ -258,13 +258,6 @@ typedef USHORT HB_GT_CELLTYPE; /********************** Unix to graphic box translation ******************/ -#ifdef HB_CDP_SUPPORT_OFF -typedef struct tag_UnixBox { - BYTE c; - USHORT u16; -} UnixBoxChar; -#endif - typedef enum { CH_CHAR, /* normal U16 character */ diff --git a/harbour/src/rtl/hbgtcore.c b/harbour/src/rtl/hbgtcore.c index 72afb00bbb..22c37d7509 100644 --- a/harbour/src/rtl/hbgtcore.c +++ b/harbour/src/rtl/hbgtcore.c @@ -1433,7 +1433,6 @@ static void hb_gt_def_VertLine( PHB_GT pGT, int iCol, int iTop, int iBottom, static BOOL hb_gt_def_SetDispCP( PHB_GT pGT, const char * pszTermCDP, const char * pszHostCDP, BOOL fBox ) { -#ifndef HB_CDP_SUPPORT_OFF if( !pszHostCDP ) pszHostCDP = hb_cdpID(); if( !pszTermCDP ) @@ -1447,10 +1446,6 @@ static BOOL hb_gt_def_SetDispCP( PHB_GT pGT, const char * pszTermCDP, const char pGT->cdpTerm != pGT->cdpHost; return TRUE; } -#else - HB_SYMBOL_UNUSED( pszTermCDP ); - HB_SYMBOL_UNUSED( pszHostCDP ); -#endif HB_SYMBOL_UNUSED( fBox ); return FALSE; diff --git a/harbour/src/vm/hvm.c b/harbour/src/vm/hvm.c index fe7e73f14a..cb8c782ec0 100644 --- a/harbour/src/vm/hvm.c +++ b/harbour/src/vm/hvm.c @@ -1132,9 +1132,7 @@ int hb_vmQuit( void ) hb_conRelease(); /* releases Console */ 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() ); hb_gcCollectAll( TRUE ); diff --git a/harbour/src/vm/itemapi.c b/harbour/src/vm/itemapi.c index 3ae96616d8..2c6bcdf774 100644 --- a/harbour/src/vm/itemapi.c +++ b/harbour/src/vm/itemapi.c @@ -2093,13 +2093,11 @@ int hb_itemStrCmp( PHB_ITEM pFirst, PHB_ITEM pSecond, BOOL bForceExact ) /* Both strings not empty */ if( ulMinLen ) { -#ifndef HB_CDP_SUPPORT_OFF PHB_CODEPAGE cdp = hb_vmCDP(); if( cdp && cdp->sort ) iRet = hb_cdpcmp( szFirst, ulLenFirst, szSecond, ulLenSecond, cdp, bForceExact ); else -#endif { do { @@ -2174,13 +2172,11 @@ int hb_itemStrICmp( PHB_ITEM pFirst, PHB_ITEM pSecond, BOOL bForceExact ) /* Both strings not empty */ if( ulMinLen ) { -#ifndef HB_CDP_SUPPORT_OFF PHB_CODEPAGE cdp = hb_vmCDP(); if( cdp && cdp->sort ) iRet = hb_cdpicmp( szFirst, ulLenFirst, szSecond, ulLenSecond, cdp, bForceExact ); else -#endif { do { diff --git a/harbour/src/vm/set.c b/harbour/src/vm/set.c index ae6284d486..3bb9ce76d8 100644 --- a/harbour/src/vm/set.c +++ b/harbour/src/vm/set.c @@ -981,13 +981,8 @@ HB_FUNC( SET ) hb_retc( pSet->HB_SET_OSCODEPAGE ); if( args > 1 && ( HB_IS_STRING( pArg2 ) || HB_IS_NIL( pArg2 ) ) ) { -#ifndef HB_CDP_SUPPORT_OFF PHB_CODEPAGE cdpOS = hb_cdpFindExt( hb_itemGetCPtr( pArg2 ) ); char * szValue = cdpOS ? hb_strdup( cdpOS->id ) : NULL; -#else - void * cdpOS = NULL; - char *szValue = NULL; -#endif if( pSet->HB_SET_OSCODEPAGE ) hb_xfree( pSet->HB_SET_OSCODEPAGE ); pSet->HB_SET_OSCODEPAGE = szValue; @@ -1817,13 +1812,8 @@ BOOL hb_setSetItem( HB_set_enum set_specifier, PHB_ITEM pItem ) case HB_SET_OSCODEPAGE: if( HB_IS_STRING( pItem ) || HB_IS_NIL( pItem ) ) { -#ifndef HB_CDP_SUPPORT_OFF PHB_CODEPAGE cdpOS = hb_cdpFindExt( hb_itemGetCPtr( pItem ) ); szValue = cdpOS ? hb_strdup( cdpOS->id ) : NULL; -#else - void * cdpOS = NULL; - szValue = NULL; -#endif if( pSet->HB_SET_OSCODEPAGE ) hb_xfree( pSet->HB_SET_OSCODEPAGE ); pSet->HB_SET_OSCODEPAGE = szValue;