2009-02-03 16:16 UTC+0100 Viktor Szakats (harbour.01 syenar hu)

* include/hbrddcdx.h
  * contrib/rddsql/sddmy/mysqldd.c
  * contrib/rddsql/sddpg/pgsqldd.c
  * contrib/rddsql/sddfb/fbirddd.c
  * contrib/rddsql/hbrddsql.h
  * contrib/rddsql/sqlbase.c
  * contrib/rddsql/sqlmix.c
  * contrib/rddado/adordd.prg
  * contrib/rddads/rddads.h
  * contrib/rddads/adsfunc.c
  * contrib/rddads/ads1.c
  * contrib/hbbmcdx/bmdbfcdx.c
  * contrib/hbbmcdx/hbbmcdx.h
    * SUCCESS -> HB_SUCCESS
    * FAILURE -> HB_FAILURE
    * ERRCODE -> HB_ERRCODE
This commit is contained in:
Viktor Szakats
2009-02-03 15:17:20 +00:00
parent 185f03cbfd
commit 1ace83c129
14 changed files with 1148 additions and 1131 deletions

View File

@@ -8,6 +8,24 @@
2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
*/
2009-02-03 16:16 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* include/hbrddcdx.h
* contrib/rddsql/sddmy/mysqldd.c
* contrib/rddsql/sddpg/pgsqldd.c
* contrib/rddsql/sddfb/fbirddd.c
* contrib/rddsql/hbrddsql.h
* contrib/rddsql/sqlbase.c
* contrib/rddsql/sqlmix.c
* contrib/rddado/adordd.prg
* contrib/rddads/rddads.h
* contrib/rddads/adsfunc.c
* contrib/rddads/ads1.c
* contrib/hbbmcdx/bmdbfcdx.c
* contrib/hbbmcdx/hbbmcdx.h
* SUCCESS -> HB_SUCCESS
* FAILURE -> HB_FAILURE
* ERRCODE -> HB_ERRCODE
2009-02-03 15:27 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* include/hbapirdd.h
* source/rdd/dbcmd.c

File diff suppressed because it is too large Load Diff

View File

@@ -138,7 +138,7 @@ HB_EXTERN_BEGIN
#define HB_CDXMAXKEY( x ) ((USHORT) ((x) > CDX_MAXKEY ? CDX_MAXKEY : (x)))
#define HB_CDXBITMASK( x ) ((LONG) ((1L<<(x))-1))
/* #define FAST_GOCOLD( A ) (((CDXAREAP) (A))->fRecordChanged || ((CDXAREAP) (A))->fCdxAppend ? (SELF_GOCOLD((A))) : SUCCESS) */
/* #define FAST_GOCOLD( A ) (((CDXAREAP) (A))->fRecordChanged || ((CDXAREAP) (A))->fCdxAppend ? (SELF_GOCOLD((A))) : HB_SUCCESS) */
#define FAST_GOCOLD( A ) SELF_GOCOLD(A)
@@ -576,53 +576,53 @@ typedef BM_FILTER * LPBM_FILTER;
#define hb_cdxBof NULL
#define hb_cdxEof NULL
#define hb_cdxFound NULL
static ERRCODE hb_cdxGoBottom( CDXAREAP pArea );
static HB_ERRCODE hb_cdxGoBottom( CDXAREAP pArea );
#define hb_cdxGoTo NULL
#define hb_cdxGoToId NULL
static ERRCODE hb_cdxGoTop( CDXAREAP pArea );
static ERRCODE hb_cdxSeek( CDXAREAP pArea, BOOL bSoftSeek, PHB_ITEM pKey, BOOL bFindLast );
static ERRCODE hb_cdxSkip( CDXAREAP pArea, LONG lToSkip );
static ERRCODE hb_cdxSkipFilter( CDXAREAP pArea, LONG lUpDown );
static ERRCODE hb_cdxSkipRaw( CDXAREAP pArea, LONG lToSkip );
static HB_ERRCODE hb_cdxGoTop( CDXAREAP pArea );
static HB_ERRCODE hb_cdxSeek( CDXAREAP pArea, BOOL bSoftSeek, PHB_ITEM pKey, BOOL bFindLast );
static HB_ERRCODE hb_cdxSkip( CDXAREAP pArea, LONG lToSkip );
static HB_ERRCODE hb_cdxSkipFilter( CDXAREAP pArea, LONG lUpDown );
static HB_ERRCODE hb_cdxSkipRaw( CDXAREAP pArea, LONG lToSkip );
#define hb_cdxAddField NULL
static ERRCODE hb_cdxAppend( CDXAREAP pArea, BOOL bUnLockAll );
static HB_ERRCODE hb_cdxAppend( CDXAREAP pArea, BOOL bUnLockAll );
#define hb_cdxCreateFields NULL
static ERRCODE hb_cdxDeleteRec( CDXAREAP pArea );
static HB_ERRCODE hb_cdxDeleteRec( CDXAREAP pArea );
#define hb_cdxDeleted NULL
#define hb_cdxFieldCount NULL
#define hb_cdxFieldDisplay NULL
#define hb_cdxFieldInfo NULL
#define hb_cdxFieldName NULL
static ERRCODE hb_cdxFlush( CDXAREAP pArea );
static HB_ERRCODE hb_cdxFlush( CDXAREAP pArea );
#define hb_cdxGetRec NULL
#define hb_cdxGetValue NULL
#define hb_cdxGetVarLen NULL
static ERRCODE hb_cdxGoCold( CDXAREAP pArea );
static ERRCODE hb_cdxGoHot( CDXAREAP pArea );
static ERRCODE hb_cdxPutRec( CDXAREAP pArea, BYTE * pBuffer );
static HB_ERRCODE hb_cdxGoCold( CDXAREAP pArea );
static HB_ERRCODE hb_cdxGoHot( CDXAREAP pArea );
static HB_ERRCODE hb_cdxPutRec( CDXAREAP pArea, BYTE * pBuffer );
#define hb_cdxPutValue NULL
static ERRCODE hb_cdxRecall( CDXAREAP pArea );
static HB_ERRCODE hb_cdxRecall( CDXAREAP pArea );
#define hb_cdxRecCount NULL
#define hb_cdxRecInfo NULL
#define hb_cdxRecNo NULL
#define hb_cdxRecId NULL
#define hb_cdxSetFieldExtent NULL
#define hb_cdxAlias NULL
static ERRCODE hb_cdxClose( CDXAREAP pArea );
static HB_ERRCODE hb_cdxClose( CDXAREAP pArea );
#define hb_cdxCreate NULL
#define hb_cdxInfo NULL
#define hb_cdxNewArea NULL
static ERRCODE hb_cdxOpen( CDXAREAP pArea, LPDBOPENINFO pOpenInfo );
static HB_ERRCODE hb_cdxOpen( CDXAREAP pArea, LPDBOPENINFO pOpenInfo );
#define hb_cdxRelease NULL
static ERRCODE hb_cdxStructSize( CDXAREAP pArea, USHORT * uiSize );
static HB_ERRCODE hb_cdxStructSize( CDXAREAP pArea, USHORT * uiSize );
#define hb_cdxSysName NULL
#define hb_cdxEval NULL
static ERRCODE hb_cdxPack ( CDXAREAP pArea );
static HB_ERRCODE hb_cdxPack ( CDXAREAP pArea );
#define hb_cdxPackRec NULL
#define hb_cdxSort NULL
#define hb_cdxTrans NULL
#define hb_cdxTransRec NULL
static ERRCODE hb_cdxZap ( CDXAREAP pArea );
static HB_ERRCODE hb_cdxZap ( CDXAREAP pArea );
#define hb_cdxChildEnd NULL
#define hb_cdxChildStart NULL
#define hb_cdxChildSync NULL
@@ -633,22 +633,22 @@ static ERRCODE hb_cdxZap ( CDXAREAP pArea );
#define hb_cdxRelEval NULL
#define hb_cdxRelText NULL
#define hb_cdxSetRel NULL
static ERRCODE hb_cdxOrderListAdd( CDXAREAP pArea, LPDBORDERINFO pOrderInfo );
static ERRCODE hb_cdxOrderListClear( CDXAREAP pArea );
static ERRCODE hb_cdxOrderListDelete( CDXAREAP pArea, LPDBORDERINFO pOrderInfo );
static ERRCODE hb_cdxOrderListFocus( CDXAREAP pArea, LPDBORDERINFO pOrderInfo );
static ERRCODE hb_cdxOrderListRebuild( CDXAREAP pArea );
static HB_ERRCODE hb_cdxOrderListAdd( CDXAREAP pArea, LPDBORDERINFO pOrderInfo );
static HB_ERRCODE hb_cdxOrderListClear( CDXAREAP pArea );
static HB_ERRCODE hb_cdxOrderListDelete( CDXAREAP pArea, LPDBORDERINFO pOrderInfo );
static HB_ERRCODE hb_cdxOrderListFocus( CDXAREAP pArea, LPDBORDERINFO pOrderInfo );
static HB_ERRCODE hb_cdxOrderListRebuild( CDXAREAP pArea );
#define hb_cdxOrderCondition NULL
static ERRCODE hb_cdxOrderCreate( CDXAREAP pArea, LPDBORDERCREATEINFO pOrderInfo );
static ERRCODE hb_cdxOrderDestroy( CDXAREAP pArea, LPDBORDERINFO pOrderInfo );
static ERRCODE hb_cdxOrderInfo( CDXAREAP pArea, USHORT uiIndex, LPDBORDERINFO pOrderInfo );
static ERRCODE hb_cdxClearFilter( CDXAREAP pArea );
static HB_ERRCODE hb_cdxOrderCreate( CDXAREAP pArea, LPDBORDERCREATEINFO pOrderInfo );
static HB_ERRCODE hb_cdxOrderDestroy( CDXAREAP pArea, LPDBORDERINFO pOrderInfo );
static HB_ERRCODE hb_cdxOrderInfo( CDXAREAP pArea, USHORT uiIndex, LPDBORDERINFO pOrderInfo );
static HB_ERRCODE hb_cdxClearFilter( CDXAREAP pArea );
#define hb_cdxClearLocate NULL
#define hb_cdxClearScope NULL
static ERRCODE hb_cdxCountScope( CDXAREAP pArea, void * pPtr, LONG * plRec );
static HB_ERRCODE hb_cdxCountScope( CDXAREAP pArea, void * pPtr, LONG * plRec );
#define hb_cdxFilterText NULL
#define hb_cdxScopeInfo NULL
static ERRCODE hb_cdxSetFilter( CDXAREAP pArea, LPDBFILTERINFO pFilterInfo );
static HB_ERRCODE hb_cdxSetFilter( CDXAREAP pArea, LPDBFILTERINFO pFilterInfo );
#define hb_cdxSetLocate NULL
#define hb_cdxSetScope NULL
#define hb_cdxSkipScope NULL
@@ -670,7 +670,7 @@ static ERRCODE hb_cdxSetFilter( CDXAREAP pArea, LPDBFILTERINFO pFilterInfo );
#define hb_cdxExit NULL
#define hb_cdxDrop NULL
#define hb_cdxExists NULL
static ERRCODE hb_cdxRddInfo( LPRDDNODE pRDD, USHORT uiIndex, ULONG ulConnect, PHB_ITEM pItem );
static HB_ERRCODE hb_cdxRddInfo( LPRDDNODE pRDD, USHORT uiIndex, ULONG ulConnect, PHB_ITEM pItem );
#define hb_cdxWhoCares NULL
HB_EXTERN_END

View File

@@ -147,7 +147,7 @@ STATIC FUNCTION ADO_INIT( nRDD )
USRRDD_RDDDATA( nRDD, aRData )
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_NEW( nWA )
@@ -158,7 +158,7 @@ STATIC FUNCTION ADO_NEW( nWA )
USRRDD_AREADATA( nWA, aWAData )
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_CREATE( nWA, aOpenInfo )
@@ -251,7 +251,7 @@ STATIC FUNCTION ADO_CREATE( nWA, aOpenInfo )
oConnection:Close()
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_CREATEFIELDS( nWA, aStruct )
@@ -301,7 +301,7 @@ STATIC FUNCTION ADO_CREATEFIELDS( nWA, aStruct )
ENDCASE
NEXT
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_OPEN( nWA, aOpenInfo )
@@ -400,7 +400,7 @@ STATIC FUNCTION ADO_OPEN( nWA, aOpenInfo )
oError:CanDefault := .T.
UR_SUPER_ERROR( nWA, oError )
RETURN FAILURE
RETURN HB_FAILURE
ENDIF
oRecordSet:CursorType := adOpenDynamic
oRecordSet:CursorLocation := adUseClient
@@ -447,7 +447,7 @@ STATIC FUNCTION ADO_OPEN( nWA, aOpenInfo )
nResult := UR_SUPER_OPEN( nWA, aOpenInfo )
IF nResult == SUCCESS
IF nResult == HB_SUCCESS
ADO_GOTOP( nWA )
ENDIF
@@ -516,7 +516,7 @@ STATIC FUNCTION ADO_GETVALUE( nWA, nField, xValue )
ENDIF
END WITH
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_GOTO( nWA, nRecord )
@@ -530,7 +530,7 @@ STATIC FUNCTION ADO_GOTO( nWA, nRecord )
ADO_RECID( nWA, @nRecNo )
END WITH
RETURN iif( nRecord == nRecNo, SUCCESS, FAILURE )
RETURN iif( nRecord == nRecNo, HB_SUCCESS, HB_FAILURE )
STATIC FUNCTION ADO_GOTOID( nWA, nRecord )
LOCAL nRecNo
@@ -543,7 +543,7 @@ STATIC FUNCTION ADO_GOTOID( nWA, nRecord )
ADO_RECID( nWA, @nRecNo )
END WITH
RETURN iif( nRecord == nRecNo, SUCCESS, FAILURE )
RETURN iif( nRecord == nRecNo, HB_SUCCESS, HB_FAILURE )
STATIC FUNCTION ADO_GOTOP( nWA )
@@ -557,7 +557,7 @@ STATIC FUNCTION ADO_GOTOP( nWA )
aWAData[ WA_BOF ] := .F.
aWAData[ WA_EOF ] := .F.
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_GOBOTTOM( nWA )
@@ -569,24 +569,24 @@ STATIC FUNCTION ADO_GOBOTTOM( nWA )
aWAData[ WA_BOF ] := .F.
aWAData[ WA_EOF ] := .F.
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_SKIPRAW( nWA, nToSkip )
LOCAL aWAData := USRRDD_AREADATA( nWA )
LOCAL oRecordSet := aWAData[ WA_RECORDSET ]
LOCAL nResult := SUCCESS
LOCAL nResult := HB_SUCCESS
IF ! Empty( aWAData[ WA_PENDINGREL ] )
IF ADO_FORCEREL( nWA ) != SUCCESS
RETURN FAILURE
IF ADO_FORCEREL( nWA ) != HB_SUCCESS
RETURN HB_FAILURE
ENDIF
ENDIF
IF nToSkip != 0
IF aWAData[ WA_EOF ]
IF nToSkip > 0
RETURN SUCCESS
RETURN HB_SUCCESS
ENDIF
ADO_GOBOTTOM( nWA )
++nToSkip
@@ -603,10 +603,10 @@ STATIC FUNCTION ADO_SKIPRAW( nWA, nToSkip )
aWAData[ WA_EOF ] := oRecordSet:EOF
ENDIF
ELSE
nResult := FAILURE
nResult := HB_FAILURE
ENDIF
CATCH
nResult := FAILURE
nResult := HB_FAILURE
END
ENDIF
@@ -619,19 +619,19 @@ STATIC FUNCTION ADO_BOF( nWA, lBof )
lBof := aWAData[ WA_BOF ]
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_EOF( nWA, lEof )
LOCAL oRecordSet := USRRDD_AREADATA( nWA )[ WA_RECORDSET ]
LOCAL nResult := SUCCESS
LOCAL nResult := HB_SUCCESS
TRY
IF USRRDD_AREADATA( nWA )[WA_CONNECTION]:State != adStateClosed
lEof := ( oRecordSet:AbsolutePosition == -3 )
ENDIF
CATCH
nResult := FAILURE
nResult := HB_FAILURE
END
RETURN nResult
@@ -650,7 +650,7 @@ STATIC FUNCTION ADO_DELETED( nWA, lDeleted )
lDeleted := .F.
END TRY
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_DELETE( nWA )
@@ -660,12 +660,12 @@ STATIC FUNCTION ADO_DELETE( nWA )
ADO_SKIPRAW( nWA, 1 )
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_RECNO( nWA, nRecNo )
LOCAL oRecordSet := USRRDD_AREADATA( nWA )[ WA_RECORDSET ]
LOCAL nResult := SUCCESS
LOCAL nResult := HB_SUCCESS
TRY
IF USRRDD_AREADATA( nWA )[WA_CONNECTION]:State != adStateClosed
@@ -673,11 +673,11 @@ STATIC FUNCTION ADO_RECNO( nWA, nRecNo )
ELSE
nRecno := 0
nResult := FAILURE
nResult := HB_FAILURE
ENDIF
CATCH
nRecNo := 0
nResult := FAILURE
nResult := HB_FAILURE
END
RETURN nResult
@@ -691,7 +691,7 @@ STATIC FUNCTION ADO_RECCOUNT( nWA, nRecords )
nRecords := oRecordSet:RecordCount()
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_PUTVALUE( nWA, nField, xValue )
@@ -706,7 +706,7 @@ STATIC FUNCTION ADO_PUTVALUE( nWA, nField, xValue )
END
ENDIF
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_APPEND( nWA, lUnLockAll )
@@ -721,7 +721,7 @@ STATIC FUNCTION ADO_APPEND( nWA, lUnLockAll )
CATCH
END
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_FLUSH( nWA )
@@ -732,13 +732,13 @@ STATIC FUNCTION ADO_FLUSH( nWA )
CATCH
END
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_ORDINFO( nWA, nIndex, aOrderInfo )
LOCAL aWAData := USRRDD_AREADATA( nWA )
LOCAL oRecordSet := aWAData[ WA_RECORDSET ]
LOCAL nResult := SUCCESS
LOCAL nResult := HB_SUCCESS
DO CASE
CASE nIndex == DBOI_EXPRESSION
@@ -780,21 +780,21 @@ STATIC FUNCTION ADO_ORDINFO( nWA, nIndex, aOrderInfo )
ADO_RECID( nWA, @aOrderInfo[ UR_ORI_RESULT ] )
ELSE
aOrderInfo[ UR_ORI_RESULT ] := 0
nResult := FAILURE
nResult := HB_FAILURE
ENDIF
CASE nIndex == DBOI_RECNO
IF aWAData[ WA_CONNECTION ]:State != adStateClosed
ADO_RECID( nWA, @aOrderInfo[ UR_ORI_RESULT ] )
ELSE
aOrderInfo[ UR_ORI_RESULT ] := 0
nResult := FAILURE
nResult := HB_FAILURE
ENDIF
CASE nIndex == DBOI_KEYCOUNT
IF aWAData[ WA_CONNECTION ]:State != adStateClosed
aOrderInfo[ UR_ORI_RESULT ] := oRecordSet:RecordCount
ELSE
aOrderInfo[ UR_ORI_RESULT ] := 0
nResult := FAILURE
nResult := HB_FAILURE
ENDIF
ENDCASE
@@ -802,7 +802,7 @@ RETURN nResult
STATIC FUNCTION ADO_RECINFO( nWA, nRecord, nInfoType, uInfo )
LOCAL nResult := SUCCESS
LOCAL nResult := HB_SUCCESS
//LOCAL oRecordSet := USRRDD_AREADATA( nWA )[ WA_RECORDSET ]
HB_SYMOL_USED( nWA )
#ifdef UR_DBRI_DELETED
@@ -835,14 +835,14 @@ STATIC FUNCTION ADO_RECINFO( nWA, nRecord, nInfoType, uInfo )
RETURN nResult
STATIC FUNCTION ADO_FIELDNAME( nWA, nField, cFieldName )
LOCAL nResult := SUCCESS
LOCAL nResult := HB_SUCCESS
LOCAL oRecordSet := USRRDD_AREADATA( nWA )[ WA_RECORDSET ]
TRY
cFieldName := oRecordSet:Fields( nField - 1 ):Name
CATCH
cFieldName := ''
nResult := FAILURE
nResult := HB_FAILURE
END TRY
RETURN nResult
@@ -922,10 +922,10 @@ STATIC FUNCTION ADO_FIELDINFO( nWA, nField, nInfoType, uInfo )
uInfo := 0
#endif
OTHERWISE
RETURN FAILURE
RETURN HB_FAILURE
ENDCASE
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_ORDLSTFOCUS( nWA, aOrderInfo )
@@ -952,14 +952,14 @@ STATIC FUNCTION ADO_ORDLSTFOCUS( nWA, aOrderInfo )
ADO_GOTO( nWA, nRecNo )
END WITH
*/
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_PACK( nWA )
//LOCAL oRecordSet := USRRDD_AREADATA( nWA )[ WA_RECORDSET ]
HB_SYMOL_USED( nWA )
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_RAWLOCK( nWA, nAction, nRecNo )
@@ -970,7 +970,7 @@ STATIC FUNCTION ADO_RAWLOCK( nWA, nAction, nRecNo )
HB_SYMBOL_UNUSED( nWA )
HB_SYMBOL_UNUSED( nAction )
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_LOCK( nWA, aLockInfo )
@@ -981,7 +981,7 @@ STATIC FUNCTION ADO_LOCK( nWA, aLockInfo )
aLockInfo[ UR_LI_RECORD ] := RECNO()
aLockInfo[ UR_LI_RESULT ] := .T.
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_UNLOCK( nWA, xRecID )
@@ -991,7 +991,7 @@ STATIC FUNCTION ADO_UNLOCK( nWA, xRecID )
HB_SYMBOL_UNUSED( xRecId )
HB_SYMBOL_UNUSED( nWA )
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_SETFILTER( nWA, aFilterInfo )
@@ -999,7 +999,7 @@ STATIC FUNCTION ADO_SETFILTER( nWA, aFilterInfo )
oRecordSet:Filter := SQLTranslate( aFilterInfo[ UR_FRI_CEXPR ] )
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_CLEARFILTER( nWA )
@@ -1010,7 +1010,7 @@ STATIC FUNCTION ADO_CLEARFILTER( nWA )
CATCH
END
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_ZAP( nWA )
@@ -1026,7 +1026,7 @@ STATIC FUNCTION ADO_ZAP( nWA )
oRecordSet:Requery()
ENDIF
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_SETLOCATE( nWA, aScopeInfo )
@@ -1036,7 +1036,7 @@ STATIC FUNCTION ADO_SETLOCATE( nWA, aScopeInfo )
aWAData[ WA_SCOPEINFO ] := aScopeInfo
return SUCCESS
return HB_SUCCESS
STATIC FUNCTION ADO_LOCATE( nWA, lContinue )
@@ -1047,7 +1047,7 @@ STATIC FUNCTION ADO_LOCATE( nWA, lContinue )
aWAData[ WA_FOUND ] := ! oRecordSet:EOF
aWAData[ WA_EOF ] := oRecordSet:EOF
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_CLEARREL( nWA )
@@ -1066,7 +1066,7 @@ STATIC FUNCTION ADO_CLEARREL( nWA )
ENDIF
ENDIF
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_RELAREA( nWA, nRelNo, nRelArea )
@@ -1079,7 +1079,7 @@ STATIC FUNCTION ADO_RELAREA( nWA, nRelNo, nRelArea )
nRelArea := 0
END TRY
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_RELTEXT( nWA, nRelNo, cExpr )
@@ -1093,7 +1093,7 @@ STATIC FUNCTION ADO_RELTEXT( nWA, nRelNo, cExpr )
cExpr := ''
END TRY
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_SETREL( nWA, aRelInfo )
@@ -1109,7 +1109,7 @@ STATIC FUNCTION ADO_SETREL( nWA, aRelInfo )
// raise error for can't create relation
END
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_FORCEREL( nWA )
@@ -1124,31 +1124,31 @@ STATIC FUNCTION ADO_FORCEREL( nWA )
RETURN ADO_RELEVAL( nWA, aPendingRel )
ENDIF
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_RELEVAL( nWA, aRelInfo )
LOCAL aInfo, nReturn, nOrder, uResult
nReturn := ADO_EVALBLOCK( aRelInfo[UR_RI_PARENT], aRelInfo[UR_RI_BEXPR], @uResult )
IF nReturn == SUCCESS
IF nReturn == HB_SUCCESS
/*
* Check the current order
*/
aInfo := Array( UR_ORI_SIZE )
nReturn := ADO_ORDINFO( nWA, DBOI_NUMBER, @aInfo )
IF nReturn == SUCCESS
IF nReturn == HB_SUCCESS
nOrder := aInfo[UR_ORI_RESULT]
IF nOrder != 0
IF aRelInfo[UR_RI_SCOPED]
aInfo[UR_ORI_NEWVAL] := uResult
nReturn := ADO_ORDINFO( nWA, DBOI_SCOPETOP, @aInfo )
IF nReturn == SUCCESS
IF nReturn == HB_SUCCESS
nReturn := ADO_ORDINFO( nWA, DBOI_SCOPEBOTTOM, @aInfo )
ENDIF
ENDIF
IF nReturn == SUCCESS
IF nReturn == HB_SUCCESS
nReturn := ADO_SEEK( nWA, .F., uResult, .F. )
ENDIF
ELSE
@@ -1169,7 +1169,7 @@ STATIC FUNCTION ADO_ORDLSTADD( nWA, aOrderInfo )
CATCH
END
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_ORDLSTCLEAR( nWA )
@@ -1180,7 +1180,7 @@ STATIC FUNCTION ADO_ORDLSTCLEAR( nWA )
CATCH
END
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_ORDCREATE( nWA, aOrderCreateInfo )
@@ -1217,7 +1217,7 @@ STATIC FUNCTION ADO_ORDCREATE( nWA, aOrderCreateInfo )
UR_SUPER_ERROR( nWA, oError )
END
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_ORDDESTROY( nWA, aOrderInfo )
@@ -1232,7 +1232,7 @@ STATIC FUNCTION ADO_ORDDESTROY( nWA, aOrderInfo )
NEXT
ENDIF
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_EVALBLOCK( nArea, bBlock, uResult )
@@ -1251,11 +1251,11 @@ STATIC FUNCTION ADO_EVALBLOCK( nArea, bBlock, uResult )
DbSelectArea( nCurrArea )
ENDIF
RETURN SUCCESS
RETURN HB_SUCCESS
STATIC FUNCTION ADO_EXISTS( nRdd, cTable, cIndex, ulConnect )
//LOCAL n
LOCAL lRet := FAILURE
LOCAL lRet := HB_FAILURE
LOCAL aRData := USRRDD_RDDDATA( nRDD )
HB_SYMBOL_UNUSED( ulConnect )
@@ -1263,13 +1263,13 @@ STATIC FUNCTION ADO_EXISTS( nRdd, cTable, cIndex, ulConnect )
IF ! Empty( cTable ) .AND. ! Empty( aRData[ WA_CATALOG ] )
TRY
//n := aRData[ WA_CATALOG ]:Tables( cTable )
lRet := SUCCESS
lRet := HB_SUCCESS
CATCH
END TRY
IF ! Empty( cIndex )
TRY
//n := aRData[ WA_CATALOG ]:Tables( cTable ):Indexes( cIndex )
lRet := SUCCESS
lRet := HB_SUCCESS
CATCH
END TRY
ENDIF
@@ -1279,7 +1279,7 @@ RETURN lRet
STATIC FUNCTION ADO_DROP( nRdd, cTable, cIndex, ulConnect )
//LOCAL n
LOCAL lRet := FAILURE
LOCAL lRet := HB_FAILURE
LOCAL aRData := USRRDD_RDDDATA( nRDD )
HB_SYMBOL_UNUSED( ulConnect )
@@ -1287,13 +1287,13 @@ STATIC FUNCTION ADO_DROP( nRdd, cTable, cIndex, ulConnect )
IF ! Empty( cTable ) .AND. ! Empty( aRData[ WA_CATALOG ] )
TRY
//n := aRData[ WA_CATALOG ]:Tables:Delete( cTable )
lRet := SUCCESS
lRet := HB_SUCCESS
CATCH
END TRY
IF ! Empty( cIndex )
TRY
//n := aRData[ WA_CATALOG ]:Tables( cTable ):Indexes:Delete( cIndex )
lRet := SUCCESS
lRet := HB_SUCCESS
CATCH
END TRY
ENDIF
@@ -1312,12 +1312,12 @@ STATIC FUNCTION ADO_SEEK( nWA, lSoftSeek, cKey, lFindLast )
LPCDXTAG pTag;
if ( FAST_GOCOLD( ( AREAP ) pArea ) == FAILURE )
return FAILURE;
if ( FAST_GOCOLD( ( AREAP ) pArea ) == HB_FAILURE )
return HB_FAILURE;
//oRecordSet:Find( aWAData[ WA_SCOPEINFO ][ UR_SI_CFOR ], iif( lContinue, 1, 0 ) )
LPCDXKEY pKey;
ERRCODE retval = SUCCESS;
ERRCODE retval = HB_SUCCESS;
BOOL fEOF = FALSE, fLast;
ULONG ulRec;
@@ -1356,10 +1356,10 @@ STATIC FUNCTION ADO_SEEK( nWA, lSoftSeek, cKey, lFindLast )
if ( !fEOF )
{
retval = SELF_GOTO( ( AREAP ) pArea, pTag->CurKey->rec );
if ( retval != FAILURE && pArea->fPositioned )
if ( retval != HB_FAILURE && pArea->fPositioned )
{
retval = SELF_SKIPFILTER( ( AREAP ) pArea, fFindLast ? -1 : 1 );
if ( retval != FAILURE && ulRec && pArea->fPositioned )
if ( retval != HB_FAILURE && ulRec && pArea->fPositioned )
{
pArea->fFound = ( ulRec == pArea->ulRecNo ||
hb_cdxValCompare( pTag, pKey->val, pKey->len,
@@ -1369,7 +1369,7 @@ STATIC FUNCTION ADO_SEEK( nWA, lSoftSeek, cKey, lFindLast )
}
}
}
if ( retval != FAILURE &&
if ( retval != HB_FAILURE &&
( fEOF || ! hb_cdxTopScope( pTag ) ||
! hb_cdxBottomScope( pTag ) ) )
{
@@ -1379,7 +1379,7 @@ STATIC FUNCTION ADO_SEEK( nWA, lSoftSeek, cKey, lFindLast )
hb_cdxKeyFree( pKey );
return retval;
*/
RETURN FAILURE
RETURN HB_FAILURE
static function ADO_FOUND( nWA, lFound )
@@ -1387,7 +1387,7 @@ static function ADO_FOUND( nWA, lFound )
lFound := aWAData[ WA_FOUND ]
return SUCCESS
return HB_SUCCESS
FUNCTION ADORDD_GETFUNCTABLE( pFuncCount, pFuncTable, pSuperTable, nRddID )

File diff suppressed because it is too large Load Diff

View File

@@ -183,7 +183,7 @@ HB_FUNC( ADSISSERVERLOADED )
{
UNSIGNED16 pbLoaded = 0;
hb_retni( ISCHAR( 1 ) && AdsIsServerLoaded( ( UNSIGNED8 * ) hb_parcx( 1 ),
hb_retni( ISCHAR( 1 ) && AdsIsServerLoaded( ( UNSIGNED8 * ) hb_parcx( 1 ),
&pbLoaded ) == AE_SUCCESS ? pbLoaded : 0 );
}
@@ -230,7 +230,7 @@ HB_FUNC( ADSGETTABLECONTYPE )
AdsGetTableConnection( pArea->hTable, &pTableConnectHandle );
if( pTableConnectHandle &&
if( pTableConnectHandle &&
AdsGetConnectionType( pTableConnectHandle, &pusConnectType ) != AE_SUCCESS )
pusConnectType = 0;
}
@@ -421,7 +421,7 @@ HB_FUNC( ADSBLOB2FILE )
char * szFileName = hb_parcx( 1 );
char * szFieldName = hb_parcx( 2 );
if( strlen( szFileName ) &&
if( strlen( szFileName ) &&
strlen( szFieldName ) )
{
ADSAREAP pArea = hb_adsGetWorkAreaPointer();
@@ -442,7 +442,7 @@ HB_FUNC( ADSFILE2BLOB )
char * szFileName = hb_parcx( 1 );
char * szFieldName = hb_parcx( 2 );
if( strlen( szFileName ) &&
if( strlen( szFileName ) &&
strlen( szFieldName ) )
{
ADSAREAP pArea = hb_adsGetWorkAreaPointer();
@@ -476,7 +476,7 @@ HB_FUNC( ADSKEYNO )
UNSIGNED32 pulKey = 0L;
ADSHANDLE hIndex = 0;
UNSIGNED16 usFilterOption = pFilterOption ? ( UNSIGNED16 ) hb_itemGetNI( pFilterOption ) : ADS_IGNOREFILTERS;
/* get an Index Handle */
if( pxOrder == NULL || HB_IS_NIL( pxOrder ) ) /* didn't pass it in; use current */
{
@@ -503,7 +503,7 @@ HB_FUNC( ADSKEYNO )
( UNSIGNED8 * ) hb_itemGetCPtr( pxOrder ) /* ordName */,
&hIndex );
}
if( hIndex == 0 ) /* no index selected */
{
AdsGetRecordNum( pArea->hTable,
@@ -516,7 +516,7 @@ HB_FUNC( ADSKEYNO )
usFilterOption,
&pulKey );
}
hb_retnl( pulKey );
}
else
@@ -570,7 +570,7 @@ HB_FUNC( ADSKEYCOUNT )
( UNSIGNED8 * ) hb_itemGetCPtr( pxOrder ) /* ordName */,
&hIndex );
}
if( hIndex == 0 ) /* no index selected */
hIndex = pArea->hTable;
@@ -594,7 +594,7 @@ HB_FUNC( ADSKEYCOUNT )
if( pusBufLen ) /* had a scope */
{
AdsGetAOF( pArea->hTable,
AdsGetAOF( pArea->hTable,
pucFilter,
&pusBufLen );
@@ -609,10 +609,10 @@ HB_FUNC( ADSKEYCOUNT )
{
ULONG ulRecNo;
UNSIGNED16 u16eof;
SELF_RECNO( ( AREAP ) pArea, &ulRecNo );
AdsGotoTop( hIndex );
AdsAtEOF( pArea->hTable, &u16eof );
while( AdsSkip( hIndex, 1 ) != AE_NO_CURRENT_RECORD && !u16eof )
@@ -636,7 +636,7 @@ HB_FUNC( ADSKEYCOUNT )
&pulKey );
}
}
hb_retnl( pulKey );
}
else
@@ -735,11 +735,11 @@ HB_FUNC( ADSEVALAOF )
if( ISCHAR( 1 ) )
{
char * pucFilter = hb_adsOemToAnsi( hb_parc( 1 ), hb_parclen( 1 ) );
AdsEvalAOF( pArea->hTable,
( UNSIGNED8 * ) pucFilter,
&pusOptLevel );
hb_adsOemAnsiFree( pucFilter );
}
@@ -883,7 +883,7 @@ HB_FUNC( ADSISRECORDVALID )
{
BOOL fEof = TRUE;
if( SELF_EOF( ( AREAP ) pArea, &fEof ) == SUCCESS && !fEof )
if( SELF_EOF( ( AREAP ) pArea, &fEof ) == HB_SUCCESS && !fEof )
{
if( pArea->dbfi.itmCobExpr )
{
@@ -919,13 +919,13 @@ HB_FUNC( ADSSETAOF )
{
UNSIGNED16 usResolve = ( UNSIGNED16 ) ( hb_pcount() > 1 ? hb_parni( 2 ) : ADS_RESOLVE_DYNAMIC ); /* ADS_RESOLVE_IMMEDIATE */
char * pucFilter = hb_adsOemToAnsi( hb_parc( 1 ), hb_parclen( 1 ) );
UNSIGNED32 ulRetVal = AdsSetAOF( pArea->hTable,
( UNSIGNED8 * ) pucFilter,
usResolve );
hb_adsOemAnsiFree( pucFilter );
hb_retl( ulRetVal == AE_SUCCESS );
}
else
@@ -1091,7 +1091,7 @@ HB_FUNC( ADSCONNECT )
{
ADSHANDLE hConnect = 0;
if( ISCHAR( 1 ) &&
if( ISCHAR( 1 ) &&
AdsConnect( ( UNSIGNED8 * ) hb_parcx( 1 ),
&hConnect ) == AE_SUCCESS )
{
@@ -1109,7 +1109,7 @@ HB_FUNC( ADSDISCONNECT )
* AdsDisconnect() is used to disconnect a connection from the specified server.
* If tables are currently opened, all data is flushed, locks are released,
* and open tables are closed before the disconnect occurs.
*
*
* If zero is passed as the connection handle, all connections on the server
* associated with the user will be disconnected. If AdsDisconnect() is called
* on a connection with a transaction active, the transaction will be rolled back.
@@ -1118,7 +1118,7 @@ HB_FUNC( ADSDISCONNECT )
ADSHANDLE hConnect = HB_ADS_PARCONNECTION( 1 );
/* NOTE: Only allow disconnect of 0 if explicitly passed or hb_ads_hConnect is 0
(hConnect might be 0 if caller accidentally disconnects twice;
(hConnect might be 0 if caller accidentally disconnects twice;
this should not close all connections! */
if( ( hConnect != 0 || ISNUM( 1 ) ) &&
@@ -1138,7 +1138,7 @@ HB_FUNC( ADSSTMTSETTABLELOCKTYPE )
ADSAREAP pArea = hb_adsGetWorkAreaPointer();
hb_retl( pArea && pArea->hStatement &&
AdsStmtSetTableLockType( pArea->hStatement,
AdsStmtSetTableLockType( pArea->hStatement,
( UNSIGNED16 ) hb_parni( 1 ) /* usLockType */ ) == AE_SUCCESS );
}
@@ -1505,7 +1505,7 @@ HB_FUNC( ADSGETHANDLETYPE ) /* DD, admin, table */
{
UNSIGNED16 usType = AE_INVALID_HANDLE;
hb_retni( AdsGetHandleType( HB_ADS_PARCONNECTION( 1 ) /* hConnect */,
hb_retni( AdsGetHandleType( HB_ADS_PARCONNECTION( 1 ) /* hConnect */,
&usType ) == AE_SUCCESS ? usType : AE_INVALID_HANDLE );
}
@@ -1825,7 +1825,7 @@ HB_FUNC( ADSDDGETDATABASEPROPERTY )
UNSIGNED16 ulBuffer;
UNSIGNED16 ulLength = sizeof( ulBuffer );
AdsDDGetDatabaseProperty( hConnect,
AdsDDGetDatabaseProperty( hConnect,
ulProperty,
&ulBuffer,
&ulLength );
@@ -1869,9 +1869,9 @@ HB_FUNC( ADSDDSETDATABASEPROPERTY )
case ADS_DD_ADMIN_PASSWORD:
case ADS_DD_ENCRYPT_TABLE_PASSWORD:
{
ulRetVal = AdsDDSetDatabaseProperty( hConnect,
ulProperty,
HB_IS_STRING( pParam ) ? hb_itemGetCPtr( pParam ) : NULL,
ulRetVal = AdsDDSetDatabaseProperty( hConnect,
ulProperty,
HB_IS_STRING( pParam ) ? hb_itemGetCPtr( pParam ) : NULL,
( UNSIGNED16 ) hb_itemGetCLen( pParam ) + 1 );
break;
}
@@ -1905,7 +1905,7 @@ HB_FUNC( ADSDDSETDATABASEPROPERTY )
#endif
{
ulBuffer = ( UNSIGNED16 ) hb_itemGetL( pParam );
ulRetVal = AdsDDSetDatabaseProperty( hConnect,
ulRetVal = AdsDDSetDatabaseProperty( hConnect,
ulProperty,
&ulBuffer,
sizeof( ulBuffer ) );
@@ -1953,7 +1953,7 @@ HB_FUNC( ADSDDGETUSERPROPERTY )
UNSIGNED8 pvProperty[ ADS_MAX_PARAMDEF_LEN ] = { 0 };
UNSIGNED16 usPropertyLen = ADS_MAX_PARAMDEF_LEN;
UNSIGNED32 ulRetVal = AdsDDGetUserProperty( HB_ADS_PARCONNECTION( 4 ) /* hConnect */,
UNSIGNED32 ulRetVal = AdsDDGetUserProperty( HB_ADS_PARCONNECTION( 4 ) /* hConnect */,
( UNSIGNED8 * ) hb_parcx( 1 ) /* pucUserName */,
( UNSIGNED16 ) hb_parni( 2 ) /* usPropertyID */,
pvProperty,
@@ -2035,7 +2035,7 @@ HB_FUNC( ADSCOPYTABLECONTENTS )
{
int iOldArea = hb_rddGetCurrentWorkAreaNumber();
if( hb_rddSelectWorkAreaAlias( hb_parcx( 1 ) /* szAliasDest */ ) == SUCCESS )
if( hb_rddSelectWorkAreaAlias( hb_parcx( 1 ) /* szAliasDest */ ) == HB_SUCCESS )
{
ADSAREAP pDest = hb_adsGetWorkAreaPointer();
@@ -2077,7 +2077,7 @@ HB_FUNC( ADSDIRECTORY )
&usFileNameLen,
&sHandle );
if( ulRetVal == AE_SUCCESS ||
if( ulRetVal == AE_SUCCESS ||
ulRetVal == AE_NO_FILE_FOUND )
{
while( ulRetVal == AE_SUCCESS )
@@ -2103,7 +2103,7 @@ HB_FUNC( ADSCHECKEXISTENCE )
{
UNSIGNED16 usExist = 0;
hb_retl( AdsCheckExistence( HB_ADS_PARCONNECTION( 2 ) /* hConnect */,
hb_retl( AdsCheckExistence( HB_ADS_PARCONNECTION( 2 ) /* hConnect */,
( UNSIGNED8 * ) hb_parcx( 1 ) /* pucFilename */,
&usExist ) == AE_SUCCESS && usExist != 0 );
}
@@ -2119,13 +2119,13 @@ HB_FUNC( ADSSTMTSETTABLEPASSWORD )
char * pucTableName = hb_parcx( 1 );
char * pucPassword = hb_parcx( 2 );
if( strlen( pucTableName ) &&
if( strlen( pucTableName ) &&
strlen( pucPassword ) )
{
ADSAREAP pArea = hb_adsGetWorkAreaPointer();
if( pArea && pArea->hStatement )
hb_retnl( AdsStmtSetTablePassword( pArea->hStatement,
hb_retnl( AdsStmtSetTablePassword( pArea->hStatement,
( UNSIGNED8 * ) pucTableName,
( UNSIGNED8 * ) pucPassword ) );
else
@@ -2199,7 +2199,7 @@ HB_FUNC( ADSCREATEFTSINDEX )
HB_FUNC( ADSCREATESAVEPOINT )
{
hb_retnl( AdsCreateSavepoint( HB_ADS_PARCONNECTION( 1 ) /* hConnect */,
( UNSIGNED8 * ) hb_parc( 2 ) /* pucSavepoint */,
( UNSIGNED8 * ) hb_parc( 2 ) /* pucSavepoint */,
ADS_DEFAULT /* ulOptions */ ) );
}

View File

@@ -88,8 +88,8 @@
#if 0
/* Compatibility ACE version override.
Usage is discouraged and unnecessary unless we want to
override autodetection. For the latter, ADS_LIB_VERSION
Usage is discouraged and unnecessary unless we want to
override autodetection. For the latter, ADS_LIB_VERSION
is recommended. If ADS_LIB_VERSION is #defined,
ADS_REQUIRE_VERSION will be ignored. [vszakats] */
#if !defined( ADS_LIB_VERSION )
@@ -107,7 +107,7 @@
#endif
#endif
/* Make sure to not allow a manual override requesting
/* Make sure to not allow a manual override requesting
a higher version than the one of ACE. [vszakats] */
#if !defined( ADS_LIB_VERSION )
#define ADS_LIB_VERSION _ADS_LIB_VERSION
@@ -238,7 +238,7 @@ extern int hb_ads_iCharType;
extern BOOL hb_ads_bTestRecLocks;
extern ADSHANDLE hb_ads_hConnect;
extern ERRCODE hb_adsCloseCursor( ADSAREAP pArea );
extern HB_ERRCODE hb_adsCloseCursor( ADSAREAP pArea );
extern ADSAREAP hb_adsGetWorkAreaPointer( void );
#ifdef ADS_USE_OEM_TRANSLATION

View File

@@ -81,8 +81,8 @@
#define MAX_FIELD_NAME 64
#define SQLDD_ROWSET_INIT 256
#define SQLDD_ROWSET_RESIZE 64
#define SQLDD_ROWSET_INIT 256
#define SQLDD_ROWSET_RESIZE 64
#define SQLDD_FLAG_DELETED 1
#define SQLDD_FLAG_CACHED 2
@@ -122,16 +122,16 @@ typedef struct _SQLBASEAREA
ULONG ulConnection;
struct _SQLDDCONNECTION* pConnection;
struct _SDDNODE* pSDD;
struct _SDDNODE* pSDD;
char* szQuery; /* SQL query */
ULONG ulRecNo; /* Current record number */
ULONG ulRecCount; /* Total records */
ULONG ulRecMax; /* Size of pRow, pRowFlags buffer */
void** pRow; /* array of native pointers or cached PHB_ITEM */
BYTE* pRowFlags;
BYTE* pRowFlags;
void* pRecord;
BYTE bRecordFlags;
@@ -140,8 +140,8 @@ typedef struct _SQLBASEAREA
void* pStmt; /* SQL statement */
void* pTrans; /* SQL transaction */
void* pNatRecord;
void* pNatLength;
void* pNatRecord;
void* pNatLength;
BOOL fFetched;
BOOL fPositioned;
@@ -209,24 +209,24 @@ typedef struct _MIXTAG
char* szForExpr;
PHB_ITEM pKeyItem;
PHB_ITEM pForItem;
BYTE bType;
UINT uiKeyLen; /* Length of key */
UINT uiTotalLen; /* Total length of key structure */
BOOL fEof;
BOOL fBof;
BOOL fCustom;
PMIXNODE Root;
PMIXKEY CurKey;
PMIXNODE CurNode;
UINT CurPos;
PMIXKEY HotKey;
BOOL HotFor;
BYTE* pSortTable; /* National sorttable for character key tags, NULL otherwise */
} MIXTAG, *PMIXTAG;
@@ -265,16 +265,16 @@ typedef struct _SQLMIXAREA
ULONG ulConnection;
struct _SQLDDCONNECTION* pConnection;
struct _SDDNODE* pSDD;
struct _SDDNODE* pSDD;
char* szQuery; /* SQL query */
ULONG ulRecNo; /* Current record number */
ULONG ulRecCount; /* Total records */
ULONG ulRecMax; /* Size of pRow, pRowFlags buffer */
void** pRow; /* array of native pointers or cached PHB_ITEM */
BYTE* pRowFlags;
BYTE* pRowFlags;
void* pRecord;
BYTE bRecordFlags;
@@ -283,8 +283,8 @@ typedef struct _SQLMIXAREA
void* pStmt; /* SQL statement */
void* pTrans; /* SQL transaction */
void* pNatRecord;
void* pNatLength;
void* pNatRecord;
void* pNatLength;
BOOL fFetched;
BOOL fPositioned;
@@ -309,14 +309,14 @@ typedef struct _SQLMIXAREA
====================================================================
*/
typedef ERRCODE (* SDDFUNC_CONNECT )( SQLDDCONNECTION* pConnection, PHB_ITEM pItem );
typedef ERRCODE (* SDDFUNC_DISCONNECT )( SQLDDCONNECTION* pConnection );
typedef ERRCODE (* SDDFUNC_EXECUTE )( SQLDDCONNECTION* pConnection, PHB_ITEM pItem );
typedef ERRCODE (* SDDFUNC_OPEN )( SQLBASEAREAP pArea );
typedef ERRCODE (* SDDFUNC_CLOSE )( SQLBASEAREAP pArea );
typedef ERRCODE (* SDDFUNC_GOTO )( SQLBASEAREAP pArea, ULONG ulRecNo );
typedef ERRCODE (* SDDFUNC_GETVALUE )( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem );
typedef ERRCODE (* SDDFUNC_GETVARLEN )( SQLBASEAREAP pArea, USHORT uiIndex, ULONG * pLength );
typedef HB_ERRCODE (* SDDFUNC_CONNECT )( SQLDDCONNECTION* pConnection, PHB_ITEM pItem );
typedef HB_ERRCODE (* SDDFUNC_DISCONNECT )( SQLDDCONNECTION* pConnection );
typedef HB_ERRCODE (* SDDFUNC_EXECUTE )( SQLDDCONNECTION* pConnection, PHB_ITEM pItem );
typedef HB_ERRCODE (* SDDFUNC_OPEN )( SQLBASEAREAP pArea );
typedef HB_ERRCODE (* SDDFUNC_CLOSE )( SQLBASEAREAP pArea );
typedef HB_ERRCODE (* SDDFUNC_GOTO )( SQLBASEAREAP pArea, ULONG ulRecNo );
typedef HB_ERRCODE (* SDDFUNC_GETVALUE )( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem );
typedef HB_ERRCODE (* SDDFUNC_GETVARLEN )( SQLBASEAREAP pArea, USHORT uiIndex, ULONG * pLength );
typedef struct _SDDNODE

View File

@@ -65,14 +65,14 @@
#define DIALECT 1
static ERRCODE fbConnect( SQLDDCONNECTION* pConnection, PHB_ITEM pItem );
static ERRCODE fbDisconnect( SQLDDCONNECTION* pConnection );
static ERRCODE fbExecute( SQLDDCONNECTION* pConnection, PHB_ITEM pItem );
static ERRCODE fbOpen( SQLBASEAREAP pArea );
static ERRCODE fbClose( SQLBASEAREAP pArea );
static ERRCODE fbGoTo( SQLBASEAREAP pArea, ULONG ulRecNo );
static ERRCODE fbGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem );
static ERRCODE fbGetVarLen( SQLBASEAREAP pArea, USHORT uiIndex, ULONG * pLength );
static HB_ERRCODE fbConnect( SQLDDCONNECTION* pConnection, PHB_ITEM pItem );
static HB_ERRCODE fbDisconnect( SQLDDCONNECTION* pConnection );
static HB_ERRCODE fbExecute( SQLDDCONNECTION* pConnection, PHB_ITEM pItem );
static HB_ERRCODE fbOpen( SQLBASEAREAP pArea );
static HB_ERRCODE fbClose( SQLBASEAREAP pArea );
static HB_ERRCODE fbGoTo( SQLBASEAREAP pArea, ULONG ulRecNo );
static HB_ERRCODE fbGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem );
static HB_ERRCODE fbGetVarLen( SQLBASEAREAP pArea, USHORT uiIndex, ULONG * pLength );
static SDDNODE firebirddd = {
@@ -152,7 +152,7 @@ static USHORT hb_errRT_FireBirdDD( ULONG ulGenCode, ULONG ulSubCode, const char
/* ============= SDD METHODS ============================================================= */
static ERRCODE fbConnect( SQLDDCONNECTION* pConnection, PHB_ITEM pItem )
static HB_ERRCODE fbConnect( SQLDDCONNECTION* pConnection, PHB_ITEM pItem )
{
ISC_STATUS status[ 5 ];
isc_db_handle db = NULL;
@@ -177,35 +177,35 @@ static ERRCODE fbConnect( SQLDDCONNECTION* pConnection, PHB_ITEM pItem )
memcpy( parambuf + i, hb_arrayGetCPtr( pItem, 4 ), ul );
i += ul;
if ( isc_attach_database( status, hb_arrayGetCLen( pItem, 5 ), hb_arrayGetCPtr( pItem, 5 ),
if ( isc_attach_database( status, hb_arrayGetCLen( pItem, 5 ), hb_arrayGetCPtr( pItem, 5 ),
& db, (short) i, parambuf ) )
{
/* TODO: error code in status[1]; */
return FAILURE;
return HB_FAILURE;
}
pConnection->hConnection = (void*) db;
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE fbDisconnect( SQLDDCONNECTION* pConnection )
static HB_ERRCODE fbDisconnect( SQLDDCONNECTION* pConnection )
{
ISC_STATUS status[ 5 ];
isc_detach_database( status, (isc_db_handle*) &pConnection->hConnection );
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE fbExecute( SQLDDCONNECTION* pConnection, PHB_ITEM pItem )
static HB_ERRCODE fbExecute( SQLDDCONNECTION* pConnection, PHB_ITEM pItem )
{
HB_SYMBOL_UNUSED( pConnection );
HB_SYMBOL_UNUSED( pItem );
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE fbOpen( SQLBASEAREAP pArea )
static HB_ERRCODE fbOpen( SQLBASEAREAP pArea )
{
ISC_STATUS status[ 5 ];
isc_tr_handle pTrans = NULL;
@@ -223,7 +223,7 @@ static ERRCODE fbOpen( SQLBASEAREAP pArea )
if ( isc_start_transaction ( status, &pTrans, 1, (isc_db_handle*) &pArea->pConnection->hConnection, 0, NULL ) )
{
hb_errRT_FireBirdDD( EG_OPEN, ESQLDD_START, "Start transaction failed", NULL, status[ 1 ] );
return FAILURE;
return HB_FAILURE;
}
pSqlda = (XSQLDA*) hb_xgrab( XSQLDA_LENGTH( 1 ) );
@@ -235,7 +235,7 @@ static ERRCODE fbOpen( SQLBASEAREAP pArea )
hb_errRT_FireBirdDD( EG_OPEN, ESQLDD_STMTALLOC, "Allocate statement failed", NULL, status[ 1 ] );
isc_rollback_transaction( status, &pTrans );
hb_xfree( pSqlda );
return FAILURE;
return HB_FAILURE;
}
if ( isc_dsql_prepare( status, &pTrans, &pStmt, 0, pArea->szQuery, DIALECT, pSqlda ) )
@@ -244,7 +244,7 @@ static ERRCODE fbOpen( SQLBASEAREAP pArea )
isc_dsql_free_statement( status, &pStmt, DSQL_drop );
isc_rollback_transaction( status, &pTrans );
hb_xfree( pSqlda );
return FAILURE;
return HB_FAILURE;
}
if ( pSqlda->sqld > pSqlda->sqln ) {
@@ -260,7 +260,7 @@ static ERRCODE fbOpen( SQLBASEAREAP pArea )
isc_dsql_free_statement( status, &pStmt, DSQL_drop );
isc_rollback_transaction( status, &pTrans );
hb_xfree( pSqlda );
return FAILURE;
return HB_FAILURE;
}
}
@@ -283,7 +283,7 @@ static ERRCODE fbOpen( SQLBASEAREAP pArea )
pFieldInfo.uiDec = 0;
iType = pVar->sqltype & ~1;
switch ( iType )
switch ( iType )
{
case SQL_TEXT:
pFieldInfo.uiType = HB_FT_STRING;
@@ -331,7 +331,7 @@ static ERRCODE fbOpen( SQLBASEAREAP pArea )
break;
}
if ( pVar->sqltype & 1 )
if ( pVar->sqltype & 1 )
pVar->sqlind = (short*) hb_xgrab( sizeof( short ) );
if ( ! bError )
@@ -390,7 +390,7 @@ static ERRCODE fbOpen( SQLBASEAREAP pArea )
}
*/
if ( ! bError )
bError = ( SELF_ADDFIELD( (AREAP) pArea, &pFieldInfo ) == FAILURE );
bError = ( SELF_ADDFIELD( (AREAP) pArea, &pFieldInfo ) == HB_FAILURE );
}
if ( bError )
@@ -408,7 +408,7 @@ static ERRCODE fbOpen( SQLBASEAREAP pArea )
hb_itemClear( pItemEof );
hb_itemRelease( pItemEof );
hb_errRT_FireBirdDD( EG_CORRUPTION, ESQLDD_INVALIDFIELD, "Invalid field type", pArea->szQuery, 0 );
return FAILURE;
return HB_FAILURE;
}
pArea->ulRecCount = 0;
@@ -421,11 +421,11 @@ static ERRCODE fbOpen( SQLBASEAREAP pArea )
* pArea->pRow = pItemEof;
pArea->pRowFlags[ 0 ] = SQLDD_FLAG_CACHED;
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE fbClose( SQLBASEAREAP pArea )
static HB_ERRCODE fbClose( SQLBASEAREAP pArea )
{
ISC_STATUS status[ 5 ];
@@ -445,11 +445,11 @@ static ERRCODE fbClose( SQLBASEAREAP pArea )
isc_rollback_transaction( status, &pArea->pTrans );
pArea->pTrans = NULL;
}
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE fbGoTo( SQLBASEAREAP pArea, ULONG ulRecNo )
static HB_ERRCODE fbGoTo( SQLBASEAREAP pArea, ULONG ulRecNo )
{
ISC_STATUS status[ 5 ];
XSQLVAR* pVar;
@@ -470,7 +470,7 @@ static ERRCODE fbGoTo( SQLBASEAREAP pArea, ULONG ulRecNo )
pVar = (XSQLVAR *) pArea->pResult;
pVar += ( ui - 1 );
if ( ( pVar->sqltype & 1 ) && ( * pVar->sqlind < 0 ) )
if ( ( pVar->sqltype & 1 ) && ( * pVar->sqlind < 0 ) )
continue; /* NIL value */
iType = pVar->sqltype;
@@ -525,14 +525,14 @@ static ERRCODE fbGoTo( SQLBASEAREAP pArea, ULONG ulRecNo )
if ( isc_dsql_free_statement( status, & pArea->pStmt, DSQL_drop ) )
{
hb_errRT_FireBirdDD( EG_OPEN, ESQLDD_STMTFREE, "Statement free error", NULL, status[ 1 ] );
return FAILURE;
return HB_FAILURE;
}
pArea->pStmt = NULL;
if ( isc_commit_transaction( status, & pArea->pTrans ) )
{
hb_errRT_FireBirdDD( EG_OPEN, ESQLDD_COMMIT, "Transaction commit error", NULL, status[ 1 ] );
return FAILURE;
return HB_FAILURE;
}
pArea->pTrans = NULL;
@@ -543,7 +543,7 @@ static ERRCODE fbGoTo( SQLBASEAREAP pArea, ULONG ulRecNo )
else
{
hb_errRT_FireBirdDD( EG_OPEN, ESQLDD_FETCH, "Fetch error", NULL, ( USHORT ) lErr );
return FAILURE;
return HB_FAILURE;
}
}
@@ -559,23 +559,23 @@ static ERRCODE fbGoTo( SQLBASEAREAP pArea, ULONG ulRecNo )
pArea->bRecordFlags = pArea->pRowFlags[ ulRecNo ];
pArea->fPositioned = TRUE;
}
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE fbGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
static HB_ERRCODE fbGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
{
HB_SYMBOL_UNUSED( pArea );
HB_SYMBOL_UNUSED( uiIndex );
HB_SYMBOL_UNUSED( pItem );
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE fbGetVarLen( SQLBASEAREAP pArea, USHORT uiIndex, ULONG * pLength )
static HB_ERRCODE fbGetVarLen( SQLBASEAREAP pArea, USHORT uiIndex, ULONG * pLength )
{
HB_SYMBOL_UNUSED( pArea );
HB_SYMBOL_UNUSED( uiIndex );
HB_SYMBOL_UNUSED( pLength );
return SUCCESS;
return HB_SUCCESS;
}

View File

@@ -88,14 +88,14 @@ typedef int my_socket;
#endif
static ERRCODE mysqlConnect( SQLDDCONNECTION* pConnection, PHB_ITEM pItem );
static ERRCODE mysqlDisconnect( SQLDDCONNECTION* pConnection );
static ERRCODE mysqlExecute( SQLDDCONNECTION* pConnection, PHB_ITEM pItem );
static ERRCODE mysqlOpen( SQLBASEAREAP pArea );
static ERRCODE mysqlClose( SQLBASEAREAP pArea );
static ERRCODE mysqlGoTo( SQLBASEAREAP pArea, ULONG ulRecNo );
static ERRCODE mysqlGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem );
static ERRCODE mysqlGetVarLen( SQLBASEAREAP pArea, USHORT uiIndex, ULONG * pLength );
static HB_ERRCODE mysqlConnect( SQLDDCONNECTION* pConnection, PHB_ITEM pItem );
static HB_ERRCODE mysqlDisconnect( SQLDDCONNECTION* pConnection );
static HB_ERRCODE mysqlExecute( SQLDDCONNECTION* pConnection, PHB_ITEM pItem );
static HB_ERRCODE mysqlOpen( SQLBASEAREAP pArea );
static HB_ERRCODE mysqlClose( SQLBASEAREAP pArea );
static HB_ERRCODE mysqlGoTo( SQLBASEAREAP pArea, ULONG ulRecNo );
static HB_ERRCODE mysqlGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem );
static HB_ERRCODE mysqlGetVarLen( SQLBASEAREAP pArea, USHORT uiIndex, ULONG * pLength );
static SDDNODE mysqldd =
@@ -176,36 +176,36 @@ static USHORT hb_errRT_MySQLDD( ULONG ulGenCode, ULONG ulSubCode, const char * s
/*============= SDD METHODS =============================================================*/
static ERRCODE mysqlConnect( SQLDDCONNECTION* pConnection, PHB_ITEM pItem )
static HB_ERRCODE mysqlConnect( SQLDDCONNECTION* pConnection, PHB_ITEM pItem )
{
MYSQL* pMySql;
/* TraceLog( NULL, "mysqlConnect type:%04X s2:%s s3:%s s4:%s s5:%s\n", pItem->type, hb_arrayGetCPtr( pItem, 2 ), hb_arrayGetCPtr( pItem, 3 ), hb_arrayGetCPtr( pItem, 4 ), hb_arrayGetCPtr( pItem, 5 ) ); */
pMySql = mysql_init( NULL );
if ( ! mysql_real_connect( pMySql, hb_arrayGetCPtr( pItem, 2 ), hb_arrayGetCPtr( pItem, 3 ), hb_arrayGetCPtr( pItem, 4 ),
hb_arrayGetCPtr( pItem, 5 ), 0 /* port */, NULL /* pipe */, 0 /* flags*/ ) )
if ( ! mysql_real_connect( pMySql, hb_arrayGetCPtr( pItem, 2 ), hb_arrayGetCPtr( pItem, 3 ), hb_arrayGetCPtr( pItem, 4 ),
hb_arrayGetCPtr( pItem, 5 ), 0 /* port */, NULL /* pipe */, 0 /* flags*/ ) )
{
mysql_close( pMySql );
return FAILURE;
return HB_FAILURE;
}
pConnection->hConnection = (void*) pMySql;
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE mysqlDisconnect( SQLDDCONNECTION* pConnection )
static HB_ERRCODE mysqlDisconnect( SQLDDCONNECTION* pConnection )
{
mysql_close( ( MYSQL * ) pConnection->hConnection );
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE mysqlExecute( SQLDDCONNECTION* pConnection, PHB_ITEM pItem )
static HB_ERRCODE mysqlExecute( SQLDDCONNECTION* pConnection, PHB_ITEM pItem )
{
MYSQL_RES* pResult;
if ( mysql_real_query( (MYSQL*) pConnection->hConnection, hb_itemGetCPtr( pItem ), hb_itemGetCLen( pItem ) ) )
if ( mysql_real_query( (MYSQL*) pConnection->hConnection, hb_itemGetCPtr( pItem ), hb_itemGetCLen( pItem ) ) )
{
const char* szError;
@@ -216,7 +216,7 @@ static ERRCODE mysqlExecute( SQLDDCONNECTION* pConnection, PHB_ITEM pItem )
else
pConnection->szError = ( char * ) hb_xgrab( strlen( szError ) + 1 );
hb_strncpy( pConnection->szError, szError, strlen( szError ) );
return FAILURE;
return HB_FAILURE;
}
pResult = mysql_store_result( (MYSQL*) pConnection->hConnection );
@@ -231,12 +231,12 @@ static ERRCODE mysqlExecute( SQLDDCONNECTION* pConnection, PHB_ITEM pItem )
{
pConnection->ulAffectedRows = (ULONG) mysql_affected_rows( (MYSQL*) pConnection->hConnection );
if ( mysql_insert_id( (MYSQL*) pConnection->hConnection ) != 0 )
hb_itemPutNInt( pConnection->pNewID, mysql_insert_id( (MYSQL*) pConnection->hConnection ) );
hb_itemPutNInt( pConnection->pNewID, mysql_insert_id( (MYSQL*) pConnection->hConnection ) );
}
else /* error */
{
const char* szError;
pConnection->iError = (int) mysql_errno( (MYSQL*) pConnection->hConnection );
szError = mysql_error( (MYSQL*) pConnection->hConnection );
if ( pConnection->szError )
@@ -244,14 +244,14 @@ static ERRCODE mysqlExecute( SQLDDCONNECTION* pConnection, PHB_ITEM pItem )
else
pConnection->szError = ( char * ) hb_xgrab( strlen( szError ) + 1 );
hb_strncpy( pConnection->szError, szError, strlen( szError ) );
return FAILURE;
return HB_FAILURE;
}
}
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE mysqlOpen( SQLBASEAREAP pArea )
static HB_ERRCODE mysqlOpen( SQLBASEAREAP pArea )
{
PHB_ITEM pItemEof, pItem;
ULONG ulIndex;
@@ -261,41 +261,41 @@ static ERRCODE mysqlOpen( SQLBASEAREAP pArea )
DBFIELDINFO pFieldInfo;
MYSQL_FIELD* pMyField;
void** pRow;
if ( mysql_real_query( (MYSQL*) pArea->pConnection->hConnection, pArea->szQuery, strlen( pArea->szQuery ) ) )
if ( mysql_real_query( (MYSQL*) pArea->pConnection->hConnection, pArea->szQuery, strlen( pArea->szQuery ) ) )
{
hb_errRT_MySQLDD( EG_OPEN, ESQLDD_INVALIDQUERY, (char*) mysql_error( (MYSQL*) pArea->pConnection->hConnection ), pArea->szQuery,
hb_errRT_MySQLDD( EG_OPEN, ESQLDD_INVALIDQUERY, (char*) mysql_error( (MYSQL*) pArea->pConnection->hConnection ), pArea->szQuery,
mysql_errno( (MYSQL*) pArea->pConnection->hConnection ) );
return FAILURE;
return HB_FAILURE;
}
if ( ( pArea->pResult = mysql_store_result( (MYSQL*) pArea->pConnection->hConnection ) ) == NULL )
if ( ( pArea->pResult = mysql_store_result( (MYSQL*) pArea->pConnection->hConnection ) ) == NULL )
{
hb_errRT_MySQLDD( EG_MEM, ESQLDD_INVALIDQUERY, (char*) mysql_error( (MYSQL*) pArea->pConnection->hConnection ), pArea->szQuery,
hb_errRT_MySQLDD( EG_MEM, ESQLDD_INVALIDQUERY, (char*) mysql_error( (MYSQL*) pArea->pConnection->hConnection ), pArea->szQuery,
mysql_errno( (MYSQL*) pArea->pConnection->hConnection ) );
return FAILURE;
return HB_FAILURE;
}
uiFields = mysql_num_fields( (MYSQL_RES*) pArea->pResult );
SELF_SETFIELDEXTENT( (AREAP) pArea, uiFields );
pItemEof = hb_itemArrayNew( uiFields );
pBuffer = (BYTE*) hb_xgrab( 256 );
bError = FALSE;
for ( uiCount = 0; uiCount < uiFields; uiCount++ )
{
pMyField = mysql_fetch_field_direct( (MYSQL_RES*) pArea->pResult, uiCount );
hb_strncpy( ( char * ) pBuffer, pMyField->name, 256 - 1 );
pFieldInfo.atomName = pBuffer;
pFieldInfo.atomName[ MAX_FIELD_NAME ] = '\0';
hb_strUpper( (char *) pFieldInfo.atomName, MAX_FIELD_NAME + 1 );
pFieldInfo.uiLen = pMyField->length;
pFieldInfo.uiDec = 0;
switch( pMyField->type )
{
case MYSQL_TYPE_TINY:
@@ -308,7 +308,7 @@ static ERRCODE mysqlOpen( SQLBASEAREAP pArea )
case MYSQL_TYPE_INT24:
pFieldInfo.uiType = HB_FT_LONG;
break;
case MYSQL_TYPE_DECIMAL:
case MYSQL_TYPE_NEWDECIMAL:
case MYSQL_TYPE_FLOAT:
@@ -316,25 +316,25 @@ static ERRCODE mysqlOpen( SQLBASEAREAP pArea )
pFieldInfo.uiType = HB_FT_DOUBLE;
pFieldInfo.uiDec = pMyField->decimals;
break;
case MYSQL_TYPE_STRING:
case MYSQL_TYPE_VAR_STRING:
case MYSQL_TYPE_ENUM:
case MYSQL_TYPE_DATETIME:
pFieldInfo.uiType = HB_FT_STRING;
break;
case MYSQL_TYPE_DATE:
pFieldInfo.uiType = HB_FT_DATE;
break;
case MYSQL_TYPE_TINY_BLOB:
case MYSQL_TYPE_MEDIUM_BLOB:
case MYSQL_TYPE_LONG_BLOB:
case MYSQL_TYPE_BLOB:
pFieldInfo.uiType = HB_FT_MEMO;
break;
/*
case MYSQL_TYPE_TIMESTAMP:
case MYSQL_TYPE_TIME:
@@ -351,7 +351,7 @@ static ERRCODE mysqlOpen( SQLBASEAREAP pArea )
pFieldInfo.uiType = 0;
break;
}
if ( ! bError )
{
switch ( pFieldInfo.uiType )
@@ -404,22 +404,22 @@ static ERRCODE mysqlOpen( SQLBASEAREAP pArea )
}*/
if ( ! bError )
bError = ( SELF_ADDFIELD( (AREAP) pArea, &pFieldInfo ) == FAILURE );
bError = ( SELF_ADDFIELD( (AREAP) pArea, &pFieldInfo ) == HB_FAILURE );
}
if ( bError )
break;
}
hb_xfree( pBuffer );
if ( bError )
{
hb_itemRelease( pItemEof );
hb_errRT_MySQLDD( EG_CORRUPTION, ESQLDD_INVALIDFIELD, "Invalid field type", pArea->szQuery, uiError );
return FAILURE;
return HB_FAILURE;
}
pArea->ulRecCount = (ULONG) mysql_num_rows( (MYSQL_RES*) pArea->pResult );
pArea->pRow = (void**) hb_xgrab( ( pArea->ulRecCount + 1 ) * sizeof( void* ) );
@@ -433,26 +433,26 @@ static ERRCODE mysqlOpen( SQLBASEAREAP pArea )
pArea->pRowFlags[ 0 ] = SQLDD_FLAG_CACHED;
pRow++;
for ( ulIndex = 1; ulIndex <= pArea->ulRecCount; ulIndex++ )
for ( ulIndex = 1; ulIndex <= pArea->ulRecCount; ulIndex++ )
{
*pRow++ = (void*) mysql_row_tell( (MYSQL_RES*) pArea->pResult );
mysql_fetch_row( (MYSQL_RES*) pArea->pResult );
}
pArea->fFetched = 1;
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE mysqlClose( SQLBASEAREAP pArea )
static HB_ERRCODE mysqlClose( SQLBASEAREAP pArea )
{
if ( pArea->pResult )
mysql_free_result( (MYSQL_RES*) pArea->pResult );
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE mysqlGoTo( SQLBASEAREAP pArea, ULONG ulRecNo )
static HB_ERRCODE mysqlGoTo( SQLBASEAREAP pArea, ULONG ulRecNo )
{
if ( ulRecNo <= 0 || ulRecNo > pArea->ulRecCount )
{
@@ -475,11 +475,11 @@ static ERRCODE mysqlGoTo( SQLBASEAREAP pArea, ULONG ulRecNo )
pArea->fPositioned = TRUE;
}
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE mysqlGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
static HB_ERRCODE mysqlGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
{
LPFIELD pField;
char* pValue;
@@ -494,34 +494,34 @@ static ERRCODE mysqlGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem
pValue = ( (MYSQL_ROW) ( pArea->pNatRecord ) ) [ uiIndex ];
ulLen = ( (unsigned long*) ( pArea->pNatLength ) ) [ uiIndex ];
/* NULL => NIL (?) */
if ( ! pValue )
{
hb_itemClear( pItem );
return SUCCESS;
return HB_SUCCESS;
}
switch( pField->uiType )
{
case HB_FT_STRING:
case HB_FT_STRING:
{
#if 0
#if 0
char* pStr;
/* Do NOT trim strings */
pStr = (char*) hb_xgrab( pField->uiLen + 1 );
if ( pValue )
if ( pValue )
memcpy( pStr, pValue, ulLen );
if ( (ULONG)pField->uiLen > ulLen )
if ( (ULONG)pField->uiLen > ulLen )
memset( pStr + ulLen, ' ', pField->uiLen - ulLen );
pStr[ pField->uiLen ] = '\0';
hb_itemPutCRaw( pItem, pStr, pField->uiLen );
#else
/* Trim strings */
if ( pValue )
if ( pValue )
hb_itemPutCL( pItem, pValue, ulLen );
else
hb_itemPutCL( pItem, "", 0 );
@@ -530,21 +530,21 @@ static ERRCODE mysqlGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem
}
case HB_FT_MEMO:
if ( pValue )
if ( pValue )
hb_itemPutCL( pItem, pValue, ulLen );
else
hb_itemPutCL( pItem, "", 0 );
hb_itemSetCMemo( pItem );
break;
case HB_FT_INTEGER:
case HB_FT_LONG:
case HB_FT_DOUBLE:
if ( pValue )
if ( pValue )
{
hb_strncpy( szBuffer, pValue, sizeof( szBuffer ) - 1 );
if ( pField->uiDec )
{
hb_itemPutNDLen( pItem, atof( szBuffer ),
@@ -553,22 +553,22 @@ static ERRCODE mysqlGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem
}
else
hb_itemPutNLLen( pItem, atol( szBuffer ), (int) pField->uiLen );
}
else
}
else
{
if ( pField->uiDec )
hb_itemPutNDLen( pItem, 0.0,
(int) pField->uiLen - ( (int) pField->uiDec + 1 ),
(int) pField->uiDec );
else
else
hb_itemPutNLLen( pItem, 0, (int) pField->uiLen );
}
break;
case HB_FT_DATE:
case HB_FT_DATE:
{
char szDate[ 9 ];
szDate[ 0 ] = pValue[ 0 ];
szDate[ 1 ] = pValue[ 1 ];
szDate[ 2 ] = pValue[ 2 ];
@@ -591,20 +591,20 @@ static ERRCODE mysqlGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem
{
pError = hb_errNew();
hb_errPutGenCode( pError, EG_DATATYPE );
hb_errPutDescription( pError, hb_langDGetErrorDesc( EG_DATATYPE ) );
hb_errPutDescription( pError, hb_langDGetErrorDesc( EG_DATATYPE ) );
hb_errPutSubCode( pError, EDBF_DATATYPE );
SELF_ERROR( ( AREAP ) pArea, pError );
hb_itemRelease( pError );
return FAILURE;
return HB_FAILURE;
}
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE mysqlGetVarLen( SQLBASEAREAP pArea, USHORT uiIndex, ULONG * pLength )
static HB_ERRCODE mysqlGetVarLen( SQLBASEAREAP pArea, USHORT uiIndex, ULONG * pLength )
{
HB_SYMBOL_UNUSED( pArea );
HB_SYMBOL_UNUSED( uiIndex );
HB_SYMBOL_UNUSED( pLength );
return SUCCESS;
return HB_SUCCESS;
}

View File

@@ -75,7 +75,7 @@
#define CIDROID 650
#define FLOAT4OID 700
#define FLOAT8OID 701
#define CASHOID 790
#define CASHOID 790
#define MACADDROID 829
#define INETOID 869
#define BPCHAROID 1042
@@ -90,14 +90,14 @@
#define NUMERICOID 1700
static ERRCODE pgsqlConnect( SQLDDCONNECTION* pConnection, PHB_ITEM pItem );
static ERRCODE pgsqlDisconnect( SQLDDCONNECTION* pConnection );
static ERRCODE pgsqlExecute( SQLDDCONNECTION* pConnection, PHB_ITEM pItem );
static ERRCODE pgsqlOpen( SQLBASEAREAP pArea );
static ERRCODE pgsqlClose( SQLBASEAREAP pArea );
static ERRCODE pgsqlGoTo( SQLBASEAREAP pArea, ULONG ulRecNo );
static ERRCODE pgsqlGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem );
static ERRCODE pgsqlGetVarLen( SQLBASEAREAP pArea, USHORT uiIndex, ULONG * pLength );
static HB_ERRCODE pgsqlConnect( SQLDDCONNECTION* pConnection, PHB_ITEM pItem );
static HB_ERRCODE pgsqlDisconnect( SQLDDCONNECTION* pConnection );
static HB_ERRCODE pgsqlExecute( SQLDDCONNECTION* pConnection, PHB_ITEM pItem );
static HB_ERRCODE pgsqlOpen( SQLBASEAREAP pArea );
static HB_ERRCODE pgsqlClose( SQLBASEAREAP pArea );
static HB_ERRCODE pgsqlGoTo( SQLBASEAREAP pArea, ULONG ulRecNo );
static HB_ERRCODE pgsqlGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem );
static HB_ERRCODE pgsqlGetVarLen( SQLBASEAREAP pArea, USHORT uiIndex, ULONG * pLength );
static SDDNODE pgsqldd = {
@@ -178,7 +178,7 @@ static USHORT hb_errRT_PostgreSQLDD( ULONG ulGenCode, ULONG ulSubCode, const cha
/* ============= SDD METHODS ============================================================= */
static ERRCODE pgsqlConnect( SQLDDCONNECTION* pConnection, PHB_ITEM pItem )
static HB_ERRCODE pgsqlConnect( SQLDDCONNECTION* pConnection, PHB_ITEM pItem )
{
PGconn* pConn;
ConnStatusType status;
@@ -187,29 +187,29 @@ static ERRCODE pgsqlConnect( SQLDDCONNECTION* pConnection, PHB_ITEM pItem )
if ( ! pConn ) /* Low memory, etc */
{
return FAILURE;
}
return HB_FAILURE;
}
status = PQstatus( pConn );
if ( status != CONNECTION_OK )
{
PQfinish( pConn );
return FAILURE;
return HB_FAILURE;
}
pConnection->hConnection = (void*) pConn;
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE pgsqlDisconnect( SQLDDCONNECTION* pConnection )
static HB_ERRCODE pgsqlDisconnect( SQLDDCONNECTION* pConnection )
{
if ( ! pConnection->hConnection )
return FAILURE;
return HB_FAILURE;
PQfinish( (PGconn *) pConnection->hConnection );
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE pgsqlExecute( SQLDDCONNECTION* pConnection, PHB_ITEM pItem )
static HB_ERRCODE pgsqlExecute( SQLDDCONNECTION* pConnection, PHB_ITEM pItem )
{
char* szQuery;
int iTuples;
@@ -219,14 +219,14 @@ static ERRCODE pgsqlExecute( SQLDDCONNECTION* pConnection, PHB_ITEM pItem )
if ( ! pConnection->hConnection || ! szQuery )
{
hb_itemClear( pItem );
return FAILURE;
return HB_FAILURE;
}
pResult = PQexec( (PGconn *) pConnection->hConnection, szQuery );
if ( ! pResult )
{
{
hb_itemClear( pItem );
return FAILURE;
return HB_FAILURE;
}
iTuples = PQntuples( pResult );
@@ -238,11 +238,11 @@ static ERRCODE pgsqlExecute( SQLDDCONNECTION* pConnection, PHB_ITEM pItem )
/* printf( "pgsqlExecute PQoidValue=%d [%s]\n", (int) PQoidValue( pResult ), PQoidStatus( pResult ) ); */
}
PQclear( pResult );
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE pgsqlOpen( SQLBASEAREAP pArea )
static HB_ERRCODE pgsqlOpen( SQLBASEAREAP pArea )
{
PGresult* pResult;
ExecStatusType status;
@@ -257,14 +257,14 @@ static ERRCODE pgsqlOpen( SQLBASEAREAP pArea )
if ( ! pResult )
{
hb_errRT_PostgreSQLDD( EG_OPEN, ESQLDD_LOWMEMORY, "Query failed", NULL, 0 ); /* Low memory, etc */
return FAILURE;
return HB_FAILURE;
}
status = PQresultStatus( pResult );
if ( status != PGRES_TUPLES_OK && status != PGRES_COMMAND_OK )
{
hb_errRT_PostgreSQLDD( EG_OPEN, ESQLDD_INVALIDQUERY, PQresultErrorMessage( pResult ), pArea->szQuery, status );
return FAILURE;
return HB_FAILURE;
}
pArea->pResult = pResult;
@@ -437,7 +437,7 @@ static ERRCODE pgsqlOpen( SQLBASEAREAP pArea )
} */
if ( ! bError )
bError = ( SELF_ADDFIELD( (AREAP) pArea, &pFieldInfo ) == FAILURE );
bError = ( SELF_ADDFIELD( (AREAP) pArea, &pFieldInfo ) == HB_FAILURE );
}
if ( bError )
@@ -451,7 +451,7 @@ static ERRCODE pgsqlOpen( SQLBASEAREAP pArea )
hb_itemClear( pItemEof );
hb_itemRelease( pItemEof );
hb_errRT_PostgreSQLDD( EG_CORRUPTION, ESQLDD_INVALIDFIELD, "Invalid field type", pArea->szQuery, 0 );
return FAILURE;
return HB_FAILURE;
}
pArea->ulRecCount = (ULONG) PQntuples( pResult );
@@ -464,19 +464,19 @@ static ERRCODE pgsqlOpen( SQLBASEAREAP pArea )
pArea->pRowFlags[ 0 ] = SQLDD_FLAG_CACHED;
pArea->fFetched = 1;
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE pgsqlClose( SQLBASEAREAP pArea )
static HB_ERRCODE pgsqlClose( SQLBASEAREAP pArea )
{
if ( pArea->pResult )
PQclear( (PGresult *) pArea->pResult );
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE pgsqlGoTo( SQLBASEAREAP pArea, ULONG ulRecNo )
static HB_ERRCODE pgsqlGoTo( SQLBASEAREAP pArea, ULONG ulRecNo )
{
if ( ulRecNo <= 0 || ulRecNo > pArea->ulRecCount )
{
@@ -492,11 +492,11 @@ static ERRCODE pgsqlGoTo( SQLBASEAREAP pArea, ULONG ulRecNo )
pArea->fPositioned = TRUE;
}
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE pgsqlGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
static HB_ERRCODE pgsqlGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
{
LPFIELD pField;
char* pValue;
@@ -509,7 +509,7 @@ static ERRCODE pgsqlGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem
pField = pArea->lpFields + uiIndex;
if ( PQgetisnull( (PGresult *) pArea->pResult, pArea->ulRecNo - 1, uiIndex ) )
return SUCCESS;
return HB_SUCCESS;
pValue = PQgetvalue( (PGresult *) pArea->pResult, pArea->ulRecNo - 1, uiIndex );
ulLen = (ULONG) PQgetlength( (PGresult *) pArea->pResult, pArea->ulRecNo - 1, uiIndex );
@@ -518,7 +518,7 @@ static ERRCODE pgsqlGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem
switch( pField->uiType )
{
case HB_FT_STRING:
case HB_FT_STRING:
hb_itemPutCL( pItem, pValue, ulLen );
break;
@@ -537,12 +537,12 @@ static ERRCODE pgsqlGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem
hb_itemPutNLLen( pItem, atol( pValue ), (int) pField->uiLen );
break;
case HB_FT_LOGICAL:
case HB_FT_LOGICAL:
hb_itemPutL( pItem, pValue[ 0 ] == 'T' || pValue[ 0 ] == 'Y' );
break;
case HB_FT_DATE:
case HB_FT_DATE:
{
char szDate[ 9 ];
@@ -572,16 +572,16 @@ static ERRCODE pgsqlGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem
hb_errPutSubCode( pError, EDBF_DATATYPE );
SELF_ERROR( ( AREAP ) pArea, pError );
hb_itemRelease( pError );
return FAILURE;
return HB_FAILURE;
}
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE pgsqlGetVarLen( SQLBASEAREAP pArea, USHORT uiIndex, ULONG * pLength )
static HB_ERRCODE pgsqlGetVarLen( SQLBASEAREAP pArea, USHORT uiIndex, ULONG * pLength )
{
HB_SYMBOL_UNUSED( pArea );
HB_SYMBOL_UNUSED( uiIndex );
HB_SYMBOL_UNUSED( pLength );
return SUCCESS;
return HB_SUCCESS;
}

View File

@@ -67,13 +67,13 @@
static PSDDNODE s_pSdd = NULL;
int hb_sddRegister( PSDDNODE pSdd )
int hb_sddRegister( PSDDNODE pSdd )
{
PSDDNODE pNode = s_pSdd;
while ( pNode )
{
if ( ! hb_stricmp( pNode->Name, pSdd->Name ) )
if ( ! hb_stricmp( pNode->Name, pSdd->Name ) )
return 0;
pNode = pNode->pNext;
}
@@ -94,10 +94,10 @@ static ULONG s_ulConnectionCurrent = 0;
static RDDFUNCS sqlbaseSuper;
static ERRCODE hb_errRT_SQLBASE( ULONG ulGenCode, ULONG ulSubCode, const char * szDescription, const char * szOperation )
static HB_ERRCODE hb_errRT_SQLBASE( ULONG ulGenCode, ULONG ulSubCode, const char * szDescription, const char * szOperation )
{
PHB_ITEM pError;
ERRCODE iRet = FAILURE;
HB_ERRCODE iRet = HB_FAILURE;
if ( hb_vmRequestQuery() == 0 )
{
@@ -111,32 +111,32 @@ static ERRCODE hb_errRT_SQLBASE( ULONG ulGenCode, ULONG ulSubCode, const char *
/*============= RDD METHODS =============================================================*/
static ERRCODE sqlbaseGoBottom( SQLBASEAREAP pArea )
static HB_ERRCODE sqlbaseGoBottom( SQLBASEAREAP pArea )
{
if ( SELF_GOCOLD( (AREAP) pArea ) == FAILURE )
return FAILURE;
if ( SELF_GOCOLD( (AREAP) pArea ) == HB_FAILURE )
return HB_FAILURE;
if ( ! pArea->fFetched && pArea->pSDD->GoTo( pArea, (ULONG) -1 ) == FAILURE )
return FAILURE;
if ( ! pArea->fFetched && pArea->pSDD->GoTo( pArea, (ULONG) -1 ) == HB_FAILURE )
return HB_FAILURE;
pArea->fTop = FALSE;
pArea->fBottom = TRUE;
if ( SELF_GOTO( (AREAP) pArea, pArea->ulRecCount ) != SUCCESS )
return FAILURE;
if ( SELF_GOTO( (AREAP) pArea, pArea->ulRecCount ) != HB_SUCCESS )
return HB_FAILURE;
return SELF_SKIPFILTER( (AREAP) pArea, -1 );
}
static ERRCODE sqlbaseGoTo( SQLBASEAREAP pArea, ULONG ulRecNo )
static HB_ERRCODE sqlbaseGoTo( SQLBASEAREAP pArea, ULONG ulRecNo )
{
if ( SELF_GOCOLD( (AREAP) pArea ) == FAILURE )
return FAILURE;
if ( SELF_GOCOLD( (AREAP) pArea ) == HB_FAILURE )
return HB_FAILURE;
if ( pArea->pSDD->GoTo( pArea, ulRecNo ) == FAILURE )
return FAILURE;
if ( pArea->pSDD->GoTo( pArea, ulRecNo ) == HB_FAILURE )
return HB_FAILURE;
if ( pArea->fPositioned )
{
@@ -150,11 +150,11 @@ static ERRCODE sqlbaseGoTo( SQLBASEAREAP pArea, ULONG ulRecNo )
}
pArea->fFound = FALSE;
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlbaseGoToId( SQLBASEAREAP pArea, PHB_ITEM pItem )
static HB_ERRCODE sqlbaseGoToId( SQLBASEAREAP pArea, PHB_ITEM pItem )
{
PHB_ITEM pError;
@@ -168,31 +168,31 @@ static ERRCODE sqlbaseGoToId( SQLBASEAREAP pArea, PHB_ITEM pItem )
hb_errPutSubCode( pError, EDBF_DATATYPE );
SELF_ERROR( (AREAP) pArea, pError );
hb_itemRelease( pError );
return FAILURE;
return HB_FAILURE;
}
}
static ERRCODE sqlbaseGoTop( SQLBASEAREAP pArea )
static HB_ERRCODE sqlbaseGoTop( SQLBASEAREAP pArea )
{
pArea->fTop = TRUE;
pArea->fBottom = FALSE;
if ( SELF_GOTO( (AREAP) pArea, 1 ) == FAILURE )
return FAILURE;
if ( SELF_GOTO( (AREAP) pArea, 1 ) == HB_FAILURE )
return HB_FAILURE;
return SELF_SKIPFILTER( (AREAP) pArea, 1 );
}
static ERRCODE sqlbaseSkip( SQLBASEAREAP pArea, LONG lToSkip )
static HB_ERRCODE sqlbaseSkip( SQLBASEAREAP pArea, LONG lToSkip )
{
ERRCODE uiError;
HB_ERRCODE uiError;
if ( pArea->lpdbPendingRel )
{
if ( SELF_FORCEREL( ( AREAP ) pArea ) != SUCCESS )
return FAILURE;
if ( SELF_FORCEREL( ( AREAP ) pArea ) != HB_SUCCESS )
return HB_FAILURE;
}
pArea->fTop = pArea->fBottom = FALSE;
@@ -204,7 +204,7 @@ static ERRCODE sqlbaseSkip( SQLBASEAREAP pArea, LONG lToSkip )
uiError = SELF_SKIPRAW( (AREAP) pArea, lToSkip );
/* Move first record and set Bof flag */
if ( uiError == SUCCESS && pArea->fBof && lToSkip < 0 )
if ( uiError == HB_SUCCESS && pArea->fBof && lToSkip < 0 )
{
uiError = SELF_GOTOP( (AREAP) pArea );
pArea->fBof = TRUE;
@@ -219,14 +219,14 @@ static ERRCODE sqlbaseSkip( SQLBASEAREAP pArea, LONG lToSkip )
}
static ERRCODE sqlbaseSkipRaw( SQLBASEAREAP pArea, LONG lToSkip )
static HB_ERRCODE sqlbaseSkipRaw( SQLBASEAREAP pArea, LONG lToSkip )
{
ERRCODE uiError;
HB_ERRCODE uiError;
if ( pArea->lpdbPendingRel )
{
if ( SELF_FORCEREL( ( AREAP ) pArea ) != SUCCESS )
return FAILURE;
if ( SELF_FORCEREL( ( AREAP ) pArea ) != HB_SUCCESS )
return HB_FAILURE;
}
if ( lToSkip == 0 )
@@ -257,8 +257,8 @@ static ERRCODE sqlbaseSkipRaw( SQLBASEAREAP pArea, LONG lToSkip )
return uiError;
}
static ERRCODE sqlbaseAppend( SQLBASEAREAP pArea, BOOL bUnLockAll )
static HB_ERRCODE sqlbaseAppend( SQLBASEAREAP pArea, BOOL bUnLockAll )
{
/*
PHB_ITEM pArray;
@@ -269,11 +269,11 @@ static ERRCODE sqlbaseAppend( SQLBASEAREAP pArea, BOOL bUnLockAll )
HB_SYMBOL_UNUSED( bUnLockAll );
/* This GOTO is GOCOLD + GOEOF */
if ( SELF_GOTO( ( AREAP ) pArea, 0 ) == FAILURE )
return FAILURE;
if ( SELF_GOTO( ( AREAP ) pArea, 0 ) == HB_FAILURE )
return HB_FAILURE;
if ( ! pArea->fRecordChanged && SELF_GOHOT( ( AREAP ) pArea ) == FAILURE )
return FAILURE;
if ( ! pArea->fRecordChanged && SELF_GOHOT( ( AREAP ) pArea ) == HB_FAILURE )
return HB_FAILURE;
if ( pArea->ulRecCount + 1 >= pArea->ulRecMax )
{
@@ -288,12 +288,12 @@ static ERRCODE sqlbaseAppend( SQLBASEAREAP pArea, BOOL bUnLockAll )
for ( us = 1; us <= pArea->uiFieldCount; us++ )
{
pItem = hb_itemNew( NULL );
if ( SELF_GETVALUE( (AREAP) pArea, us, pItem ) == SUCCESS )
hb_arraySetForward( pArray, us, pItem );
if ( SELF_GETVALUE( (AREAP) pArea, us, pItem ) == HB_SUCCESS )
hb_arraySetForward( pArray, us, pItem );
hb_itemRelease( pItem );
}
pArea->pRecord = pArray;
pArea->pRecord = pArray;
pArea->bRecordFlags = SQLDD_FLAG_CACHED;
pArea->fRecordChanged = TRUE;
*/
@@ -301,72 +301,72 @@ static ERRCODE sqlbaseAppend( SQLBASEAREAP pArea, BOOL bUnLockAll )
pArea->ulRecCount++;
pArea->ulRecNo = pArea->ulRecCount;
pArea->fBof = pArea->fEof = pArea->fFound = FALSE;
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlbaseDeleteRec( SQLBASEAREAP pArea )
static HB_ERRCODE sqlbaseDeleteRec( SQLBASEAREAP pArea )
{
if ( ! pArea->fPositioned )
return SUCCESS;
return HB_SUCCESS;
if ( ! pArea->fRecordChanged && SELF_GOHOT( ( AREAP ) pArea ) == FAILURE )
return FAILURE;
if ( ! pArea->fRecordChanged && SELF_GOHOT( ( AREAP ) pArea ) == HB_FAILURE )
return HB_FAILURE;
pArea->bRecordFlags |= SQLDD_FLAG_DELETED;
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlbaseDeleted( SQLBASEAREAP pArea, BOOL* pDeleted )
static HB_ERRCODE sqlbaseDeleted( SQLBASEAREAP pArea, BOOL* pDeleted )
{
* pDeleted = pArea->bRecordFlags & SQLDD_FLAG_DELETED;
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlbaseGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
static HB_ERRCODE sqlbaseGetValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
{
if ( pArea->bRecordFlags & SQLDD_FLAG_CACHED )
{
hb_arrayGet( pArea->pRecord, uiIndex, pItem );
return SUCCESS;
return HB_SUCCESS;
}
return pArea->pSDD->GetValue( pArea, uiIndex, pItem );
}
static ERRCODE sqlbaseGetVarLen( SQLBASEAREAP pArea, USHORT uiIndex, ULONG * pLength )
static HB_ERRCODE sqlbaseGetVarLen( SQLBASEAREAP pArea, USHORT uiIndex, ULONG * pLength )
{
/* TODO: should we use this code?
if ( pArea->lpFields[ uiIndex ].uiType == HB_IT_MEMO )
if ( pArea->lpFields[ uiIndex ].uiType == HB_IT_MEMO )
{
return pArea->pSDD->GetVarLen( pArea, uiIndex, pLength );
}
}
*/
* pLength = pArea->lpFields[ uiIndex - 1 ].uiLen;
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlbaseGoCold( SQLBASEAREAP pArea )
static HB_ERRCODE sqlbaseGoCold( SQLBASEAREAP pArea )
{
if ( pArea->fRecordChanged )
{
if ( ! pArea->fAppend && pArea->pRowFlags[ pArea->ulRecNo ] & SQLDD_FLAG_CACHED )
{
hb_itemRelease( (PHB_ITEM) ( pArea->pRow[ pArea->ulRecNo ] ) );
hb_itemRelease( (PHB_ITEM) ( pArea->pRow[ pArea->ulRecNo ] ) );
}
pArea->pRow[ pArea->ulRecNo ] = pArea->pRecord;
pArea->pRowFlags[ pArea->ulRecNo ] = pArea->bRecordFlags;
pArea->fRecordChanged = FALSE;
pArea->fAppend = FALSE;
}
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlbaseGoHot( SQLBASEAREAP pArea )
static HB_ERRCODE sqlbaseGoHot( SQLBASEAREAP pArea )
{
PHB_ITEM pArray, pItem;
USHORT us;
@@ -376,32 +376,32 @@ static ERRCODE sqlbaseGoHot( SQLBASEAREAP pArea )
for ( us = 1; us <= pArea->uiFieldCount; us++ )
{
pItem = hb_itemNew( NULL );
if ( SELF_GETVALUE( (AREAP) pArea, us, pItem ) == SUCCESS )
if ( SELF_GETVALUE( (AREAP) pArea, us, pItem ) == HB_SUCCESS )
hb_arraySetForward( pArray, us, pItem );
hb_itemRelease( pItem );
}
pArea->pRecord = pArray;
pArea->pRecord = pArray;
pArea->bRecordFlags |= SQLDD_FLAG_CACHED;
pArea->fRecordChanged = TRUE;
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlbasePutValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
static HB_ERRCODE sqlbasePutValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
{
LPFIELD pField;
ERRCODE uiError;
HB_ERRCODE uiError;
if ( ! pArea->fPositioned )
return SUCCESS;
return HB_SUCCESS;
if ( ! pArea->fRecordChanged && SELF_GOHOT( ( AREAP ) pArea ) == FAILURE )
return FAILURE;
if ( ! pArea->fRecordChanged && SELF_GOHOT( ( AREAP ) pArea ) == HB_FAILURE )
return HB_FAILURE;
uiError = SUCCESS;
uiError = HB_SUCCESS;
pField = pArea->lpFields + ( uiIndex - 1 );
if ( ( ( HB_IS_MEMO( pItem ) || HB_IS_STRING( pItem ) ) && pField->uiType == HB_FT_STRING ) ||
if ( ( ( HB_IS_MEMO( pItem ) || HB_IS_STRING( pItem ) ) && pField->uiType == HB_FT_STRING ) ||
( HB_IS_DATE( pItem ) && pField->uiType == HB_FT_DATE ) ||
( HB_IS_NUMBER( pItem ) && ( pField->uiType == HB_FT_INTEGER || pField->uiType == HB_FT_LONG ||
pField->uiType == HB_FT_FLOAT || pField->uiType == HB_FT_DOUBLE ) ) ||
@@ -422,42 +422,42 @@ static ERRCODE sqlbasePutValue( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pIt
hb_errPutFlags( pError, EF_CANDEFAULT );
uiError = SELF_ERROR( (AREAP) pArea, pError );
hb_itemRelease( pError );
return uiError == E_DEFAULT ? SUCCESS : FAILURE;
return uiError == E_DEFAULT ? HB_SUCCESS : HB_FAILURE;
}
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlbaseRecall( SQLBASEAREAP pArea )
static HB_ERRCODE sqlbaseRecall( SQLBASEAREAP pArea )
{
if ( ! pArea->fPositioned )
return SUCCESS;
return HB_SUCCESS;
if ( ! pArea->fRecordChanged && SELF_GOHOT( ( AREAP ) pArea ) != SUCCESS )
return FAILURE;
if ( ! pArea->fRecordChanged && SELF_GOHOT( ( AREAP ) pArea ) != HB_SUCCESS )
return HB_FAILURE;
pArea->bRecordFlags &= ~SQLDD_FLAG_DELETED;
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlbaseRecCount( SQLBASEAREAP pArea, ULONG * pRecCount )
static HB_ERRCODE sqlbaseRecCount( SQLBASEAREAP pArea, ULONG * pRecCount )
{
* pRecCount = pArea->ulRecCount;
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlbaseRecNo( SQLBASEAREAP pArea, ULONG * ulRecNo )
static HB_ERRCODE sqlbaseRecNo( SQLBASEAREAP pArea, ULONG * ulRecNo )
{
* ulRecNo = pArea->ulRecNo;
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlbaseRecId( SQLBASEAREAP pArea, PHB_ITEM pRecNo )
static HB_ERRCODE sqlbaseRecId( SQLBASEAREAP pArea, PHB_ITEM pRecNo )
{
ERRCODE errCode;
HB_ERRCODE errCode;
ULONG ulRecNo;
errCode = SELF_RECNO( (AREAP) pArea, &ulRecNo );
@@ -466,21 +466,21 @@ static ERRCODE sqlbaseRecId( SQLBASEAREAP pArea, PHB_ITEM pRecNo )
}
static ERRCODE sqlbaseClose( SQLBASEAREAP pArea )
static HB_ERRCODE sqlbaseClose( SQLBASEAREAP pArea )
{
if ( SELF_GOCOLD( (AREAP) pArea ) == FAILURE )
return FAILURE;
if ( SELF_GOCOLD( (AREAP) pArea ) == HB_FAILURE )
return HB_FAILURE;
if ( SUPER_CLOSE( (AREAP) pArea ) == FAILURE )
return FAILURE;
if ( SUPER_CLOSE( (AREAP) pArea ) == HB_FAILURE )
return HB_FAILURE;
pArea->pSDD->Close( pArea );
if ( pArea->pRow )
if ( pArea->pRow )
{
ULONG ulIndex;
for ( ulIndex = 0; ulIndex <= pArea->ulRecCount; ulIndex++ )
for ( ulIndex = 0; ulIndex <= pArea->ulRecCount; ulIndex++ )
{
if ( pArea->pRowFlags[ ulIndex ] & SQLDD_FLAG_CACHED )
{
@@ -494,23 +494,23 @@ static ERRCODE sqlbaseClose( SQLBASEAREAP pArea )
if ( pArea->szQuery )
hb_xfree( pArea->szQuery );
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlbaseCreate( SQLBASEAREAP pArea, LPDBOPENINFO pOpenInfo )
static HB_ERRCODE sqlbaseCreate( SQLBASEAREAP pArea, LPDBOPENINFO pOpenInfo )
{
PHB_ITEM pItemEof, pItem;
USHORT uiCount;
BOOL bError;
pArea->ulConnection = pOpenInfo->ulConnection ? pOpenInfo->ulConnection : s_ulConnectionCurrent;
if ( pArea->ulConnection > s_ulConnectionCount ||
if ( pArea->ulConnection > s_ulConnectionCount ||
( pArea->ulConnection && ! s_pConnection[ pArea->ulConnection - 1 ].hConnection ) )
{
hb_errRT_SQLBASE( EG_OPEN, ESQLDD_NOTCONNECTED, "Not connected", NULL );
return FAILURE;
return HB_FAILURE;
}
if ( pArea->ulConnection )
@@ -518,14 +518,14 @@ static ERRCODE sqlbaseCreate( SQLBASEAREAP pArea, LPDBOPENINFO pOpenInfo )
pArea->pConnection = & s_pConnection[ pArea->ulConnection - 1 ];
pArea->pSDD = pArea->pConnection->pSDD;
}
pItemEof = hb_itemArrayNew( pArea->uiFieldCount );
bError = FALSE;
for ( uiCount = 0; uiCount < pArea->uiFieldCount; uiCount++ )
{
LPFIELD pField = pArea->lpFields + uiCount;
switch ( pField->uiType )
{
case HB_FT_STRING:
@@ -548,14 +548,14 @@ static ERRCODE sqlbaseCreate( SQLBASEAREAP pArea, LPDBOPENINFO pOpenInfo )
case HB_FT_INTEGER:
if ( pField->uiDec )
pItem = hb_itemPutND( NULL, 0.0 );
else
else
pItem = hb_itemPutNI( NULL, 0 );
break;
case HB_FT_LONG:
if ( pField->uiDec )
pItem = hb_itemPutND( NULL, 0.0 );
else
else
pItem = hb_itemPutNL( NULL, 0 );
break;
@@ -587,16 +587,16 @@ static ERRCODE sqlbaseCreate( SQLBASEAREAP pArea, LPDBOPENINFO pOpenInfo )
if ( bError )
break;
}
if ( bError )
{
hb_itemClear( pItemEof );
hb_itemRelease( pItemEof );
hb_errRT_SQLBASE( EG_CORRUPTION, ESQLDD_INVALIDFIELD, "Invalid field type", NULL );
SELF_CLOSE( (AREAP) pArea );
return FAILURE;
return HB_FAILURE;
}
pArea->ulRecCount = 0;
pArea->pRow = (void**) hb_xalloc( SQLDD_ROWSET_RESIZE * sizeof( void* ) );
@@ -607,16 +607,16 @@ static ERRCODE sqlbaseCreate( SQLBASEAREAP pArea, LPDBOPENINFO pOpenInfo )
pArea->pRowFlags[ 0 ] = SQLDD_FLAG_CACHED;
pArea->fFetched = 1;
if ( SUPER_CREATE( (AREAP) pArea, pOpenInfo ) != SUCCESS )
if ( SUPER_CREATE( (AREAP) pArea, pOpenInfo ) != HB_SUCCESS )
{
SELF_CLOSE( (AREAP) pArea );
return FAILURE;
return HB_FAILURE;
}
return SELF_GOTOP( (AREAP) pArea );
}
static ERRCODE sqlbaseInfo( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
static HB_ERRCODE sqlbaseInfo( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
{
switch( uiIndex )
{
@@ -625,95 +625,95 @@ static ERRCODE sqlbaseInfo( SQLBASEAREAP pArea, USHORT uiIndex, PHB_ITEM pItem )
break;
}
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlbaseOpen( SQLBASEAREAP pArea, LPDBOPENINFO pOpenInfo )
static HB_ERRCODE sqlbaseOpen( SQLBASEAREAP pArea, LPDBOPENINFO pOpenInfo )
{
ERRCODE errCode;
HB_ERRCODE errCode;
pArea->ulConnection = pOpenInfo->ulConnection ? pOpenInfo->ulConnection : s_ulConnectionCurrent;
if ( pArea->ulConnection <= 0 || pArea->ulConnection > s_ulConnectionCount ||
if ( pArea->ulConnection <= 0 || pArea->ulConnection > s_ulConnectionCount ||
! s_pConnection[ pArea->ulConnection - 1 ].hConnection )
{
hb_errRT_SQLBASE( EG_OPEN, ESQLDD_NOTCONNECTED, "Not connected", NULL );
return FAILURE;
return HB_FAILURE;
}
pArea->pConnection = & s_pConnection[ pArea->ulConnection - 1 ];
pArea->pSDD = pArea->pConnection->pSDD;
/* filename is a query */
pArea->szQuery = (char*) hb_strdup( (char*) pOpenInfo->abName );
if ( pArea->uiFieldCount )
if ( pArea->uiFieldCount )
/* This should not happen (in __dbTrans()), because RDD is registered with RDT_FULL */
return FAILURE;
return HB_FAILURE;
errCode = pArea->pSDD->Open( pArea );
if ( errCode == SUCCESS )
if ( errCode == HB_SUCCESS )
{
errCode = SUPER_OPEN( (AREAP) pArea, pOpenInfo );
}
if( errCode != SUCCESS )
if( errCode != HB_SUCCESS )
{
SELF_CLOSE( (AREAP) pArea );
return FAILURE;
return HB_FAILURE;
}
return SELF_GOTOP( (AREAP) pArea );
}
static ERRCODE sqlbaseStructSize( SQLBASEAREAP pArea, USHORT * uiSize )
static HB_ERRCODE sqlbaseStructSize( SQLBASEAREAP pArea, USHORT * uiSize )
{
HB_SYMBOL_UNUSED( pArea );
* uiSize = sizeof( SQLBASEAREA );
return SUCCESS;
return HB_SUCCESS;
}
/*
static ERRCODE sqlbaseChildEnd( SQLBASEAREAP pArea, LPDBRELINFO pRelInfo )
static HB_ERRCODE sqlbaseChildEnd( SQLBASEAREAP pArea, LPDBRELINFO pRelInfo )
{
ERRCODE uiError;
HB_ERRCODE uiError;
if ( pArea->lpdbPendingRel == pRelInfo )
uiError = SELF_FORCEREL( (AREAP) pArea );
else
uiError = SUCCESS;
uiError = HB_SUCCESS;
SUPER_CHILDEND( (AREAP) pArea, pRelInfo );
return uiError;
}
static ERRCODE sqlbaseChildStart( SQLBASEAREAP pArea, LPDBRELINFO pRelInfo )
static HB_ERRCODE sqlbaseChildStart( SQLBASEAREAP pArea, LPDBRELINFO pRelInfo )
{
if ( SELF_CHILDSYNC( (AREAP) pArea, pRelInfo ) != SUCCESS )
return FAILURE;
if ( SELF_CHILDSYNC( (AREAP) pArea, pRelInfo ) != HB_SUCCESS )
return HB_FAILURE;
return SUPER_CHILDSTART( (AREAP) pArea, pRelInfo );
}
static ERRCODE sqlbaseChildSync( SQLBASEAREAP pArea, LPDBRELINFO pRelInfo )
static HB_ERRCODE sqlbaseChildSync( SQLBASEAREAP pArea, LPDBRELINFO pRelInfo )
{
if ( SELF_GOCOLD( (AREAP) pArea ) != SUCCESS )
return FAILURE;
if ( SELF_GOCOLD( (AREAP) pArea ) != HB_SUCCESS )
return HB_FAILURE;
pArea->lpdbPendingRel = pRelInfo;
if ( pArea->lpdbRelations )
return SELF_SYNCCHILDREN( (AREAP) pArea );
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlbaseForceRel( SQLBASEAREAP pArea )
static HB_ERRCODE sqlbaseForceRel( SQLBASEAREAP pArea )
{
if ( pArea->lpdbPendingRel )
{
@@ -723,23 +723,23 @@ static ERRCODE sqlbaseForceRel( SQLBASEAREAP pArea )
pArea->lpdbPendingRel = NULL;
return SELF_RELEVAL( (AREAP) pArea, lpdbPendingRel );
}
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlbaseSetFilter( SQLBASEAREAP pArea, LPDBFILTERINFO pFilterInfo )
static HB_ERRCODE sqlbaseSetFilter( SQLBASEAREAP pArea, LPDBFILTERINFO pFilterInfo )
{
if ( pArea->lpdbPendingRel )
{
if ( SELF_FORCEREL( (AREAP) pArea ) != SUCCESS )
return FAILURE;
if ( SELF_FORCEREL( (AREAP) pArea ) != HB_SUCCESS )
return HB_FAILURE;
}
return SUPER_SETFILTER( (AREAP) pArea, pFilterInfo );
}
*/
static ERRCODE sqlbaseExit( LPRDDNODE pRDD )
static HB_ERRCODE sqlbaseExit( LPRDDNODE pRDD )
{
ULONG ul;
@@ -750,7 +750,7 @@ static ERRCODE sqlbaseExit( LPRDDNODE pRDD )
/* Disconnect all connections */
for ( ul = 0; ul < s_ulConnectionCount; ul++ )
{
if ( s_pConnection[ ul ].hConnection )
if ( s_pConnection[ ul ].hConnection )
{
s_pConnection[ ul ].pSDD->Disconnect( & s_pConnection[ ul ] );
if ( s_pConnection[ ul ].szError )
@@ -766,11 +766,11 @@ static ERRCODE sqlbaseExit( LPRDDNODE pRDD )
s_ulConnectionCurrent = 0;
}
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlbaseRddInfo( LPRDDNODE pRDD, USHORT uiIndex, ULONG ulConnect, PHB_ITEM pItem )
static HB_ERRCODE sqlbaseRddInfo( LPRDDNODE pRDD, USHORT uiIndex, ULONG ulConnect, PHB_ITEM pItem )
{
ULONG ulConn;
SQLDDCONNECTION* pConn;
@@ -816,7 +816,7 @@ static ERRCODE sqlbaseRddInfo( LPRDDNODE pRDD, USHORT uiIndex, ULONG ulConnect,
break;
case RDDI_CONNECT:
case RDDI_CONNECT:
{
PSDDNODE pNode = NULL;
ULONG ul;
@@ -825,14 +825,14 @@ static ERRCODE sqlbaseRddInfo( LPRDDNODE pRDD, USHORT uiIndex, ULONG ulConnect,
/* Find free connection handle */
for ( ul = 0; ul < s_ulConnectionCount; ul++ )
{
if ( ! s_pConnection[ ul ].hConnection )
if ( ! s_pConnection[ ul ].hConnection )
break;
}
if ( ul >= s_ulConnectionCount )
{
/* Realloc connection table */
if ( s_pConnection )
if ( s_pConnection )
s_pConnection = (SQLDDCONNECTION*) hb_xrealloc( s_pConnection, sizeof( SQLDDCONNECTION ) * ( s_ulConnectionCount + CONNECTION_LIST_EXPAND ) );
else
s_pConnection = (SQLDDCONNECTION*) hb_xgrab( sizeof( SQLDDCONNECTION ) * CONNECTION_LIST_EXPAND );
@@ -848,7 +848,7 @@ static ERRCODE sqlbaseRddInfo( LPRDDNODE pRDD, USHORT uiIndex, ULONG ulConnect,
pNode = s_pSdd;
while ( pNode )
{
if ( ! hb_stricmp( pNode->Name, pStr ) )
if ( ! hb_stricmp( pNode->Name, pStr ) )
break;
pNode = pNode->pNext;
}
@@ -856,25 +856,25 @@ static ERRCODE sqlbaseRddInfo( LPRDDNODE pRDD, USHORT uiIndex, ULONG ulConnect,
pConn = & s_pConnection[ ul ];
ul++;
if ( pNode && pNode->Connect( pConn, pItem ) == SUCCESS )
if ( pNode && pNode->Connect( pConn, pItem ) == HB_SUCCESS )
{
pConn->pSDD = pNode;
pConn->pNewID = hb_itemNew( NULL );
}
else
else
ul = 0;
if ( ul )
s_ulConnectionCurrent = ul;
hb_itemPutNI( pItem, ul );
hb_itemPutNI( pItem, ul );
break;
}
case RDDI_DISCONNECT:
case RDDI_DISCONNECT:
{
if ( pConn && pConn->pSDD->Disconnect( pConn ) == SUCCESS )
if ( pConn && pConn->pSDD->Disconnect( pConn ) == HB_SUCCESS )
{
pConn->hConnection = 0;
pConn->iError = 0;
@@ -890,14 +890,14 @@ static ERRCODE sqlbaseRddInfo( LPRDDNODE pRDD, USHORT uiIndex, ULONG ulConnect,
}
hb_itemRelease( pConn->pNewID );
hb_itemPutL( pItem, TRUE );
return SUCCESS;
hb_itemPutL( pItem, TRUE );
return HB_SUCCESS;
}
hb_itemPutL( pItem, FALSE );
return SUCCESS;
hb_itemPutL( pItem, FALSE );
return HB_SUCCESS;
}
case RDDI_EXECUTE:
case RDDI_EXECUTE:
{
if ( pConn )
{
@@ -915,72 +915,72 @@ static ERRCODE sqlbaseRddInfo( LPRDDNODE pRDD, USHORT uiIndex, ULONG ulConnect,
}
pConn->szQuery = hb_strdup( hb_itemGetCPtr( pItem ) );
hb_itemPutL( pItem, pConn->pSDD->Execute( pConn, pItem ) == SUCCESS );
hb_itemPutL( pItem, pConn->pSDD->Execute( pConn, pItem ) == HB_SUCCESS );
}
else
hb_itemPutL( pItem, FALSE );
return SUCCESS;
return HB_SUCCESS;
}
case RDDI_ERROR:
case RDDI_ERROR:
{
if ( pConn )
hb_itemPutC( pItem, pConn->szError );
else
hb_itemClear( pItem );
return SUCCESS;
return HB_SUCCESS;
}
case RDDI_ERRORNO:
case RDDI_ERRORNO:
{
if ( pConn )
hb_itemPutNI( pItem, pConn->iError );
else
hb_itemClear( pItem );
return SUCCESS;
return HB_SUCCESS;
}
case RDDI_QUERY:
case RDDI_QUERY:
{
if ( pConn )
hb_itemPutC( pItem, pConn->szQuery );
else
hb_itemClear( pItem );
return SUCCESS;
return HB_SUCCESS;
}
case RDDI_NEWID:
case RDDI_NEWID:
{
if ( pConn )
hb_itemCopy( pItem, pConn->pNewID );
else
hb_itemClear( pItem );
return SUCCESS;
return HB_SUCCESS;
}
case RDDI_AFFECTEDROWS:
case RDDI_AFFECTEDROWS:
{
if ( pConn )
hb_itemPutNInt( pItem, pConn->ulAffectedRows );
else
hb_itemClear( pItem );
return SUCCESS;
return HB_SUCCESS;
}
/*
default:
return SUPER_RDDINFO( pRDD, uiIndex, ulConnect, pItem );
return SUPER_RDDINFO( pRDD, uiIndex, ulConnect, pItem );
*/
}
return SUCCESS;
return HB_SUCCESS;
}
/*====================================================================================*/
static RDDFUNCS sqlbaseTable =
{
( DBENTRYP_BP ) NULL, /* sqlbaseBof */
@@ -1119,10 +1119,10 @@ HB_FUNC( SQLBASE_GETFUNCTABLE )
if ( pTable )
{
ERRCODE errCode;
HB_ERRCODE errCode;
errCode = hb_rddInherit( pTable, &sqlbaseTable, &sqlbaseSuper, 0 );
if ( errCode == SUCCESS )
if ( errCode == HB_SUCCESS )
{
s_rddidSQLBASE = uiRddId;
}
@@ -1130,7 +1130,7 @@ HB_FUNC( SQLBASE_GETFUNCTABLE )
}
else
{
hb_retni( FAILURE );
hb_retni( HB_FAILURE );
}
}

View File

@@ -108,10 +108,10 @@ static RDDFUNCS sqlmixSuper;
*/
static ERRCODE sqlmixErrorRT( SQLMIXAREAP pArea, USHORT uiGenCode, USHORT uiSubCode, char* filename, USHORT uiOsCode, USHORT uiFlags )
static HB_ERRCODE sqlmixErrorRT( SQLMIXAREAP pArea, USHORT uiGenCode, USHORT uiSubCode, char* filename, USHORT uiOsCode, USHORT uiFlags )
{
PHB_ITEM pError;
ERRCODE iRet = FAILURE;
HB_ERRCODE iRet = HB_FAILURE;
if ( hb_vmRequestQuery() == 0 )
{
@@ -133,7 +133,7 @@ static ERRCODE sqlmixErrorRT( SQLMIXAREAP pArea, USHORT uiGenCode, USHORT uiSubC
/*
=======================================================================
Memory Index
Memory Index
=======================================================================
*/
@@ -164,7 +164,7 @@ static PMIXKEY hb_mixKeyPutItem( PMIXKEY pKey, PHB_ITEM pItem, ULONG ulRecNo, PM
case 'C':
ul = hb_itemGetCLen( pItem );
if ( ul > (ULONG) pTag->uiKeyLen )
if ( ul > (ULONG) pTag->uiKeyLen )
ul = pTag->uiKeyLen;
memcpy( pKey->val, hb_itemGetCPtr( pItem ), ul );
@@ -228,7 +228,7 @@ static BOOL hb_mixEvalCond( SQLMIXAREAP pArea, PHB_ITEM pCondItem )
int iCurrArea = 0;
BOOL fRet;
if ( pArea )
if ( pArea )
{
iCurrArea = hb_rddGetCurrentWorkAreaNumber();
@@ -287,7 +287,7 @@ static int hb_mixKeyCompareValue( PMIXTAG pTag, PMIXKEY pKey1, PMIXKEY pKey2, UI
if ( i == 0 )
{
/* This condition seems inverted, but it's ok for seek last */
if ( pTag->uiKeyLen > uiLen )
if ( pTag->uiKeyLen > uiLen )
i = -1;
}
return i;
@@ -330,14 +330,14 @@ static int hb_mixKeyCompare( PMIXTAG pTag, PMIXKEY pKey1, PMIXKEY pKey2, UINT ui
if ( pKey2->rec == (ULONG) -1 )
{
/* This condition seems inverted, but it's ok for seek last */
if ( pTag->uiKeyLen > uiLen )
if ( pTag->uiKeyLen > uiLen )
i = -1;
}
else
{
if ( pTag->uiKeyLen > uiLen )
if ( pTag->uiKeyLen > uiLen )
i = 1;
else if ( pTag->uiKeyLen < uiLen )
else if ( pTag->uiKeyLen < uiLen )
i = -1;
}
}
@@ -389,7 +389,7 @@ static void hb_mixTagPrintNode( PMIXTAG pTag, PMIXNODE pNode, int iLevel )
hb_mixTagPrintNode( pTag, pNode->Child[ i ], iLevel + 1 );
}
printf("%*ld %*s\n", iLevel * 10 + 5, MIX_KEY( pTag, pNode, i )->rec, pTag->uiKeyLen,
printf("%*ld %*s\n", iLevel * 10 + 5, MIX_KEY( pTag, pNode, i )->rec, pTag->uiKeyLen,
MIX_KEY( pTag, pNode, i )->notnul ? ( char * ) MIX_KEY( pTag, pNode, i )->val : "NULL" );
}
@@ -403,14 +403,14 @@ static void hb_mixTagPrintNode( PMIXTAG pTag, PMIXNODE pNode, int iLevel )
}
*/
static PMIXNODE hb_mixTagCreateNode( PMIXTAG pTag, BOOL fLeaf )
static PMIXNODE hb_mixTagCreateNode( PMIXTAG pTag, BOOL fLeaf )
{
PMIXNODE pNode;
ULONG ulSize;
ulSize = ( fLeaf ? sizeof( MIXNODELEAF ) : sizeof( MIXNODE ) ) + MIX_NODE_ORDER * pTag->uiTotalLen;
ulSize = ( fLeaf ? sizeof( MIXNODELEAF ) : sizeof( MIXNODE ) ) + MIX_NODE_ORDER * pTag->uiTotalLen;
pNode = (PMIXNODE) hb_xgrab( ulSize );
pNode = (PMIXNODE) hb_xgrab( ulSize );
memset( pNode, 0, ulSize );
pNode->Leaf = fLeaf ? 1 : 0;
return pNode;
@@ -423,7 +423,7 @@ static UINT hb_mixTagNodeParentIndex( PMIXNODE pNode )
UINT ui;
/* Find position in the parent node */
ui = pParent->KeyCount;
ui = pParent->KeyCount;
do {
if ( pParent->Child[ ui ] == pNode )
return ui;
@@ -441,13 +441,13 @@ static int hb_mixTagFindKey( PMIXTAG pTag, PMIXKEY pKey, UINT uiLen, PMIXNODE* p
pNode = pTag->Root;
while ( 1 )
while ( 1 )
{
i = -2;
/* TODO: binary search */
for ( ui = 0; ui < pNode->KeyCount; ui++ )
{
{
i = hb_mixKeyCompare( pTag, MIX_KEY( pTag, pNode, ui ), pKey, uiLen );
if ( i >= 0 )
@@ -456,7 +456,7 @@ static int hb_mixTagFindKey( PMIXTAG pTag, PMIXKEY pKey, UINT uiLen, PMIXNODE* p
}
}
if ( i == 0 || pNode->Leaf )
if ( i == 0 || pNode->Leaf )
break;
else
pNode = pNode->Child[ ui ];
@@ -494,7 +494,7 @@ static int hb_mixTagFindKey( PMIXTAG pTag, PMIXKEY pKey, UINT uiLen, PMIXNODE* p
static void hb_mixTagSetCurrent( PMIXTAG pTag, PMIXNODE pNode, UINT uiPos )
{
if ( uiPos < pNode->KeyCount )
if ( uiPos < pNode->KeyCount )
{
pTag->CurNode = pNode;
pTag->CurPos = uiPos;
@@ -544,8 +544,8 @@ static BOOL hb_mixTagRefreshKey( PMIXTAG pTag )
static void hb_mixTagAddKeyNode( PMIXTAG pTag, PMIXNODE pNode, UINT uiPos, PMIXKEY pKey, PMIXNODE pChildLeft, PMIXNODE pChildRight )
{
MIX_COPY_KEYS_INTERNAL( pTag, pNode, uiPos + 1, uiPos, pNode->KeyCount - uiPos );
if ( ! pNode->Leaf )
{
if ( ! pNode->Leaf )
{
MIX_COPY_CHILDS_INTERNAL( pTag, pNode, uiPos + 2, uiPos + 1, pNode->KeyCount - uiPos );
pNode->Child[ uiPos ] = pChildLeft;
pNode->Child[ uiPos + 1 ] = pChildRight;
@@ -562,7 +562,7 @@ static void hb_mixTagAddKeyPos( PMIXTAG pTag, PMIXNODE pNode, UINT uiPos, PMIXKE
PMIXNODE pNewNode;
UINT j, k;
if ( pNode->KeyCount < MIX_NODE_ORDER )
if ( pNode->KeyCount < MIX_NODE_ORDER )
{
hb_mixTagAddKeyNode( pTag, pNode, uiPos, pKey, pChildLeft, pChildRight );
return;
@@ -585,7 +585,7 @@ static void hb_mixTagAddKeyPos( PMIXTAG pTag, PMIXNODE pNode, UINT uiPos, PMIXKE
MIX_ASSIGN_KEY( pTag, pNode->Parent, j - 1, pKey );
pNode->Parent->Key[ j - 1 ] = pKey;
}
else
else
{
MIX_COPY_KEYS_EXTERNAL( pTag, pNode->Parent, j - 1, pNode, 0 , 1 );
uiPos--;
@@ -636,25 +636,25 @@ static void hb_mixTagAddKeyPos( PMIXTAG pTag, PMIXNODE pNode, UINT uiPos, PMIXKE
/* Insert new item to the left node or right node */
if ( uiPos <= MIX_NODE_ORDER / 2 )
if ( uiPos <= MIX_NODE_ORDER / 2 )
hb_mixTagAddKeyNode( pTag, pNode, uiPos, pKey, pChildLeft, pChildRight );
else
hb_mixTagAddKeyNode( pTag, pNewNode, uiPos - MIX_NODE_ORDER / 2 - 1, pKey, pChildLeft, pChildRight );
/* Assign the leftmost child of the new node */
if ( ! pNode->Leaf )
if ( ! pNode->Leaf )
{
pNewNode->Child[ 0 ] = pNode->Child[ pNode->KeyCount ];
pNewNode->Child[ 0 ]->Parent = pNewNode;
}
pNode->KeyCount--;
pNode->KeyCount--;
/* Move middle (last+1 in first node) item up */
if ( pNode->Parent )
{
hb_mixTagAddKeyPos( pTag, pNode->Parent, hb_mixTagNodeParentIndex( pNode ),
hb_mixTagAddKeyPos( pTag, pNode->Parent, hb_mixTagNodeParentIndex( pNode ),
MIX_KEY( pTag, pNode, pNode->KeyCount ), pNode, pNewNode );
}
else
@@ -662,7 +662,7 @@ static void hb_mixTagAddKeyPos( PMIXTAG pTag, PMIXNODE pNode, UINT uiPos, PMIXKE
pTag->Root = hb_mixTagCreateNode( pTag, 0 );
hb_mixTagAddKeyNode( pTag, pTag->Root, 0, MIX_KEY( pTag, pNode, pNode->KeyCount ), pNode, pNewNode );
}
}
@@ -686,7 +686,7 @@ static BOOL hb_mixTagAddKey( PMIXTAG pTag, PMIXKEY pKey )
static void hb_mixTagDelKeyNode( PMIXTAG pTag, PMIXNODE pNode, UINT uiPos )
{
MIX_COPY_KEYS_INTERNAL( pTag, pNode, uiPos, uiPos + 1, pNode->KeyCount - uiPos - 1 );
if ( ! pNode->Leaf )
if ( ! pNode->Leaf )
{
MIX_COPY_CHILDS_INTERNAL( pTag, pNode, uiPos, uiPos + 1, pNode->KeyCount - uiPos );
}
@@ -698,11 +698,11 @@ static void hb_mixTagNodeAdjust( PMIXTAG pTag, PMIXNODE pNode )
{
UINT i, j;
PMIXNODE pParent, pSibling;
while ( 1 )
{
if ( pNode->KeyCount >= MIX_NODE_ORDER / 2 )
if ( pNode->KeyCount >= MIX_NODE_ORDER / 2 )
return;
/* Check siblings */
@@ -717,7 +717,7 @@ static void hb_mixTagNodeAdjust( PMIXTAG pTag, PMIXNODE pNode )
/* Borrow from left */
pSibling = pParent->Child[ j - 1 ];
/* It could not be pNode->Child[ 0 ] if it is not Leaf!!! */
hb_mixTagAddKeyNode( pTag, pNode, 0, MIX_KEY( pTag, pParent, j - 1 ), pSibling->Child[ pSibling->KeyCount ], pNode->Child[ 0 ] );
MIX_COPY_KEYS_EXTERNAL( pTag, pParent, j - 1, pSibling, pSibling->KeyCount - 1, 1 );
@@ -747,7 +747,7 @@ static void hb_mixTagNodeAdjust( PMIXTAG pTag, PMIXNODE pNode )
{
pSibling->KeyCount += pNode->KeyCount;
}
else
else
{
MIX_COPY_CHILDS_EXTERNAL( pTag, pSibling, pSibling->KeyCount, pNode, 0, pNode->KeyCount );
for ( i = 0; i < pNode->KeyCount; i++ )
@@ -774,7 +774,7 @@ static void hb_mixTagNodeAdjust( PMIXTAG pTag, PMIXNODE pNode )
{
pNode->KeyCount += pSibling->KeyCount;
}
else
else
{
MIX_COPY_CHILDS_EXTERNAL( pTag, pNode, pNode->KeyCount, pSibling, 0, pSibling->KeyCount );
for ( i = 0; i < pSibling->KeyCount; i++ )
@@ -790,7 +790,7 @@ static void hb_mixTagNodeAdjust( PMIXTAG pTag, PMIXNODE pNode )
pNode = pParent;
}
}
else
else
{
/* Adjust root */
@@ -813,7 +813,7 @@ static void hb_mixTagDelKeyPos( PMIXTAG pTag, PMIXNODE pNode, UINT uiPos )
hb_mixTagDelKeyNode( pTag, pNode, uiPos );
hb_mixTagNodeAdjust( pTag, pNode );
}
else
else
{
PMIXNODE pLeaf;
@@ -837,7 +837,7 @@ static BOOL hb_mixTagDelKey( PMIXTAG pTag, PMIXKEY pKey )
i = hb_mixTagFindKey( pTag, pKey, pTag->uiKeyLen, &pNode, &ui, FALSE );
if ( i )
if ( i )
return FALSE;
hb_mixTagDelKeyPos( pTag, pNode, ui );
@@ -870,10 +870,10 @@ static BYTE* hb_mixBuildSortTable( PHB_CODEPAGE pCodepage )
}
}
}
}
}
else
{
for ( i = 0; i < 256; i++ )
for ( i = 0; i < 256; i++ )
pSortTable[ i ] = ( BYTE ) i;
}
return pSortTable;
@@ -911,7 +911,7 @@ static PMIXTAG hb_mixTagCreate( char* szTagName, PHB_ITEM pKeyExpr, PHB_ITEM pKe
pTag->uiTotalLen = sizeof( MIXKEY ) + pTag->uiKeyLen;
/* Use national support */
if ( bType == 'C' )
if ( bType == 'C' )
{
if( pArea->cdPage && pArea->cdPage->lSort && !pArea->pSortTable )
{
@@ -930,16 +930,16 @@ static PMIXTAG hb_mixTagCreate( char* szTagName, PHB_ITEM pKeyExpr, PHB_ITEM pKe
lStep = pOrdCondInfo->lStep;
}
if ( ! pOrdCondInfo || pOrdCondInfo->fAll )
if ( ! pOrdCondInfo || pOrdCondInfo->fAll )
{
pArea->pTag = NULL;
}
else
}
else
{
if ( pOrdCondInfo->itmRecID )
ulStartRec = hb_itemGetNL( pOrdCondInfo->itmRecID );
if ( ulStartRec )
if ( ulStartRec )
{
ulNextCount = 1;
}
@@ -947,7 +947,7 @@ static PMIXTAG hb_mixTagCreate( char* szTagName, PHB_ITEM pKeyExpr, PHB_ITEM pKe
{
if ( pOrdCondInfo->itmStartRecID )
ulStartRec = hb_itemGetNL( pOrdCondInfo->itmStartRecID );
if ( !ulStartRec )
ulStartRec = pArea->ulRecNo;
@@ -967,7 +967,7 @@ static PMIXTAG hb_mixTagCreate( char* szTagName, PHB_ITEM pKeyExpr, PHB_ITEM pKe
{
SELF_GOTO( (AREAP) pArea, ulStartRec );
}
else
else
{
SELF_GOTOP( (AREAP) pArea );
}
@@ -993,7 +993,7 @@ static PMIXTAG hb_mixTagCreate( char* szTagName, PHB_ITEM pKeyExpr, PHB_ITEM pKe
if ( pForItem == NULL || hb_mixEvalCond( NULL, pForItem ) )
{
pItem = hb_vmEvalBlockOrMacro( pKeyItem );
pKey = hb_mixKeyPutItem( pKey, pItem, pArea->ulRecNo, pTag );
hb_mixTagAddKey( pTag, pKey );
}
@@ -1003,7 +1003,7 @@ static PMIXTAG hb_mixTagCreate( char* szTagName, PHB_ITEM pKeyExpr, PHB_ITEM pKe
ulNextCount--;
if ( !ulNextCount ) break;
}
if ( SELF_SKIPRAW( ( AREAP ) pArea, 1 ) == FAILURE )
if ( SELF_SKIPRAW( ( AREAP ) pArea, 1 ) == HB_FAILURE )
break;
}
if ( pKey )
@@ -1028,19 +1028,19 @@ static void hb_mixTagDestroyNode( PMIXNODE pNode )
static void hb_mixTagDestroy( PMIXTAG pTag )
{
if ( pTag->szName )
if ( pTag->szName )
hb_xfree( pTag->szName );
if ( pTag->szKeyExpr )
if ( pTag->szKeyExpr )
hb_xfree( pTag->szKeyExpr );
if ( pTag->szForExpr )
if ( pTag->szForExpr )
hb_xfree( pTag->szForExpr );
if ( pTag->pKeyItem )
if ( pTag->pKeyItem )
hb_vmDestroyBlockOrMacro( pTag->pKeyItem );
if ( pTag->pForItem )
if ( pTag->pForItem )
hb_vmDestroyBlockOrMacro( pTag->pForItem );
if ( pTag->Root )
@@ -1055,13 +1055,13 @@ static void hb_mixTagDestroy( PMIXTAG pTag )
static void hb_mixTagGoTop( PMIXTAG pTag )
{
PMIXNODE pNode;
pNode = pTag->Root;
while ( ! pNode->Leaf )
{
pNode = pNode->Child[ 0 ];
}
if ( ! pNode->KeyCount )
{
pTag->fEof = TRUE;
@@ -1077,13 +1077,13 @@ static void hb_mixTagGoTop( PMIXTAG pTag )
static void hb_mixTagGoBottom( PMIXTAG pTag )
{
PMIXNODE pNode;
pNode = pTag->Root;
while ( ! pNode->Leaf )
{
pNode = pNode->Child[ pNode->KeyCount ];
}
if ( ! pNode->KeyCount )
{
pTag->fEof = TRUE;
@@ -1100,10 +1100,10 @@ static void hb_mixTagSkip( PMIXTAG pTag, LONG lSkip )
{
PMIXNODE pNode, pNode2;
UINT uiPos, uiPos2;
pNode = pTag->CurNode;
uiPos = pTag->CurPos;
/* printf("hb_mixTagSkip: CurNode=%p, CurPos=%d lSkip=%d\n", pNode, uiPos, lSkip ); */
if ( lSkip > 0 )
@@ -1113,7 +1113,7 @@ static void hb_mixTagSkip( PMIXTAG pTag, LONG lSkip )
{
if ( pNode->Leaf )
{
if ( (LONG) (pNode->KeyCount - 1 - uiPos) >= lSkip )
if ( (LONG) (pNode->KeyCount - 1 - uiPos) >= lSkip )
{
uiPos += lSkip;
lSkip = 0;
@@ -1145,7 +1145,7 @@ static void hb_mixTagSkip( PMIXTAG pTag, LONG lSkip )
{
pNode = pNode->Child[ uiPos + 1 ];
while ( ! pNode->Leaf )
{
{
pNode = pNode->Child[ 0 ];
}
uiPos = 0;
@@ -1159,7 +1159,7 @@ static void hb_mixTagSkip( PMIXTAG pTag, LONG lSkip )
/*
This is not needed. skip(-1) from Eof is processed inside sqlmixSkipRaw
if ( pTag->fEof )
if ( pTag->fEof )
{
hb_mixTagGoBottom( pTag );
lSkip--;
@@ -1172,7 +1172,7 @@ static void hb_mixTagSkip( PMIXTAG pTag, LONG lSkip )
{
if ( pNode->Leaf )
{
if ( (LONG) uiPos >= lSkip )
if ( (LONG) uiPos >= lSkip )
{
uiPos -= lSkip;
lSkip = 0;
@@ -1207,8 +1207,8 @@ static void hb_mixTagSkip( PMIXTAG pTag, LONG lSkip )
}
else
{
do
{
do
{
pNode = pNode->Child[ uiPos ];
uiPos = pNode->KeyCount;
}
@@ -1240,18 +1240,18 @@ static PMIXTAG hb_mixFindTag( SQLMIXAREAP pArea, PHB_ITEM pOrder )
iOrder = hb_itemGetNI( pOrder );
pTag = pArea->pTagList;
while ( pTag && iOrder != ++iCurr )
while ( pTag && iOrder != ++iCurr )
{
pTag = pTag->pNext;
}
}
else
}
else
{
char szTag[ MIX_MAXTAGNAMELEN + 1 ];
hb_strncpyUpperTrim( szTag, hb_itemGetCPtr( pOrder ), MIX_MAXTAGNAMELEN );
pTag = pArea->pTagList;
while ( pTag && hb_stricmp( szTag, pTag->szName ) )
while ( pTag && hb_stricmp( szTag, pTag->szName ) )
{
pTag = pTag->pNext;
}
@@ -1263,7 +1263,7 @@ static PMIXTAG hb_mixFindTag( SQLMIXAREAP pArea, PHB_ITEM pOrder )
/*=======================================================================*/
static ULONG hb_mixTagNodeKeyCount( PMIXNODE pNode )
static ULONG hb_mixTagNodeKeyCount( PMIXNODE pNode )
{
ULONG ulKeyCount;
UINT ui;
@@ -1373,12 +1373,12 @@ static ULONG hb_mixDBOIKeyNo( PMIXTAG pTag, BOOL fFilter )
=======================================================================
*/
static ERRCODE sqlmixGoBottom( SQLMIXAREAP pArea )
static HB_ERRCODE sqlmixGoBottom( SQLMIXAREAP pArea )
{
ERRCODE retval;
HB_ERRCODE retval;
if ( SELF_GOCOLD( ( AREAP ) pArea ) == FAILURE )
return FAILURE;
if ( SELF_GOCOLD( ( AREAP ) pArea ) == HB_FAILURE )
return HB_FAILURE;
if ( ! pArea->pTag )
return SUPER_GOBOTTOM( ( AREAP ) pArea );
@@ -1392,19 +1392,19 @@ static ERRCODE sqlmixGoBottom( SQLMIXAREAP pArea )
pArea->fBottom = TRUE;
retval = SELF_GOTO( ( AREAP ) pArea, pArea->pTag->CurKey ? pArea->pTag->CurKey->rec : 0 );
if ( retval != FAILURE && pArea->fPositioned )
if ( retval != HB_FAILURE && pArea->fPositioned )
retval = SELF_SKIPFILTER( ( AREAP ) pArea, -1 );
return retval;
}
static ERRCODE sqlmixGoTop( SQLMIXAREAP pArea )
static HB_ERRCODE sqlmixGoTop( SQLMIXAREAP pArea )
{
ERRCODE retval;
HB_ERRCODE retval;
if ( SELF_GOCOLD( ( AREAP ) pArea ) == FAILURE )
return FAILURE;
if ( SELF_GOCOLD( ( AREAP ) pArea ) == HB_FAILURE )
return HB_FAILURE;
if ( ! pArea->pTag )
return SUPER_GOTOP( ( AREAP ) pArea );
@@ -1418,27 +1418,27 @@ static ERRCODE sqlmixGoTop( SQLMIXAREAP pArea )
pArea->fBottom = FALSE;
retval = SELF_GOTO( ( AREAP ) pArea, pArea->pTag->CurKey ? pArea->pTag->CurKey->rec : 0 );
if ( retval != FAILURE && pArea->fPositioned )
if ( retval != HB_FAILURE && pArea->fPositioned )
retval = SELF_SKIPFILTER( ( AREAP ) pArea, -1 );
return retval;
}
static ERRCODE sqlmixSeek( SQLMIXAREAP pArea, BOOL fSoftSeek, PHB_ITEM pItem, BOOL fFindLast )
static HB_ERRCODE sqlmixSeek( SQLMIXAREAP pArea, BOOL fSoftSeek, PHB_ITEM pItem, BOOL fFindLast )
{
if ( SELF_GOCOLD( ( AREAP ) pArea ) == FAILURE )
return FAILURE;
if ( SELF_GOCOLD( ( AREAP ) pArea ) == HB_FAILURE )
return HB_FAILURE;
if ( ! pArea->pTag )
{
sqlmixErrorRT( pArea, EG_NOORDER, 1201, NULL, 0, EF_CANDEFAULT );
return FAILURE;
return HB_FAILURE;
}
else
{
PMIXKEY pKey;
ERRCODE retval = SUCCESS;
HB_ERRCODE retval = HB_SUCCESS;
BOOL fEOF;
PMIXTAG pTag = pArea->pTag;
PMIXNODE pNode;
@@ -1485,10 +1485,10 @@ static ERRCODE sqlmixSeek( SQLMIXAREAP pArea, BOOL fSoftSeek, PHB_ITEM pItem, BO
if ( !fEOF )
{
retval = SELF_GOTO( ( AREAP ) pArea, pTag->CurKey->rec );
if ( retval != FAILURE && pArea->fPositioned )
if ( retval != HB_FAILURE && pArea->fPositioned )
{
retval = SELF_SKIPFILTER( ( AREAP ) pArea, fFindLast ? -1 : 1 );
if ( retval != FAILURE && pArea->fPositioned )
if ( retval != HB_FAILURE && pArea->fPositioned )
{
pArea->fFound = ( uiKeyLen == 0 || memcmp( pTag->CurKey->val, pKey->val, (ULONG) uiKeyLen ) == 0 );
if ( ! pArea->fFound && ! fSoftSeek )
@@ -1496,7 +1496,7 @@ static ERRCODE sqlmixSeek( SQLMIXAREAP pArea, BOOL fSoftSeek, PHB_ITEM pItem, BO
}
}
}
if ( retval != FAILURE && fEOF )
if ( retval != HB_FAILURE && fEOF )
{
retval = SELF_GOTO( ( AREAP ) pArea, 0 );
}
@@ -1508,13 +1508,13 @@ static ERRCODE sqlmixSeek( SQLMIXAREAP pArea, BOOL fSoftSeek, PHB_ITEM pItem, BO
}
static ERRCODE sqlmixSkipRaw( SQLMIXAREAP pArea, LONG lToSkip )
static HB_ERRCODE sqlmixSkipRaw( SQLMIXAREAP pArea, LONG lToSkip )
{
PMIXTAG pTag = pArea->pTag;
BOOL fOut = FALSE;
if ( SELF_GOCOLD( ( AREAP ) pArea ) == FAILURE )
return FAILURE;
if ( SELF_GOCOLD( ( AREAP ) pArea ) == HB_FAILURE )
return HB_FAILURE;
if ( ! pTag || lToSkip == 0 )
return SUPER_SKIPRAW( ( AREAP ) pArea, lToSkip );
@@ -1537,21 +1537,21 @@ static ERRCODE sqlmixSkipRaw( SQLMIXAREAP pArea, LONG lToSkip )
if ( ! fOut )
hb_mixTagSkip( pTag, lToSkip );
if ( SELF_GOTO( ( AREAP ) pArea, ( pTag->fEof || fOut ) ? 0 : pTag->CurKey->rec ) != SUCCESS )
return FAILURE;
if ( SELF_GOTO( ( AREAP ) pArea, ( pTag->fEof || fOut ) ? 0 : pTag->CurKey->rec ) != HB_SUCCESS )
return HB_FAILURE;
pArea->fEof = pTag->fEof;
pArea->fBof = pTag->fBof;
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlmixGoCold( SQLMIXAREAP pArea )
static HB_ERRCODE sqlmixGoCold( SQLMIXAREAP pArea )
{
BOOL fRecordChanged = pArea->fRecordChanged;
BOOL fAppend = pArea->fAppend;
if ( SUPER_GOCOLD( ( AREAP ) pArea ) == FAILURE )
return FAILURE;
if ( SUPER_GOCOLD( ( AREAP ) pArea ) == HB_FAILURE )
return HB_FAILURE;
if ( fRecordChanged && pArea->pTagList )
{
@@ -1594,7 +1594,7 @@ static ERRCODE sqlmixGoCold( SQLMIXAREAP pArea )
}
if ( fDel )
hb_mixTagDelKey( pTag, pTag->HotKey );
hb_mixTagDelKey( pTag, pTag->HotKey );
if ( fAdd )
hb_mixTagAddKey( pTag, pKey );
@@ -1608,11 +1608,11 @@ static ERRCODE sqlmixGoCold( SQLMIXAREAP pArea )
pArea->lpdbPendingRel = lpdbPendingRel;
}
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlmixGoHot( SQLMIXAREAP pArea )
static HB_ERRCODE sqlmixGoHot( SQLMIXAREAP pArea )
{
PMIXTAG pTag;
@@ -1621,8 +1621,8 @@ static ERRCODE sqlmixGoHot( SQLMIXAREAP pArea )
printf( "sqlmixGoHot: multiple marking buffer as hot." );
*/
if ( SUPER_GOHOT( (AREAP) pArea ) == FAILURE )
return FAILURE;
if ( SUPER_GOHOT( (AREAP) pArea ) == HB_FAILURE )
return HB_FAILURE;
pTag = pArea->pTagList;
while ( pTag )
@@ -1634,38 +1634,38 @@ static ERRCODE sqlmixGoHot( SQLMIXAREAP pArea )
}
pTag = pTag->pNext;
}
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlmixClose( SQLMIXAREAP pArea )
static HB_ERRCODE sqlmixClose( SQLMIXAREAP pArea )
{
if ( SELF_GOCOLD( (AREAP) pArea ) == FAILURE )
return FAILURE;
if ( SELF_GOCOLD( (AREAP) pArea ) == HB_FAILURE )
return HB_FAILURE;
if ( SUPER_CLOSE( (AREAP) pArea ) == FAILURE )
return FAILURE;
if ( SUPER_CLOSE( (AREAP) pArea ) == HB_FAILURE )
return HB_FAILURE;
if ( SELF_ORDLSTCLEAR( (AREAP) pArea ) == FAILURE )
return FAILURE;
if ( SELF_ORDLSTCLEAR( (AREAP) pArea ) == HB_FAILURE )
return HB_FAILURE;
if ( pArea->pSortTable )
hb_xfree( pArea->pSortTable );
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlmixStructSize( SQLMIXAREAP pArea, USHORT* StructSize )
static HB_ERRCODE sqlmixStructSize( SQLMIXAREAP pArea, USHORT* StructSize )
{
HB_SYMBOL_UNUSED( pArea );
* StructSize = sizeof( SQLMIXAREA );
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlmixOrderListClear( SQLMIXAREAP pArea )
static HB_ERRCODE sqlmixOrderListClear( SQLMIXAREAP pArea )
{
PMIXTAG pTag;
@@ -1676,11 +1676,11 @@ static ERRCODE sqlmixOrderListClear( SQLMIXAREAP pArea )
hb_mixTagDestroy( pTag );
}
pArea->pTag = NULL;
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlmixOrderListFocus( SQLMIXAREAP pArea, LPDBORDERINFO pOrderInfo )
static HB_ERRCODE sqlmixOrderListFocus( SQLMIXAREAP pArea, LPDBORDERINFO pOrderInfo )
{
if ( pArea->pTag )
{
@@ -1691,13 +1691,13 @@ static ERRCODE sqlmixOrderListFocus( SQLMIXAREAP pArea, LPDBORDERINFO pOrderInfo
{
pArea->pTag = hb_mixFindTag( pArea, pOrderInfo->itmOrder );
}
return pArea->pTag ? SUCCESS : FAILURE;
return pArea->pTag ? HB_SUCCESS : HB_FAILURE;
}
static ERRCODE sqlmixOrderCreate( SQLMIXAREAP pArea, LPDBORDERCREATEINFO pOrderInfo )
static HB_ERRCODE sqlmixOrderCreate( SQLMIXAREAP pArea, LPDBORDERCREATEINFO pOrderInfo )
{
PMIXTAG pTagNew, pTag;
PMIXTAG pTagNew, pTag;
PHB_ITEM pKeyItem, pForItem = NULL, pWhileItem = NULL, pResult;
ULONG ulRecNo;
USHORT uiLen;
@@ -1708,10 +1708,10 @@ static ERRCODE sqlmixOrderCreate( SQLMIXAREAP pArea, LPDBORDERCREATEINFO pOrderI
{
pKeyItem = hb_itemNew( pOrderInfo->itmCobExpr );
}
else
else
{
if ( SELF_COMPILE( (AREAP) pArea, (BYTE*) hb_itemGetCPtr( pOrderInfo->abExpr ) ) == FAILURE )
return FAILURE;
if ( SELF_COMPILE( (AREAP) pArea, (BYTE*) hb_itemGetCPtr( pOrderInfo->abExpr ) ) == HB_FAILURE )
return HB_FAILURE;
pKeyItem = pArea->valResult;
pArea->valResult = NULL;
}
@@ -1719,11 +1719,11 @@ static ERRCODE sqlmixOrderCreate( SQLMIXAREAP pArea, LPDBORDERCREATEINFO pOrderI
/* Test key codeblock on EOF */
ulRecNo = pArea->ulRecNo;
SELF_GOTO( (AREAP) pArea, 0 );
if ( SELF_EVALBLOCK( (AREAP) pArea, pKeyItem ) == FAILURE )
if ( SELF_EVALBLOCK( (AREAP) pArea, pKeyItem ) == HB_FAILURE )
{
hb_vmDestroyBlockOrMacro( pKeyItem );
SELF_GOTO( (AREAP) pArea, ulRecNo );
return FAILURE;
return HB_FAILURE;
}
pResult = pArea->valResult;
@@ -1766,7 +1766,7 @@ static ERRCODE sqlmixOrderCreate( SQLMIXAREAP pArea, LPDBORDERCREATEINFO pOrderI
hb_vmDestroyBlockOrMacro( pKeyItem );
SELF_GOTO( (AREAP) pArea, ulRecNo );
sqlmixErrorRT( pArea, bType == 'U' ? EG_DATATYPE : EG_DATAWIDTH, 1026, NULL, 0, 0 );
return FAILURE;
return HB_FAILURE;
}
if ( pArea->lpdbOrdCondInfo )
@@ -1778,15 +1778,15 @@ static ERRCODE sqlmixOrderCreate( SQLMIXAREAP pArea, LPDBORDERCREATEINFO pOrderI
}
else if ( pArea->lpdbOrdCondInfo->abFor )
{
if ( SELF_COMPILE( (AREAP) pArea, pArea->lpdbOrdCondInfo->abFor ) == FAILURE )
if ( SELF_COMPILE( (AREAP) pArea, pArea->lpdbOrdCondInfo->abFor ) == HB_FAILURE )
{
hb_vmDestroyBlockOrMacro( pKeyItem );
SELF_GOTO( (AREAP) pArea, ulRecNo );
return FAILURE;
return HB_FAILURE;
}
pForItem = pArea->valResult;
pArea->valResult = NULL;
}
}
/* Obtain WHILE codeblock */
if ( pArea->lpdbOrdCondInfo->itmCobWhile )
@@ -1795,30 +1795,30 @@ static ERRCODE sqlmixOrderCreate( SQLMIXAREAP pArea, LPDBORDERCREATEINFO pOrderI
}
else if ( pArea->lpdbOrdCondInfo->abWhile )
{
if ( SELF_COMPILE( (AREAP) pArea, pArea->lpdbOrdCondInfo->abWhile ) == FAILURE )
if ( SELF_COMPILE( (AREAP) pArea, pArea->lpdbOrdCondInfo->abWhile ) == HB_FAILURE )
{
hb_vmDestroyBlockOrMacro( pKeyItem );
if ( pForItem )
hb_vmDestroyBlockOrMacro( pForItem );
SELF_GOTO( (AREAP) pArea, ulRecNo );
return FAILURE;
return HB_FAILURE;
}
pWhileItem = pArea->valResult;
pArea->valResult = NULL;
}
}
}
/* Test FOR codeblock on EOF */
if ( pForItem )
{
if ( SELF_EVALBLOCK( (AREAP) pArea, pForItem ) == FAILURE )
if ( SELF_EVALBLOCK( (AREAP) pArea, pForItem ) == HB_FAILURE )
{
hb_vmDestroyBlockOrMacro( pKeyItem );
hb_vmDestroyBlockOrMacro( pForItem );
if ( pWhileItem )
hb_vmDestroyBlockOrMacro( pWhileItem );
SELF_GOTO( (AREAP) pArea, ulRecNo );
return FAILURE;
return HB_FAILURE;
}
if ( hb_itemType( pArea->valResult ) != HB_IT_LOGICAL )
{
@@ -1830,7 +1830,7 @@ static ERRCODE sqlmixOrderCreate( SQLMIXAREAP pArea, LPDBORDERCREATEINFO pOrderI
hb_vmDestroyBlockOrMacro( pWhileItem );
SELF_GOTO( (AREAP) pArea, ulRecNo );
sqlmixErrorRT( pArea, EG_DATATYPE, EDBF_INVALIDFOR, NULL, 0, 0 );
return FAILURE;
return HB_FAILURE;
}
hb_itemRelease( pArea->valResult );
pArea->valResult = 0;
@@ -1846,26 +1846,26 @@ static ERRCODE sqlmixOrderCreate( SQLMIXAREAP pArea, LPDBORDERCREATEINFO pOrderI
hb_vmDestroyBlockOrMacro( pWhileItem );
/* Append the tag to the end of list */
if ( pArea->pTagList )
if ( pArea->pTagList )
{
pTag = pArea->pTagList;
while ( pTag->pNext )
while ( pTag->pNext )
{
pTag = pTag->pNext;
}
pTag->pNext = pTagNew;
}
else
}
else
{
pArea->pTagList = pTagNew;
}
pArea->pTag = pTagNew;
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlmixOrderInfo( SQLMIXAREAP pArea, USHORT uiIndex, LPDBORDERINFO pOrderInfo )
static HB_ERRCODE sqlmixOrderInfo( SQLMIXAREAP pArea, USHORT uiIndex, LPDBORDERINFO pOrderInfo )
{
PMIXTAG pTag;
USHORT uiTag = 0;
@@ -1876,7 +1876,7 @@ static ERRCODE sqlmixOrderInfo( SQLMIXAREAP pArea, USHORT uiIndex, LPDBORDERINFO
case DBOI_EVALSTEP:
pOrderInfo->itmResult = hb_itemPutNL( pOrderInfo->itmResult,
pArea->lpdbOrdCondInfo ? pArea->lpdbOrdCondInfo->lStep : 0 );
return SUCCESS;
return HB_SUCCESS;
case DBOI_ORDERCOUNT:
pTag = pArea->pTagList;
@@ -1886,12 +1886,12 @@ static ERRCODE sqlmixOrderInfo( SQLMIXAREAP pArea, USHORT uiIndex, LPDBORDERINFO
uiTag++;
}
pOrderInfo->itmResult = hb_itemPutNI( pOrderInfo->itmResult, uiTag );
return SUCCESS;
return HB_SUCCESS;
}
if ( SELF_GOCOLD( ( AREAP ) pArea ) == FAILURE )
return FAILURE;
if ( SELF_GOCOLD( ( AREAP ) pArea ) == HB_FAILURE )
return HB_FAILURE;
if ( pOrderInfo->itmOrder )
@@ -1920,12 +1920,12 @@ static ERRCODE sqlmixOrderInfo( SQLMIXAREAP pArea, USHORT uiIndex, LPDBORDERINFO
{
char* pForExpr = hb_itemGetCPtr( pOrderInfo->itmNewVal );
if ( SELF_COMPILE( (AREAP) pArea, (BYTE*) pForExpr ) == SUCCESS )
if ( SELF_COMPILE( (AREAP) pArea, (BYTE*) pForExpr ) == HB_SUCCESS )
{
PHB_ITEM pForItem = pArea->valResult;
pArea->valResult = NULL;
if ( SELF_EVALBLOCK( (AREAP) pArea, pForItem ) == SUCCESS )
if ( SELF_EVALBLOCK( (AREAP) pArea, pForItem ) == HB_SUCCESS )
{
if ( hb_itemType( pArea->valResult ) == HB_IT_LOGICAL )
{
@@ -1954,8 +1954,8 @@ static ERRCODE sqlmixOrderInfo( SQLMIXAREAP pArea, USHORT uiIndex, LPDBORDERINFO
/* TODO:
pOrderInfo->itmResult = hb_itemPutL( pOrderInfo->itmResult,
hb_cdxDBOIKeyGoto( pArea, pTag,
hb_itemGetNL( pOrderInfo->itmNewVal ), uiIndex == DBOI_POSITION ) == SUCCESS );
hb_cdxDBOIKeyGoto( pArea, pTag,
hb_itemGetNL( pOrderInfo->itmNewVal ), uiIndex == DBOI_POSITION ) == HB_SUCCESS );
*/
}
else
@@ -1978,7 +1978,7 @@ static ERRCODE sqlmixOrderInfo( SQLMIXAREAP pArea, USHORT uiIndex, LPDBORDERINFO
case DBOI_FINDRECCONT:
pOrderInfo->itmResult = hb_itemPutL( pOrderInfo->itmResult,
hb_cdxDBOIFindRec( pArea, pTag,
hb_cdxDBOIFindRec( pArea, pTag,
hb_itemGetNL( pOrderInfo->itmNewVal ), TRUE ) );
break;
*/
@@ -2067,7 +2067,7 @@ static ERRCODE sqlmixOrderInfo( SQLMIXAREAP pArea, USHORT uiIndex, LPDBORDERINFO
SELF_FORCEREL( ( AREAP ) pArea );
if ( ! pArea->fPositioned ||
( pTag->pForItem &&
( pTag->pForItem &&
! hb_cdxEvalCond( pArea, pTag->pForItem, TRUE ) ) )
{
pOrderInfo->itmResult = hb_itemPutL( pOrderInfo->itmResult, FALSE );
@@ -2106,7 +2106,7 @@ static ERRCODE sqlmixOrderInfo( SQLMIXAREAP pArea, USHORT uiIndex, LPDBORDERINFO
SELF_FORCEREL( ( AREAP ) pArea );
if ( !pArea->fPositioned ||
( pTag->pForItem &&
( pTag->pForItem &&
!hb_cdxEvalCond( pArea, pTag->pForItem, TRUE ) ) )
{
pOrderInfo->itmResult = hb_itemPutL( pOrderInfo->itmResult, FALSE );
@@ -2142,19 +2142,19 @@ static ERRCODE sqlmixOrderInfo( SQLMIXAREAP pArea, USHORT uiIndex, LPDBORDERINFO
return SUPER_ORDINFO( ( AREAP ) pArea, uiIndex, pOrderInfo );
}
return SUCCESS;
return HB_SUCCESS;
}
static ERRCODE sqlmixExit( LPRDDNODE pRDD )
static HB_ERRCODE sqlmixExit( LPRDDNODE pRDD )
{
/* This empty method is used to avoid duplicated sqlbase exit call */
HB_SYMBOL_UNUSED( pRDD );
return SUCCESS;
return HB_SUCCESS;
}
static RDDFUNCS sqlmixTable =
static RDDFUNCS sqlmixTable =
{( DBENTRYP_BP ) NULL, /* sqlmixBof */
( DBENTRYP_BP ) NULL, /* sqlmixEof */
( DBENTRYP_BP ) NULL, /* sqlmixFound */
@@ -2269,10 +2269,10 @@ HB_FUNC( SQLMIX_GETFUNCTABLE )
if ( pTable )
{
ERRCODE errCode;
HB_ERRCODE errCode;
errCode = hb_rddInherit( pTable, &sqlmixTable, &sqlmixSuper, "SQLBASE" );
if ( errCode == SUCCESS )
if ( errCode == HB_SUCCESS )
{
s_uiRddIdSQLMIX = uiRddId;
}
@@ -2280,7 +2280,7 @@ HB_FUNC( SQLMIX_GETFUNCTABLE )
}
else
{
hb_retni( FAILURE );
hb_retni( HB_FAILURE );
}
}
@@ -2337,4 +2337,3 @@ HB_CALL_ON_STARTUP_END( _hb_sqlmix_rdd_init_ )
static HB_$INITSYM hb_vm_auto_sqlmix_rdd_init = _hb_sqlmix_rdd_init_;
#pragma data_seg()
#endif

View File

@@ -135,7 +135,7 @@ HB_EXTERN_BEGIN
#define HB_CDXMAXKEY( x ) ((USHORT) ((x) > CDX_MAXKEY ? CDX_MAXKEY : (x)))
#define HB_CDXBITMASK( x ) ((LONG) ((1L<<(x))-1))
/* #define FAST_GOCOLD( A ) (((CDXAREAP) (A))->fRecordChanged || ((CDXAREAP) (A))->fCdxAppend ? (SELF_GOCOLD((A))) : SUCCESS) */
/* #define FAST_GOCOLD( A ) (((CDXAREAP) (A))->fRecordChanged || ((CDXAREAP) (A))->fCdxAppend ? (SELF_GOCOLD((A))) : HB_SUCCESS) */
#define FAST_GOCOLD( A ) SELF_GOCOLD(A)