2007-05-03 16:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/common.mak
  * harbour/include/hbapirdd.h
  - harbour/include/hbrddwrk.h
  * harbour/source/rdd/Makefile
  + harbour/source/rdd/wacore.c
  + harbour/source/rdd/wafunc.c
  * harbour/source/rdd/workarea.c
    * cleaned RDD code:
      * the default work area implementation from which each RDD inherits
        and RDD management is now in workarea.c file - this part will be
        common for all threads in future MT version
      * the code to mange workareas and aliases moved to wacore.c - this
        code uses some static variables which will be moved to HVM stack
        in MT version
      * helper RDD functions thread independent moved to wafunc.c

  * harbour/source/rdd/dbcmd.c
    * removed RDD/WorkArea management code - only independent HB_FUNCs
      left. IMHO it will be good to divide this file into few ones.
    * changed dbCreate() and dbUseArea() to return logical value

  * harbour/config/global.cf
    - removed nulsys from linked library list - it should not be here
      because it can confuse some linkers and wrong library will be
      created

  * harbour/contrib/rdd_ads/ads1.c
  * harbour/source/rdd/dbf1.c
  * harbour/source/rdd/delim1.c
  * harbour/source/rdd/sdf1.c
  * harbour/source/rdd/dbfcdx/dbfcdx1.c
  * harbour/source/rdd/dbfdbt/dbfdbt1.c
  * harbour/source/rdd/dbffpt/dbffpt1.c
  * harbour/source/rdd/dbfntx/dbfntx1.c
  * harbour/source/rdd/nulsys/nulsys.c
    * updated for recent modifications in RDD API

  * harbour/include/hbextern.ch
    - removed __RDDSETDEFAULT() - this function was necessary with old
      rdd register code and we not not need it for few years. It's not
      Clipper function so I do not see any reason to keep it but if you
      want we can add wrapper to standard RDDSETDEFAULT()

  * harbour/source/rdd/hbsix/sxcompr.c
    + added workaround for SIX3 bug which I intentionally replicated in
      [x]Harbour but it may cause data corruption so IMHO it will be better
      to fix it.

  * harbour/source/rtl/errorsys.prg
    * added default action for EG_LOCK - it's Clipper compatible behavior
      but done in differ way. Due to some differences in linker we are
      using we cannot exactly replicate Clipper behavior because it will
      not work on some platforms as expected so I decided to add it here.
      I think it's even more Clear then the trick with source/sys/ntxerr.prg
      done by Clipper. Many people do not even knows about it.

  * harbour/source/rtl/gtcrs/chrmap.c
    * changed environment variable name from HB_CHRMAP to HB_CHARMAP to
      be compatible with description in default map file
This commit is contained in:
Przemyslaw Czerpak
2007-05-03 14:11:30 +00:00
parent 9f83848464
commit 271095b949
23 changed files with 2833 additions and 2994 deletions

View File

@@ -8,6 +8,67 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-05-03 16:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/common.mak
* harbour/include/hbapirdd.h
- harbour/include/hbrddwrk.h
* harbour/source/rdd/Makefile
+ harbour/source/rdd/wacore.c
+ harbour/source/rdd/wafunc.c
* harbour/source/rdd/workarea.c
* cleaned RDD code:
* the default work area implementation from which each RDD inherits
and RDD management is now in workarea.c file - this part will be
common for all threads in future MT version
* the code to mange workareas and aliases moved to wacore.c - this
code uses some static variables which will be moved to HVM stack
in MT version
* helper RDD functions thread independent moved to wafunc.c
* harbour/source/rdd/dbcmd.c
* removed RDD/WorkArea management code - only independent HB_FUNCs
left. IMHO it will be good to divide this file into few ones.
* changed dbCreate() and dbUseArea() to return logical value
* harbour/config/global.cf
- removed nulsys from linked library list - it should not be here
because it can confuse some linkers and wrong library will be
created
* harbour/contrib/rdd_ads/ads1.c
* harbour/source/rdd/dbf1.c
* harbour/source/rdd/delim1.c
* harbour/source/rdd/sdf1.c
* harbour/source/rdd/dbfcdx/dbfcdx1.c
* harbour/source/rdd/dbfdbt/dbfdbt1.c
* harbour/source/rdd/dbffpt/dbffpt1.c
* harbour/source/rdd/dbfntx/dbfntx1.c
* harbour/source/rdd/nulsys/nulsys.c
* updated for recent modifications in RDD API
* harbour/include/hbextern.ch
- removed __RDDSETDEFAULT() - this function was necessary with old
rdd register code and we not not need it for few years. It's not
Clipper function so I do not see any reason to keep it but if you
want we can add wrapper to standard RDDSETDEFAULT()
* harbour/source/rdd/hbsix/sxcompr.c
+ added workaround for SIX3 bug which I intentionally replicated in
[x]Harbour but it may cause data corruption so IMHO it will be better
to fix it.
* harbour/source/rtl/errorsys.prg
* added default action for EG_LOCK - it's Clipper compatible behavior
but done in differ way. Due to some differences in linker we are
using we cannot exactly replicate Clipper behavior because it will
not work on some platforms as expected so I decided to add it here.
I think it's even more Clear then the trick with source/sys/ntxerr.prg
done by Clipper. Many people do not even knows about it.
* harbour/source/rtl/gtcrs/chrmap.c
* changed environment variable name from HB_CHRMAP to HB_CHARMAP to
be compatible with description in default map file
2007-05-01 22:53 UTC+0100 Antonio Linares (alinares@fivetechsoft.com)
* contrib/adordd/adordd.prg
* DbCreate() implementation just for Microsoft Access

View File

@@ -681,6 +681,8 @@ CODEPAGE_LIB_OBJS = \
RDD_LIB_OBJS = \
$(OBJ_DIR)\dbcmd.obj \
$(OBJ_DIR)\workarea.obj \
$(OBJ_DIR)\wacore.obj \
$(OBJ_DIR)\wafunc.obj \
$(OBJ_DIR)\dbf1.obj \
$(OBJ_DIR)\dbnubs.obj \
$(OBJ_DIR)\delim1.obj \

View File

@@ -6,7 +6,6 @@ GRANDP = ../../
HB_ARCH := $(HB_ARCHITECTURE)/$(HB_COMPILER)
HB_DB_DRIVERS=\
nulsys \
dbfntx \
dbfcdx \
dbffpt \

View File

@@ -359,7 +359,7 @@ static ERRCODE hb_adsCheckLock( ADSAREAP pArea )
u32RetVal = AdsIsRecordLocked( pArea->hTable, 0, &u16Locked );
if( u32RetVal != AE_SUCCESS )
{
hb_errRT_DBCMD( EG_LOCK, u32RetVal, "Lock Required by TestRecLocks", "ADSISRECORDLOCKED" );
hb_errRT_DBCMD( EG_UNLOCKED, u32RetVal, "Lock Required by TestRecLocks", "ADSISRECORDLOCKED" );
return FAILURE;
}
if( !u16Locked )
@@ -4496,106 +4496,106 @@ static ERRCODE adsRddInfo( LPRDDNODE pRDD, USHORT uiIndex, ULONG ulConnect, PHB_
#define adsWhoCares NULL
static RDDFUNCS adsTable = { ( DBENTRYP_BP ) adsBof,
( DBENTRYP_BP ) adsEof,
( DBENTRYP_BP ) adsFound,
( DBENTRYP_V ) adsGoBottom,
( DBENTRYP_UL ) adsGoTo,
( DBENTRYP_I ) adsGoToId,
( DBENTRYP_V ) adsGoTop,
( DBENTRYP_BIB ) adsSeek,
( DBENTRYP_L ) adsSkip,
( DBENTRYP_L ) adsSkipFilter,
( DBENTRYP_L ) adsSkipRaw,
( DBENTRYP_VF ) adsAddField,
( DBENTRYP_B ) adsAppend,
( DBENTRYP_I ) adsCreateFields,
( DBENTRYP_V ) adsDeleteRec,
( DBENTRYP_BP ) adsDeleted,
( DBENTRYP_SP ) adsFieldCount,
( DBENTRYP_VF ) adsFieldDisplay,
( DBENTRYP_SSI ) adsFieldInfo,
( DBENTRYP_SVP ) adsFieldName,
( DBENTRYP_V ) adsFlush,
( DBENTRYP_PP ) adsGetRec,
( DBENTRYP_SI ) adsGetValue,
( DBENTRYP_SVL ) adsGetVarLen,
( DBENTRYP_V ) adsGoCold,
( DBENTRYP_V ) adsGoHot,
( DBENTRYP_P ) adsPutRec,
( DBENTRYP_SI ) adsPutValue,
( DBENTRYP_V ) adsRecall,
( DBENTRYP_ULP ) adsRecCount,
( DBENTRYP_ISI ) adsRecInfo,
( DBENTRYP_ULP ) adsRecNo,
( DBENTRYP_I ) adsRecId,
( DBENTRYP_S ) adsSetFieldExtent,
( DBENTRYP_P ) adsAlias,
( DBENTRYP_V ) adsClose,
( DBENTRYP_VP ) adsCreate,
( DBENTRYP_SI ) adsInfo,
( DBENTRYP_V ) adsNewArea,
( DBENTRYP_VP ) adsOpen,
( DBENTRYP_V ) adsRelease,
( DBENTRYP_SP ) adsStructSize,
( DBENTRYP_P ) adsSysName,
( DBENTRYP_VEI ) adsEval,
( DBENTRYP_V ) adsPack,
( DBENTRYP_LSP ) adsPackRec,
( DBENTRYP_VS ) adsSort,
( DBENTRYP_VT ) adsTrans,
( DBENTRYP_VT ) adsTransRec,
( DBENTRYP_V ) adsZap,
( DBENTRYP_VR ) adsChildEnd,
( DBENTRYP_VR ) adsChildStart,
( DBENTRYP_VR ) adsChildSync,
( DBENTRYP_V ) adsSyncChildren,
( DBENTRYP_V ) adsClearRel,
( DBENTRYP_V ) adsForceRel,
( DBENTRYP_SVP ) adsRelArea,
( DBENTRYP_VR ) adsRelEval,
( DBENTRYP_SVP ) adsRelText,
( DBENTRYP_VR ) adsSetRel,
( DBENTRYP_OI ) adsOrderListAdd,
( DBENTRYP_V ) adsOrderListClear,
( DBENTRYP_OI ) adsOrderListDelete,
( DBENTRYP_OI ) adsOrderListFocus,
( DBENTRYP_V ) adsOrderListRebuild,
( DBENTRYP_VOI ) adsOrderCondition,
( DBENTRYP_VOC ) adsOrderCreate,
( DBENTRYP_OI ) adsOrderDestroy,
( DBENTRYP_OII ) adsOrderInfo,
( DBENTRYP_V ) adsClearFilter,
( DBENTRYP_V ) adsClearLocate,
( DBENTRYP_V ) adsClearScope,
( DBENTRYP_VPLP ) adsCountScope,
( DBENTRYP_I ) adsFilterText,
( DBENTRYP_SI ) adsScopeInfo,
( DBENTRYP_VFI ) adsSetFilter,
( DBENTRYP_VLO ) adsSetLocate,
( DBENTRYP_VOS ) adsSetScope,
( DBENTRYP_VPL ) adsSkipScope,
( DBENTRYP_B ) adsLocate,
( DBENTRYP_P ) adsCompile,
( DBENTRYP_I ) adsError,
( DBENTRYP_I ) adsEvalBlock,
( DBENTRYP_VSP ) adsRawLock,
( DBENTRYP_VL ) adsLock,
( DBENTRYP_I ) adsUnLock,
( DBENTRYP_V ) adsCloseMemFile,
( DBENTRYP_VP ) adsCreateMemFile,
( DBENTRYP_SVPB ) adsGetValueFile,
( DBENTRYP_VP ) adsOpenMemFile,
( DBENTRYP_SVPB ) adsPutValueFile,
( DBENTRYP_V ) adsReadDBHeader,
( DBENTRYP_V ) adsWriteDBHeader,
( DBENTRYP_R ) adsInit,
( DBENTRYP_R ) adsExit,
( DBENTRYP_RVV ) adsDrop,
( DBENTRYP_RVV ) adsExists,
( DBENTRYP_RSLV ) adsRddInfo,
( DBENTRYP_SVP ) adsWhoCares
};
static const RDDFUNCS adsTable = { ( DBENTRYP_BP ) adsBof,
( DBENTRYP_BP ) adsEof,
( DBENTRYP_BP ) adsFound,
( DBENTRYP_V ) adsGoBottom,
( DBENTRYP_UL ) adsGoTo,
( DBENTRYP_I ) adsGoToId,
( DBENTRYP_V ) adsGoTop,
( DBENTRYP_BIB ) adsSeek,
( DBENTRYP_L ) adsSkip,
( DBENTRYP_L ) adsSkipFilter,
( DBENTRYP_L ) adsSkipRaw,
( DBENTRYP_VF ) adsAddField,
( DBENTRYP_B ) adsAppend,
( DBENTRYP_I ) adsCreateFields,
( DBENTRYP_V ) adsDeleteRec,
( DBENTRYP_BP ) adsDeleted,
( DBENTRYP_SP ) adsFieldCount,
( DBENTRYP_VF ) adsFieldDisplay,
( DBENTRYP_SSI ) adsFieldInfo,
( DBENTRYP_SVP ) adsFieldName,
( DBENTRYP_V ) adsFlush,
( DBENTRYP_PP ) adsGetRec,
( DBENTRYP_SI ) adsGetValue,
( DBENTRYP_SVL ) adsGetVarLen,
( DBENTRYP_V ) adsGoCold,
( DBENTRYP_V ) adsGoHot,
( DBENTRYP_P ) adsPutRec,
( DBENTRYP_SI ) adsPutValue,
( DBENTRYP_V ) adsRecall,
( DBENTRYP_ULP ) adsRecCount,
( DBENTRYP_ISI ) adsRecInfo,
( DBENTRYP_ULP ) adsRecNo,
( DBENTRYP_I ) adsRecId,
( DBENTRYP_S ) adsSetFieldExtent,
( DBENTRYP_P ) adsAlias,
( DBENTRYP_V ) adsClose,
( DBENTRYP_VP ) adsCreate,
( DBENTRYP_SI ) adsInfo,
( DBENTRYP_V ) adsNewArea,
( DBENTRYP_VP ) adsOpen,
( DBENTRYP_V ) adsRelease,
( DBENTRYP_SP ) adsStructSize,
( DBENTRYP_P ) adsSysName,
( DBENTRYP_VEI ) adsEval,
( DBENTRYP_V ) adsPack,
( DBENTRYP_LSP ) adsPackRec,
( DBENTRYP_VS ) adsSort,
( DBENTRYP_VT ) adsTrans,
( DBENTRYP_VT ) adsTransRec,
( DBENTRYP_V ) adsZap,
( DBENTRYP_VR ) adsChildEnd,
( DBENTRYP_VR ) adsChildStart,
( DBENTRYP_VR ) adsChildSync,
( DBENTRYP_V ) adsSyncChildren,
( DBENTRYP_V ) adsClearRel,
( DBENTRYP_V ) adsForceRel,
( DBENTRYP_SVP ) adsRelArea,
( DBENTRYP_VR ) adsRelEval,
( DBENTRYP_SVP ) adsRelText,
( DBENTRYP_VR ) adsSetRel,
( DBENTRYP_OI ) adsOrderListAdd,
( DBENTRYP_V ) adsOrderListClear,
( DBENTRYP_OI ) adsOrderListDelete,
( DBENTRYP_OI ) adsOrderListFocus,
( DBENTRYP_V ) adsOrderListRebuild,
( DBENTRYP_VOI ) adsOrderCondition,
( DBENTRYP_VOC ) adsOrderCreate,
( DBENTRYP_OI ) adsOrderDestroy,
( DBENTRYP_OII ) adsOrderInfo,
( DBENTRYP_V ) adsClearFilter,
( DBENTRYP_V ) adsClearLocate,
( DBENTRYP_V ) adsClearScope,
( DBENTRYP_VPLP ) adsCountScope,
( DBENTRYP_I ) adsFilterText,
( DBENTRYP_SI ) adsScopeInfo,
( DBENTRYP_VFI ) adsSetFilter,
( DBENTRYP_VLO ) adsSetLocate,
( DBENTRYP_VOS ) adsSetScope,
( DBENTRYP_VPL ) adsSkipScope,
( DBENTRYP_B ) adsLocate,
( DBENTRYP_P ) adsCompile,
( DBENTRYP_I ) adsError,
( DBENTRYP_I ) adsEvalBlock,
( DBENTRYP_VSP ) adsRawLock,
( DBENTRYP_VL ) adsLock,
( DBENTRYP_I ) adsUnLock,
( DBENTRYP_V ) adsCloseMemFile,
( DBENTRYP_VP ) adsCreateMemFile,
( DBENTRYP_SVPB ) adsGetValueFile,
( DBENTRYP_VP ) adsOpenMemFile,
( DBENTRYP_SVPB ) adsPutValueFile,
( DBENTRYP_V ) adsReadDBHeader,
( DBENTRYP_V ) adsWriteDBHeader,
( DBENTRYP_R ) adsInit,
( DBENTRYP_R ) adsExit,
( DBENTRYP_RVV ) adsDrop,
( DBENTRYP_RVV ) adsExists,
( DBENTRYP_RSLV ) adsRddInfo,
( DBENTRYP_SVP ) adsWhoCares
};
static void adsRegisterRDD( USHORT * pusRddId )
{
@@ -4611,7 +4611,7 @@ static void adsRegisterRDD( USHORT * pusRddId )
{
ERRCODE errCode;
errCode = hb_rddInherit( pTable, &adsTable, &adsSuper, 0 );
errCode = hb_rddInherit( pTable, &adsTable, &adsSuper, NULL );
if ( errCode == SUCCESS )
{
/*

View File

@@ -77,25 +77,6 @@ HB_EXTERN_BEGIN
#define HARBOUR_MAX_RDD_RELTEXT_LENGTH 256
/* RDD virtual machine integration functions */
extern HB_EXPORT USHORT hb_rddInsertAreaNode( char *szDriver );
extern HB_EXPORT USHORT hb_rddGetCurrentFieldPos( char * szName );
extern HB_EXPORT void * hb_rddAllocWorkAreaAlias( char * szAlias, int iArea );
extern HB_EXPORT int hb_rddGetCurrentWorkAreaNumber( void );
extern HB_EXPORT void * hb_rddGetCurrentWorkAreaPointer( void );
extern HB_EXPORT ERRCODE hb_rddGetAliasNumber( char * szAlias, int * iArea );
extern HB_EXPORT ERRCODE hb_rddSelectWorkAreaAlias( char * szAlias );
extern HB_EXPORT ERRCODE hb_rddSelectWorkAreaNumber( int iArea );
extern HB_EXPORT ERRCODE hb_rddSelectWorkAreaSymbol( PHB_SYMB pSymAlias );
extern HB_EXPORT ERRCODE hb_rddGetFieldValue( HB_ITEM_PTR pItem, PHB_SYMB pFieldSymbol );
extern HB_EXPORT ERRCODE hb_rddPutFieldValue( HB_ITEM_PTR pItem, PHB_SYMB pFieldSymbol );
extern HB_EXPORT ERRCODE hb_rddFieldGet( HB_ITEM_PTR pItem, PHB_SYMB pFieldSymbol );
extern HB_EXPORT ERRCODE hb_rddFieldPut( HB_ITEM_PTR pItem, PHB_SYMB pFieldSymbol );
extern HB_EXPORT void hb_rddShutDown( void );
extern HB_EXPORT void hb_rddReleaseCurrentArea( void );
/* DBCMD errors */
@@ -104,6 +85,7 @@ extern HB_EXPORT void hb_rddReleaseCurrentArea( void );
#define EDBCMD_NOVAR 1003
#define EDBCMD_USE_BADPARAMETER 1005
#define EDBCMD_REL_BADPARAMETER 1006
#define EDBCMD_ORDLSTADD_BADPARAMETER 1008
#define EDBCMD_FIELDNAME_BADPARAMETER 1009
#define EDBCMD_BADALIAS 1010
#define EDBCMD_DUPALIAS 1011
@@ -1129,19 +1111,80 @@ typedef RDDNODE * LPRDDNODE;
* PROTOTYPES
* ----------
*/
extern HB_EXPORT int hb_rddRegister( char * szDriver, USHORT uiType );
extern HB_EXPORT ERRCODE hb_rddInherit( PRDDFUNCS pTable, PRDDFUNCS pSubTable, PRDDFUNCS pSuperTable, BYTE * szDrvName );
/* RDD virtual machine integration functions */
extern HB_EXPORT void hb_rddShutDown( void );
extern HB_EXPORT ERRCODE hb_rddGetFieldValue( HB_ITEM_PTR pItem, PHB_SYMB pFieldSymbol );
extern HB_EXPORT ERRCODE hb_rddPutFieldValue( HB_ITEM_PTR pItem, PHB_SYMB pFieldSymbol );
extern HB_EXPORT ERRCODE hb_rddFieldGet( HB_ITEM_PTR pItem, PHB_SYMB pFieldSymbol );
extern HB_EXPORT ERRCODE hb_rddFieldPut( HB_ITEM_PTR pItem, PHB_SYMB pFieldSymbol );
extern HB_EXPORT int hb_rddGetCurrentWorkAreaNumber( void );
extern HB_EXPORT ERRCODE hb_rddSelectWorkAreaNumber( int iArea );
extern HB_EXPORT ERRCODE hb_rddSelectWorkAreaAlias( const char * szAlias );
extern HB_EXPORT ERRCODE hb_rddSelectWorkAreaSymbol( PHB_SYMB pSymAlias );
extern HB_EXPORT ERRCODE hb_rddGetAliasNumber( const char * szAlias, int * iArea );
/* other functions */
extern HB_EXPORT void * hb_rddAllocWorkAreaAlias( const char * szAlias, int iArea );
extern HB_EXPORT void * hb_rddGetCurrentWorkAreaPointer( void );
extern HB_EXPORT void * hb_rddGetWorkAreaPointer( int iArea );
extern HB_EXPORT USHORT hb_rddInsertAreaNode( const char *szDriver );
extern HB_EXPORT void hb_rddReleaseCurrentArea( void );
extern HB_EXPORT int hb_rddRegister( const char * szDriver, USHORT uiType );
extern HB_EXPORT ERRCODE hb_rddInherit( RDDFUNCS * pTable, const RDDFUNCS * pSubTable, RDDFUNCS * pSuperTable, const char * szDrvName );
extern HB_EXPORT LPRDDNODE hb_rddGetNode( USHORT uiNode );
extern HB_EXPORT LPRDDNODE hb_rddFindNode( const char * szDriver, USHORT * uiIndex );
extern HB_EXPORT USHORT hb_rddFieldIndex( AREAP pArea, const char * szName );
extern HB_EXPORT USHORT hb_rddFieldExpIndex( AREAP pArea, const char * szField );
extern HB_EXPORT const char * hb_rddDefaultDrv( const char * szDriver );
extern HB_EXPORT ERRCODE hb_rddSelectFirstAvailable( void );
extern HB_EXPORT ERRCODE hb_rddVerifyAliasName( const char * szAlias );
extern HB_EXPORT void * hb_rddNewAreaNode( LPRDDNODE pRddNode, USHORT uiRddID );
extern HB_EXPORT PHB_ITEM hb_rddList( USHORT uiType );
extern HB_EXPORT void hb_rddCloseAll( void );
extern HB_EXPORT void hb_rddFlushAll( void );
extern HB_EXPORT void hb_rddUnLockAll( void );
extern HB_EXPORT BOOL hb_rddGetNetErr( void );
extern HB_EXPORT void hb_rddSetNetErr( BOOL fNetErr );
extern HB_EXPORT ERRCODE hb_rddOpenTable(
const char * szFileName, const char * szDriver,
USHORT uiArea, const char *szAlias,
BOOL fShared, BOOL fReadonly,
const char * szCpId, ULONG ulConnection,
PHB_ITEM pStruct, PHB_ITEM pDelim );
extern HB_EXPORT ERRCODE hb_rddCreateTable(
const char * szFileName, const char * szDriver,
USHORT uiArea, const char *szAlias,
BOOL fKeepOpen,
const char * szCpId, ULONG ulConnection,
PHB_ITEM pStruct, PHB_ITEM pDelim );
extern HB_EXPORT ERRCODE hb_dbTransStruct(
AREAP lpaSource, AREAP lpaDest,
LPDBTRANSINFO lpdbTransInfo,
PHB_ITEM *pStruct, PHB_ITEM pFields );
extern HB_EXPORT ERRCODE hb_rddTransRecords(
AREAP pArea,
const char *szFileName, const char *szDriver,
ULONG ulConnection,
PHB_ITEM pFields, BOOL fExport,
PHB_ITEM pCobFor, PHB_ITEM pStrFor,
PHB_ITEM pCobWhile, PHB_ITEM pStrWhile,
PHB_ITEM pNext, PHB_ITEM pRecID,
PHB_ITEM pRest,
const char *szCpId,
PHB_ITEM pDelim );
extern HB_EXPORT void hb_tblStructure( AREAP pArea, PHB_ITEM pStruct );
#if 0
extern HB_EXPORT ERRCODE hb_rddDisinherit( BYTE * drvName );
extern HB_EXPORT ERRCODE hb_rddDisinherit( char * drvName );
extern HB_EXPORT USHORT hb_rddGetCurrentFieldPos( const char * szName );
extern HB_EXPORT USHORT hb_rddExtendType( HB_TYPE fieldType );
extern HB_EXPORT HB_TYPE hb_rddFieldType( USHORT extendType );
#endif
typedef short (* WACALLBACK )( AREA *, int );
extern HB_EXPORT ERRCODE hb_rddIterateWorkAreas ( WACALLBACK pCallBack, int data );
extern HB_EXPORT USHORT hb_rddFieldIndex( AREAP pArea, char * szName );
extern HB_EXPORT USHORT hb_rddFieldExpIndex( AREAP pArea, char * szField );
typedef ERRCODE ( * WACALLBACK )( AREAP, void * );
extern HB_EXPORT ERRCODE hb_rddIterateWorkAreas( WACALLBACK pCallBack, void * cargo );
extern HB_EXPORT ERRCODE hb_rddGetTempAlias( char * szAliasTmp );
HB_EXTERN_END

View File

@@ -417,7 +417,6 @@ EXTERNAL __MRESTORE
EXTERNAL __MSAVE
EXTERNAL __MXRELEASE
EXTERNAL __QUIT
EXTERNAL __RDDSETDEFAULT
EXTERNAL __REPORTFORM
EXTERNAL __RUN
EXTERNAL __SETCENTURY

View File

@@ -1,170 +0,0 @@
/*
* $Id$
*/
/*
* Harbour Project source code:
* Default RDD module
*
* Copyright 1999 Bruno Cantero <bruno@issnet.net>
* www - http://www.harbour-project.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
#ifndef HB_RDDWRK_H_
#define HB_RDDWRK_H_
#include "hbapirdd.h"
HB_EXTERN_BEGIN
/*
* -- METHODS --
*/
extern ERRCODE hb_waBof( AREAP pArea, BOOL * pBof );
extern ERRCODE hb_waEof( AREAP pArea, BOOL * pEof );
extern ERRCODE hb_waFound( AREAP pArea, BOOL * pFound );
#define hb_waGoBottom hb_waUnsupported
#define hb_waGoTo ( DBENTRYP_UL ) hb_waUnsupported
#define hb_waGoToId ( DBENTRYP_I ) hb_waUnsupported
#define hb_waGoTop hb_waUnsupported
#define hb_waSeek ( DBENTRYP_BIB ) hb_waUnsupported
extern ERRCODE hb_waSkip( AREAP pArea, LONG lToSkip );
extern ERRCODE hb_waSkipFilter( AREAP pArea, LONG lUpDown );
#define hb_waSkipRaw ( DBENTRYP_L ) hb_waUnsupported
extern ERRCODE hb_waAddField( AREAP pArea, LPDBFIELDINFO pFieldInfo );
#define hb_waAppend ( DBENTRYP_B ) hb_waUnsupported
extern ERRCODE hb_waCreateFields( AREAP pArea, PHB_ITEM pStruct );
#define hb_waDeleteRec hb_waUnsupported
#define hb_waDeleted ( DBENTRYP_BP ) hb_waUnsupported
extern ERRCODE hb_waFieldCount( AREAP pArea, USHORT * uiFields );
#define hb_waFieldDisplay ( DBENTRYP_VF ) hb_waUnsupported
extern ERRCODE hb_waFieldInfo( AREAP pArea, USHORT uiIndex, USHORT uiType, PHB_ITEM pItem );
extern ERRCODE hb_waFieldName( AREAP pArea, USHORT uiIndex, void * szName );
#define hb_waFlush hb_waUnsupported
#define hb_waGetRec ( DBENTRYP_PP ) hb_waUnsupported
#define hb_waGetValue ( DBENTRYP_SI ) hb_waUnsupported
#define hb_waGetVarLen ( DBENTRYP_SVL ) hb_waUnsupported
#define hb_waGoCold hb_waUnsupported
#define hb_waGoHot hb_waUnsupported
#define hb_waPutRec ( DBENTRYP_P ) hb_waUnsupported
#define hb_waPutValue ( DBENTRYP_SI ) hb_waUnsupported
#define hb_waRecall hb_waUnsupported
#define hb_waRecCount ( DBENTRYP_ULP ) hb_waUnsupported
#define hb_waRecInfo ( DBENTRYP_ISI ) hb_waUnsupported
#define hb_waRecNo ( DBENTRYP_ULP ) hb_waUnsupported
#define hb_waRecId ( DBENTRYP_I ) hb_waUnsupported
extern ERRCODE hb_waSetFieldExtent( AREAP pArea, USHORT uiFieldExtent );
extern ERRCODE hb_waAlias( AREAP pArea, BYTE * szAlias );
extern ERRCODE hb_waClose( AREAP pArea );
/* Like in Clipper map CREATE() method at work area level to OPEN() */
#define hb_waCreate hb_waOpen
extern ERRCODE hb_waInfo( AREAP pArea, USHORT uiIndex, PHB_ITEM pItem );
extern ERRCODE hb_waNewArea( AREAP pArea );
extern ERRCODE hb_waOpen( AREAP pArea, LPDBOPENINFO pInfo );
extern ERRCODE hb_waRelease( AREAP pArea );
extern ERRCODE hb_waStructSize( AREAP pArea, USHORT * uiSize );
extern ERRCODE hb_waSysName( AREAP pArea, BYTE * pBuffer );
extern ERRCODE hb_waEval( AREAP pArea, LPDBEVALINFO pEvalInfo );
#define hb_waPack hb_waUnsupported
#define hb_waPackRec ( DBENTRYP_LSP ) hb_waUnsupported
#define hb_waSort ( DBENTRYP_VS ) hb_waUnsupported
extern ERRCODE hb_waTrans( AREAP pArea, LPDBTRANSINFO pTransInfo );
extern ERRCODE hb_waTransRec( AREAP pArea, LPDBTRANSINFO pTransInfo );
#define hb_waZap hb_waUnsupported
extern ERRCODE hb_waChildEnd( AREAP pArea, LPDBRELINFO pRelInfo );
extern ERRCODE hb_waChildStart( AREAP pArea, LPDBRELINFO pRelInfo );
#define hb_waChildSync ( DBENTRYP_VR ) hb_waUnsupported
extern ERRCODE hb_waSyncChildren( AREAP pArea );
extern ERRCODE hb_waClearRel( AREAP pArea );
#define hb_waForceRel hb_waUnsupported
extern ERRCODE hb_waRelArea( AREAP pArea, USHORT uiRelNo, void * pRelArea );
extern ERRCODE hb_waRelEval( AREAP pArea, LPDBRELINFO pRelInfo );
extern ERRCODE hb_waRelText( AREAP pArea, USHORT uiRelNo, void * pExpr );
extern ERRCODE hb_waSetRel( AREAP pArea, LPDBRELINFO pRelInfo );
#define hb_waOrderListAdd ( DBENTRYP_OI ) hb_waUnsupported
#define hb_waOrderListClear hb_waUnsupported
#define hb_waOrderListDelete ( DBENTRYP_OI ) hb_waUnsupported
#define hb_waOrderListFocus ( DBENTRYP_OI ) hb_waUnsupported
#define hb_waOrderListRebuild hb_waUnsupported
extern ERRCODE hb_waOrderCondition( AREAP pArea, LPDBORDERCONDINFO param );
#define hb_waOrderCreate ( DBENTRYP_VOC ) hb_waUnsupported
#define hb_waOrderDestroy ( DBENTRYP_OI ) hb_waUnsupported
/* #define hb_waOrderInfo ( DBENTRYP_OII ) hb_waNull */
extern ERRCODE hb_waOrderInfo( AREAP pArea, USHORT index, LPDBORDERINFO param );
extern ERRCODE hb_waClearFilter( AREAP pArea );
extern ERRCODE hb_waClearLocate( AREAP pArea );
#define hb_waClearScope hb_waUnsupported
#define hb_waCountScope ( DBENTRYP_VPLP ) hb_waUnsupported
extern ERRCODE hb_waFilterText( AREAP pArea, PHB_ITEM pFilter );
#define hb_waScopeInfo ( DBENTRYP_SI ) hb_waUnsupported
extern ERRCODE hb_waSetFilter( AREAP pArea, LPDBFILTERINFO pFilterInfo );
extern ERRCODE hb_waSetLocate( AREAP pArea, LPDBSCOPEINFO pScopeInfo );
#define hb_waSetScope ( DBENTRYP_VOS ) hb_waUnsupported
#define hb_waSkipScope ( DBENTRYP_VPL ) hb_waUnsupported
ERRCODE hb_waLocate( AREAP pArea, BOOL fContinue );
extern ERRCODE hb_waCompile( AREAP pArea, BYTE * pExpr );
extern ERRCODE hb_waError( AREAP pArea, PHB_ITEM pError );
extern ERRCODE hb_waEvalBlock( AREAP pArea, PHB_ITEM pBlock );
#define hb_waRawLock ( DBENTRYP_VSP ) hb_waUnsupported
#define hb_waLock ( DBENTRYP_VL ) hb_waUnsupported
#define hb_waUnLock ( DBENTRYP_I ) hb_waUnsupported
#define hb_waCloseMemFile hb_waUnsupported
#define hb_waCreateMemFile ( DBENTRYP_VP ) hb_waUnsupported
#define hb_waGetValueFile ( DBENTRYP_SVPB ) hb_waUnsupported
#define hb_waOpenMemFile ( DBENTRYP_VP ) hb_waUnsupported
#define hb_waPutValueFile ( DBENTRYP_SVPB ) hb_waUnsupported
#define hb_waReadDBHeader hb_waUnsupported
#define hb_waWriteDBHeader hb_waUnsupported
#define hb_rddInit (DBENTRYP_R) NULL
#define hb_rddExit (DBENTRYP_R) NULL
#define hb_rddDrop (DBENTRYP_RVV) hb_waRddUnsupported
#define hb_rddExists (DBENTRYP_RVV) hb_waRddUnsupported
extern ERRCODE hb_rddInfo( LPRDDNODE pRDD, USHORT uiIndex, ULONG ulConnection, PHB_ITEM pItem );
#define hb_waWhoCares ( DBENTRYP_SVP ) hb_waUnsupported
HB_EXTERN_END
#endif /* HB_RDDWRK_H_ */

View File

@@ -7,6 +7,8 @@ ROOT = ../../
C_SOURCES=\
dbcmd.c \
workarea.c \
wacore.c \
wafunc.c \
dbf1.c \
dbnubs.c \
dbsql.c \

File diff suppressed because it is too large Load Diff

View File

@@ -72,106 +72,106 @@
static USHORT s_uiRddId = ( USHORT ) -1;
static RDDFUNCS dbfSuper;
static RDDFUNCS dbfTable = { ( DBENTRYP_BP ) hb_dbfBof,
( DBENTRYP_BP ) hb_dbfEof,
( DBENTRYP_BP ) hb_dbfFound,
( DBENTRYP_V ) hb_dbfGoBottom,
( DBENTRYP_UL ) hb_dbfGoTo,
( DBENTRYP_I ) hb_dbfGoToId,
( DBENTRYP_V ) hb_dbfGoTop,
( DBENTRYP_BIB ) hb_dbfSeek,
( DBENTRYP_L ) hb_dbfSkip,
( DBENTRYP_L ) hb_dbfSkipFilter,
( DBENTRYP_L ) hb_dbfSkipRaw,
( DBENTRYP_VF ) hb_dbfAddField,
( DBENTRYP_B ) hb_dbfAppend,
( DBENTRYP_I ) hb_dbfCreateFields,
( DBENTRYP_V ) hb_dbfDeleteRec,
( DBENTRYP_BP ) hb_dbfDeleted,
( DBENTRYP_SP ) hb_dbfFieldCount,
( DBENTRYP_VF ) hb_dbfFieldDisplay,
( DBENTRYP_SSI ) hb_dbfFieldInfo,
( DBENTRYP_SVP ) hb_dbfFieldName,
( DBENTRYP_V ) hb_dbfFlush,
( DBENTRYP_PP ) hb_dbfGetRec,
( DBENTRYP_SI ) hb_dbfGetValue,
( DBENTRYP_SVL ) hb_dbfGetVarLen,
( DBENTRYP_V ) hb_dbfGoCold,
( DBENTRYP_V ) hb_dbfGoHot,
( DBENTRYP_P ) hb_dbfPutRec,
( DBENTRYP_SI ) hb_dbfPutValue,
( DBENTRYP_V ) hb_dbfRecall,
( DBENTRYP_ULP ) hb_dbfRecCount,
( DBENTRYP_ISI ) hb_dbfRecInfo,
( DBENTRYP_ULP ) hb_dbfRecNo,
( DBENTRYP_I ) hb_dbfRecId,
( DBENTRYP_S ) hb_dbfSetFieldExtent,
( DBENTRYP_P ) hb_dbfAlias,
( DBENTRYP_V ) hb_dbfClose,
( DBENTRYP_VP ) hb_dbfCreate,
( DBENTRYP_SI ) hb_dbfInfo,
( DBENTRYP_V ) hb_dbfNewArea,
( DBENTRYP_VP ) hb_dbfOpen,
( DBENTRYP_V ) hb_dbfRelease,
( DBENTRYP_SP ) hb_dbfStructSize,
( DBENTRYP_P ) hb_dbfSysName,
( DBENTRYP_VEI ) hb_dbfEval,
( DBENTRYP_V ) hb_dbfPack,
( DBENTRYP_LSP ) hb_dbfPackRec,
( DBENTRYP_VS ) hb_dbfSort,
( DBENTRYP_VT ) hb_dbfTrans,
( DBENTRYP_VT ) hb_dbfTransRec,
( DBENTRYP_V ) hb_dbfZap,
( DBENTRYP_VR ) hb_dbfChildEnd,
( DBENTRYP_VR ) hb_dbfChildStart,
( DBENTRYP_VR ) hb_dbfChildSync,
( DBENTRYP_V ) hb_dbfSyncChildren,
( DBENTRYP_V ) hb_dbfClearRel,
( DBENTRYP_V ) hb_dbfForceRel,
( DBENTRYP_SVP ) hb_dbfRelArea,
( DBENTRYP_VR ) hb_dbfRelEval,
( DBENTRYP_SVP ) hb_dbfRelText,
( DBENTRYP_VR ) hb_dbfSetRel,
( DBENTRYP_OI ) hb_dbfOrderListAdd,
( DBENTRYP_V ) hb_dbfOrderListClear,
( DBENTRYP_OI ) hb_dbfOrderListDelete,
( DBENTRYP_OI ) hb_dbfOrderListFocus,
( DBENTRYP_V ) hb_dbfOrderListRebuild,
( DBENTRYP_VOI ) hb_dbfOrderCondition,
( DBENTRYP_VOC ) hb_dbfOrderCreate,
( DBENTRYP_OI ) hb_dbfOrderDestroy,
( DBENTRYP_OII ) hb_dbfOrderInfo,
( DBENTRYP_V ) hb_dbfClearFilter,
( DBENTRYP_V ) hb_dbfClearLocate,
( DBENTRYP_V ) hb_dbfClearScope,
( DBENTRYP_VPLP ) hb_dbfCountScope,
( DBENTRYP_I ) hb_dbfFilterText,
( DBENTRYP_SI ) hb_dbfScopeInfo,
( DBENTRYP_VFI ) hb_dbfSetFilter,
( DBENTRYP_VLO ) hb_dbfSetLocate,
( DBENTRYP_VOS ) hb_dbfSetScope,
( DBENTRYP_VPL ) hb_dbfSkipScope,
( DBENTRYP_B ) hb_dbfLocate,
( DBENTRYP_P ) hb_dbfCompile,
( DBENTRYP_I ) hb_dbfError,
( DBENTRYP_I ) hb_dbfEvalBlock,
( DBENTRYP_VSP ) hb_dbfRawLock,
( DBENTRYP_VL ) hb_dbfLock,
( DBENTRYP_I ) hb_dbfUnLock,
( DBENTRYP_V ) hb_dbfCloseMemFile,
( DBENTRYP_VP ) hb_dbfCreateMemFile,
( DBENTRYP_SVPB ) hb_dbfGetValueFile,
( DBENTRYP_VP ) hb_dbfOpenMemFile,
( DBENTRYP_SVPB ) hb_dbfPutValueFile,
( DBENTRYP_V ) hb_dbfReadDBHeader,
( DBENTRYP_V ) hb_dbfWriteDBHeader,
( DBENTRYP_R ) hb_dbfInit,
( DBENTRYP_R ) hb_dbfExit,
( DBENTRYP_RVV ) hb_dbfDrop,
( DBENTRYP_RVV ) hb_dbfExists,
( DBENTRYP_RSLV ) hb_dbfRddInfo,
( DBENTRYP_SVP ) hb_dbfWhoCares
};
static const RDDFUNCS dbfTable = { ( DBENTRYP_BP ) hb_dbfBof,
( DBENTRYP_BP ) hb_dbfEof,
( DBENTRYP_BP ) hb_dbfFound,
( DBENTRYP_V ) hb_dbfGoBottom,
( DBENTRYP_UL ) hb_dbfGoTo,
( DBENTRYP_I ) hb_dbfGoToId,
( DBENTRYP_V ) hb_dbfGoTop,
( DBENTRYP_BIB ) hb_dbfSeek,
( DBENTRYP_L ) hb_dbfSkip,
( DBENTRYP_L ) hb_dbfSkipFilter,
( DBENTRYP_L ) hb_dbfSkipRaw,
( DBENTRYP_VF ) hb_dbfAddField,
( DBENTRYP_B ) hb_dbfAppend,
( DBENTRYP_I ) hb_dbfCreateFields,
( DBENTRYP_V ) hb_dbfDeleteRec,
( DBENTRYP_BP ) hb_dbfDeleted,
( DBENTRYP_SP ) hb_dbfFieldCount,
( DBENTRYP_VF ) hb_dbfFieldDisplay,
( DBENTRYP_SSI ) hb_dbfFieldInfo,
( DBENTRYP_SVP ) hb_dbfFieldName,
( DBENTRYP_V ) hb_dbfFlush,
( DBENTRYP_PP ) hb_dbfGetRec,
( DBENTRYP_SI ) hb_dbfGetValue,
( DBENTRYP_SVL ) hb_dbfGetVarLen,
( DBENTRYP_V ) hb_dbfGoCold,
( DBENTRYP_V ) hb_dbfGoHot,
( DBENTRYP_P ) hb_dbfPutRec,
( DBENTRYP_SI ) hb_dbfPutValue,
( DBENTRYP_V ) hb_dbfRecall,
( DBENTRYP_ULP ) hb_dbfRecCount,
( DBENTRYP_ISI ) hb_dbfRecInfo,
( DBENTRYP_ULP ) hb_dbfRecNo,
( DBENTRYP_I ) hb_dbfRecId,
( DBENTRYP_S ) hb_dbfSetFieldExtent,
( DBENTRYP_P ) hb_dbfAlias,
( DBENTRYP_V ) hb_dbfClose,
( DBENTRYP_VP ) hb_dbfCreate,
( DBENTRYP_SI ) hb_dbfInfo,
( DBENTRYP_V ) hb_dbfNewArea,
( DBENTRYP_VP ) hb_dbfOpen,
( DBENTRYP_V ) hb_dbfRelease,
( DBENTRYP_SP ) hb_dbfStructSize,
( DBENTRYP_P ) hb_dbfSysName,
( DBENTRYP_VEI ) hb_dbfEval,
( DBENTRYP_V ) hb_dbfPack,
( DBENTRYP_LSP ) hb_dbfPackRec,
( DBENTRYP_VS ) hb_dbfSort,
( DBENTRYP_VT ) hb_dbfTrans,
( DBENTRYP_VT ) hb_dbfTransRec,
( DBENTRYP_V ) hb_dbfZap,
( DBENTRYP_VR ) hb_dbfChildEnd,
( DBENTRYP_VR ) hb_dbfChildStart,
( DBENTRYP_VR ) hb_dbfChildSync,
( DBENTRYP_V ) hb_dbfSyncChildren,
( DBENTRYP_V ) hb_dbfClearRel,
( DBENTRYP_V ) hb_dbfForceRel,
( DBENTRYP_SVP ) hb_dbfRelArea,
( DBENTRYP_VR ) hb_dbfRelEval,
( DBENTRYP_SVP ) hb_dbfRelText,
( DBENTRYP_VR ) hb_dbfSetRel,
( DBENTRYP_OI ) hb_dbfOrderListAdd,
( DBENTRYP_V ) hb_dbfOrderListClear,
( DBENTRYP_OI ) hb_dbfOrderListDelete,
( DBENTRYP_OI ) hb_dbfOrderListFocus,
( DBENTRYP_V ) hb_dbfOrderListRebuild,
( DBENTRYP_VOI ) hb_dbfOrderCondition,
( DBENTRYP_VOC ) hb_dbfOrderCreate,
( DBENTRYP_OI ) hb_dbfOrderDestroy,
( DBENTRYP_OII ) hb_dbfOrderInfo,
( DBENTRYP_V ) hb_dbfClearFilter,
( DBENTRYP_V ) hb_dbfClearLocate,
( DBENTRYP_V ) hb_dbfClearScope,
( DBENTRYP_VPLP ) hb_dbfCountScope,
( DBENTRYP_I ) hb_dbfFilterText,
( DBENTRYP_SI ) hb_dbfScopeInfo,
( DBENTRYP_VFI ) hb_dbfSetFilter,
( DBENTRYP_VLO ) hb_dbfSetLocate,
( DBENTRYP_VOS ) hb_dbfSetScope,
( DBENTRYP_VPL ) hb_dbfSkipScope,
( DBENTRYP_B ) hb_dbfLocate,
( DBENTRYP_P ) hb_dbfCompile,
( DBENTRYP_I ) hb_dbfError,
( DBENTRYP_I ) hb_dbfEvalBlock,
( DBENTRYP_VSP ) hb_dbfRawLock,
( DBENTRYP_VL ) hb_dbfLock,
( DBENTRYP_I ) hb_dbfUnLock,
( DBENTRYP_V ) hb_dbfCloseMemFile,
( DBENTRYP_VP ) hb_dbfCreateMemFile,
( DBENTRYP_SVPB ) hb_dbfGetValueFile,
( DBENTRYP_VP ) hb_dbfOpenMemFile,
( DBENTRYP_SVPB ) hb_dbfPutValueFile,
( DBENTRYP_V ) hb_dbfReadDBHeader,
( DBENTRYP_V ) hb_dbfWriteDBHeader,
( DBENTRYP_R ) hb_dbfInit,
( DBENTRYP_R ) hb_dbfExit,
( DBENTRYP_RVV ) hb_dbfDrop,
( DBENTRYP_RVV ) hb_dbfExists,
( DBENTRYP_RSLV ) hb_dbfRddInfo,
( DBENTRYP_SVP ) hb_dbfWhoCares
};
/*
* Common functions.
@@ -4610,11 +4610,11 @@ HB_FUNC( DBF_GETFUNCTABLE )
{
ERRCODE errCode;
if ( uiCount )
if( uiCount )
* uiCount = RDDFUNCSCOUNT;
errCode = hb_rddInherit( pTable, &dbfTable, &dbfSuper, 0 );
errCode = hb_rddInherit( pTable, &dbfTable, &dbfSuper, NULL );
hb_retni( errCode );
if ( errCode == SUCCESS )
if( errCode == SUCCESS )
{
/*
* we successfully register our RDD so now we can initialize it

View File

@@ -133,7 +133,7 @@ static void hb_cdxSortFree( LPCDXSORTINFO pSort );
static USHORT s_uiRddId = ( USHORT ) -1;
static RDDFUNCS cdxSuper;
static RDDFUNCS cdxTable =
static const RDDFUNCS cdxTable =
{
/* Movement and positioning methods */
@@ -9443,11 +9443,11 @@ HB_FUNC( SIXCDX_GETFUNCTABLE )
if ( uiCount )
* uiCount = RDDFUNCSCOUNT;
errCode = hb_rddInherit( pTable, &cdxTable, &cdxSuper, ( BYTE * ) "DBFFPT" );
errCode = hb_rddInherit( pTable, &cdxTable, &cdxSuper, "DBFFPT" );
if ( errCode != SUCCESS )
errCode = hb_rddInherit( pTable, &cdxTable, &cdxSuper, ( BYTE * ) "DBFDBT" );
errCode = hb_rddInherit( pTable, &cdxTable, &cdxSuper, "DBFDBT" );
if ( errCode != SUCCESS )
errCode = hb_rddInherit( pTable, &cdxTable, &cdxSuper, ( BYTE * ) "DBF" );
errCode = hb_rddInherit( pTable, &cdxTable, &cdxSuper, "DBF" );
hb_retni( errCode );
if ( errCode == SUCCESS )
{
@@ -9507,11 +9507,11 @@ HB_FUNC( DBFCDX_GETFUNCTABLE )
if ( uiCount )
* uiCount = RDDFUNCSCOUNT;
errCode = hb_rddInherit( pTable, &cdxTable, &cdxSuper, ( BYTE * ) "DBFFPT" );
errCode = hb_rddInherit( pTable, &cdxTable, &cdxSuper, "DBFFPT" );
if ( errCode != SUCCESS )
errCode = hb_rddInherit( pTable, &cdxTable, &cdxSuper, ( BYTE * ) "DBFDBT" );
errCode = hb_rddInherit( pTable, &cdxTable, &cdxSuper, "DBFDBT" );
if ( errCode != SUCCESS )
errCode = hb_rddInherit( pTable, &cdxTable, &cdxSuper, ( BYTE * ) "DBF" );
errCode = hb_rddInherit( pTable, &cdxTable, &cdxSuper, "DBF" );
if ( errCode == SUCCESS )
{
/*

View File

@@ -69,7 +69,7 @@
#endif
static RDDFUNCS dbtSuper;
static RDDFUNCS dbtTable =
static const RDDFUNCS dbtTable =
{
/* Movement and positioning methods */
@@ -805,7 +805,7 @@ HB_FUNC( DBFDBT_GETFUNCTABLE )
{
if ( uiCount )
* uiCount = RDDFUNCSCOUNT;
hb_retni( hb_rddInherit( pTable, &dbtTable, &dbtSuper, ( BYTE * ) "DBF" ) );
hb_retni( hb_rddInherit( pTable, &dbtTable, &dbtSuper, "DBF" ) );
}
else
hb_retni( FAILURE );

View File

@@ -81,7 +81,7 @@ static USHORT s_uiRddIdBLOB = ( USHORT ) -1;
static USHORT s_uiRddIdFPT = ( USHORT ) -1;
static RDDFUNCS fptSuper;
static RDDFUNCS fptTable =
static const RDDFUNCS fptTable =
{
/* Movement and positioning methods */
@@ -4689,7 +4689,7 @@ static void hb_dbffptRegisterRDD( USHORT * pusRddId )
if ( uiCount )
* uiCount = RDDFUNCSCOUNT;
errCode = hb_rddInherit( pTable, &fptTable, &fptSuper, ( BYTE * ) "DBF" );
errCode = hb_rddInherit( pTable, &fptTable, &fptSuper, "DBF" );
if ( errCode == SUCCESS )
*pusRddId = uiRddId;
hb_retni( errCode );

View File

@@ -7504,7 +7504,8 @@ static ERRCODE ntxRddInfo( LPRDDNODE pRDD, USHORT uiIndex, ULONG ulConnect, PHB_
return SUCCESS;
}
static RDDFUNCS ntxTable = { ntxBof,
static const RDDFUNCS ntxTable = {
ntxBof,
ntxEof,
ntxFound,
( DBENTRYP_V ) ntxGoBottom,
@@ -7622,11 +7623,11 @@ HB_FUNC( DBFNTX_GETFUNCTABLE )
if( uiCount )
* uiCount = RDDFUNCSCOUNT;
errCode = hb_rddInherit( pTable, &ntxTable, &ntxSuper, ( BYTE * ) "DBFFPT" );
errCode = hb_rddInherit( pTable, &ntxTable, &ntxSuper, "DBFFPT" );
if( errCode != SUCCESS )
errCode = hb_rddInherit( pTable, &ntxTable, &ntxSuper, ( BYTE * ) "DBFDBT" );
errCode = hb_rddInherit( pTable, &ntxTable, &ntxSuper, "DBFDBT" );
if( errCode != SUCCESS )
errCode = hb_rddInherit( pTable, &ntxTable, &ntxSuper, ( BYTE * ) "DBF" );
errCode = hb_rddInherit( pTable, &ntxTable, &ntxSuper, "DBF" );
if( errCode == SUCCESS )
{
/*

View File

@@ -66,7 +66,7 @@
#define SUPERTABLE (&delimSuper)
static RDDFUNCS delimSuper;
static USHORT s_uiNumLength[ 9 ] = { 0, 4, 6, 8, 11, 13, 16, 18, 20 };
static const USHORT s_uiNumLength[ 9 ] = { 0, 4, 6, 8, 11, 13, 16, 18, 20 };
static void hb_delimInitArea( DELIMAREAP pArea, char * szFileName )
{
@@ -1402,106 +1402,106 @@ static ERRCODE hb_delimRddInfo( LPRDDNODE pRDD, USHORT uiIndex, ULONG ulConnect,
}
static RDDFUNCS delimTable = { NULL /* hb_delimBof */,
NULL /* hb_delimEof */,
NULL /* hb_delimFound */,
NULL /* hb_delimGoBottom */,
NULL /* hb_delimGoTo */,
NULL /* hb_delimGoToId */,
( DBENTRYP_V ) hb_delimGoTop,
NULL /* hb_delimSeek */,
NULL /* hb_delimSkip */,
NULL /* hb_delimSkipFilter */,
( DBENTRYP_L ) hb_delimSkipRaw,
( DBENTRYP_VF ) hb_delimAddField,
( DBENTRYP_B ) hb_delimAppend,
NULL /* hb_delimCreateFields */,
( DBENTRYP_V ) hb_delimDeleteRec,
( DBENTRYP_BP ) hb_delimDeleted,
NULL /* hb_delimFieldCount */,
NULL /* hb_delimFieldDisplay */,
NULL /* hb_delimFieldInfo */,
NULL /* hb_delimFieldName */,
( DBENTRYP_V ) hb_delimFlush,
( DBENTRYP_PP ) hb_delimGetRec,
( DBENTRYP_SI ) hb_delimGetValue,
NULL /* hb_delimGetVarLen */,
( DBENTRYP_V ) hb_delimGoCold,
( DBENTRYP_V ) hb_delimGoHot,
( DBENTRYP_P ) hb_delimPutRec,
( DBENTRYP_SI ) hb_delimPutValue,
NULL /* hb_delimRecall */,
( DBENTRYP_ULP ) hb_delimRecCount,
NULL /* hb_delimRecInfo */,
( DBENTRYP_ULP ) hb_delimRecNo,
( DBENTRYP_I ) hb_delimRecId,
( DBENTRYP_S ) hb_delimSetFieldExtent,
NULL /* hb_delimAlias */,
( DBENTRYP_V ) hb_delimClose,
( DBENTRYP_VP ) hb_delimCreate,
( DBENTRYP_SI ) hb_delimInfo,
( DBENTRYP_V ) hb_delimNewArea,
( DBENTRYP_VP ) hb_delimOpen,
NULL /* hb_delimRelease */,
( DBENTRYP_SP ) hb_delimStructSize,
NULL /* hb_delimSysName */,
NULL /* hb_delimEval */,
NULL /* hb_delimPack */,
NULL /* hb_delimPackRec */,
NULL /* hb_delimSort */,
( DBENTRYP_VT ) hb_delimTrans,
NULL /* hb_delimTransRec */,
NULL /* hb_delimZap */,
NULL /* hb_delimChildEnd */,
NULL /* hb_delimChildStart */,
NULL /* hb_delimChildSync */,
NULL /* hb_delimSyncChildren */,
NULL /* hb_delimClearRel */,
NULL /* hb_delimForceRel */,
NULL /* hb_delimRelArea */,
NULL /* hb_delimRelEval */,
NULL /* hb_delimRelText */,
NULL /* hb_delimSetRel */,
NULL /* hb_delimOrderListAdd */,
NULL /* hb_delimOrderListClear */,
NULL /* hb_delimOrderListDelete */,
NULL /* hb_delimOrderListFocus */,
NULL /* hb_delimOrderListRebuild */,
NULL /* hb_delimOrderCondition */,
NULL /* hb_delimOrderCreate */,
NULL /* hb_delimOrderDestroy */,
NULL /* hb_delimOrderInfo */,
NULL /* hb_delimClearFilter */,
NULL /* hb_delimClearLocate */,
NULL /* hb_delimClearScope */,
NULL /* hb_delimCountScope */,
NULL /* hb_delimFilterText */,
NULL /* hb_delimScopeInfo */,
NULL /* hb_delimSetFilter */,
NULL /* hb_delimSetLocate */,
NULL /* hb_delimSetScope */,
NULL /* hb_delimSkipScope */,
NULL /* hb_delimLocate */,
NULL /* hb_delimCompile */,
NULL /* hb_delimError */,
NULL /* hb_delimEvalBlock */,
NULL /* hb_delimRawLock */,
NULL /* hb_delimLock */,
NULL /* hb_delimUnLock */,
NULL /* hb_delimCloseMemFile */,
NULL /* hb_delimCreateMemFile */,
NULL /* hb_delimGetValueFile */,
NULL /* hb_delimOpenMemFile */,
NULL /* hb_delimPutValueFile */,
NULL /* hb_delimReadDBHeader */,
NULL /* hb_delimWriteDBHeader */,
NULL /* hb_delimInit */,
NULL /* hb_delimExit */,
NULL /* hb_delimDrop */,
NULL /* hb_delimExists */,
( DBENTRYP_RSLV ) hb_delimRddInfo,
NULL /* hb_delimWhoCares */
};
static const RDDFUNCS delimTable = { NULL /* hb_delimBof */,
NULL /* hb_delimEof */,
NULL /* hb_delimFound */,
NULL /* hb_delimGoBottom */,
NULL /* hb_delimGoTo */,
NULL /* hb_delimGoToId */,
( DBENTRYP_V ) hb_delimGoTop,
NULL /* hb_delimSeek */,
NULL /* hb_delimSkip */,
NULL /* hb_delimSkipFilter */,
( DBENTRYP_L ) hb_delimSkipRaw,
( DBENTRYP_VF ) hb_delimAddField,
( DBENTRYP_B ) hb_delimAppend,
NULL /* hb_delimCreateFields */,
( DBENTRYP_V ) hb_delimDeleteRec,
( DBENTRYP_BP ) hb_delimDeleted,
NULL /* hb_delimFieldCount */,
NULL /* hb_delimFieldDisplay */,
NULL /* hb_delimFieldInfo */,
NULL /* hb_delimFieldName */,
( DBENTRYP_V ) hb_delimFlush,
( DBENTRYP_PP ) hb_delimGetRec,
( DBENTRYP_SI ) hb_delimGetValue,
NULL /* hb_delimGetVarLen */,
( DBENTRYP_V ) hb_delimGoCold,
( DBENTRYP_V ) hb_delimGoHot,
( DBENTRYP_P ) hb_delimPutRec,
( DBENTRYP_SI ) hb_delimPutValue,
NULL /* hb_delimRecall */,
( DBENTRYP_ULP ) hb_delimRecCount,
NULL /* hb_delimRecInfo */,
( DBENTRYP_ULP ) hb_delimRecNo,
( DBENTRYP_I ) hb_delimRecId,
( DBENTRYP_S ) hb_delimSetFieldExtent,
NULL /* hb_delimAlias */,
( DBENTRYP_V ) hb_delimClose,
( DBENTRYP_VP ) hb_delimCreate,
( DBENTRYP_SI ) hb_delimInfo,
( DBENTRYP_V ) hb_delimNewArea,
( DBENTRYP_VP ) hb_delimOpen,
NULL /* hb_delimRelease */,
( DBENTRYP_SP ) hb_delimStructSize,
NULL /* hb_delimSysName */,
NULL /* hb_delimEval */,
NULL /* hb_delimPack */,
NULL /* hb_delimPackRec */,
NULL /* hb_delimSort */,
( DBENTRYP_VT ) hb_delimTrans,
NULL /* hb_delimTransRec */,
NULL /* hb_delimZap */,
NULL /* hb_delimChildEnd */,
NULL /* hb_delimChildStart */,
NULL /* hb_delimChildSync */,
NULL /* hb_delimSyncChildren */,
NULL /* hb_delimClearRel */,
NULL /* hb_delimForceRel */,
NULL /* hb_delimRelArea */,
NULL /* hb_delimRelEval */,
NULL /* hb_delimRelText */,
NULL /* hb_delimSetRel */,
NULL /* hb_delimOrderListAdd */,
NULL /* hb_delimOrderListClear */,
NULL /* hb_delimOrderListDelete */,
NULL /* hb_delimOrderListFocus */,
NULL /* hb_delimOrderListRebuild */,
NULL /* hb_delimOrderCondition */,
NULL /* hb_delimOrderCreate */,
NULL /* hb_delimOrderDestroy */,
NULL /* hb_delimOrderInfo */,
NULL /* hb_delimClearFilter */,
NULL /* hb_delimClearLocate */,
NULL /* hb_delimClearScope */,
NULL /* hb_delimCountScope */,
NULL /* hb_delimFilterText */,
NULL /* hb_delimScopeInfo */,
NULL /* hb_delimSetFilter */,
NULL /* hb_delimSetLocate */,
NULL /* hb_delimSetScope */,
NULL /* hb_delimSkipScope */,
NULL /* hb_delimLocate */,
NULL /* hb_delimCompile */,
NULL /* hb_delimError */,
NULL /* hb_delimEvalBlock */,
NULL /* hb_delimRawLock */,
NULL /* hb_delimLock */,
NULL /* hb_delimUnLock */,
NULL /* hb_delimCloseMemFile */,
NULL /* hb_delimCreateMemFile */,
NULL /* hb_delimGetValueFile */,
NULL /* hb_delimOpenMemFile */,
NULL /* hb_delimPutValueFile */,
NULL /* hb_delimReadDBHeader */,
NULL /* hb_delimWriteDBHeader */,
NULL /* hb_delimInit */,
NULL /* hb_delimExit */,
NULL /* hb_delimDrop */,
NULL /* hb_delimExists */,
( DBENTRYP_RSLV ) hb_delimRddInfo,
NULL /* hb_delimWhoCares */
};
/*
@@ -1523,7 +1523,7 @@ HB_FUNC( DELIM_GETFUNCTABLE )
HB_TRACE(HB_TR_DEBUG, ("DELIM_GETFUNCTABLE(%i, %p)", uiCount, pTable));
if( pTable )
hb_retni( hb_rddInherit( pTable, &delimTable, &delimSuper, 0 ) );
hb_retni( hb_rddInherit( pTable, &delimTable, &delimSuper, NULL ) );
else
hb_retni( FAILURE );
}

View File

@@ -123,6 +123,9 @@
#include "hbsxfunc.h"
#define HB_SX_UNCOMPRESED 0xFFFFFFFFUL
/* number of bits for encoded item (position,length) */
#define ITEMBITS 16
/* unused DUMMY bits - who does know why SIX has it? */
@@ -677,7 +680,6 @@ HB_FUNC( SX_FDECOMPRESS )
HB_FUNC( _SX_STRCOMPRESS )
{
BOOL fOK = FALSE;
BYTE * pStr = ( BYTE * ) hb_parc( 1 ), * pBuf;
if( pStr )
@@ -688,13 +690,16 @@ HB_FUNC( _SX_STRCOMPRESS )
ulBuf = ulLen + 257;
pBuf = ( BYTE * ) hb_xgrab( ulBuf );
HB_PUT_LE_UINT32( pBuf, ulLen );
fOK = hb_LZSSxCompressMem( pStr, ulLen, pBuf + 4, ulBuf - 4, &ulDst );
if( fOK )
hb_retclen( ( char * ) pBuf, ulDst + 4 );
if( ! hb_LZSSxCompressMem( pStr, ulLen, pBuf + 4, ulBuf - 4, &ulDst ) )
{
/* It's not six compatible - it's a workaround for wrongly defined SIX behavior */
HB_PUT_LE_UINT32( pBuf, HB_SX_UNCOMPRESED );
memcpy( pBuf + 4, pStr, ulLen );
}
hb_retclen( ( char * ) pBuf, ulDst + 4 );
hb_xfree( pBuf );
}
if( !fOK )
else
hb_itemReturn( hb_param( 1, HB_IT_ANY ) );
}
@@ -710,20 +715,29 @@ HB_FUNC( _SX_STRDECOMPRESS )
if( ulLen >= 4 )
{
ulBuf = HB_GET_LE_UINT32( pStr );
pBuf = ( BYTE * ) hb_xalloc( ulBuf );
if( pBuf )
if( ulBuf == HB_SX_UNCOMPRESED )
{
fOK = hb_LZSSxDecompressMem( pStr + 4, ulLen - 4, pBuf, ulBuf );
if( fOK )
hb_retclen( ( char * ) pBuf, ulBuf );
hb_xfree( pBuf );
hb_retclen( ( char * ) pStr + 4, ulLen - 4 );
fOK = TRUE;
}
else
{
PHB_ITEM pItem = hb_errRT_SubstParams( "SIXCOMPRESS", EG_MEM, 0, "possible compressed string corruption", "_SX_STRDECOMPRESS" );
hb_itemReturn( pItem );
hb_itemRelease( pItem );
return;
pBuf = ( BYTE * ) hb_xalloc( ulBuf + 1 );
if( pBuf )
{
fOK = hb_LZSSxDecompressMem( pStr + 4, ulLen - 4, pBuf, ulBuf );
if( fOK )
hb_retclen_buffer( ( char * ) pBuf, ulBuf );
else
hb_xfree( pBuf );
}
else
{
PHB_ITEM pItem = hb_errRT_SubstParams( "SIXCOMPRESS", EG_MEM, 0, "possible compressed string corruption", "_SX_STRDECOMPRESS" );
if( pItem )
hb_itemRelease( hb_itemReturn( pItem ) );
return;
}
}
}
}

View File

@@ -54,7 +54,7 @@
#include "hbapi.h"
#include "hbapirdd.h"
HB_EXPORT ERRCODE hb_rddSelectWorkAreaAlias( char * szName )
HB_EXPORT ERRCODE hb_rddSelectWorkAreaAlias( const char * szName )
{
HB_SYMBOL_UNUSED( szName );
@@ -112,7 +112,7 @@ HB_EXPORT ERRCODE hb_rddPutFieldValue( HB_ITEM_PTR pItem, PHB_SYMB pFieldSymbol
return FAILURE;
}
HB_EXPORT ERRCODE hb_rddGetAliasNumber( char * szAlias, int * iArea )
HB_EXPORT ERRCODE hb_rddGetAliasNumber( const char * szAlias, int * iArea )
{
HB_SYMBOL_UNUSED( szAlias );
HB_SYMBOL_UNUSED( iArea );

View File

@@ -65,7 +65,7 @@
#define SUPERTABLE (&sdfSuper)
static RDDFUNCS sdfSuper;
static USHORT s_uiNumLength[ 9 ] = { 0, 4, 6, 8, 11, 13, 16, 18, 20 };
static const USHORT s_uiNumLength[ 9 ] = { 0, 4, 6, 8, 11, 13, 16, 18, 20 };
static void hb_sdfInitArea( SDFAREAP pArea, char * szFileName )
{
@@ -1134,105 +1134,105 @@ static ERRCODE hb_sdfRddInfo( LPRDDNODE pRDD, USHORT uiIndex, ULONG ulConnect, P
}
static RDDFUNCS sdfTable = { NULL /* hb_sdfBof */,
NULL /* hb_sdfEof */,
NULL /* hb_sdfFound */,
NULL /* hb_sdfGoBottom */,
NULL /* hb_sdfGoTo */,
NULL /* hb_sdfGoToId */,
( DBENTRYP_V ) hb_sdfGoTop,
NULL /* hb_sdfSeek */,
NULL /* hb_sdfSkip */,
NULL /* hb_sdfSkipFilter */,
( DBENTRYP_L ) hb_sdfSkipRaw,
( DBENTRYP_VF ) hb_sdfAddField,
( DBENTRYP_B ) hb_sdfAppend,
NULL /* hb_sdfCreateFields */,
( DBENTRYP_V ) hb_sdfDeleteRec,
( DBENTRYP_BP ) hb_sdfDeleted,
NULL /* hb_sdfFieldCount */,
NULL /* hb_sdfFieldDisplay */,
NULL /* hb_sdfFieldInfo */,
NULL /* hb_sdfFieldName */,
( DBENTRYP_V ) hb_sdfFlush,
( DBENTRYP_PP ) hb_sdfGetRec,
( DBENTRYP_SI ) hb_sdfGetValue,
NULL /* hb_sdfGetVarLen */,
( DBENTRYP_V ) hb_sdfGoCold,
( DBENTRYP_V ) hb_sdfGoHot,
( DBENTRYP_P ) hb_sdfPutRec,
( DBENTRYP_SI ) hb_sdfPutValue,
NULL /* hb_sdfRecall */,
( DBENTRYP_ULP ) hb_sdfRecCount,
NULL /* hb_sdfRecInfo */,
( DBENTRYP_ULP ) hb_sdfRecNo,
( DBENTRYP_I ) hb_sdfRecId,
( DBENTRYP_S ) hb_sdfSetFieldExtent,
NULL /* hb_sdfAlias */,
( DBENTRYP_V ) hb_sdfClose,
( DBENTRYP_VP ) hb_sdfCreate,
( DBENTRYP_SI ) hb_sdfInfo,
( DBENTRYP_V ) hb_sdfNewArea,
( DBENTRYP_VP ) hb_sdfOpen,
NULL /* hb_sdfRelease */,
( DBENTRYP_SP ) hb_sdfStructSize,
NULL /* hb_sdfSysName */,
NULL /* hb_sdfEval */,
NULL /* hb_sdfPack */,
NULL /* hb_sdfPackRec */,
NULL /* hb_sdfSort */,
( DBENTRYP_VT ) hb_sdfTrans,
NULL /* hb_sdfTransRec */,
NULL /* hb_sdfZap */,
NULL /* hb_sdfChildEnd */,
NULL /* hb_sdfChildStart */,
NULL /* hb_sdfChildSync */,
NULL /* hb_sdfSyncChildren */,
NULL /* hb_sdfClearRel */,
NULL /* hb_sdfForceRel */,
NULL /* hb_sdfRelArea */,
NULL /* hb_sdfRelEval */,
NULL /* hb_sdfRelText */,
NULL /* hb_sdfSetRel */,
NULL /* hb_sdfOrderListAdd */,
NULL /* hb_sdfOrderListClear */,
NULL /* hb_sdfOrderListDelete */,
NULL /* hb_sdfOrderListFocus */,
NULL /* hb_sdfOrderListRebuild */,
NULL /* hb_sdfOrderCondition */,
NULL /* hb_sdfOrderCreate */,
NULL /* hb_sdfOrderDestroy */,
NULL /* hb_sdfOrderInfo */,
NULL /* hb_sdfClearFilter */,
NULL /* hb_sdfClearLocate */,
NULL /* hb_sdfClearScope */,
NULL /* hb_sdfCountScope */,
NULL /* hb_sdfFilterText */,
NULL /* hb_sdfScopeInfo */,
NULL /* hb_sdfSetFilter */,
NULL /* hb_sdfSetLocate */,
NULL /* hb_sdfSetScope */,
NULL /* hb_sdfSkipScope */,
NULL /* hb_sdfLocate */,
NULL /* hb_sdfCompile */,
NULL /* hb_sdfError */,
NULL /* hb_sdfEvalBlock */,
NULL /* hb_sdfRawLock */,
NULL /* hb_sdfLock */,
NULL /* hb_sdfUnLock */,
NULL /* hb_sdfCloseMemFile */,
NULL /* hb_sdfCreateMemFile */,
NULL /* hb_sdfGetValueFile */,
NULL /* hb_sdfOpenMemFile */,
NULL /* hb_sdfPutValueFile */,
NULL /* hb_sdfReadDBHeader */,
NULL /* hb_sdfWriteDBHeader */,
NULL /* hb_sdfInit */,
NULL /* hb_sdfExit */,
NULL /* hb_sdfDrop */,
NULL /* hb_sdfExists */,
( DBENTRYP_RSLV ) hb_sdfRddInfo,
NULL /* hb_sdfWhoCares */
static const RDDFUNCS sdfTable = { NULL /* hb_sdfBof */,
NULL /* hb_sdfEof */,
NULL /* hb_sdfFound */,
NULL /* hb_sdfGoBottom */,
NULL /* hb_sdfGoTo */,
NULL /* hb_sdfGoToId */,
( DBENTRYP_V ) hb_sdfGoTop,
NULL /* hb_sdfSeek */,
NULL /* hb_sdfSkip */,
NULL /* hb_sdfSkipFilter */,
( DBENTRYP_L ) hb_sdfSkipRaw,
( DBENTRYP_VF ) hb_sdfAddField,
( DBENTRYP_B ) hb_sdfAppend,
NULL /* hb_sdfCreateFields */,
( DBENTRYP_V ) hb_sdfDeleteRec,
( DBENTRYP_BP ) hb_sdfDeleted,
NULL /* hb_sdfFieldCount */,
NULL /* hb_sdfFieldDisplay */,
NULL /* hb_sdfFieldInfo */,
NULL /* hb_sdfFieldName */,
( DBENTRYP_V ) hb_sdfFlush,
( DBENTRYP_PP ) hb_sdfGetRec,
( DBENTRYP_SI ) hb_sdfGetValue,
NULL /* hb_sdfGetVarLen */,
( DBENTRYP_V ) hb_sdfGoCold,
( DBENTRYP_V ) hb_sdfGoHot,
( DBENTRYP_P ) hb_sdfPutRec,
( DBENTRYP_SI ) hb_sdfPutValue,
NULL /* hb_sdfRecall */,
( DBENTRYP_ULP ) hb_sdfRecCount,
NULL /* hb_sdfRecInfo */,
( DBENTRYP_ULP ) hb_sdfRecNo,
( DBENTRYP_I ) hb_sdfRecId,
( DBENTRYP_S ) hb_sdfSetFieldExtent,
NULL /* hb_sdfAlias */,
( DBENTRYP_V ) hb_sdfClose,
( DBENTRYP_VP ) hb_sdfCreate,
( DBENTRYP_SI ) hb_sdfInfo,
( DBENTRYP_V ) hb_sdfNewArea,
( DBENTRYP_VP ) hb_sdfOpen,
NULL /* hb_sdfRelease */,
( DBENTRYP_SP ) hb_sdfStructSize,
NULL /* hb_sdfSysName */,
NULL /* hb_sdfEval */,
NULL /* hb_sdfPack */,
NULL /* hb_sdfPackRec */,
NULL /* hb_sdfSort */,
( DBENTRYP_VT ) hb_sdfTrans,
NULL /* hb_sdfTransRec */,
NULL /* hb_sdfZap */,
NULL /* hb_sdfChildEnd */,
NULL /* hb_sdfChildStart */,
NULL /* hb_sdfChildSync */,
NULL /* hb_sdfSyncChildren */,
NULL /* hb_sdfClearRel */,
NULL /* hb_sdfForceRel */,
NULL /* hb_sdfRelArea */,
NULL /* hb_sdfRelEval */,
NULL /* hb_sdfRelText */,
NULL /* hb_sdfSetRel */,
NULL /* hb_sdfOrderListAdd */,
NULL /* hb_sdfOrderListClear */,
NULL /* hb_sdfOrderListDelete */,
NULL /* hb_sdfOrderListFocus */,
NULL /* hb_sdfOrderListRebuild */,
NULL /* hb_sdfOrderCondition */,
NULL /* hb_sdfOrderCreate */,
NULL /* hb_sdfOrderDestroy */,
NULL /* hb_sdfOrderInfo */,
NULL /* hb_sdfClearFilter */,
NULL /* hb_sdfClearLocate */,
NULL /* hb_sdfClearScope */,
NULL /* hb_sdfCountScope */,
NULL /* hb_sdfFilterText */,
NULL /* hb_sdfScopeInfo */,
NULL /* hb_sdfSetFilter */,
NULL /* hb_sdfSetLocate */,
NULL /* hb_sdfSetScope */,
NULL /* hb_sdfSkipScope */,
NULL /* hb_sdfLocate */,
NULL /* hb_sdfCompile */,
NULL /* hb_sdfError */,
NULL /* hb_sdfEvalBlock */,
NULL /* hb_sdfRawLock */,
NULL /* hb_sdfLock */,
NULL /* hb_sdfUnLock */,
NULL /* hb_sdfCloseMemFile */,
NULL /* hb_sdfCreateMemFile */,
NULL /* hb_sdfGetValueFile */,
NULL /* hb_sdfOpenMemFile */,
NULL /* hb_sdfPutValueFile */,
NULL /* hb_sdfReadDBHeader */,
NULL /* hb_sdfWriteDBHeader */,
NULL /* hb_sdfInit */,
NULL /* hb_sdfExit */,
NULL /* hb_sdfDrop */,
NULL /* hb_sdfExists */,
( DBENTRYP_RSLV ) hb_sdfRddInfo,
NULL /* hb_sdfWhoCares */
};
HB_FUNC( SDF ) { ; }
@@ -1249,7 +1249,7 @@ HB_FUNC( SDF_GETFUNCTABLE )
HB_TRACE(HB_TR_DEBUG, ("SDF_GETFUNCTABLE(%i, %p)", uiCount, pTable));
if( pTable )
hb_retni( hb_rddInherit( pTable, &sdfTable, &sdfSuper, 0 ) );
hb_retni( hb_rddInherit( pTable, &sdfTable, &sdfSuper, NULL ) );
else
hb_retni( FAILURE );
}

421
harbour/source/rdd/wacore.c Normal file
View File

@@ -0,0 +1,421 @@
/*
* $Id$
*/
/*
* Harbour Project source code:
* Default RDD module
*
* Copyright 1999 Bruno Cantero <bruno@issnet.net>
* Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
* www - http://www.harbour-project.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
#include "hbapi.h"
#include "hbapirdd.h"
#include "hbapiitm.h"
#include "hbapierr.h"
#include "hbvm.h"
/* Default RDD name */
static AREAP * s_WaList = NULL; /* Allocated WorkAreas */
static USHORT s_uiWaMax = 0; /* Number of allocated WA */
static USHORT s_uiWaSpace = 0; /* Number of allocated WA */
static USHORT * s_WaNums = NULL; /* Allocated WorkAreas */
static USHORT s_uiWaNumMax = 0; /* Number of allocated WA */
static USHORT s_uiCurrArea = 1; /* Current WokrArea number */
static AREAP s_pCurrArea = NULL; /* Current WorkArea pointer */
static BOOL s_fNetError = FALSE; /* Error on Networked environments */
#define HB_SET_WA( n ) do \
{ \
s_uiCurrArea = n; \
s_pCurrArea = ( ( s_uiCurrArea < s_uiWaNumMax ) ? \
s_WaList[ s_WaNums[ s_uiCurrArea ] ] : \
NULL ); \
} while( 0 )
/*
* Return the next free WorkArea for later use.
*/
HB_EXPORT ERRCODE hb_rddSelectFirstAvailable( void )
{
USHORT uiArea;
HB_TRACE(HB_TR_DEBUG, ("hb_rddSelectFirstAvailable()"));
uiArea = 1;
while( uiArea < s_uiWaNumMax )
{
if( s_WaNums[ uiArea ] == 0 )
break;
uiArea++;
}
if( uiArea >= HARBOUR_MAX_RDD_AREA_NUM )
return FAILURE;
HB_SET_WA( uiArea );
return SUCCESS;
}
/*
* Insert the new WorkArea node
*/
HB_EXPORT USHORT hb_rddInsertAreaNode( const char *szDriver )
{
USHORT uiRddID, uiWaPos;
LPRDDNODE pRddNode;
AREAP pArea;
HB_TRACE(HB_TR_DEBUG, ("hb_rddInsertAreaNode(%s)", szDriver));
if( s_uiCurrArea && s_pCurrArea )
return 0;
pRddNode = hb_rddFindNode( szDriver, &uiRddID );
if( !pRddNode )
return 0;
pArea = ( AREAP ) hb_rddNewAreaNode( pRddNode, uiRddID );
if( !pArea )
return 0;
if( s_uiCurrArea == 0 )
{
if( hb_rddSelectFirstAvailable() != SUCCESS )
return 0;
}
if( s_uiCurrArea >= s_uiWaNumMax )
{
int iSize = ( ( s_uiCurrArea + 256 ) >> 8 ) << 8;
if( s_uiWaNumMax == 0 )
{
s_WaNums = (USHORT *) hb_xgrab( iSize * sizeof(USHORT) );
}
else
{
s_WaNums = (USHORT *) hb_xrealloc( s_WaNums, iSize * sizeof(USHORT) );
}
memset( &s_WaNums[ s_uiWaNumMax ], 0, ( iSize - s_uiWaNumMax ) * sizeof(USHORT) );
s_uiWaNumMax = iSize;
}
if( s_uiWaSpace == 0 )
{
s_uiWaSpace = 256;
s_WaList = (AREAP *) hb_xgrab( s_uiWaSpace * sizeof(AREAP) );
memset( &s_WaList[ 0 ], 0, s_uiWaSpace * sizeof(AREAP) );
s_WaList[ 0 ] = NULL;
uiWaPos = 1;
s_uiWaMax = 2;
}
else
{
uiWaPos = s_uiWaMax++;
if( s_uiWaMax > s_uiWaSpace )
{
s_uiWaSpace = ( ( s_uiWaMax + 256 ) >> 8 ) << 8;
s_WaList = (AREAP *) hb_xrealloc( s_WaList, s_uiWaSpace * sizeof(AREAP) );
memset( &s_WaList[ s_uiWaMax ], 0, ( s_uiWaSpace - s_uiWaMax ) * sizeof(AREAP) );
}
while( uiWaPos > 1 )
{
if( s_WaList[ uiWaPos - 1 ]->uiArea < s_uiCurrArea )
break;
s_WaList[ uiWaPos ] = s_WaList[ uiWaPos - 1 ];
s_WaNums[ s_WaList[ uiWaPos ]->uiArea ] = uiWaPos;
uiWaPos--;
}
}
s_WaList[ uiWaPos ] = pArea;
s_WaNums[ s_uiCurrArea ] = uiWaPos;
s_pCurrArea = s_WaList[ uiWaPos ];
s_pCurrArea->uiArea = s_uiCurrArea;
return s_uiCurrArea;
}
/*
* Closes and releases the current WorkArea preparing it
* to be used with a new database.
*/
HB_EXPORT void hb_rddReleaseCurrentArea( void )
{
USHORT uiWaPos;
AREAP pArea = s_pCurrArea;
HB_TRACE(HB_TR_DEBUG, ("hb_rddReleaseCurrentArea()"));
if( !pArea )
return;
if( SELF_CLOSE( pArea ) == FAILURE )
return;
SELF_RELEASE( pArea );
uiWaPos = s_WaNums[ s_uiCurrArea ];
s_WaNums[ s_uiCurrArea ] = 0;
s_uiWaMax--;
if( s_uiWaMax <= 1 )
{
s_uiWaSpace = s_uiWaMax = s_uiWaNumMax = 0;
hb_xfree( s_WaList );
hb_xfree( s_WaNums );
s_WaList = NULL;
s_WaNums = NULL;
}
else
{
while( uiWaPos < s_uiWaMax )
{
s_WaList[ uiWaPos ] = s_WaList[ uiWaPos + 1 ];
s_WaNums[ s_WaList[ uiWaPos ]->uiArea ] = uiWaPos;
uiWaPos++;
}
s_WaList[ s_uiWaMax ] = NULL;
if( s_uiWaSpace - s_uiWaMax >= 256 )
{
s_uiWaSpace = ( ( s_uiWaMax + 256 ) >> 8 ) << 8;
s_WaList = ( AREAP * ) hb_xrealloc( s_WaList, s_uiWaSpace * sizeof( AREAP ) );
}
}
s_pCurrArea = NULL;
}
/*
* Closes all WorkAreas.
*/
HB_EXPORT void hb_rddCloseAll( void )
{
HB_TRACE(HB_TR_DEBUG, ("hb_rddCloseAll()"));
if( s_uiWaMax > 0 )
{
BOOL isParents, isFinish = FALSE;
AREAP pArea;
USHORT uiIndex;
do
{
isParents = FALSE;
for( uiIndex = 1; uiIndex < s_uiWaMax; uiIndex++ )
{
pArea = s_WaList[ uiIndex ];
HB_SET_WA( pArea->uiArea );
if( isFinish )
{
SELF_RELEASE( pArea );
s_WaNums[ s_uiCurrArea ] = 0;
s_pCurrArea = NULL;
}
else if( pArea->uiParents )
{
isParents = TRUE;
}
else
{
SELF_CLOSE( pArea );
}
}
if( !isParents && !isFinish )
{
isParents = isFinish = TRUE;
}
}
while( isParents );
s_uiWaSpace = s_uiWaMax = s_uiWaNumMax = 0;
hb_xfree( s_WaList );
hb_xfree( s_WaNums );
s_WaList = NULL;
s_WaNums = NULL;
HB_SET_WA( 1 );
}
}
HB_EXPORT void hb_rddFlushAll( void )
{
USHORT uiArea = hb_rddGetCurrentWorkAreaNumber(), uiIndex;
for( uiIndex = 1; uiIndex < s_uiWaMax; ++uiIndex )
{
hb_rddSelectWorkAreaNumber( s_WaList[ uiIndex ]->uiArea );
SELF_FLUSH( s_pCurrArea );
}
hb_rddSelectWorkAreaNumber( uiArea );
}
HB_EXPORT void hb_rddUnLockAll( void )
{
USHORT uiArea = hb_rddGetCurrentWorkAreaNumber(), uiIndex;
for( uiIndex = 1; uiIndex < s_uiWaMax; ++uiIndex )
{
hb_rddSelectWorkAreaNumber( s_WaList[ uiIndex ]->uiArea );
SELF_UNLOCK( s_pCurrArea, NULL );
}
hb_rddSelectWorkAreaNumber( uiArea );
}
/*
* call a pCallBack function with all open workareas ###
*/
HB_EXPORT ERRCODE hb_rddIterateWorkAreas( WACALLBACK pCallBack, void * cargo )
{
ERRCODE errCode = SUCCESS;
USHORT uiIndex;
HB_TRACE(HB_TR_DEBUG, ("hb_rddIterateWorkAreas(%p)", pCallBack));
for( uiIndex = 1; uiIndex < s_uiWaMax; uiIndex++ )
{
errCode = pCallBack( s_WaList[ uiIndex ], cargo );
if( errCode != SUCCESS )
break;
}
return errCode;
}
HB_EXPORT BOOL hb_rddGetNetErr( void )
{
return s_fNetError;
}
HB_EXPORT void hb_rddSetNetErr( BOOL fNetErr )
{
s_fNetError = fNetErr;
}
/*
* Get (/set) default RDD driver
*/
HB_EXPORT const char * hb_rddDefaultDrv( const char * szDriver )
{
static char s_szDefDriver[ HARBOUR_MAX_RDD_DRIVERNAME_LENGTH + 1 ] = "";
static BOOL s_fInit = FALSE;
if( szDriver && *szDriver )
{
char szNewDriver[ HARBOUR_MAX_RDD_DRIVERNAME_LENGTH + 1 ];
hb_strncpyUpper( szNewDriver, szDriver, HARBOUR_MAX_RDD_DRIVERNAME_LENGTH );
if( !hb_rddFindNode( szNewDriver, NULL ) )
return NULL;
hb_strncpy( s_szDefDriver, szNewDriver, HARBOUR_MAX_RDD_DRIVERNAME_LENGTH );
}
else if( !s_fInit && !s_szDefDriver[ 0 ] && hb_rddGetNode( 0 ) )
{
char *szDrvTable[] = { "DBFNTX", "DBFCDX", "DBFFPT", "DBF", NULL };
int i;
for( i = 0; szDrvTable[ i ]; ++i )
{
if( hb_rddFindNode( szDrvTable[ i ], NULL ) )
{
hb_strncpy( s_szDefDriver, szDrvTable[ i ], HARBOUR_MAX_RDD_DRIVERNAME_LENGTH );
break;
}
}
s_fInit = TRUE;
}
return s_szDefDriver;
}
/*
* Function for getting given workarea pointer
*/
HB_EXPORT void * hb_rddGetWorkAreaPointer( int iArea )
{
HB_TRACE(HB_TR_DEBUG, ("hb_rddGetWorkAreaPointer(%d)", iArea));
if( iArea == 0 )
return s_pCurrArea;
else if( iArea >= 1 && ( UINT ) iArea < ( UINT ) s_uiWaNumMax )
return s_WaList[ s_WaNums[ iArea ] ];
else
return NULL;
}
/*
* Function for getting current workarea pointer
*/
HB_EXPORT void * hb_rddGetCurrentWorkAreaPointer( void )
{
HB_TRACE(HB_TR_DEBUG, ("hb_rddGetCurrentWorkAreaPointer()"));
return s_pCurrArea;
}
/*
* Return the current WorkArea number.
*/
HB_EXPORT int hb_rddGetCurrentWorkAreaNumber( void )
{
HB_TRACE(HB_TR_DEBUG, ("hb_rddGetCurrentWorkAreaNumber()"));
return s_uiCurrArea;
}
/*
* Select a WorkArea by the number.
*/
HB_EXPORT ERRCODE hb_rddSelectWorkAreaNumber( int iArea )
{
HB_TRACE(HB_TR_DEBUG, ("hb_rddSelectWorkAreaNumber(%d)", iArea));
if( iArea < 1 || iArea > HARBOUR_MAX_RDD_AREA_NUM )
HB_SET_WA( 0 );
else
HB_SET_WA( iArea );
return ( s_pCurrArea == NULL ) ? FAILURE : SUCCESS;
}

1108
harbour/source/rdd/wafunc.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -7,6 +7,7 @@
* Default RDD module
*
* Copyright 1999 Bruno Cantero <bruno@issnet.net>
* Copyright 2004-2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
* www - http://www.harbour-project.org
*
* This program is free software; you can redistribute it and/or modify
@@ -56,24 +57,23 @@
*/
#include <ctype.h>
#include "hbapi.h"
#include "hbapirdd.h"
#include "hbinit.h"
#include "hbvm.h"
#include "hbapiitm.h"
#include "hbapierr.h"
#include "hbapilng.h"
#include "hbvm.h"
#include "hbset.h"
#include "hbrddwrk.h"
/*
* -- METHODS --
* -- BASIC RDD METHODS --
*/
/*
* Determine logical beginning of file.
*/
ERRCODE hb_waBof( AREAP pArea, BOOL * pBof )
static ERRCODE hb_waBof( AREAP pArea, BOOL * pBof )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waBof(%p, %p)", pArea, pBof));
@@ -84,7 +84,7 @@ ERRCODE hb_waBof( AREAP pArea, BOOL * pBof )
/*
* Determine logical end of file.
*/
ERRCODE hb_waEof( AREAP pArea, BOOL * pEof )
static ERRCODE hb_waEof( AREAP pArea, BOOL * pEof )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waEof(%p, %p)", pArea, pEof));
@@ -95,7 +95,7 @@ ERRCODE hb_waEof( AREAP pArea, BOOL * pEof )
/*
* Determine outcome of the last search operation.
*/
ERRCODE hb_waFound( AREAP pArea, BOOL * pFound )
static ERRCODE hb_waFound( AREAP pArea, BOOL * pFound )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waFound(%p, %p)", pArea, pFound));
@@ -106,7 +106,7 @@ ERRCODE hb_waFound( AREAP pArea, BOOL * pFound )
/*
* Reposition cursor relative to current position.
*/
ERRCODE hb_waSkip( AREAP pArea, LONG lToSkip )
static ERRCODE hb_waSkip( AREAP pArea, LONG lToSkip )
{
LONG lSkip;
@@ -147,7 +147,7 @@ ERRCODE hb_waSkip( AREAP pArea, LONG lToSkip )
/*
* Reposition cursor respecting any filter setting.
*/
ERRCODE hb_waSkipFilter( AREAP pArea, LONG lUpDown )
static ERRCODE hb_waSkipFilter( AREAP pArea, LONG lUpDown )
{
BOOL fBottom, fDeleted;
PHB_ITEM pResult;
@@ -235,7 +235,7 @@ ERRCODE hb_waSkipFilter( AREAP pArea, LONG lUpDown )
/*
* Add a field to the WorkArea.
*/
ERRCODE hb_waAddField( AREAP pArea, LPDBFIELDINFO pFieldInfo )
static ERRCODE hb_waAddField( AREAP pArea, LPDBFIELDINFO pFieldInfo )
{
LPFIELD pField;
char szFieldName[ HB_SYMBOL_NAME_LEN + 1 ], *szPtr;
@@ -268,7 +268,7 @@ ERRCODE hb_waAddField( AREAP pArea, LPDBFIELDINFO pFieldInfo )
/*
* Add all fields defined in an array to the WorkArea.
*/
ERRCODE hb_waCreateFields( AREAP pArea, PHB_ITEM pStruct )
static ERRCODE hb_waCreateFields( AREAP pArea, PHB_ITEM pStruct )
{
USHORT uiItems, uiCount, uiLen, uiDec;
ERRCODE errCode = SUCCESS;
@@ -387,7 +387,7 @@ ERRCODE hb_waCreateFields( AREAP pArea, PHB_ITEM pStruct )
/*
* Determine the number of fields in the WorkArea.
*/
ERRCODE hb_waFieldCount( AREAP pArea, USHORT * uiFields )
static ERRCODE hb_waFieldCount( AREAP pArea, USHORT * uiFields )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waFieldCount(%p, %p)", pArea, uiFields));
@@ -398,7 +398,7 @@ ERRCODE hb_waFieldCount( AREAP pArea, USHORT * uiFields )
/*
* Retrieve information about a field.
*/
ERRCODE hb_waFieldInfo( AREAP pArea, USHORT uiIndex, USHORT uiType, PHB_ITEM pItem )
static ERRCODE hb_waFieldInfo( AREAP pArea, USHORT uiIndex, USHORT uiType, PHB_ITEM pItem )
{
LPFIELD pField;
@@ -473,7 +473,7 @@ ERRCODE hb_waFieldInfo( AREAP pArea, USHORT uiIndex, USHORT uiType, PHB_ITEM pIt
/*
* Determine the name associated with a field number.
*/
ERRCODE hb_waFieldName( AREAP pArea, USHORT uiIndex, void * szName )
static ERRCODE hb_waFieldName( AREAP pArea, USHORT uiIndex, void * szName )
{
LPFIELD pField;
@@ -491,7 +491,7 @@ ERRCODE hb_waFieldName( AREAP pArea, USHORT uiIndex, void * szName )
/*
* Establish the extent of the array of fields for a WorkArea.
*/
ERRCODE hb_waSetFieldExtent( AREAP pArea, USHORT uiFieldExtent )
static ERRCODE hb_waSetFieldExtent( AREAP pArea, USHORT uiFieldExtent )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waSetFieldExtent(%p, %hu)", pArea, uiFieldExtent));
@@ -510,7 +510,7 @@ ERRCODE hb_waSetFieldExtent( AREAP pArea, USHORT uiFieldExtent )
/*
* Obtain the alias of the WorkArea.
*/
ERRCODE hb_waAlias( AREAP pArea, BYTE * szAlias )
static ERRCODE hb_waAlias( AREAP pArea, BYTE * szAlias )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waAlias(%p, %p)", pArea, szAlias));
@@ -525,12 +525,12 @@ ERRCODE hb_waAlias( AREAP pArea, BYTE * szAlias )
/*
* Close the table in the WorkArea - helper function
*/
static short hb_waCloseAux( AREAP pArea, int nChildArea )
static ERRCODE hb_waCloseAux( AREAP pArea, void * pChildArea )
{
USHORT uiPrevArea, uiArea;
LPDBRELINFO lpdbRelation, lpdbRelPrev, lpdbRelTmp;
uiArea = ( USHORT ) nChildArea;
uiArea = ( ( AREAP ) pChildArea )->uiArea;
if( pArea->lpdbRelations )
{
uiPrevArea = hb_rddGetCurrentWorkAreaNumber();
@@ -565,13 +565,13 @@ static short hb_waCloseAux( AREAP pArea, int nChildArea )
}
}
}
return 1;
return SUCCESS;
}
/*
* Close the table in the WorkArea.
*/
ERRCODE hb_waClose( AREAP pArea )
static ERRCODE hb_waClose( AREAP pArea )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waClose(%p)", pArea));
@@ -583,7 +583,7 @@ ERRCODE hb_waClose( AREAP pArea )
if( pArea->uiParents > 0 )
{
/* Clear relations that has this area as a child */
hb_rddIterateWorkAreas ( hb_waCloseAux, pArea->uiArea );
hb_rddIterateWorkAreas( hb_waCloseAux, pArea );
}
if( pArea->atomAlias )
@@ -595,7 +595,7 @@ ERRCODE hb_waClose( AREAP pArea )
/*
* Retrieve information about the current driver.
*/
ERRCODE hb_waInfo( AREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
static ERRCODE hb_waInfo( AREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waInfo(%p, %hu, %p)", pArea, uiIndex, pItem));
@@ -725,8 +725,7 @@ ERRCODE hb_waInfo( AREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
* Retrieve information about the current order that SELF could not.
* Called by SELF_ORDINFO if uiIndex is not supported.
*/
#ifdef HB_COMPAT_C53
ERRCODE hb_waOrderInfo( AREAP pArea, USHORT index, LPDBORDERINFO param )
static ERRCODE hb_waOrderInfo( AREAP pArea, USHORT index, LPDBORDERINFO param )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waOrderInfo(%p, %hu, %p)", pArea, index, param));
@@ -737,12 +736,11 @@ ERRCODE hb_waOrderInfo( AREAP pArea, USHORT index, LPDBORDERINFO param )
hb_errRT_DBCMD( EG_ARG, EDBCMD_BADPARAMETER, NULL, "DBORDERINFO" );
return FAILURE;
}
#endif
/*
* Clear the WorkArea for use.
*/
ERRCODE hb_waNewArea( AREAP pArea )
static ERRCODE hb_waNewArea( AREAP pArea )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waNewArea(%p)", pArea));
@@ -758,7 +756,7 @@ ERRCODE hb_waNewArea( AREAP pArea )
* Open a data store in the WorkArea.
* Like in Clipper it's also mapped as Create() method at WA level
*/
ERRCODE hb_waOpen( AREAP pArea, LPDBOPENINFO pInfo )
static ERRCODE hb_waOpen( AREAP pArea, LPDBOPENINFO pInfo )
{
if( !pArea->atomAlias && pInfo->atomAlias && pInfo->atomAlias[ 0 ] )
{
@@ -773,7 +771,7 @@ ERRCODE hb_waOpen( AREAP pArea, LPDBOPENINFO pInfo )
return SUCCESS;
}
ERRCODE hb_waOrderCondition( AREAP pArea, LPDBORDERCONDINFO param )
static ERRCODE hb_waOrderCondition( AREAP pArea, LPDBORDERCONDINFO param )
{
if( pArea->lpdbOrdCondInfo )
{
@@ -811,7 +809,7 @@ ERRCODE hb_waOrderCondition( AREAP pArea, LPDBORDERCONDINFO param )
/*
* Release all references to a WorkArea.
*/
ERRCODE hb_waRelease( AREAP pArea )
static ERRCODE hb_waRelease( AREAP pArea )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waRelease(%p)", pArea));
@@ -830,7 +828,7 @@ ERRCODE hb_waRelease( AREAP pArea )
/*
* Retrieve the size of the WorkArea structure.
*/
ERRCODE hb_waStructSize( AREAP pArea, USHORT * uiSize )
static ERRCODE hb_waStructSize( AREAP pArea, USHORT * uiSize )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waStrucSize(%p, %p)", pArea, uiSize));
HB_SYMBOL_UNUSED( pArea );
@@ -842,7 +840,7 @@ ERRCODE hb_waStructSize( AREAP pArea, USHORT * uiSize )
/*
* Obtain the name of replaceable database driver (RDD) subsystem.
*/
ERRCODE hb_waSysName( AREAP pArea, BYTE * pBuffer )
static ERRCODE hb_waSysName( AREAP pArea, BYTE * pBuffer )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waSysName(%p, %p)", pArea, pBuffer));
@@ -855,7 +853,7 @@ ERRCODE hb_waSysName( AREAP pArea, BYTE * pBuffer )
/*
* Evaluate code block for each record in WorkArea.
*/
ERRCODE hb_waEval( AREAP pArea, LPDBEVALINFO pEvalInfo )
static ERRCODE hb_waEval( AREAP pArea, LPDBEVALINFO pEvalInfo )
{
LONG lNext = 1;
BOOL fEof;
@@ -912,7 +910,7 @@ ERRCODE hb_waEval( AREAP pArea, LPDBEVALINFO pEvalInfo )
/*
* Locate a record which pass given condition
*/
ERRCODE hb_waLocate( AREAP pArea, BOOL fContinue )
static ERRCODE hb_waLocate( AREAP pArea, BOOL fContinue )
{
LONG lNext = 1;
BOOL fEof;
@@ -983,7 +981,7 @@ ERRCODE hb_waLocate( AREAP pArea, BOOL fContinue )
/*
* Copy one or more records from one WorkArea to another.
*/
ERRCODE hb_waTrans( AREAP pArea, LPDBTRANSINFO pTransInfo )
static ERRCODE hb_waTrans( AREAP pArea, LPDBTRANSINFO pTransInfo )
{
LONG lNext = 1;
BOOL fEof;
@@ -1043,7 +1041,7 @@ ERRCODE hb_waTrans( AREAP pArea, LPDBTRANSINFO pTransInfo )
/*
* Copy a record to another WorkArea.
*/
ERRCODE hb_waTransRec( AREAP pArea, LPDBTRANSINFO pTransInfo )
static ERRCODE hb_waTransRec( AREAP pArea, LPDBTRANSINFO pTransInfo )
{
BOOL bDeleted;
BYTE *pRecord;
@@ -1115,7 +1113,7 @@ ERRCODE hb_waTransRec( AREAP pArea, LPDBTRANSINFO pTransInfo )
/*
* Report end of relation.
*/
ERRCODE hb_waChildEnd( AREAP pArea, LPDBRELINFO pRelInfo )
static ERRCODE hb_waChildEnd( AREAP pArea, LPDBRELINFO pRelInfo )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waChildEnd(%p, %p)", pArea, pRelInfo));
@@ -1138,7 +1136,7 @@ ERRCODE hb_waChildEnd( AREAP pArea, LPDBRELINFO pRelInfo )
/*
* Report initialization of a relation.
*/
ERRCODE hb_waChildStart( AREAP pArea, LPDBRELINFO pRelInfo )
static ERRCODE hb_waChildStart( AREAP pArea, LPDBRELINFO pRelInfo )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waChildStart(%p, %p)", pArea, pRelInfo));
HB_SYMBOL_UNUSED( pRelInfo );
@@ -1150,7 +1148,7 @@ ERRCODE hb_waChildStart( AREAP pArea, LPDBRELINFO pRelInfo )
/*
* Force relational movement in child WorkAreas.
*/
ERRCODE hb_waSyncChildren( AREAP pArea )
static ERRCODE hb_waSyncChildren( AREAP pArea )
{
LPDBRELINFO lpdbRelation;
@@ -1170,7 +1168,7 @@ ERRCODE hb_waSyncChildren( AREAP pArea )
/*
* Clear all relations in the specified WorkArea.
*/
ERRCODE hb_waClearRel( AREAP pArea )
static ERRCODE hb_waClearRel( AREAP pArea )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waClearRel(%p)", pArea ));
@@ -1208,7 +1206,7 @@ ERRCODE hb_waClearRel( AREAP pArea )
/*
* Obtain the workarea number of the specified relation.
*/
ERRCODE hb_waRelArea( AREAP pArea, USHORT uiRelNo, void * pRelArea )
static ERRCODE hb_waRelArea( AREAP pArea, USHORT uiRelNo, void * pRelArea )
{
LPDBRELINFO lpdbRelations;
USHORT uiIndex = 1;
@@ -1234,7 +1232,7 @@ ERRCODE hb_waRelArea( AREAP pArea, USHORT uiRelNo, void * pRelArea )
/*
* Evaluate a block against the relation in specified WorkArea.
*/
ERRCODE hb_waRelEval( AREAP pArea, LPDBRELINFO pRelInfo )
static ERRCODE hb_waRelEval( AREAP pArea, LPDBRELINFO pRelInfo )
{
PHB_ITEM pResult;
DBORDERINFO pInfo;
@@ -1297,7 +1295,7 @@ ERRCODE hb_waRelEval( AREAP pArea, LPDBRELINFO pRelInfo )
/*
* Obtain the character expression of the specified relation.
*/
ERRCODE hb_waRelText( AREAP pArea, USHORT uiRelNo, void * pExpr )
static ERRCODE hb_waRelText( AREAP pArea, USHORT uiRelNo, void * pExpr )
{
LPDBRELINFO lpdbRelations;
USHORT uiIndex = 1;
@@ -1323,7 +1321,7 @@ ERRCODE hb_waRelText( AREAP pArea, USHORT uiRelNo, void * pExpr )
/*
* Set a relation in the parent file.
*/
ERRCODE hb_waSetRel( AREAP pArea, LPDBRELINFO lpdbRelInf )
static ERRCODE hb_waSetRel( AREAP pArea, LPDBRELINFO lpdbRelInf )
{
LPDBRELINFO lpdbRelations;
@@ -1356,7 +1354,7 @@ ERRCODE hb_waSetRel( AREAP pArea, LPDBRELINFO lpdbRelInf )
/*
* Clear the active filter expression.
*/
ERRCODE hb_waClearFilter( AREAP pArea )
static ERRCODE hb_waClearFilter( AREAP pArea )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waClearFilter(%p)", pArea));
@@ -1380,7 +1378,7 @@ ERRCODE hb_waClearFilter( AREAP pArea )
/*
* Clear the active locate expression.
*/
ERRCODE hb_waClearLocate( AREAP pArea )
static ERRCODE hb_waClearLocate( AREAP pArea )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waClearLocate(%p)", pArea));
@@ -1427,7 +1425,7 @@ ERRCODE hb_waClearLocate( AREAP pArea )
/*
* Return filter condition of the specified WorkArea.
*/
ERRCODE hb_waFilterText( AREAP pArea, PHB_ITEM pFilter )
static ERRCODE hb_waFilterText( AREAP pArea, PHB_ITEM pFilter )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waFilterText(%p, %p)", pArea, pFilter));
@@ -1440,7 +1438,7 @@ ERRCODE hb_waFilterText( AREAP pArea, PHB_ITEM pFilter )
/*
* Set the filter condition for the specified WorkArea.
*/
ERRCODE hb_waSetFilter( AREAP pArea, LPDBFILTERINFO pFilterInfo )
static ERRCODE hb_waSetFilter( AREAP pArea, LPDBFILTERINFO pFilterInfo )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waSetFilter(%p, %p)", pArea, pFilterInfo));
@@ -1465,7 +1463,7 @@ ERRCODE hb_waSetFilter( AREAP pArea, LPDBFILTERINFO pFilterInfo )
/*
* Set the locate scope for the specified WorkArea.
*/
ERRCODE hb_waSetLocate( AREAP pArea, LPDBSCOPEINFO pScopeInfo )
static ERRCODE hb_waSetLocate( AREAP pArea, LPDBSCOPEINFO pScopeInfo )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waSetLocate(%p, %p)", pArea, pScopeInfo));
@@ -1507,7 +1505,7 @@ ERRCODE hb_waSetLocate( AREAP pArea, LPDBSCOPEINFO pScopeInfo )
/*
* Compile a character expression.
*/
ERRCODE hb_waCompile( AREAP pArea, BYTE * pExpr )
static ERRCODE hb_waCompile( AREAP pArea, BYTE * pExpr )
{
HB_MACRO_PTR pMacro;
@@ -1526,7 +1524,7 @@ ERRCODE hb_waCompile( AREAP pArea, BYTE * pExpr )
/*
* Raise a runtime error.
*/
ERRCODE hb_waError( AREAP pArea, PHB_ITEM pError )
static ERRCODE hb_waError( AREAP pArea, PHB_ITEM pError )
{
char * szRddName;
@@ -1546,7 +1544,7 @@ ERRCODE hb_waError( AREAP pArea, PHB_ITEM pError )
/*
* Evaluate a code block.
*/
ERRCODE hb_waEvalBlock( AREAP pArea, PHB_ITEM pBlock )
static ERRCODE hb_waEvalBlock( AREAP pArea, PHB_ITEM pBlock )
{
PHB_ITEM pItem;
int iCurrArea;
@@ -1573,7 +1571,7 @@ ERRCODE hb_waEvalBlock( AREAP pArea, PHB_ITEM pBlock )
/*
* RDD info
*/
ERRCODE hb_rddInfo( LPRDDNODE pRDD, USHORT uiIndex, ULONG ulConnection, PHB_ITEM pItem )
static ERRCODE hb_waRddInfo( LPRDDNODE pRDD, USHORT uiIndex, ULONG ulConnection, PHB_ITEM pItem )
{
BOOL fResult;
int iResult;
@@ -1691,3 +1689,396 @@ ERRCODE hb_rddInfo( LPRDDNODE pRDD, USHORT uiIndex, ULONG ulConnection, PHB_ITEM
}
return SUCCESS;
}
/*
* Raise a runtime error if an method is not defined.
*/
static ERRCODE hb_waUnsupported( AREAP pArea )
{
PHB_ITEM pError;
HB_TRACE(HB_TR_DEBUG, ("hb_waUnsupported(%p)", pArea));
pError = hb_errNew();
hb_errPutGenCode( pError, EG_UNSUPPORTED );
hb_errPutDescription( pError, hb_langDGetErrorDesc( EG_UNSUPPORTED ) );
SELF_ERROR( pArea, pError );
hb_itemRelease( pError );
return FAILURE;
}
/*
* Raise a runtime error if an method is not defined.
*/
static ERRCODE hb_waRddUnsupported( LPRDDNODE pRDD )
{
PHB_ITEM pError;
HB_TRACE(HB_TR_DEBUG, ("hb_waRDDUnsupported(%p)", pRDD));
pError = hb_errNew();
hb_errPutGenCode( pError, EG_UNSUPPORTED );
hb_errPutDescription( pError, hb_langDGetErrorDesc( EG_UNSUPPORTED ) );
hb_errPutSeverity( pError, ES_ERROR );
hb_errPutSubSystem( pError, pRDD->szName );
hb_errLaunch( pError );
hb_itemRelease( pError );
return FAILURE;
}
#if 0
/*
* Empty method.
*/
static ERRCODE hb_waNull( AREAP pArea )
{
HB_TRACE(HB_TR_DEBUG, ("hb_waNull(%p)", pArea));
HB_SYMBOL_UNUSED( pArea );
return SUCCESS;
}
#endif
/*
* The default virtual method table for all WorkAreas.
*/
static const RDDFUNCS waTable =
{
/* Movement and positioning methods */
/* ( DBENTRYP_BP ) */ hb_waBof, /* Bof */
/* ( DBENTRYP_BP ) */ hb_waEof, /* Eof */
/* ( DBENTRYP_BP ) */ hb_waFound, /* Found */
( DBENTRYP_V ) hb_waUnsupported, /* GoBottom */
( DBENTRYP_UL ) hb_waUnsupported, /* GoTo */
( DBENTRYP_I ) hb_waUnsupported, /* GoToId */
( DBENTRYP_V ) hb_waUnsupported, /* GoTop */
( DBENTRYP_BIB ) hb_waUnsupported, /* Seek */
/* ( DBENTRYP_L ) */ hb_waSkip, /* Skip */
/* ( DBENTRYP_L ) */ hb_waSkipFilter, /* SkipFilter */
( DBENTRYP_L ) hb_waUnsupported, /* SkipRaw */
/* Data management */
/* ( DBENTRYP_VF ) */ hb_waAddField, /* AddField */
( DBENTRYP_B ) hb_waUnsupported, /* Append */
/* ( DBENTRYP_I ) */ hb_waCreateFields, /* CreateFields */
( DBENTRYP_V ) hb_waUnsupported, /* DeleteRec */
( DBENTRYP_BP ) hb_waUnsupported, /* Deleted */
/* ( DBENTRYP_SP ) */ hb_waFieldCount, /* FieldCount */
( DBENTRYP_VF ) hb_waUnsupported, /* FieldDisplay */
/* ( DBENTRYP_SSI ) */ hb_waFieldInfo, /* FieldInfo */
/* ( DBENTRYP_SVP ) */ hb_waFieldName, /* FieldName */
( DBENTRYP_V ) hb_waUnsupported, /* Flush */
( DBENTRYP_PP ) hb_waUnsupported, /* GetRec */
( DBENTRYP_SI ) hb_waUnsupported, /* GetValue */
( DBENTRYP_SVL ) hb_waUnsupported, /* GetVarLen */
( DBENTRYP_V ) hb_waUnsupported, /* GoCold */
( DBENTRYP_V ) hb_waUnsupported, /* GoHot */
( DBENTRYP_P ) hb_waUnsupported, /* PutRec */
( DBENTRYP_SI ) hb_waUnsupported, /* PutValue */
( DBENTRYP_V ) hb_waUnsupported, /* Recall */
( DBENTRYP_ULP ) hb_waUnsupported, /* RecCount */
( DBENTRYP_ISI ) hb_waUnsupported, /* RecInfo */
( DBENTRYP_ULP ) hb_waUnsupported, /* RecNo */
( DBENTRYP_I ) hb_waUnsupported, /* RecId */
/* ( DBENTRYP_S ) */ hb_waSetFieldExtent, /* SetFieldExtent */
/* WorkArea/Database management */
/* ( DBENTRYP_P ) */ hb_waAlias, /* Alias */
/* ( DBENTRYP_V ) */ hb_waClose, /* Close */
/* Like in Clipper map CREATE() method at work area level to OPEN() */
/* ( DBENTRYP_VP ) */ hb_waOpen, /* Create */
/* ( DBENTRYP_SI ) */ hb_waInfo, /* Info */
/* ( DBENTRYP_V ) */ hb_waNewArea, /* NewArea */
/* ( DBENTRYP_VP ) */ hb_waOpen, /* Open */
/* ( DBENTRYP_V ) */ hb_waRelease, /* Release */
/* ( DBENTRYP_SP ) */ hb_waStructSize, /* StructSize */
/* ( DBENTRYP_P ) */ hb_waSysName, /* SysName */
/* ( DBENTRYP_VEI ) */ hb_waEval, /* Eval */
( DBENTRYP_V ) hb_waUnsupported, /* Pack */
( DBENTRYP_LSP ) hb_waUnsupported, /* PackRec */
( DBENTRYP_VS ) hb_waUnsupported, /* Sort */
/* ( DBENTRYP_VT ) */ hb_waTrans, /* Trans */
/* ( DBENTRYP_VT ) */ hb_waTransRec, /* TransRec */
( DBENTRYP_V ) hb_waUnsupported, /* Zap */
/* Relational Methods */
/* ( DBENTRYP_VR ) */ hb_waChildEnd, /* ChildEnd */
/* ( DBENTRYP_VR ) */ hb_waChildStart, /* ChildStart */
( DBENTRYP_VR ) hb_waUnsupported, /* ChildSync */
/* ( DBENTRYP_V ) */ hb_waSyncChildren, /* SyncChildren */
/* ( DBENTRYP_V ) */ hb_waClearRel, /* ClearRel */
( DBENTRYP_V ) hb_waUnsupported, /* ForceRel */
/* ( DBENTRYP_SVP ) */ hb_waRelArea, /* RelArea */
/* ( DBENTRYP_VR ) */ hb_waRelEval, /* RelEval */
/* ( DBENTRYP_SVP ) */ hb_waRelText, /* RelText */
/* ( DBENTRYP_VR ) */ hb_waSetRel, /* SetRel */
/* Order Management */
( DBENTRYP_OI ) hb_waUnsupported, /* OrderListAdd */
( DBENTRYP_V ) hb_waUnsupported, /* OrderListClear */
( DBENTRYP_OI ) hb_waUnsupported, /* OrderListDelete */
( DBENTRYP_OI ) hb_waUnsupported, /* OrderListFocus */
( DBENTRYP_V ) hb_waUnsupported, /* OrderListRebuild */
/* ( DBENTRYP_VOI ) */ hb_waOrderCondition, /* OrderCondition */
( DBENTRYP_VOC ) hb_waUnsupported, /* OrderCreate */
( DBENTRYP_OI ) hb_waUnsupported, /* OrderDestroy */
/* ( DBENTRYP_OII ) */ hb_waOrderInfo, /* OrderInfo */
/* Filters and Scope Settings */
/* ( DBENTRYP_V ) */ hb_waClearFilter, /* ClearFilter */
/* ( DBENTRYP_V ) */ hb_waClearLocate, /* ClearLocate */
( DBENTRYP_V ) hb_waUnsupported, /* ClearScope */
( DBENTRYP_VPLP ) hb_waUnsupported, /* CountScope */
/* ( DBENTRYP_I ) */ hb_waFilterText, /* FilterText */
( DBENTRYP_SI ) hb_waUnsupported, /* ScopeInfo */
/* ( DBENTRYP_VFI ) */ hb_waSetFilter, /* SetFilter */
/* ( DBENTRYP_VLO ) */ hb_waSetLocate, /* SetLocate */
( DBENTRYP_VOS ) hb_waUnsupported, /* SetScope */
( DBENTRYP_VPL ) hb_waUnsupported, /* SkipScope */
/* ( DBENTRYP_B ) */ hb_waLocate, /* Locate */
/* Miscellaneous */
/* ( DBENTRYP_P ) */ hb_waCompile, /* Compile */
/* ( DBENTRYP_I ) */ hb_waError, /* Error */
/* ( DBENTRYP_I ) */ hb_waEvalBlock, /* EvalBlock */
/* Network operations */
( DBENTRYP_VSP ) hb_waUnsupported, /* RawLock */
( DBENTRYP_VL ) hb_waUnsupported, /* Lock */
( DBENTRYP_I ) hb_waUnsupported, /* UnLock */
/* Memofile functions */
( DBENTRYP_V ) hb_waUnsupported, /* CloseMemFile */
( DBENTRYP_VP ) hb_waUnsupported, /* CreateMemFile */
( DBENTRYP_SVPB ) hb_waUnsupported, /* GetValueFile */
( DBENTRYP_VP ) hb_waUnsupported, /* OpenMemFile */
( DBENTRYP_SVPB ) hb_waUnsupported, /* PutValueFile */
/* Database file header handling */
( DBENTRYP_V ) hb_waUnsupported, /* ReadDBHeader */
( DBENTRYP_V ) hb_waUnsupported, /* WriteDBHeader */
/* non WorkArea functions */
( DBENTRYP_R ) NULL, /* Init */
( DBENTRYP_R ) NULL, /* Exit */
( DBENTRYP_RVV ) hb_waRddUnsupported, /* Drop */
( DBENTRYP_RVV ) hb_waRddUnsupported, /* Exists */
/* ( DBENTRYP_RSLV ) */ hb_waRddInfo, /* RddInfo */
/* Special and reserved methods */
( DBENTRYP_SVP ) hb_waUnsupported /* WhoCares */
};
/* common for all threads list of registered RDDs */
static LPRDDNODE * s_RddList = NULL; /* Registered RDDs */
static USHORT s_uiRddMax = 0; /* Number of registered RDD */
/*
* Get RDD node poionter
*/
HB_EXPORT LPRDDNODE hb_rddGetNode( USHORT uiNode )
{
HB_TRACE(HB_TR_DEBUG, ("hb_rddGetNode(%hu)", uiNode));
return uiNode < s_uiRddMax ? s_RddList[ uiNode ] : NULL;
}
HB_EXPORT PHB_ITEM hb_rddList( USHORT uiType )
{
USHORT uiCount, uiIndex, uiRdds;
PHB_ITEM pRddArray;
LPRDDNODE pNode;
HB_TRACE(HB_TR_DEBUG, ("hb_rddList(%hu)", uiType));
for( uiCount = uiRdds = 0; uiCount < s_uiRddMax; ++uiCount )
{
if( uiType == 0 || s_RddList[ uiCount ]->uiType == uiType )
++uiRdds;
}
pRddArray = hb_itemArrayNew( uiRdds );
for( uiCount = uiIndex = 0; uiCount < s_uiRddMax && uiIndex < uiRdds; ++uiCount )
{
pNode = s_RddList[ uiCount ];
if( uiType == 0 || pNode->uiType == uiType )
hb_itemPutC( hb_arrayGetItemPtr( pRddArray, ++uiIndex ), pNode->szName );
}
return pRddArray;
}
/*
* Find a RDD node.
*/
HB_EXPORT LPRDDNODE hb_rddFindNode( const char * szDriver, USHORT * uiIndex )
{
USHORT uiCount;
HB_TRACE(HB_TR_DEBUG, ("hb_rddFindNode(%s, %p)", szDriver, uiIndex));
for( uiCount = 0; uiCount < s_uiRddMax; uiCount++ )
{
LPRDDNODE pNode = s_RddList[ uiCount ];
if( strcmp( pNode->szName, szDriver ) == 0 ) /* Matched RDD */
{
if( uiIndex )
* uiIndex = uiCount;
return pNode;
}
}
if( uiIndex )
* uiIndex = 0;
return NULL;
}
/*
* Shutdown the RDD system.
*/
HB_EXPORT void hb_rddShutDown( void )
{
USHORT uiCount;
HB_TRACE(HB_TR_DEBUG, ("hb_rddShutDown()"));
if( s_uiRddMax > 0 )
{
hb_rddCloseAll();
for( uiCount = 0; uiCount < s_uiRddMax; uiCount++ )
{
if( s_RddList[ uiCount ]->pTable.exit != NULL )
{
SELF_EXIT( s_RddList[ uiCount ] );
}
hb_xfree( s_RddList[ uiCount ] );
}
hb_xfree( s_RddList );
s_RddList = NULL;
s_uiRddMax = 0;
}
}
/*
* Register a RDD driver.
*/
HB_EXPORT int hb_rddRegister( const char * szDriver, USHORT uiType )
{
LPRDDNODE pRddNewNode;
PHB_DYNS pGetFuncTable;
char szGetFuncTable[ HARBOUR_MAX_RDD_DRIVERNAME_LENGTH + 14 ];
USHORT uiFunctions;
HB_TRACE(HB_TR_DEBUG, ("hb_rddRegister(%s, %hu)", szDriver, uiType));
if( hb_rddFindNode( szDriver, NULL ) ) /* Duplicated RDD */
{
return 1;
}
snprintf( szGetFuncTable, sizeof( szGetFuncTable ), "%s_GETFUNCTABLE",
szDriver );
pGetFuncTable = hb_dynsymFindName( szGetFuncTable );
if( !pGetFuncTable )
{
return 2; /* Not valid RDD */
}
/* Create a new RDD node */
pRddNewNode = ( LPRDDNODE ) hb_xgrab( sizeof( RDDNODE ) );
memset( pRddNewNode, 0, sizeof( RDDNODE ) );
/* Fill the new RDD node */
hb_strncpy( pRddNewNode->szName, szDriver, HARBOUR_MAX_RDD_DRIVERNAME_LENGTH );
pRddNewNode->uiType = uiType;
pRddNewNode->rddID = s_uiRddMax;
/* Call <szDriver>_GETFUNCTABLE() */
hb_vmPushSymbol( hb_dynsymSymbol( pGetFuncTable ) );
hb_vmPushNil();
hb_vmPushPointer( ( void * ) &uiFunctions );
hb_vmPushPointer( ( void * ) &pRddNewNode->pTable );
hb_vmPushPointer( ( void * ) &pRddNewNode->pSuperTable );
hb_vmPushInteger( s_uiRddMax );
hb_vmDo( 4 );
if( hb_parni( -1 ) != SUCCESS )
{
hb_xfree( pRddNewNode ); /* Delete de new RDD node */
return 3; /* Invalid FUNCTABLE */
}
if( s_uiRddMax == 0 ) /* First RDD node */
s_RddList = (LPRDDNODE *) hb_xgrab( sizeof(LPRDDNODE) );
else
s_RddList = (LPRDDNODE *) hb_xrealloc( s_RddList, sizeof(LPRDDNODE) * ( s_uiRddMax + 1 ) );
s_RddList[ s_uiRddMax++ ] = pRddNewNode; /* Add the new RDD node */
if( pRddNewNode->pTable.init != NULL )
{
SELF_INIT( pRddNewNode );
}
return 0; /* Ok */
}
/*
* pTable - a table in new RDDNODE that will be filled
* pSubTable - a table with a list of supported functions
* pSuperTable - a current table in a RDDNODE
* szDrvName - a driver name that will be inherited
*/
HB_EXPORT ERRCODE hb_rddInherit( RDDFUNCS * pTable, const RDDFUNCS * pSubTable, RDDFUNCS * pSuperTable, const char * szDrvName )
{
LPRDDNODE pRddNode;
USHORT uiCount;
DBENTRYP_V * pFunction, * pSubFunction;
HB_TRACE(HB_TR_DEBUG, ("hb_rddInherit(%p, %p, %p, %s)", pTable, pSubTable, pSuperTable, szDrvName));
if( !pTable )
{
return FAILURE;
}
/* Copy the pSuperTable into pTable */
if( !szDrvName || ! *szDrvName )
{
/* no name for inherited driver - use the default one */
memcpy( pTable, &waTable, sizeof( RDDFUNCS ) );
memcpy( pSuperTable, &waTable, sizeof( RDDFUNCS ) );
}
else
{
char szSuperName[ HARBOUR_MAX_RDD_DRIVERNAME_LENGTH + 1 ];
hb_strncpyUpper( szSuperName, szDrvName, HARBOUR_MAX_RDD_DRIVERNAME_LENGTH );
pRddNode = hb_rddFindNode( szSuperName, NULL );
if( !pRddNode )
{
return FAILURE;
}
memcpy( pTable, &pRddNode->pTable, sizeof( RDDFUNCS ) );
memcpy( pSuperTable, &pRddNode->pTable, sizeof( RDDFUNCS ) );
}
/* Copy the non NULL entries from pSubTable into pTable */
pFunction = ( DBENTRYP_V * ) pTable;
pSubFunction = ( DBENTRYP_V * ) pSubTable;
for( uiCount = 0; uiCount < RDDFUNCSCOUNT; uiCount++ )
{
if( * pSubFunction )
* pFunction = * pSubFunction;
pFunction ++;
pSubFunction ++;
}
return SUCCESS;
}
HB_FUNC_EXTERN( RDDSYS );
void _hb_rddWorkAreaForceLink( void )
{
HB_FUNC_EXEC( RDDSYS );
}

View File

@@ -69,10 +69,18 @@ STATIC FUNCTION DefError( oError )
LOCAL n
// By default, division by zero results in zero
IF oError:genCode == EG_ZERODIV
IF oError:genCode == EG_ZERODIV .AND. ;
oError:canSubstitute
RETURN 0
ENDIF
// By default, retry on RDD lock error failure */
IF oError:genCode == EG_LOCK .AND. ;
oError:canRetry
// oError:tries++
RETURN .T.
ENDIF
// Set NetErr() of there was a database open error
IF oError:genCode == EG_OPEN .AND. ;
oError:osCode == 32 .AND. ;
@@ -113,7 +121,7 @@ STATIC FUNCTION DefError( oError )
nChoice := 0
WHILE nChoice == 0
IF Empty( oError:osCode )
IF ISNIL( cDOSError )
nChoice := Alert( cMessage, aOptions )
ELSE
nChoice := Alert( cMessage + ";" + cDOSError, aOptions )
@@ -134,7 +142,7 @@ STATIC FUNCTION DefError( oError )
// "Quit" selected
IF ! Empty( oError:osCode )
IF ! ISNIL( cDOSError )
cMessage += " " + cDOSError
ENDIF

View File

@@ -323,7 +323,7 @@ int hb_gt_crs_chrmapinit( int *piTransTbl, char *pszTerm )
if ( pszTerm != NULL && *pszTerm != '\0' )
{
pszFile = getenv("HB_CHRMAP");
pszFile = getenv("HB_CHARMAP");
if ( pszFile != NULL && *pszFile != '\0' )
nRet = hb_gt_crs_chrmapread( pszFile, pszTerm, piTransTbl );
if ( nRet == -1 )