From 8615a44d6ca6321c2fe32fc82eccbe6e03bfbd65 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 29 Jul 1999 03:40:52 +0000 Subject: [PATCH] *** empty log message *** --- harbour/ChangeLog | 51 ++ harbour/include/Makefile | 2 +- harbour/include/error.api | 2 +- harbour/include/errorapi.h | 7 +- harbour/include/extend.api | 2 +- harbour/include/extend.h | 97 ++-- harbour/include/filesys.api | 3 +- harbour/include/filesys.h | 5 +- harbour/include/fm.api | 2 +- harbour/include/gt.api | 2 +- harbour/include/gtapi.h | 9 +- harbour/include/inkey.h | 3 +- harbour/include/item.api | 2 +- harbour/include/itemapi.h | 2 +- harbour/include/pcode.h | 2 +- harbour/include/rdd_api.old | 802 +++++++++++++-------------- harbour/include/set.h | 3 +- harbour/makefile.b16 | 3 +- harbour/makefile.b31 | 3 +- harbour/makefile.b32 | 3 +- harbour/makefile.b40 | 3 +- harbour/makefile.vc | 4 - harbour/source/compiler/genobj32.c | 30 +- harbour/source/compiler/harbour.l | 10 +- harbour/source/compiler/harbour.y | 213 +++---- harbour/source/hbpp/harb.h | 4 +- harbour/source/hbpp/preproc.c | 8 +- harbour/source/odbc/odbc.c | 6 +- harbour/source/rdd/dbcmd.c | 16 +- harbour/source/rdd/dbfntx1.c | 6 +- harbour/source/rtl/Makefile | 1 - harbour/source/rtl/arrays.c | 62 +-- harbour/source/rtl/classes.c | 36 +- harbour/source/rtl/codebloc.c | 4 +- harbour/source/rtl/console.c | 14 +- harbour/source/rtl/copyfile.c | 12 +- harbour/source/rtl/dates.c | 22 +- harbour/source/rtl/descend.c | 8 +- harbour/source/rtl/dir.c | 46 +- harbour/source/rtl/environ.c | 8 +- harbour/source/rtl/errorapi.c | 10 +- harbour/source/rtl/extend.c | 170 +++--- harbour/source/rtl/files.c | 8 +- harbour/source/rtl/gt/gtdos.c | 2 +- harbour/source/rtl/gt/gtos2.c | 2 +- harbour/source/rtl/gt/gtwin.c | 2 +- harbour/source/rtl/gt/gtxxx.c | 2 +- harbour/source/rtl/gtapi.c | 12 +- harbour/source/rtl/hardcr.c | 4 +- harbour/source/rtl/inkey.c | 2 + harbour/source/rtl/itemapi.c | 193 ++++++- harbour/source/rtl/math.c | 8 +- harbour/source/rtl/memvars.c | 26 +- harbour/source/rtl/mtran.c | 4 +- harbour/source/rtl/natmsg/msgbas.c | 2 +- harbour/source/rtl/natmsg/msgcat.c | 2 +- harbour/source/rtl/natmsg/msgcz852.c | 2 +- harbour/source/rtl/natmsg/msgczkam.c | 2 +- harbour/source/rtl/natmsg/msgdut.c | 2 +- harbour/source/rtl/natmsg/msgeo.c | 2 +- harbour/source/rtl/natmsg/msgfre.c | 2 +- harbour/source/rtl/natmsg/msggal.c | 2 +- harbour/source/rtl/natmsg/msgger.c | 2 +- harbour/source/rtl/natmsg/msghu.c | 2 +- harbour/source/rtl/natmsg/msgia.c | 2 +- harbour/source/rtl/natmsg/msgita.c | 2 +- harbour/source/rtl/natmsg/msgkor.c | 2 +- harbour/source/rtl/natmsg/msgpl852.c | 2 +- harbour/source/rtl/natmsg/msgpliso.c | 2 +- harbour/source/rtl/natmsg/msgplmaz.c | 2 +- harbour/source/rtl/natmsg/msgpor.c | 2 +- harbour/source/rtl/natmsg/msgr1251.c | 2 +- harbour/source/rtl/natmsg/msgru866.c | 2 +- harbour/source/rtl/natmsg/msgspa.c | 2 +- harbour/source/rtl/natmsg/msguk.c | 2 +- harbour/source/rtl/natmsg/msgyu852.c | 2 +- harbour/source/rtl/set.c | 11 +- harbour/source/rtl/setcolor.c | 10 +- harbour/source/rtl/strings.c | 78 ++- harbour/source/rtl/transfrm.c | 18 +- harbour/source/runner/runner.c | 5 +- harbour/source/tools/asciisum.c | 2 +- harbour/source/tools/ascpos.c | 2 +- harbour/source/tools/atdiff.c | 2 +- harbour/source/tools/chareven.c | 2 +- harbour/source/tools/charmix.c | 2 +- harbour/source/tools/charodd.c | 2 +- harbour/source/tools/chrcount.c | 2 +- harbour/source/tools/chrfirst.c | 2 +- harbour/source/tools/chrtotal.c | 2 +- harbour/source/tools/dates2.c | 10 +- harbour/source/tools/datesx.c | 2 +- harbour/source/tools/debug.c | 16 +- harbour/source/tools/hb_f.c | 2 +- harbour/source/tools/io.c | 36 +- harbour/source/tools/mathx.c | 2 +- harbour/source/tools/strcount.c | 2 +- harbour/source/tools/strcspn.c | 2 +- harbour/source/tools/strdiff.c | 2 +- harbour/source/tools/strexpan.c | 2 +- harbour/source/tools/stringsx.c | 2 +- harbour/source/tools/strleft.c | 2 +- harbour/source/tools/strpbrk.c | 2 +- harbour/source/tools/strright.c | 2 +- harbour/source/vm/dynsym.c | 18 +- harbour/source/vm/hvm.c | 221 ++------ harbour/tests/working/rtl_test.prg | 214 ++++--- harbour/tests/working/strsub.prg | 2 +- 108 files changed, 1429 insertions(+), 1257 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ab0c185231..ddc08bfdae 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,54 @@ +19990728-20:35 CET Victor Szel + * Changed all #include to #include "x", where + x is a Harbour header file. + Many source and header files involved. + * include/extend.h - Small cleanups. + * include/extend.h - Some functions renamed to be more + consistent. + source/rtl/arrays.c + source/rtl/classes.c + source/rtl/codebloc.c + source/rtl/dir.c + source/rtl/errorapi.c + source/rtl/extend.c + source/rtl/itemapi.c + source/rtl/memvars.c + source/rtl/transfrm.c + source/tools/debug.c + source/vm/hvm.c + ItemCopy() -> hb_itemCopy() + ItemRelease() -> hb_itemClear() + ItemUnRef() -> hb_itemUnRef() + GetMethod() -> hb_GetMethod() + * include/version.h renamed to hb_ver.h + source/rtl/environ.c + source/compiler/harbour.y + include/Makefile + * source/vm/hvm.c - hb_item*() functions moved to source/rtl/itemapi.c + * source/vm/hvm.c - Codeblock and memvar management function + declarations moved to include/extend.h + * source/rtl/strcmp.c/hb_stricmp() moved to source/rtl/strings.c + * source/rtl/strcmp.c/hb_itemStrCmp() moved to source/rtl/itemapi.c + - source/rtl/strcmp.c removed. + source/rtl/makefile + makefile.b16 + makefile.b31 + makefile.b32 + makefile.b40 + makefile.vc + - makefile.icc removed (superseded by GNU Make System) + + tests/working/rtl_test.prg - Further improved, it's + now fully automatic. + ! source/rtl/strings.c - LEFT(),RIGHT(),SUBSTR() bugs fixed with + some LONG casts for asstring.length. + UPPER(),LOWER() LONG -> ULONG + * source/compiler/harbour.y + source/compiler/harbour.l + source/compiler/genobj32.c + Some ints changed to BOOL. + ! tests/working/strsub.prg - "Press a key" changed + to "press Enter". + 19990728-19:45 GMT+1 Antonio Linares * include/classes.ch Added support for 'Super' keyword diff --git a/harbour/include/Makefile b/harbour/include/Makefile index 65a9c587ab..bf26bf8c18 100644 --- a/harbour/include/Makefile +++ b/harbour/include/Makefile @@ -27,7 +27,7 @@ C_HEADERS=\ run_exp.h \ set.h \ super.h \ - version.h \ + hbver.h \ PRG_HEADERS=\ box.ch \ diff --git a/harbour/include/error.api b/harbour/include/error.api index 49a4e8add3..abdb2024a3 100644 --- a/harbour/include/error.api +++ b/harbour/include/error.api @@ -5,7 +5,7 @@ #ifndef HB_ERROR_API_ #define HB_ERROR_API_ -#include +#include "errorapi.h" #define _errNew hb_errNew #define _errLaunch hb_errLaunch diff --git a/harbour/include/errorapi.h b/harbour/include/errorapi.h index 4296dd80dc..4988210986 100644 --- a/harbour/include/errorapi.h +++ b/harbour/include/errorapi.h @@ -24,14 +24,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - V 1.0 1999-04-25 - Initial posting. + V 1.11 Victor Szel #include changed to #include "x". + V 1.0 ? Initial posting. */ #ifndef HB_ERRORAPI_H_ #define HB_ERRORAPI_H_ -#include -#include +#include "extend.h" +#include "error.ch" /* Error codes (returned from hb_errLaunch()) */ diff --git a/harbour/include/extend.api b/harbour/include/extend.api index 8973cd3d35..7ac257da04 100644 --- a/harbour/include/extend.api +++ b/harbour/include/extend.api @@ -5,7 +5,7 @@ #ifndef HB_EXTEND_API_ #define HB_EXTEND_API_ -#include +#include "extend.h" #define _parc hb_parc #define _parclen hb_parclen diff --git a/harbour/include/extend.h b/harbour/include/extend.h index 6121e0913f..923e6d2fa7 100644 --- a/harbour/include/extend.h +++ b/harbour/include/extend.h @@ -29,14 +29,14 @@ #include #include #include -#include -#include +#include "hbdefs.h" +#include "hbsetup.h" struct _DYNSYM; /* forward declaration */ typedef struct /* symbol support structure */ { - char * szName; /* the name of the symbol */ + char* szName; /* the name of the symbol */ SYMBOLSCOPE cScope; /* the scope of the symbol */ HARBOURFUNC pFunPtr; /* function address for function symbol table entries */ struct _DYNSYM * pDynSym; /* pointer to its dynamic symbol if defined */ @@ -47,7 +47,7 @@ typedef struct /* symbol support structure */ #define FS_STATIC 2 #define FS_INIT 8 #define FS_EXIT 16 -#define FS_INITEXIT 24 +#define FS_INITEXIT ( FS_INIT | FS_EXIT ) #define FS_MESSAGE 32 #define FS_MEMVAR 128 @@ -81,8 +81,7 @@ struct _HB_BASEARRAY; struct _HB_ITEM; struct _HB_VALUE; -/* Internal structures that holds data -*/ +/* Internal structures that holds data */ struct hb_struArray { struct _HB_BASEARRAY * value; @@ -186,51 +185,50 @@ typedef PHB_ITEM HB_ITEM_PTR; typedef struct _HB_BASEARRAY { - PHB_ITEM pItems; /* pointer to the array items */ - ULONG ulLen; /* number of items in the array */ - WORD wHolders; /* number of holders of this array */ - WORD wClass; /* offset to the classes base if it is an object */ - WORD wSuperCast; /* is it a super cast ? */ + PHB_ITEM pItems; /* pointer to the array items */ + ULONG ulLen; /* number of items in the array */ + WORD wHolders; /* number of holders of this array */ + WORD wClass; /* offset to the classes base if it is an object */ + WORD wSuperCast; /* is it a super cast ? */ } BASEARRAY, * PBASEARRAY; typedef struct /* stack managed by the virtual machine */ { - PHB_ITEM pItems; /* pointer to the stack items */ - PHB_ITEM pPos; /* pointer to the latest used item */ - LONG wItems; /* total items that may be holded on the stack */ - HB_ITEM Return; /* latest returned value */ - PHB_ITEM pBase; /* stack frame position for the current function call */ - PHB_ITEM pEvalBase;/* stack frame position for the evaluated codeblock */ - int iStatics; /* statics base for the current function call */ - char szDate[ 9 ]; /* last returned date from _pards() yyyymmdd format */ + PHB_ITEM pItems; /* pointer to the stack items */ + PHB_ITEM pPos; /* pointer to the latest used item */ + LONG wItems; /* total items that may be holded on the stack */ + HB_ITEM Return; /* latest returned value */ + PHB_ITEM pBase; /* stack frame position for the current function call */ + PHB_ITEM pEvalBase; /* stack frame position for the evaluated codeblock */ + int iStatics; /* statics base for the current function call */ + char szDate[ 9 ]; /* last returned date from _pards() yyyymmdd format */ } STACK; typedef struct _DYNSYM { - HB_HANDLE hArea; /* Workarea number */ - HB_HANDLE hMemvar; /* Index number into memvars ( publics & privates ) array */ - PSYMBOL pSymbol; /* pointer to its relative local symbol */ - HARBOURFUNC pFunPtr; /* Pointer to the function address */ -} DYNSYM, * PDYNSYM; /* dynamic symbol structure */ + HB_HANDLE hArea; /* Workarea number */ + HB_HANDLE hMemvar; /* Index number into memvars ( publics & privates ) array */ + PSYMBOL pSymbol; /* pointer to its relative local symbol */ + HARBOURFUNC pFunPtr; /* Pointer to the function address */ +} DYNSYM, * PDYNSYM; /* dynamic symbol structure */ /* internal structure for codeblocks */ typedef struct _HB_CODEBLOCK { - BYTE * pCode; /* codeblock pcode */ - PHB_ITEM pLocals; /* table with referenced local variables */ - WORD wLocals; /* number of referenced local variables */ - PSYMBOL pSymbols; /* codeblocks symbols */ - ULONG lCounter; /* numer of references to this codeblock */ + BYTE* pCode; /* codeblock pcode */ + PHB_ITEM pLocals; /* table with referenced local variables */ + WORD wLocals; /* number of referenced local variables */ + PSYMBOL pSymbols; /* codeblocks symbols */ + ULONG lCounter; /* numer of references to this codeblock */ } HB_CODEBLOCK, * HB_CODEBLOCK_PTR; typedef struct _HB_VALUE { - HB_ITEM item; - ULONG counter; - HB_HANDLE hPrevMemvar; + HB_ITEM item; + ULONG counter; + HB_HANDLE hPrevMemvar; } HB_VALUE, * HB_VALUE_PTR; - PHB_ITEM hb_param( int iParam, WORD wType ); /* retrieve a generic parameter */ char * hb_parc( int iParam, ... ); /* retrieve a string parameter */ ULONG hb_parclen( int iParam, ... ); /* retrieve a string parameter length */ @@ -240,6 +238,7 @@ double hb_parnd( int iParam, ... ); /* retrieve a numeric parameter as a doubl int hb_parni( int iParam, ... ); /* retrieve a numeric parameter as a integer */ long hb_parnl( int iParam, ... ); /* retrieve a numeric parameter as a long */ WORD hb_parinfo( int iParam ); /* Determine the param count or data type */ +ULONG hb_parinfa( int iParamNum, ULONG uiArrayIndex ); void hb_storc( char * szText, int iParam, ... ); /* stores a szString on a variable by reference */ void hb_storclen( char * fixText, WORD wLength, int iParam, ... ); /* stores a fixed length string on a variable by reference */ void hb_stords( char * szDate, int iParam, ... ); /* szDate must have yyyymmdd format */ @@ -263,10 +262,6 @@ void * hb_xrealloc( void * pMem, ULONG lSize ); /* reallocates memory */ void hb_xfree( void * pMem ); /* frees memory */ ULONG hb_xsize( void * pMem ); /* returns the size of an allocated memory block */ -void ItemCopy( PHB_ITEM pDest, PHB_ITEM pSource ); -void ItemRelease( PHB_ITEM pItem ); -PHB_ITEM ItemUnRef( PHB_ITEM pItem ); /* de-references passed variable */ - void hb_arrayNew( PHB_ITEM pItem, ULONG ulLen ); /* creates a new array */ void hb_arrayGet( PHB_ITEM pArray, ULONG ulIndex, PHB_ITEM pItem ); /* retrieves an item */ ULONG hb_arrayLen( PHB_ITEM pArray ); /* retrives the array len */ @@ -282,19 +277,43 @@ void hb_arrayDel( PHB_ITEM pArray, ULONG ulIndex ); PHB_ITEM hb_arrayClone( PHB_ITEM pArray ); void hb_arrayAdd( PHB_ITEM pArray, PHB_ITEM pItemValue ); char * hb_arrayGetDate( PHB_ITEM pArray, ULONG ulIndex ); /* retrieves the date value contained on an array element */ -ULONG hb_parinfa( int iParamNum, ULONG uiArrayIndex ); + int hb_itemStrCmp( PHB_ITEM pFirst, PHB_ITEM pSecond, BOOL bForceExact ); /* our string compare */ +void hb_itemCopy( PHB_ITEM pDest, PHB_ITEM pSource ); /* copies an item to one place to another respecting its containts */ +void hb_itemClear( PHB_ITEM pItem ); +PHB_ITEM hb_itemUnRef( PHB_ITEM pItem ); /* de-references passed variable */ + char * hb_str( PHB_ITEM pNumber, PHB_ITEM pWidth, PHB_ITEM pDec ); /* convert number to string */ int hb_stricmp( const char *s1, const char *s2 ); BOOL hb_strempty( char * szText, ULONG ulLen ); +ULONG hb_strAt( char *, long, char *, long ); -HARBOURFUNC GetMethod( PHB_ITEM pObject, PSYMBOL pSymMsg ); /* returns the method pointer of a object class */ +HARBOURFUNC hb_GetMethod( PHB_ITEM pObject, PSYMBOL pSymMsg ); /* returns the method pointer of a object class */ char * hb_GetClassName( PHB_ITEM pObject ); /* retrieves an object class name */ +ULONG hb_isMessage( PHB_ITEM, char * ); /* dynamic symbol table management */ PDYNSYM hb_GetDynSym( char * szName ); /* finds and creates a dynamic symbol if not found */ PDYNSYM hb_NewDynSym( PSYMBOL pSymbol ); /* creates a new dynamic symbol based on a local one */ PDYNSYM hb_FindDynSym( char * szName ); /* finds a dynamic symbol */ +HB_CODEBLOCK_PTR hb_CodeblockNew( BYTE *, WORD, WORD *, PSYMBOL ); +void hb_CodeblockDelete( PHB_ITEM ); +PHB_ITEM hb_CodeblockGetVar( PHB_ITEM, LONG ); +PHB_ITEM hb_CodeblockGetRef( PHB_ITEM, PHB_ITEM ); +void hb_CodeblockEvaluate( PHB_ITEM ); +void hb_CodeblockCopy( PHB_ITEM, PHB_ITEM ); + +/* Initialisation and closing memvars subsystem */ +void hb_MemvarsInit( void ); +void hb_MemvarsRelease( void ); +void hb_MemvarValueIncRef( HB_HANDLE ); +void hb_MemvarValueDecRef( HB_HANDLE ); +void hb_MemvarSetValue( PSYMBOL, HB_ITEM_PTR ); +void hb_MemvarGetValue( HB_ITEM_PTR, PSYMBOL ); +void hb_MemvarGetRefer( HB_ITEM_PTR, PSYMBOL ); +void hb_MemvarNewSymbol( PSYMBOL ); +ULONG hb_MemvarGetPrivatesBase( void ); +void hb_MemvarSetPrivatesBase( ULONG ); #endif /* HB_EXTEND_H_ */ diff --git a/harbour/include/filesys.api b/harbour/include/filesys.api index 4652e75f23..ceaa860c8e 100644 --- a/harbour/include/filesys.api +++ b/harbour/include/filesys.api @@ -29,6 +29,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit their web site at http://www.gnu.org/). + V 1.6 Victor Szel #include changed to #include "x". V 1.5 David G. Holm Added my email address. V 1.4 David G. Holm Added copyright and license header, along with a complete version history. @@ -41,7 +42,7 @@ #ifndef HB_FILESYS_API_ #define HB_FILESYS_API_ -#include +#include "filesys.h" #define _fsChDir hb_fsChDir #define _fsChDrv hb_fsChDrv diff --git a/harbour/include/filesys.h b/harbour/include/filesys.h index baf324b92a..736cc3d8b4 100644 --- a/harbour/include/filesys.h +++ b/harbour/include/filesys.h @@ -29,6 +29,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit their web site at http://www.gnu.org/). + V 1.7 Victor Szel #include changed to #include "x". V 1.6 David G. Holm Added my email address. V 1.5 David G. Holm Added copyright and license header, along with a complete version history. @@ -43,8 +44,8 @@ #ifndef HB_FILESYS_H_ #define HB_FILESYS_H_ -#include -#include +#include "extend.h" +#include "fileio.ch" typedef void * ERRORP; typedef int FHANDLE; diff --git a/harbour/include/fm.api b/harbour/include/fm.api index fcae2885c0..fb236e3420 100644 --- a/harbour/include/fm.api +++ b/harbour/include/fm.api @@ -5,7 +5,7 @@ #ifndef HB_FM_API_ #define HB_FM_API_ -#include +#include "extend.h" #define _xgrab hb_xgrab #define _xrealloc hb_xrealloc diff --git a/harbour/include/gt.api b/harbour/include/gt.api index b6be799d42..9ce97980fa 100644 --- a/harbour/include/gt.api +++ b/harbour/include/gt.api @@ -5,7 +5,7 @@ #ifndef HB_GT_API_ #define HB_GT_API_ -#include +#include "gtapi.h" #define _gtInit hb_gtInit #define _gtBox hb_gtBox diff --git a/harbour/include/gtapi.h b/harbour/include/gtapi.h index dc34477a78..2a8f0e0aa0 100644 --- a/harbour/include/gtapi.h +++ b/harbour/include/gtapi.h @@ -5,9 +5,10 @@ #ifndef HB_GTAPI_H_ #define HB_GTAPI_H_ -#include -#include -#include +#include "extend.h" +#include "color.ch" +#include "setcurs.ch" +#include "box.h" /* maximum length of color string */ #define CLR_STRLEN 64 @@ -44,8 +45,6 @@ * - Zortech C/C++ (16-bit) for DOS 3.0r4 */ -#include - /* Public interface. These should never change, only be added to. */ void hb_gtInit(void); diff --git a/harbour/include/inkey.h b/harbour/include/inkey.h index 57e960d94a..67094d9d1e 100644 --- a/harbour/include/inkey.h +++ b/harbour/include/inkey.h @@ -29,6 +29,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit their web site at http://www.gnu.org/). + V 1.2 Victor Szel #include changed to #include "x". V 1.1 David G. Holm Committed to CVS. V 1.0 David G. Holm Initial version. */ @@ -36,7 +37,7 @@ #ifndef HB_INKEY_H_ #define HB_INKEY_H_ -#include +#include "hbdefs.h" /* Harbour keyboard support functions */ int hb_inkeyGet( void ); /* Extract the next key from the Harbour keyboard buffer */ diff --git a/harbour/include/item.api b/harbour/include/item.api index c47e9b330f..7a3a58bba1 100644 --- a/harbour/include/item.api +++ b/harbour/include/item.api @@ -5,7 +5,7 @@ #ifndef HB_ITEM_API_ #define HB_ITEM_API_ -#include +#include "itemapi.h" #define _arrayNew hb_arrayNew #define _arrayLen hb_arrayLen diff --git a/harbour/include/itemapi.h b/harbour/include/itemapi.h index fc9bac481a..5f7fd37bff 100644 --- a/harbour/include/itemapi.h +++ b/harbour/include/itemapi.h @@ -25,7 +25,7 @@ #ifndef HB_ITEMAPI_H_ #define HB_ITEMAPI_H_ -#include +#include "extend.h" typedef struct { diff --git a/harbour/include/pcode.h b/harbour/include/pcode.h index 8f91837a06..fcfc306f22 100644 --- a/harbour/include/pcode.h +++ b/harbour/include/pcode.h @@ -25,7 +25,7 @@ #ifndef HB_PCODE_H_ #define HB_PCODE_H_ -#include +#include "extend.h" typedef enum { diff --git a/harbour/include/rdd_api.old b/harbour/include/rdd_api.old index 8e1241b4c8..e8b1b12b91 100644 --- a/harbour/include/rdd_api.old +++ b/harbour/include/rdd_api.old @@ -5,144 +5,144 @@ #ifndef HB_RDD_API_ #define HB_RDD_API_ -#include +#include "extend.h" //+ -// Harbour project The free Clipper(tm) compatible xbase compiler +// Harbour project The free Clipper(tm) compatible xbase compiler // -// Harbour RDD.API +// Harbour RDD.API // -// this file is highly compatible with the CA-Clipper RDD.API +// this file is highly compatible with the CA-Clipper RDD.API // // -// NOTE: the defines in the first part of this file -// are included from rddsys.ch take care changing -// the #define +// NOTE: the defines in the first part of this file +// are included from rddsys.ch take care changing +// the #define // // // -// 99.04.25 initial posting. +// 99.04.25 initial posting. // -// all structures are ordered alphabetically (if possible) +// all structures are ordered alphabetically (if possible) // // //- -#define HARBOUR_MAX_RDD_DRIVERNAME_LENGTH 32 -#define HARBOUR_MAX_ALIAS_LENGTH 32 +#define HARBOUR_MAX_RDD_DRIVERNAME_LENGTH 32 +#define HARBOUR_MAX_ALIAS_LENGTH 32 // Flags for DBTRANSINFO -#define DBTF_MATCH 0x0001 -#define DBTF_PUTREC 0x0002 +#define DBTF_MATCH 0x0001 +#define DBTF_PUTREC 0x0002 // Codes for Locking methods -#define DBLM_EXCLUSIVE 1 -#define DBLM_MULTIPLE 2 -#define DBLM_FILE 3 +#define DBLM_EXCLUSIVE 1 +#define DBLM_MULTIPLE 2 +#define DBLM_FILE 3 // Codes for SELF_ORDINFO() -#define DBOI_CONDITION 1 // Get the order condition +#define DBOI_CONDITION 1 // Get the order condition #define DBOI_EXPRESSION 2 // Get the order expression -#define DBOI_POSITION 3 // Get the order position -#define DBOI_RECNO 4 // Get the order record number -#define DBOI_NAME 5 // Get the order list name -#define DBOI_NUMBER 6 // Get the order list position -#define DBOI_BAGNAME 7 // Get the order Bag name -#define DBOI_BAGEXT 8 // Get the order Bag Extension -#define DBOI_INDEXEXT DBOI_BAGEXT -#define DBOI_INDEXNAME DBOI_BAGNAME +#define DBOI_POSITION 3 // Get the order position +#define DBOI_RECNO 4 // Get the order record number +#define DBOI_NAME 5 // Get the order list name +#define DBOI_NUMBER 6 // Get the order list position +#define DBOI_BAGNAME 7 // Get the order Bag name +#define DBOI_BAGEXT 8 // Get the order Bag Extension +#define DBOI_INDEXEXT DBOI_BAGEXT +#define DBOI_INDEXNAME DBOI_BAGNAME #define DBOI_ORDERCOUNT 9 // Get the number of orders in the index file #define DBOI_FILEHANDLE 10 // Get the handle of the index file -#define DBOI_ISCOND 11 // Get the flag if the order has a for condition -#define DBOI_ISDESC 12 // Get the flag if the order is descending -#define DBOI_UNIQUE 13 // Get the flag if the order has the unique attribute set +#define DBOI_ISCOND 11 // Get the flag if the order has a for condition +#define DBOI_ISDESC 12 // Get the flag if the order is descending +#define DBOI_UNIQUE 13 // Get the flag if the order has the unique attribute set // Codes for SELF_INFO() -#define DBI_ISDBF 1 // Logical: RDD support DBF file format? -#define DBI_CANPUTREC 2 // Logical: RDD support Putting Records? +#define DBI_ISDBF 1 // Logical: RDD support DBF file format? +#define DBI_CANPUTREC 2 // Logical: RDD support Putting Records? #define DBI_GETHEADERSIZE 3 // Numeric: Get header size of the file -#define DBI_LASTUPDATE 4 // Date: Last date RDD file updated +#define DBI_LASTUPDATE 4 // Date: Last date RDD file updated #define DBI_GETDELIMITER 5 // String: Get default delimiter #define DBI_SETDELIMITER 6 // String: Set default delimiter -#define DBI_GETRECSIZE 7 // Numeric: Get record size of the file +#define DBI_GETRECSIZE 7 // Numeric: Get record size of the file #define DBI_GETLOCKARRAY 8 // Array: Get an array of locked records -#define DBI_TABLEEXT 9 // String: Get table file extension +#define DBI_TABLEEXT 9 // String: Get table file extension -#define DBI_ISFLOCK 20 // Get file lock status +#define DBI_ISFLOCK 20 // Get file lock status -#define DBI_CHILDCOUNT 22 // Number of opened relations -#define DBI_FILEHANDLE 23 // Handle of opened file +#define DBI_CHILDCOUNT 22 // Number of opened relations +#define DBI_FILEHANDLE 23 // Handle of opened file -#define DBI_BOF 26 // BOF flag - alternate to bof() -#define DBI_EOF 27 // EOF flag - alternate to eof() -#define DBI_DBFILTER 28 // Filter expression -#define DBI_FOUND 29 // FOUND flag - alternate to found -#define DBI_FCOUNT 30 // Number of fields -#define DBI_LOCKCOUNT 31 // Get record size of the file +#define DBI_BOF 26 // BOF flag - alternate to bof() +#define DBI_EOF 27 // EOF flag - alternate to eof() +#define DBI_DBFILTER 28 // Filter expression +#define DBI_FOUND 29 // FOUND flag - alternate to found +#define DBI_FCOUNT 30 // Number of fields +#define DBI_LOCKCOUNT 31 // Get record size of the file #define DBI_VALIDBUFFER 32 // Is the current buffer valid -#define DBI_ALIAS 33 // Alias name of workarea -#define DBI_GETSCOPE 34 // Locate codeblock -#define DBI_LOCKOFFSET 35 // New locking offset -#define DBI_SHARED 36 // Gets/Sets the shared flag +#define DBI_ALIAS 33 // Alias name of workarea +#define DBI_GETSCOPE 34 // Locate codeblock +#define DBI_LOCKOFFSET 35 // New locking offset +#define DBI_SHARED 36 // Gets/Sets the shared flag -#define DBI_MEMOEXT 37 // Gets/Sets the shared flag -#define DBI_MEMOHANDLE 38 // Dos handle for memo file +#define DBI_MEMOEXT 37 // Gets/Sets the shared flag +#define DBI_MEMOHANDLE 38 // Dos handle for memo file #define DBI_MEMOBLOCKSIZE 39 // Blocksize in memo files -#define DBI_DB_VERSION 101 // HOST driver Version +#define DBI_DB_VERSION 101 // HOST driver Version #define DBI_RDD_VERSION 102 // RDD version (current RDD) -#define DBI_USER 1000 // Start of user definable DBI_ values +#define DBI_USER 1000 // Start of user definable DBI_ values // codes for SELF_RECINFO() -#define DBRI_DELETED 1 -#define DBRI_LOCKED 2 -#define DBRI_RECSIZE 3 -#define DBRI_RECNO 4 -#define DBRI_UPDATED 5 +#define DBRI_DELETED 1 +#define DBRI_LOCKED 2 +#define DBRI_RECSIZE 3 +#define DBRI_RECNO 4 +#define DBRI_UPDATED 5 // codes for SELF_FIELDINFO() -#define DBS_NAME 1 -#define DBS_TYPE 2 -#define DBS_LEN 3 -#define DBS_DEC 4 +#define DBS_NAME 1 +#define DBS_TYPE 2 +#define DBS_LEN 3 +#define DBS_DEC 4 // codes for RawLock types -#define FILE_LOCK 1 -#define FILE_UNLOCK 2 -#define REC_LOCK 3 -#define REC_UNLOCK 4 -#define HEADER_LOCK 5 -#define HEADER_UNLOCK 6 -#define APPEND_LOCK 7 -#define APPEND_UNLOCK 8 +#define FILE_LOCK 1 +#define FILE_UNLOCK 2 +#define REC_LOCK 3 +#define REC_UNLOCK 4 +#define HEADER_LOCK 5 +#define HEADER_UNLOCK 6 +#define APPEND_LOCK 7 +#define APPEND_UNLOCK 8 -#define HARBOUR_MAX_FIELDNAME_SIZE 256 -#define INITIAL_NUMBER_OF_WORKAREAS 256 +#define HARBOUR_MAX_FIELDNAME_SIZE 256 +#define INITIAL_NUMBER_OF_WORKAREAS 256 #ifndef _RDDSYS_CH -#define _DBRELINFO struct __DBRELINFO +#define _DBRELINFO struct __DBRELINFO // -// DBFIELDINFO Field structure +// DBFIELDINFO Field structure // // // -// differences (vs. CA Clipper 5.3 spec) -// ULONG in stead of USHORT +// differences (vs. CA Clipper 5.3 spec) +// ULONG in stead of USHORT // // @@ -150,56 +150,56 @@ typedef struct { PDYNSYM atomName; // FIELD (symbol) name note for non dbf files > 10 chars! - ULONG uiType; // FIELD type note non dbf file types allowed - ULONG typeExtended; // FIELD type extended - ULONG uiLen; // Overall FIELD length - ULONG uiDec; // Decimal places of numeric FIELD + ULONG uiType; // FIELD type note non dbf file types allowed + ULONG typeExtended; // FIELD type extended + ULONG uiLen; // Overall FIELD length + ULONG uiDec; // Decimal places of numeric FIELD } DBFIELDINFO; -typedef DBFIELDINFO * LPDBFIELDINFO; +typedef DBFIELDINFO * LPDBFIELDINFO; // -// DBOPENINFO Open info structure +// DBOPENINFO Open info structure // // // typedef struct { - ULONG uiArea; // Work Area number of the data store - PBYTE abName; // The qualified name of the data store - PBYTE atomAlias; // The logical name of the data store - BOOL fShared; // Share mode of the data store - BOOL fReadonly; // Readonly mode of the data store + ULONG uiArea; // Work Area number of the data store + PBYTE abName; // The qualified name of the data store + PBYTE atomAlias; // The logical name of the data store + BOOL fShared; // Share mode of the data store + BOOL fReadonly; // Readonly mode of the data store void * lpdbHeader; // Pointer to a header of the data store } DBOPENINFO; -typedef DBOPENINFO * LPDBOPENINFO; +typedef DBOPENINFO * LPDBOPENINFO; // -// DBORDERCONDINFO Create order for conditional info structure +// DBORDERCONDINFO Create order for conditional info structure // // typedef struct _DBORDERCONDINFO { - BOOL fActive; // - PBYTE abFor; + BOOL fActive; // + PBYTE abFor; HB_ITEM itmCobFor; HB_ITEM itmCobWhile; HB_ITEM itmCobEval; - LONG lStep; - LONG lStartRecno; - LONG lNextCount; - LONG lRecno; - BOOL fRest; - BOOL fDescending; - BOOL fScoped; - BOOL fAll; - BOOL fAdditive; - BOOL fUseCurrent; - BOOL fCustom; - BOOL fNoOptimize; + LONG lStep; + LONG lStartRecno; + LONG lNextCount; + LONG lRecno; + BOOL fRest; + BOOL fDescending; + BOOL fScoped; + BOOL fAll; + BOOL fAdditive; + BOOL fUseCurrent; + BOOL fCustom; + BOOL fNoOptimize; void * lpvCargo; } DBORDERCONDINFO; typedef DBORDERCONDINFO * LPDBORDERCONDINFO; @@ -207,24 +207,24 @@ typedef DBORDERCONDINFO * LPDBORDERCONDINFO; // -// DBORDERCREATE the create order info structure +// DBORDERCREATE the create order info structure // typedef struct { - LPDBORDERCONDINFO lpdbOrdCondInfo; // conditional information - PBYTE abBagName; // Name of the Order bag - PBYTE atomBagName; // + LPDBORDERCONDINFO lpdbOrdCondInfo; // conditional information + PBYTE abBagName; // Name of the Order bag + PBYTE atomBagName; // HB_ITEM itmOrder; // - BOOL fUnique; // Flag to deterimine if all keys are unique + BOOL fUnique; // Flag to deterimine if all keys are unique HB_ITEM itmCobExpr; // Code block containing the KEY expression HB_ITEM abExpr; // String containing the KEY expression } DBORDERCREATEINFO; -typedef DBORDERCREATEINFO * LPDBORDERCREATEINFO; +typedef DBORDERCREATEINFO * LPDBORDERCREATEINFO; // -// DBORDERINFO set index info structure +// DBORDERINFO set index info structure // The Set Index Info structure // typedef struct @@ -233,11 +233,11 @@ typedef struct HB_ITEM itmOrder; // Name or Number of the Order HB_ITEM itmCobExpr; // Code block containing the KEY expression HB_ITEM itmResult; // Operation result - BOOL fAllTags; // Flag for all tags to be opened + BOOL fAllTags; // Flag for all tags to be opened } DBORDERINFO; -typedef DBORDERINFO * LPDBORDERINFO; +typedef DBORDERINFO * LPDBORDERINFO; @@ -253,12 +253,12 @@ typedef struct HB_ITEM lNext; HB_ITEM itmRecID; HB_ITEM fRest; // TRUE if start from the current record - BOOL fIgnoreFilter; - BOOL fIncludeDeleted; - BOOL fLast; - BOOL fIgnoreDuplicates; + BOOL fIgnoreFilter; + BOOL fIncludeDeleted; + BOOL fLast; + BOOL fIgnoreDuplicates; } DBSCOPEINFO; -typedef DBSCOPEINFO * LPDBSCOPEINFO; +typedef DBSCOPEINFO * LPDBSCOPEINFO; // @@ -271,18 +271,18 @@ typedef struct HB_ITEM abFilterText; // String representation of FILTER expression BOOL fFilter; } DBFILTERINFO; -typedef DBFILTERINFO * LPDBFILTERINFO; +typedef DBFILTERINFO * LPDBFILTERINFO; // differences (vs. CA Clipper 5.3 spec) // -// AREA: +// AREA: // // uiSize the struct carries a uiSize HB_ITEM which must be filled with a correct value -// RDDMETHODS equals the previous struct RDDFUNCS far * -// uiArea now a ULONG -// uiFieldExtent now a ULONG -// uiFieldCount now a ULONG -// uiParents now a ULONG +// RDDMETHODS equals the previous struct RDDFUNCS far * +// uiArea now a ULONG +// uiFieldExtent now a ULONG +// uiFieldCount now a ULONG +// uiParents now a ULONG // // @@ -290,42 +290,42 @@ typedef struct RDDFUNCS; typedef struct _AREA { - ULONG uiSize; // size of this struct - ULONG uiSizeRDDmethods; // size of the RDD methods - RDDFUNCS lprfsHost; // Virtual method table for this workarea - ULONG uiArea; // The number assigned to this workarea + ULONG uiSize; // size of this struct + ULONG uiSizeRDDmethods; // size of the RDD methods + RDDFUNCS lprfsHost; // Virtual method table for this workarea + ULONG uiArea; // The number assigned to this workarea void * atomAlias; // Pointer to the alias symbol for this workarea - ULONG uiFieldExtent; // Total number of fields allocated - ULONG uiFieldCount; // Total number of fields used - LPFIELD lpFields; // Pointer to an array of fields + ULONG uiFieldExtent; // Total number of fields allocated + ULONG uiFieldCount; // Total number of fields used + LPFIELD lpFields; // Pointer to an array of fields void * lpFieldExtents; // Void ptr for additional field properties HB_ITEM valResult; // All purpose result holder - BOOL fTop; // TRUE if "top" - BOOL fBottom; // TRUE if "bottom" - BOOL fBof; // TRUE if "bof" - BOOL fEof; // TRUE if "eof" - BOOL fFound; // TRUE if "found" + BOOL fTop; // TRUE if "top" + BOOL fBottom; // TRUE if "bottom" + BOOL fBof; // TRUE if "bof" + BOOL fEof; // TRUE if "eof" + BOOL fFound; // TRUE if "found" - DBSCOPEINFO dbsi; // Info regarding last LOCATE - DBFILTERINFO dbfi; // Filter in effect + DBSCOPEINFO dbsi; // Info regarding last LOCATE + DBFILTERINFO dbfi; // Filter in effect - LPDBORDERCONDINFO lpdbOrdCondInfo; + LPDBORDERCONDINFO lpdbOrdCondInfo; - LPDBRELINFO lpdbRelations; // Parent/Child relationships used - ULONG uiParents; // Number of parents for this area + LPDBRELINFO lpdbRelations; // Parent/Child relationships used + ULONG uiParents; // Number of parents for this area - HANDLE heap; - ULONG heapSize; + HANDLE heap; + ULONG heapSize; - ULONG rddID; // the area number + ULONG rddID; // the area number //HARBOUR defined new variables. for internal use only struct _AREA * next; struct _AREA * prev; - BOOL inUse; - FHANDLE fileHandle; - ULONG uiFlags; - UCHAR * abName; + BOOL inUse; + FHANDLE fileHandle; + ULONG uiFlags; + UCHAR * abName; struct _AREA * superArea; // from which this one inherits } AREA, * AREAP; @@ -338,16 +338,16 @@ typedef _DBRELINFO { HB_ITEM itmCobExpr; // Block representation of the relational SEEK key HB_ITEM abKey; // String representation of the relational SEEK key - AREAP lpaParent; // The parent of this relation - AREAP lpaChild; // The parents children - _DBRELINFO *lpdbriNext; // Next child or parent + AREAP lpaParent; // The parent of this relation + AREAP lpaChild; // The parents children + _DBRELINFO *lpdbriNext; // Next child or parent } DBRELINFO; -typedef DBRELINFO * LPDBRELINFO; +typedef DBRELINFO * LPDBRELINFO; // -// DBEVALINFO The Evaluation Info structure +// DBEVALINFO The Evaluation Info structure // // Contains information necessary for a block evaluation // on each record of the workarea @@ -356,9 +356,9 @@ typedef DBRELINFO * LPDBRELINFO; typedef struct { HB_ITEM itmBlock; // The block to be evaluated - DBSCOPEINFO dbsci; // Scope info that limits the evaluation + DBSCOPEINFO dbsci; // Scope info that limits the evaluation } DBEVALINFO; -typedef DBEVALINFO * LPDBEVALINFO; +typedef DBEVALINFO * LPDBEVALINFO; // @@ -370,14 +370,14 @@ typedef DBEVALINFO * LPDBEVALINFO; typedef struct { - ULONG uiSource; // Field index number from the source - ULONG uiDest; // Destination field index number + ULONG uiSource; // Field index number from the source + ULONG uiDest; // Destination field index number } DBTRANSITEM; -typedef DBTRANSITEM * LPDBTRANSITEM; +typedef DBTRANSITEM * LPDBTRANSITEM; // -// DBTRANSINFO the transfer info structure +// DBTRANSINFO the transfer info structure // // Defines a global transfer of data HB_ITEMs from on workarea // to another @@ -385,14 +385,14 @@ typedef DBTRANSITEM * LPDBTRANSITEM; typedef struct { - AREAP *lpaSource; // Pointer to source work area - AREAP *lpaDest; // Pointer to dest work area - DBSCOPEINFO dbsci; // Scope to limit transfer - ULONG uiFlags; // Transfer attributes + AREAP *lpaSource; // Pointer to source work area + AREAP *lpaDest; // Pointer to dest work area + DBSCOPEINFO dbsci; // Scope to limit transfer + ULONG uiFlags; // Transfer attributes ULONG uiItemCount; // Number of HB_ITEMs below LPDBTRANSITEM lpTransItems; // Array of HB_ITEMs. } DBTRANSINFO; -typedef DBTRANSINFO * LPDBTRANSINFO; +typedef DBTRANSINFO * LPDBTRANSINFO; // // DBSORTITEM the sort HB_ITEM structure @@ -404,16 +404,16 @@ typedef DBTRANSINFO * LPDBTRANSINFO; // typedef struct { - ULONG uiField; // Index into the workarea->fields structure - ULONG uiFlags; // sort flags + ULONG uiField; // Index into the workarea->fields structure + ULONG uiFlags; // sort flags } DBSORTITEM; -typedef DBSORTITEM * LPDBSORTITEM; +typedef DBSORTITEM * LPDBSORTITEM; // Flags for DBSORTITEM -#define SF_ASCEND 1 -#define SF_CASE 2 -#define SF_DESCEND 4 -#define SF_NUM 32 +#define SF_ASCEND 1 +#define SF_CASE 2 +#define SF_DESCEND 4 +#define SF_NUM 32 #define SF_DOUBLE 64 #define SF_LONG 128 @@ -429,12 +429,12 @@ typedef DBSORTITEM * LPDBSORTITEM; typedef struct { - DBTRANSINFO dbtri; // Destination workarea transfer information - LPDBSORTITEM lpdbsItem; // Fields which compose the key values for the sort - ULONG uiItemCount; // the number of fields above + DBTRANSINFO dbtri; // Destination workarea transfer information + LPDBSORTITEM lpdbsItem; // Fields which compose the key values for the sort + ULONG uiItemCount; // the number of fields above } DBSORTINFO; -typedef DBSORTINFO * LPDBSORTINFO; +typedef DBSORTINFO * LPDBSORTINFO; /* @@ -447,40 +447,40 @@ typedef DBSORTINFO * LPDBSORTINFO; typedef struct { - ULONG itmRecID; - ULONG uiMethod; - BOOL fResult; + ULONG itmRecID; + ULONG uiMethod; + BOOL fResult; } DBLOCKINFO; -typedef DBLOCKINFO * LPDBLOCKINFO; +typedef DBLOCKINFO * LPDBLOCKINFO; // -// FIELD the field structure +// FIELD the field structure // // This is the basic unit of access for a workarea // -#define _FIELD struct __FIELD +#define _FIELD struct __FIELD typedef _FIELD { - ULONG uiType; // Field type - ULONG uiTypeExtended; // Field type - extended - ULONG uiLen; // Field length - ULONG uiDec; // Decimal length - ULONG uiArea; // Area this field resides in + ULONG uiType; // Field type + ULONG uiTypeExtended; // Field type - extended + ULONG uiLen; // Field length + ULONG uiDec; // Decimal length + ULONG uiArea; // Area this field resides in void * sym; // Symbol that represents the field - _FIELD *lpfNext; // The next field in the list + _FIELD *lpfNext; // The next field in the list } FIELD; -typedef FIELD * LPFIELD; +typedef FIELD * LPFIELD; // -// differences (vs. CA Clipper 5.3 spec) +// differences (vs. CA Clipper 5.3 spec) // -// RDD FUNCTIONS +// RDD FUNCTIONS // -// dbstruct extra function +// dbstruct extra function // // @@ -489,42 +489,42 @@ typedef struct _RDDFUNCS /* Movement and positioning methods */ union { - ULONG nFunctionCount; + ULONG nFunctionCount; void *FunctionPointer[1]; } u; ERRCODE ( * bof ) ( AREAP, BOOL * ); ERRCODE ( * eof ) ( AREAP, BOOL * ); - ERRCODE ( * found ) ( AREAP, BOOL * ); + ERRCODE ( * found ) ( AREAP, BOOL * ); ERRCODE ( * goBottom ) ( AREAP ); - ERRCODE ( * go ) ( AREAP, ULONG ); + ERRCODE ( * go ) ( AREAP, ULONG ); ERRCODE ( * goToId ) ( AREAP, HB_ITEM ); - ERRCODE ( * goTop ) ( AREAP ); + ERRCODE ( * goTop ) ( AREAP ); ERRCODE ( * seek ) ( AREAP, BOOL, HB_ITEM ); - ERRCODE ( * skip ) ( AREAP, LONG ); + ERRCODE ( * skip ) ( AREAP, LONG ); ERRCODE ( * skipFilter ) ( AREAP, LONG ); - ERRCODE ( * skipRaw ) ( AREAP, LONG ); + ERRCODE ( * skipRaw ) ( AREAP, LONG ); /* Data management */ ERRCODE ( * addField ) ( AREAP, LPDBFIELDINFO ); - ERRCODE ( * append ) ( AREAP, BOOL ); + ERRCODE ( * append ) ( AREAP, BOOL ); ERRCODE ( * createFields ) ( AREAP, void * ); ERRCODE ( * deleterec ) ( AREAP ); - ERRCODE ( * deleted ) ( AREAP, BOOL * ); + ERRCODE ( * deleted ) ( AREAP, BOOL * ); ERRCODE ( * fieldCount ) ( AREAP, ULONG * ); ERRCODE ( * fieldDisplay ) ( AREAP, void * ); ERRCODE ( * fieldInfo ) ( AREAP, ULONG, ULONG, HB_ITEM ); ERRCODE ( * fieldName ) ( AREAP, ULONG, PBYTE ); - ERRCODE ( * flush ) ( AREAP ); - ERRCODE ( * getRec ) ( AREAP, PBYTE * ); + ERRCODE ( * flush ) ( AREAP ); + ERRCODE ( * getRec ) ( AREAP, PBYTE * ); ERRCODE ( * getValue ) ( AREAP, ULONG, HB_ITEM ); ERRCODE ( * getVarLen ) ( AREAP, ULONG, FIELD * ); - ERRCODE ( * goCold ) ( AREAP ); - ERRCODE ( * goHot ) ( AREAP ); - ERRCODE ( * putRec ) ( AREAP, PBYTE ); + ERRCODE ( * goCold ) ( AREAP ); + ERRCODE ( * goHot ) ( AREAP ); + ERRCODE ( * putRec ) ( AREAP, PBYTE ); ERRCODE ( * putValue ) ( AREAP, ULONG, HB_ITEM ); - ERRCODE ( * recall ) ( AREAP ); + ERRCODE ( * recall ) ( AREAP ); ERRCODE ( * reccount ) ( AREAP, ULONG * ); ERRCODE ( * recInfo ) ( AREAP, HB_ITEM, ULONG, HB_ITEM ); ERRCODE ( * recno ) ( AREAP, HB_ITEM ); @@ -532,22 +532,22 @@ typedef struct _RDDFUNCS /* WorkArea/Database management */ - ERRCODE ( * alias ) ( AREAP, PBYTE ); - ERRCODE ( * close ) ( AREAP ); - ERRCODE ( * create ) ( AREAP, LPDBOPENINFO ); + ERRCODE ( * alias ) ( AREAP, PBYTE ); + ERRCODE ( * close ) ( AREAP ); + ERRCODE ( * create ) ( AREAP, LPDBOPENINFO ); ERRCODE ( * info ) ( AREAP, ULONG, HB_ITEM ); - ERRCODE ( * newarea ) ( AREAP ); - ERRCODE ( * open ) ( AREAP, LPDBOPENINFO ); - ERRCODE ( * release ) ( AREAP ); + ERRCODE ( * newarea ) ( AREAP ); + ERRCODE ( * open ) ( AREAP, LPDBOPENINFO ); + ERRCODE ( * release ) ( AREAP ); ERRCODE ( * structSize ) ( AREAP, ULONG * ); - ERRCODE ( * sysName ) ( AREAP, PBYTE ); - ERRCODE ( * dbEval ) ( AREAP, LPDBEVALINFO ); - ERRCODE ( * pack ) ( AREAP ); - ERRCODE ( * packRec ) ( AREAP, LONG, BOOL * ); - ERRCODE ( * sort ) ( AREAP, LPDBSORTINFO ); - ERRCODE ( * trans ) ( AREAP, LPDBTRANSINFO ); + ERRCODE ( * sysName ) ( AREAP, PBYTE ); + ERRCODE ( * dbEval ) ( AREAP, LPDBEVALINFO ); + ERRCODE ( * pack ) ( AREAP ); + ERRCODE ( * packRec ) ( AREAP, LONG, BOOL * ); + ERRCODE ( * sort ) ( AREAP, LPDBSORTINFO ); + ERRCODE ( * trans ) ( AREAP, LPDBTRANSINFO ); ERRCODE ( * transRec ) ( AREAP, LPDBTRANSINFO ); - ERRCODE ( * zap ) ( AREAP ); + ERRCODE ( * zap ) ( AREAP ); /* Relational Methods */ @@ -557,10 +557,10 @@ typedef struct _RDDFUNCS ERRCODE ( * syncChildren ) ( AREAP ); ERRCODE ( * clearRel ) ( AREAP ); ERRCODE ( * forceRel ) ( AREAP ); - ERRCODE ( * relArea ) ( AREAP, ULONG, ULONG * ); - ERRCODE ( * relEval ) ( AREAP, LPDBRELINFO ); - ERRCODE ( * relText ) ( AREAP, ULONG, PBYTE ); - ERRCODE ( * setRel ) ( AREAP, LPDBRELINFO ); + ERRCODE ( * relArea ) ( AREAP, ULONG, ULONG * ); + ERRCODE ( * relEval ) ( AREAP, LPDBRELINFO ); + ERRCODE ( * relText ) ( AREAP, ULONG, PBYTE ); + ERRCODE ( * setRel ) ( AREAP, LPDBRELINFO ); /* Order Management */ @@ -590,14 +590,14 @@ typedef struct _RDDFUNCS /* Miscellaneous */ - ERRCODE ( * compile ) ( AREAP, PBYTE ); - ERRCODE ( * error ) ( AREAP, ERRORP ); + ERRCODE ( * compile ) ( AREAP, PBYTE ); + ERRCODE ( * error ) ( AREAP, ERRORP ); ERRCODE ( * evalBlock ) ( AREAP, HB_ITEM ); /* Network operations */ - ERRCODE ( * rawLock ) ( AREAP, ULONG, LONG ); - ERRCODE ( * lock ) ( AREAP, LPDBLOCKINFO ); + ERRCODE ( * rawLock ) ( AREAP, ULONG, LONG ); + ERRCODE ( * lock ) ( AREAP, LPDBLOCKINFO ); ERRCODE ( * unlock ) ( AREAP, HB_ITEM ); /* Memofile functions */ @@ -627,155 +627,155 @@ typedef RDDFUNCS * LPRDDFUNCS; /* Movement and positioning methods */ -#define SELF_BOF(w, sp) ((*(w)->lprfsHost.bof)(w, sp)) -#define SELF_EOF(w, sp) ((*(w)->lprfsHost.eof)(w, sp)) -#define SELF_FOUND(w, sp) ((*(w)->lprfsHost.found)(w, sp)) -#define SELF_GOTO(w, l) ((*(w)->lprfsHost.go)(w, l)) -#define SELF_GOTOID(w, sp) ((*(w)->lprfsHost.goToId)(w, sp)) -#define SELF_GOBOTTOM(w) ((*(w)->lprfsHost.goBottom)(w)) -#define SELF_GOTOP(w) ((*(w)->lprfsHost.goTop)(w)) -#define SELF_SEEK(w, i, v) ((*(w)->lprfsHost.seek)(w, i, v)) -#define SELF_SKIP(w, l) ((*(w)->lprfsHost.skip)(w, l)) -#define SELF_SKIPFILTER(w, l) ((*(w)->lprfsHost.skipFilter)(w, l)) -#define SELF_SKIPRAW(w, l) ((*(w)->lprfsHost.skipRaw)(w, l)) +#define SELF_BOF(w, sp) ((*(w)->lprfsHost.bof)(w, sp)) +#define SELF_EOF(w, sp) ((*(w)->lprfsHost.eof)(w, sp)) +#define SELF_FOUND(w, sp) ((*(w)->lprfsHost.found)(w, sp)) +#define SELF_GOTO(w, l) ((*(w)->lprfsHost.go)(w, l)) +#define SELF_GOTOID(w, sp) ((*(w)->lprfsHost.goToId)(w, sp)) +#define SELF_GOBOTTOM(w) ((*(w)->lprfsHost.goBottom)(w)) +#define SELF_GOTOP(w) ((*(w)->lprfsHost.goTop)(w)) +#define SELF_SEEK(w, i, v) ((*(w)->lprfsHost.seek)(w, i, v)) +#define SELF_SKIP(w, l) ((*(w)->lprfsHost.skip)(w, l)) +#define SELF_SKIPFILTER(w, l) ((*(w)->lprfsHost.skipFilter)(w, l)) +#define SELF_SKIPRAW(w, l) ((*(w)->lprfsHost.skipRaw)(w, l)) /* Data management */ -#define SELF_ADDFIELD(w, ip) ((*(w)->lprfsHost.addField)(w, ip)) -#define SELF_APPEND(w,l) ((*(w)->lprfsHost.append)(w,l)) +#define SELF_ADDFIELD(w, ip) ((*(w)->lprfsHost.addField)(w, ip)) +#define SELF_APPEND(w,l) ((*(w)->lprfsHost.append)(w,l)) #define SELF_CREATEFIELDS(w, v) ((*(w)->lprfsHost.createFields)(w, v)) -#define SELF_DELETE(w) ((*(w)->lprfsHost.deleterec)(w)) -#define SELF_DELETED(w, sp) ((*(w)->lprfsHost.deleted)(w, sp)) -#define SELF_FIELDCOUNT(w, sp) ((*(w)->lprfsHost.fieldCount)(w, sp)) +#define SELF_DELETE(w) ((*(w)->lprfsHost.deleterec)(w)) +#define SELF_DELETED(w, sp) ((*(w)->lprfsHost.deleted)(w, sp)) +#define SELF_FIELDCOUNT(w, sp) ((*(w)->lprfsHost.fieldCount)(w, sp)) #define SELF_FIELDDISPLAY(w, sp) ((*(w)->lprfsHost.fieldDisplay)(w, sp)) #define SELF_FIELDINFO(w,s1,s2,v) ((*(w)->lprfsHost.fieldInfo)(w,s1,s2,v)) #define SELF_FIELDNAME(w, i, bp) ((*(w)->lprfsHost.fieldName)(w, i, bp)) -#define SELF_FLUSH(w) ((*(w)->lprfsHost.flush)(w)) -#define SELF_GETREC(w, bpp) ((*(w)->lprfsHost.getRec)(w, bpp)) -#define SELF_GETVALUE(w, i, v) ((*(w)->lprfsHost.getValue)(w, i, v)) +#define SELF_FLUSH(w) ((*(w)->lprfsHost.flush)(w)) +#define SELF_GETREC(w, bpp) ((*(w)->lprfsHost.getRec)(w, bpp)) +#define SELF_GETVALUE(w, i, v) ((*(w)->lprfsHost.getValue)(w, i, v)) #define SELF_GETVARLEN(w, i, lp) ((*(w)->lprfsHost.getVarLen)(w, i, lp)) -#define SELF_GOCOLD(w) ((*(w)->lprfsHost.goCold)(w)) -#define SELF_GOHOT(w) ((*(w)->lprfsHost.goHot)(w)) -#define SELF_PUTVALUE(w, i, v) ((*(w)->lprfsHost.putValue)(w, i, v)) -#define SELF_PUTREC(w, bp) ((*(w)->lprfsHost.putRec)(w, bp)) -#define SELF_RECALL(w) ((*(w)->lprfsHost.recall)(w)) -#define SELF_RECCOUNT(w, sp) ((*(w)->lprfsHost.reccount)(w, sp)) +#define SELF_GOCOLD(w) ((*(w)->lprfsHost.goCold)(w)) +#define SELF_GOHOT(w) ((*(w)->lprfsHost.goHot)(w)) +#define SELF_PUTVALUE(w, i, v) ((*(w)->lprfsHost.putValue)(w, i, v)) +#define SELF_PUTREC(w, bp) ((*(w)->lprfsHost.putRec)(w, bp)) +#define SELF_RECALL(w) ((*(w)->lprfsHost.recall)(w)) +#define SELF_RECCOUNT(w, sp) ((*(w)->lprfsHost.reccount)(w, sp)) #define SELF_RECINFO(w,v1,i,v2) ((*(w)->lprfsHost.recInfo)(w,v1,i,v2)) -#define SELF_RECNO(w, i) ((*(w)->lprfsHost.recno)(w, i)) +#define SELF_RECNO(w, i) ((*(w)->lprfsHost.recno)(w, i)) #define SELF_SETFIELDEXTENT(w, s) ((*(w)->lprfsHost.setFieldExtent)(w, s)) /* WorkArea/Database management */ -#define SELF_ALIAS(w, bp) ((*(w)->lprfsHost.alias)(w, bp)) -#define SELF_CLOSE(w) ((*(w)->lprfsHost.close)(w)) -#define SELF_CREATE(w, ip) ((*(w)->lprfsHost.create)(w, ip)) -#define SELF_INFO(w, i, g) ((*(w)->lprfsHost.info)(w, i, g)) -#define SELF_NEW(w) ((*(w)->lprfsHost.newarea)(w)) -#define SELF_OPEN(w, ip) ((*(w)->lprfsHost.open)(w, ip)) -#define SELF_RELEASE(w) ((*(w)->lprfsHost.release)(w)) -#define SELF_STRUCTSIZE(w, sp) ((*(w)->lprfsHost.structSize)(w,sp)) -#define SELF_SYSNAME(w, bp) ((*(w)->lprfsHost.sysName)(w, bp)) -#define SELF_DBEVAL(w, ip) ((*(w)->lprfsHost.dbEval)(w, ip)) -#define SELF_PACK(w) ((*(w)->lprfsHost.pack)(w)) -#define SELF_PACKREC(w, l, sp) ((*(w)->lprfsHost.packRec)(w, l, sp)) -#define SELF_SORT(w, ip) ((*(w)->lprfsHost.sort)(w, ip)) -#define SELF_TRANS(w, ip) ((*(w)->lprfsHost.trans)(w, ip)) -#define SELF_TRANSREC(w, ip) ((*(w)->lprfsHost.transRec)(w, ip)) -#define SELF_ZAP(w) ((*(w)->lprfsHost.zap)(w)) +#define SELF_ALIAS(w, bp) ((*(w)->lprfsHost.alias)(w, bp)) +#define SELF_CLOSE(w) ((*(w)->lprfsHost.close)(w)) +#define SELF_CREATE(w, ip) ((*(w)->lprfsHost.create)(w, ip)) +#define SELF_INFO(w, i, g) ((*(w)->lprfsHost.info)(w, i, g)) +#define SELF_NEW(w) ((*(w)->lprfsHost.newarea)(w)) +#define SELF_OPEN(w, ip) ((*(w)->lprfsHost.open)(w, ip)) +#define SELF_RELEASE(w) ((*(w)->lprfsHost.release)(w)) +#define SELF_STRUCTSIZE(w, sp) ((*(w)->lprfsHost.structSize)(w,sp)) +#define SELF_SYSNAME(w, bp) ((*(w)->lprfsHost.sysName)(w, bp)) +#define SELF_DBEVAL(w, ip) ((*(w)->lprfsHost.dbEval)(w, ip)) +#define SELF_PACK(w) ((*(w)->lprfsHost.pack)(w)) +#define SELF_PACKREC(w, l, sp) ((*(w)->lprfsHost.packRec)(w, l, sp)) +#define SELF_SORT(w, ip) ((*(w)->lprfsHost.sort)(w, ip)) +#define SELF_TRANS(w, ip) ((*(w)->lprfsHost.trans)(w, ip)) +#define SELF_TRANSREC(w, ip) ((*(w)->lprfsHost.transRec)(w, ip)) +#define SELF_ZAP(w) ((*(w)->lprfsHost.zap)(w)) /* Relational Methods */ -#define SELF_CHILDEND(w, ip) ((*(w)->lprfsHost.childEnd)(w, ip)) -#define SELF_CHILDSTART(w, ip) ((*(w)->lprfsHost.childStart)(w, ip)) -#define SELF_CHILDSYNC(w, ip) ((*(w)->lprfsHost.childSync)(w, ip)) -#define SELF_SYNCCHILDREN(w) ((*(w)->lprfsHost.syncChildren)(w)) -#define SELF_CLEARREL(w) ((*(w)->lprfsHost.clearRel)(w)) -#define SELF_FORCEREL(w) ((*(w)->lprfsHost.forceRel)(w)) -#define SELF_RELAREA(w, s, sp) ((*(w)->lprfsHost.relArea)(w, s, sp)) -#define SELF_RELEVAL(w, ip) ((*(w)->lprfsHost.relEval)(w, ip)) -#define SELF_RELTEXT(w, s, bp) ((*(w)->lprfsHost.relText)(w, s, bp)) -#define SELF_SETREL(w, ip) ((*(w)->lprfsHost.setRel)(w, ip)) +#define SELF_CHILDEND(w, ip) ((*(w)->lprfsHost.childEnd)(w, ip)) +#define SELF_CHILDSTART(w, ip) ((*(w)->lprfsHost.childStart)(w, ip)) +#define SELF_CHILDSYNC(w, ip) ((*(w)->lprfsHost.childSync)(w, ip)) +#define SELF_SYNCCHILDREN(w) ((*(w)->lprfsHost.syncChildren)(w)) +#define SELF_CLEARREL(w) ((*(w)->lprfsHost.clearRel)(w)) +#define SELF_FORCEREL(w) ((*(w)->lprfsHost.forceRel)(w)) +#define SELF_RELAREA(w, s, sp) ((*(w)->lprfsHost.relArea)(w, s, sp)) +#define SELF_RELEVAL(w, ip) ((*(w)->lprfsHost.relEval)(w, ip)) +#define SELF_RELTEXT(w, s, bp) ((*(w)->lprfsHost.relText)(w, s, bp)) +#define SELF_SETREL(w, ip) ((*(w)->lprfsHost.setRel)(w, ip)) /* Order Management */ -#define SELF_ORDLSTADD(w, lp) ((*(w)->lprfsHost.orderListAdd)(w, lp)) +#define SELF_ORDLSTADD(w, lp) ((*(w)->lprfsHost.orderListAdd)(w, lp)) #define SELF_ORDLSTDELETE(w, lp) ((*(w)->lprfsHost.orderListDelete)(w, lp)) #define SELF_ORDLSTFOCUS(w, lp) ((*(w)->lprfsHost.orderListFocus)(w,lp)) -#define SELF_ORDLSTREBUILD(w) ((*(w)->lprfsHost.orderListRebuild)(w)) -#define SELF_ORDLSTCLEAR(w) ((*(w)->lprfsHost.orderListClear)(w)) +#define SELF_ORDLSTREBUILD(w) ((*(w)->lprfsHost.orderListRebuild)(w)) +#define SELF_ORDLSTCLEAR(w) ((*(w)->lprfsHost.orderListClear)(w)) -#define SELF_ORDSETCOND(w, ip) ((*(w)->lprfsHost.orderCondition)(w, ip)) -#define SELF_ORDCREATE(w, ip) ((*(w)->lprfsHost.orderCreate)(w, ip)) -#define SELF_ORDDESTROY(w, p) ((*(w)->lprfsHost.orderDestroy)(w, p)) -#define SELF_ORDINFO(w, i, p) ((*(w)->lprfsHost.orderInfo)(w, i, p)) -#define SELF_ORDEXPR(w, p) ((*(w)->lprfsHost.orderInfo)(w, DBOI_EXPRESSION, p)) -#define SELF_ORDCOND(w, p) ((*(w)->lprfsHost.orderInfo)(w, DBOI_CONDITION, p)) -#define SELF_ORDRECNO(w, p) ((*(w)->lprfsHost.orderInfo)(w, DBOI_RECNO, p)) -#define SELF_ORDPOS(w, p) ((*(w)->lprfsHost.orderInfo)(w, DBOI_POSITION, p)) -#define SELF_ORDNUMBER(w, p) ((*(w)->lprfsHost.orderInfo)(w, DBOI_NUMBER, p)) -#define SELF_ORDNAME(w, p) ((*(w)->lprfsHost.orderInfo)(w, DBOI_NAME, p)) -#define SELF_ORDBAGNAME(w, p) ((*(w)->lprfsHost.orderInfo)(w, DBOI_BAGNAME, p)) -#define SELF_ORDBAGEXT(w, p) ((*(w)->lprfsHost.orderInfo)(w, DBOI_BAGEXT, p)) +#define SELF_ORDSETCOND(w, ip) ((*(w)->lprfsHost.orderCondition)(w, ip)) +#define SELF_ORDCREATE(w, ip) ((*(w)->lprfsHost.orderCreate)(w, ip)) +#define SELF_ORDDESTROY(w, p) ((*(w)->lprfsHost.orderDestroy)(w, p)) +#define SELF_ORDINFO(w, i, p) ((*(w)->lprfsHost.orderInfo)(w, i, p)) +#define SELF_ORDEXPR(w, p) ((*(w)->lprfsHost.orderInfo)(w, DBOI_EXPRESSION, p)) +#define SELF_ORDCOND(w, p) ((*(w)->lprfsHost.orderInfo)(w, DBOI_CONDITION, p)) +#define SELF_ORDRECNO(w, p) ((*(w)->lprfsHost.orderInfo)(w, DBOI_RECNO, p)) +#define SELF_ORDPOS(w, p) ((*(w)->lprfsHost.orderInfo)(w, DBOI_POSITION, p)) +#define SELF_ORDNUMBER(w, p) ((*(w)->lprfsHost.orderInfo)(w, DBOI_NUMBER, p)) +#define SELF_ORDNAME(w, p) ((*(w)->lprfsHost.orderInfo)(w, DBOI_NAME, p)) +#define SELF_ORDBAGNAME(w, p) ((*(w)->lprfsHost.orderInfo)(w, DBOI_BAGNAME, p)) +#define SELF_ORDBAGEXT(w, p) ((*(w)->lprfsHost.orderInfo)(w, DBOI_BAGEXT, p)) /* Filters and Scope Settings */ -#define SELF_CLEARFILTER(w) ((*(w)->lprfsHost.clearFilter)(w)) -#define SELF_CLEARLOCATE(w) ((*(w)->lprfsHost.clearLocate)(w)) -#define SELF_CLEARSCOPE(w) ((*(w)->lprfsHost.clearScope)(w)) +#define SELF_CLEARFILTER(w) ((*(w)->lprfsHost.clearFilter)(w)) +#define SELF_CLEARLOCATE(w) ((*(w)->lprfsHost.clearLocate)(w)) +#define SELF_CLEARSCOPE(w) ((*(w)->lprfsHost.clearScope)(w)) #define SELF_COUNTSCOPE(w,ip,lp) ((*(w)->lprfsHost.countScope)(w,ip,lp)) -#define SELF_FILTERTEXT(w, bp) ((*(w)->lprfsHost.filterText)(w, bp)) -#define SELF_SCOPEINFO(w,i,v) ((*(w)->lprfsHost.scopeInfo)(w,i,v)) -#define SELF_SETFILTER(w, ip) ((*(w)->lprfsHost.setFilter)(w, ip)) -#define SELF_SETLOCATE(w, ip) ((*(w)->lprfsHost.setLocate)(w, ip)) -#define SELF_SETSCOPE(w, ip) ((*(w)->lprfsHost.setScope)(w, ip)) +#define SELF_FILTERTEXT(w, bp) ((*(w)->lprfsHost.filterText)(w, bp)) +#define SELF_SCOPEINFO(w,i,v) ((*(w)->lprfsHost.scopeInfo)(w,i,v)) +#define SELF_SETFILTER(w, ip) ((*(w)->lprfsHost.setFilter)(w, ip)) +#define SELF_SETLOCATE(w, ip) ((*(w)->lprfsHost.setLocate)(w, ip)) +#define SELF_SETSCOPE(w, ip) ((*(w)->lprfsHost.setScope)(w, ip)) #define SELF_SKIPSCOPE(w, bp, l) ((*(w)->lprfsHost.skipScope)(w, bp, l)) /* Miscellaneous */ -#define SELF_COMPILE(w, bp) ((*(w)->lprfsHost.compile)(w, bp)) -#define SELF_ERROR(w, ip) ((*(w)->lprfsHost.error)(w, ip)) -#define SELF_EVALBLOCK(w, v) ((*(w)->lprfsHost.evalBlock)(w, v)) +#define SELF_COMPILE(w, bp) ((*(w)->lprfsHost.compile)(w, bp)) +#define SELF_ERROR(w, ip) ((*(w)->lprfsHost.error)(w, ip)) +#define SELF_EVALBLOCK(w, v) ((*(w)->lprfsHost.evalBlock)(w, v)) /* Network operations */ -#define SELF_GETLOCKS(w, g) ((*(w)->lprfsHost.info)(w, DBI_GETLOCKARRAY, g)) -#define SELF_RAWLOCK(w, i, l) ((*(w)->lprfsHost.rawLock)(w, i, l)) -#define SELF_LOCK(w, sp) ((*(w)->lprfsHost.lock)(w, sp)) -#define SELF_UNLOCK(w, l) ((*(w)->lprfsHost.unlock)(w, l)) +#define SELF_GETLOCKS(w, g) ((*(w)->lprfsHost.info)(w, DBI_GETLOCKARRAY, g)) +#define SELF_RAWLOCK(w, i, l) ((*(w)->lprfsHost.rawLock)(w, i, l)) +#define SELF_LOCK(w, sp) ((*(w)->lprfsHost.lock)(w, sp)) +#define SELF_UNLOCK(w, l) ((*(w)->lprfsHost.unlock)(w, l)) /* Memofile functions */ -#define SELF_CLOSEMEMFILE(w) ((*(w)->lprfsHost.closeMemFile)(w)) +#define SELF_CLOSEMEMFILE(w) ((*(w)->lprfsHost.closeMemFile)(w)) #define SELF_CREATEMEMFILE(w,bp) ((*(w)->lprfsHost.createMemFile)(w,bp)) #define SELF_GETVALUEFILE(w,i,bp,b) ((*(w)->lprfsHos.>getValueFile)(w,i,bp,b)) -#define SELF_OPENMEMFILE(w,bp) ((*(w)->lprfsHost.openMemFile)(w,bp)) +#define SELF_OPENMEMFILE(w,bp) ((*(w)->lprfsHost.openMemFile)(w,bp)) #define SELF_PUTVALUEFILE(w,i,bp) ((*(w)->lprfsHost.putValueFile)(w,i,bp)) /* Database file header handling */ -#define SELF_READDBHEADER(w) ((*(w)->lprfsHost.readDBHeader)(w)) -#define SELF_WRITEDBHEADER(w) ((*(w)->lprfsHost.writeDBHeader)(w)) +#define SELF_READDBHEADER(w) ((*(w)->lprfsHost.readDBHeader)(w)) +#define SELF_WRITEDBHEADER(w) ((*(w)->lprfsHost.writeDBHeader)(w)) /* Info operations */ -#define SELF_RECSIZE(w, lp) ((*(w)->lprfsHost.info)(w, DBI_GETRECSIZE, lp)) -#define SELF_HEADERSIZE(w, fp) ((*(w)->lprfsHost.info)(w, DBI_GETHEADERSIZE, fp)) -#define SELF_LUPDATE(w, fp) ((*(w)->lprfsHost.info)(w, DBI_LASTUPDATE, fp )) -#define SELF_SETDELIM(w, fp) ((*(w)->lprfsHost.info)(w, DBI_SETDELIMITER, fp)) -#define SELF_GETDELIM(w, fp) ((*(w)->lprfsHost.info)(w, DBI_GETDELIMITER, fp)) -#define SELF_TABLEEXT(w, fp) ((*(w)->lprfsHost.info)(w, DBI_TABLEEXT, fp)) +#define SELF_RECSIZE(w, lp) ((*(w)->lprfsHost.info)(w, DBI_GETRECSIZE, lp)) +#define SELF_HEADERSIZE(w, fp) ((*(w)->lprfsHost.info)(w, DBI_GETHEADERSIZE, fp)) +#define SELF_LUPDATE(w, fp) ((*(w)->lprfsHost.info)(w, DBI_LASTUPDATE, fp )) +#define SELF_SETDELIM(w, fp) ((*(w)->lprfsHost.info)(w, DBI_SETDELIMITER, fp)) +#define SELF_GETDELIM(w, fp) ((*(w)->lprfsHost.info)(w, DBI_GETDELIMITER, fp)) +#define SELF_TABLEEXT(w, fp) ((*(w)->lprfsHost.info)(w, DBI_TABLEEXT, fp)) -#define SELF_DBSTRUCT(w, fp) ((*(w)->lprfsHost.dbstruct)(w, fp)) +#define SELF_DBSTRUCT(w, fp) ((*(w)->lprfsHost.dbstruct)(w, fp)) /*--------------------* SUPER Methods *------------------------*/ @@ -783,89 +783,89 @@ typedef RDDFUNCS * LPRDDFUNCS; /* Movement and positioning methods */ -#define SUPER_BOF(w, sp) ((*(SUPERTABLE)->bof)(w, sp)) -#define SUPER_EOF(w, sp) ((*(SUPERTABLE)->eof)(w, sp)) -#define SUPER_FOUND(w, sp) ((*(SUPERTABLE)->found)(w, sp)) -#define SUPER_GOTO(w, l) ((*(SUPERTABLE)->go)(w, l)) -#define SUPER_GOTOID(w, sp) ((*(SUPERTABLE)->goToId)(w, sp)) -#define SUPER_GOBOTTOM(w) ((*(SUPERTABLE)->goBottom)(w)) -#define SUPER_GOTOP(w) ((*(SUPERTABLE)->goTop)(w)) -#define SUPER_SEEK(w, i, v) ((*(SUPERTABLE)->seek)(w, i, v)) -#define SUPER_SKIP(w, l) ((*(SUPERTABLE)->skip)(w, l)) -#define SUPER_SKIPFILTER(w, l) ((*(SUPERTABLE)->skipFilter)(w, l)) -#define SUPER_SKIPRAW(w, l) ((*(SUPERTABLE)->skipRaw)(w, l)) +#define SUPER_BOF(w, sp) ((*(SUPERTABLE)->bof)(w, sp)) +#define SUPER_EOF(w, sp) ((*(SUPERTABLE)->eof)(w, sp)) +#define SUPER_FOUND(w, sp) ((*(SUPERTABLE)->found)(w, sp)) +#define SUPER_GOTO(w, l) ((*(SUPERTABLE)->go)(w, l)) +#define SUPER_GOTOID(w, sp) ((*(SUPERTABLE)->goToId)(w, sp)) +#define SUPER_GOBOTTOM(w) ((*(SUPERTABLE)->goBottom)(w)) +#define SUPER_GOTOP(w) ((*(SUPERTABLE)->goTop)(w)) +#define SUPER_SEEK(w, i, v) ((*(SUPERTABLE)->seek)(w, i, v)) +#define SUPER_SKIP(w, l) ((*(SUPERTABLE)->skip)(w, l)) +#define SUPER_SKIPFILTER(w, l) ((*(SUPERTABLE)->skipFilter)(w, l)) +#define SUPER_SKIPRAW(w, l) ((*(SUPERTABLE)->skipRaw)(w, l)) /* Data management */ -#define SUPER_ADDFIELD(w, ip) ((*(SUPERTABLE)->addField)(w, ip)) -#define SUPER_APPEND(w,l) ((*(SUPERTABLE)->append)(w,l)) +#define SUPER_ADDFIELD(w, ip) ((*(SUPERTABLE)->addField)(w, ip)) +#define SUPER_APPEND(w,l) ((*(SUPERTABLE)->append)(w,l)) #define SUPER_CREATEFIELDS(w, v) ((*(SUPERTABLE)->createFields)(w, v)) -#define SUPER_DELETE(w) ((*(SUPERTABLE)->deleterec)(w)) -#define SUPER_DELETED(w, sp) ((*(SUPERTABLE)->deleted)(w, sp)) +#define SUPER_DELETE(w) ((*(SUPERTABLE)->deleterec)(w)) +#define SUPER_DELETED(w, sp) ((*(SUPERTABLE)->deleted)(w, sp)) #define SUPER_FIELDCOUNT(w, sp) ((*(SUPERTABLE)->fieldCount)(w, sp)) #define SUPER_FIELDDISPLAY(w, sp) ((*(SUPERTABLE)->fieldDisplay)(w, sp)) #define SUPER_FIELDINFO(w,s1,s2,v) ((*(SUPERTABLE)->fieldInfo)(w,s1,s2,v)) #define SUPER_FIELDNAME(w, i, bp) ((*(SUPERTABLE)->fieldName)(w, i, bp)) -#define SUPER_FLUSH(w) ((*(SUPERTABLE)->flush)(w)) -#define SUPER_GETREC(w, bpp) ((*(SUPERTABLE)->getRec)(w, bpp)) +#define SUPER_FLUSH(w) ((*(SUPERTABLE)->flush)(w)) +#define SUPER_GETREC(w, bpp) ((*(SUPERTABLE)->getRec)(w, bpp)) #define SUPER_GETVALUE(w, i, v) ((*(SUPERTABLE)->getValue)(w, i, v)) #define SUPER_GETVARLEN(w, i, lp) ((*(SUPERTABLE)->getVarLen)(w, i, lp)) -#define SUPER_GOCOLD(w) ((*(SUPERTABLE)->goCold)(w)) -#define SUPER_GOHOT(w) ((*(SUPERTABLE)->goHot)(w)) +#define SUPER_GOCOLD(w) ((*(SUPERTABLE)->goCold)(w)) +#define SUPER_GOHOT(w) ((*(SUPERTABLE)->goHot)(w)) #define SUPER_PUTVALUE(w, i, v) ((*(SUPERTABLE)->putValue)(w, i, v)) -#define SUPER_PUTREC(w, bp) ((*(SUPERTABLE)->putRec)(w, bp)) -#define SUPER_RECALL(w) ((*(SUPERTABLE)->recall)(w)) -#define SUPER_RECCOUNT(w, sp) ((*(SUPERTABLE)->reccount)(w, sp)) +#define SUPER_PUTREC(w, bp) ((*(SUPERTABLE)->putRec)(w, bp)) +#define SUPER_RECALL(w) ((*(SUPERTABLE)->recall)(w)) +#define SUPER_RECCOUNT(w, sp) ((*(SUPERTABLE)->reccount)(w, sp)) #define SUPER_RECINFO(w,v1,i,v2) ((*(SUPERTABLE)->recInfo)(w,v1,i,v2)) -#define SUPER_RECNO(w, sp) ((*(SUPERTABLE)->recno)(w, sp)) +#define SUPER_RECNO(w, sp) ((*(SUPERTABLE)->recno)(w, sp)) #define SUPER_SETFIELDEXTENT(w, s) ((*(SUPERTABLE)->setFieldExtent)(w, s)) /* WorkArea/Database management */ -#define SUPER_ALIAS(w, bp) ((*(SUPERTABLE)->alias)(w, bp)) -#define SUPER_CLOSE(w) ((*(SUPERTABLE)->close)(w)) -#define SUPER_CREATE(w, ip) ((*(SUPERTABLE)->create)(w, ip)) -#define SUPER_INFO(w, i, g) ((*(SUPERTABLE)->info)(w, i, g)) -#define SUPER_NEW(w) ((*(SUPERTABLE)->newarea)(w)) -//#define SUPER_OPEN(w, ip) ((*(SUPERTABLE)->open)(w, ip)) -#define SUPER_OPEN(w, ip) ((*(w)->superArea->lprfsHost.open)(w, ip)) +#define SUPER_ALIAS(w, bp) ((*(SUPERTABLE)->alias)(w, bp)) +#define SUPER_CLOSE(w) ((*(SUPERTABLE)->close)(w)) +#define SUPER_CREATE(w, ip) ((*(SUPERTABLE)->create)(w, ip)) +#define SUPER_INFO(w, i, g) ((*(SUPERTABLE)->info)(w, i, g)) +#define SUPER_NEW(w) ((*(SUPERTABLE)->newarea)(w)) +//#define SUPER_OPEN(w, ip) ((*(SUPERTABLE)->open)(w, ip)) +#define SUPER_OPEN(w, ip) ((*(w)->superArea->lprfsHost.open)(w, ip)) -#define SUPER_RELEASE(w) ((*(SUPERTABLE)->release)(w)) +#define SUPER_RELEASE(w) ((*(SUPERTABLE)->release)(w)) #define SUPER_STRUCTSIZE(w, sp) ((*(SUPERTABLE)->structSize)(w, sp)) -#define SUPER_SYSNAME(w, bp) ((*(SUPERTABLE)->sysName)(w, bp)) -#define SUPER_DBEVAL(w, ip) ((*(SUPERTABLE)->dbEval)(w, ip)) -#define SUPER_PACK(w) ((*(SUPERTABLE)->pack)(w)) +#define SUPER_SYSNAME(w, bp) ((*(SUPERTABLE)->sysName)(w, bp)) +#define SUPER_DBEVAL(w, ip) ((*(SUPERTABLE)->dbEval)(w, ip)) +#define SUPER_PACK(w) ((*(SUPERTABLE)->pack)(w)) #define SUPER_PACKREC(w, l, sp) ((*(SUPERTABLE)->packRec)(w, l, sp)) -#define SUPER_SORT(w, ip) ((*(SUPERTABLE)->sort)(w, ip)) -#define SUPER_TRANS(w, ip) ((*(SUPERTABLE)->trans)(w, ip)) -#define SUPER_TRANSREC(w, ip) ((*(SUPERTABLE)->transRec)(w, ip)) -#define SUPER_ZAP(w) ((*(SUPERTABLE)->zap)(w)) +#define SUPER_SORT(w, ip) ((*(SUPERTABLE)->sort)(w, ip)) +#define SUPER_TRANS(w, ip) ((*(SUPERTABLE)->trans)(w, ip)) +#define SUPER_TRANSREC(w, ip) ((*(SUPERTABLE)->transRec)(w, ip)) +#define SUPER_ZAP(w) ((*(SUPERTABLE)->zap)(w)) /* Relational Methods */ -#define SUPER_CHILDEND(w, ip) ((*(SUPERTABLE)->childEnd)(w, ip)) +#define SUPER_CHILDEND(w, ip) ((*(SUPERTABLE)->childEnd)(w, ip)) #define SUPER_CHILDSTART(w, ip) ((*(SUPERTABLE)->childStart)(w, ip)) -#define SUPER_CHILDSYNC(w, ip) ((*(SUPERTABLE)->childSync)(w, ip)) -#define SUPER_SYNCCHILDREN(w) ((*(SUPERTABLE)->syncChildren)(w)) -#define SUPER_CLEARREL(w) ((*(SUPERTABLE)->clearRel)(w)) -#define SUPER_FORCEREL(w) ((*(SUPERTABLE)->forceRel)(w)) +#define SUPER_CHILDSYNC(w, ip) ((*(SUPERTABLE)->childSync)(w, ip)) +#define SUPER_SYNCCHILDREN(w) ((*(SUPERTABLE)->syncChildren)(w)) +#define SUPER_CLEARREL(w) ((*(SUPERTABLE)->clearRel)(w)) +#define SUPER_FORCEREL(w) ((*(SUPERTABLE)->forceRel)(w)) #define SUPER_RELAREA(w, s, sp) ((*(SUPERTABLE)->relArea)(w, s, sp)) -#define SUPER_RELEVAL(w, ip) ((*(SUPERTABLE)->relEval)(w, ip)) +#define SUPER_RELEVAL(w, ip) ((*(SUPERTABLE)->relEval)(w, ip)) #define SUPER_RELTEXT(w, s, bp) ((*(SUPERTABLE)->relText)(w, s, bp)) -#define SUPER_SETREL(w, ip) ((*(SUPERTABLE)->setRel)(w, ip)) +#define SUPER_SETREL(w, ip) ((*(SUPERTABLE)->setRel)(w, ip)) /* Order Management */ -#define SUPER_ORDLSTADD(w, lp) ((*(SUPERTABLE)->orderListAdd)(w, lp)) +#define SUPER_ORDLSTADD(w, lp) ((*(SUPERTABLE)->orderListAdd)(w, lp)) #define SUPER_ORDLSTDELETE(w, lp) ((*(SUPERTABLE)->orderListDelete)(w, lp)) #define SUPER_ORDLSTFOCUS(w, lp) ((*(SUPERTABLE)->orderListFocus)(w, lp)) -#define SUPER_ORDLSTREBUILD(w) ((*(SUPERTABLE)->orderListRebuild)(w)) -#define SUPER_ORDLSTCLEAR(w) ((*(SUPERTABLE)->orderListClear)(w)) +#define SUPER_ORDLSTREBUILD(w) ((*(SUPERTABLE)->orderListRebuild)(w)) +#define SUPER_ORDLSTCLEAR(w) ((*(SUPERTABLE)->orderListClear)(w)) #define SUPER_ORDSETCOND(w,ip) ((*(SUPERTABLE)->orderCondition)(w, ip)) #define SUPER_ORDCREATE(w, ip) ((*(SUPERTABLE)->orderCreate)(w, ip)) @@ -883,36 +883,36 @@ typedef RDDFUNCS * LPRDDFUNCS; /* Filters and Scope Settings */ -#define SUPER_CLEARFILTER(w) ((*(SUPERTABLE)->clearFilter)(w)) -#define SUPER_CLEARLOCATE(w) ((*(SUPERTABLE)->clearLocate)(w)) -#define SUPER_CLEARSCOPE(w) ((*(SUPERTABLE)->clearScope)(w)) +#define SUPER_CLEARFILTER(w) ((*(SUPERTABLE)->clearFilter)(w)) +#define SUPER_CLEARLOCATE(w) ((*(SUPERTABLE)->clearLocate)(w)) +#define SUPER_CLEARSCOPE(w) ((*(SUPERTABLE)->clearScope)(w)) #define SUPER_COUNTSCOPE(w,ip,lp) ((*(SUPERTABLE)->countScope)(w,ip,lp)) #define SUPER_FILTERTEXT(w, bp) ((*(SUPERTABLE)->filterText)(w, bp)) -#define SUPER_SCOPEINFO(w,i,v) ((*(SUPERTABLE)->scopeInfo)(w,i,v)) -#define SUPER_SETFILTER(w, ip) ((*(SUPERTABLE)->setFilter)(w, ip)) -#define SUPER_SETLOCATE(w, ip) ((*(SUPERTABLE)->setLocate)(w, ip)) -#define SUPER_SETSCOPE(w, ip) ((*(SUPERTABLE)->setScope)(w, ip)) +#define SUPER_SCOPEINFO(w,i,v) ((*(SUPERTABLE)->scopeInfo)(w,i,v)) +#define SUPER_SETFILTER(w, ip) ((*(SUPERTABLE)->setFilter)(w, ip)) +#define SUPER_SETLOCATE(w, ip) ((*(SUPERTABLE)->setLocate)(w, ip)) +#define SUPER_SETSCOPE(w, ip) ((*(SUPERTABLE)->setScope)(w, ip)) #define SUPER_SKIPSCOPE(w, bp, l) ((*(SUPERTABLE)->skipScope)(w, bp, l)) /* Miscellaneous */ -#define SUPER_COMPILE(w, bp) ((*(SUPERTABLE)->compile)(w, bp)) -#define SUPER_ERROR(w, ip) ((*(SUPERTABLE)->error)(w, ip)) -#define SUPER_EVALBLOCK(w, v) ((*(SUPERTABLE)->evalBlock)(w, v)) +#define SUPER_COMPILE(w, bp) ((*(SUPERTABLE)->compile)(w, bp)) +#define SUPER_ERROR(w, ip) ((*(SUPERTABLE)->error)(w, ip)) +#define SUPER_EVALBLOCK(w, v) ((*(SUPERTABLE)->evalBlock)(w, v)) /* Network operations */ -#define SUPER_GETLOCKS(w, g) ((*(SUPERTABLE)->info)(w, DBI_GETLOCKARRAY, g)) -#define SUPER_RAWLOCK(w, i, l) ((*(SUPERTABLE)->rawlock)(w, i, l)) -#define SUPER_LOCK(w, sp) ((*(SUPERTABLE)->lock)(w, sp)) -#define SUPER_UNLOCK(w) ((*(SUPERTABLE)->unlock)(w)) +#define SUPER_GETLOCKS(w, g) ((*(SUPERTABLE)->info)(w, DBI_GETLOCKARRAY, g)) +#define SUPER_RAWLOCK(w, i, l) ((*(SUPERTABLE)->rawlock)(w, i, l)) +#define SUPER_LOCK(w, sp) ((*(SUPERTABLE)->lock)(w, sp)) +#define SUPER_UNLOCK(w) ((*(SUPERTABLE)->unlock)(w)) /* Memofile functions */ -#define SUPER_CLOSEMEMFILE(w) ((*(SUPERTABLE)->closeMemFile)(w)) +#define SUPER_CLOSEMEMFILE(w) ((*(SUPERTABLE)->closeMemFile)(w)) #define SUPER_CREATEMEMFILE(w,bp) ((*(SUPERTABLE)->createMemFile)(w,bp)) #define SUPER_GETVALUEFILE(w,i,bp,b) ((*(SUPERTABLE)->getValueFile)(w,i,bp,b)) #define SUPER_OPENMEMFILE(w,bp) ((*(SUPERTABLE)->openMemFile)(w,bp)) @@ -921,41 +921,41 @@ typedef RDDFUNCS * LPRDDFUNCS; /* Database file header handling */ -#define SUPER_READDBHEADER(w) ((*(SUPERTABLE)->readDBHeader)(w)) -#define SUPER_WRITEDBHEADER(w) ((*(SUPERTABLE)->writeDBHeader)(w)) +#define SUPER_READDBHEADER(w) ((*(SUPERTABLE)->readDBHeader)(w)) +#define SUPER_WRITEDBHEADER(w) ((*(SUPERTABLE)->writeDBHeader)(w)) /* Info operations */ -#define SUPER_RECSIZE(w, lp) ((*(SUPERTABLE)->info)(w, DBI_GETRECSIZE, lp)) +#define SUPER_RECSIZE(w, lp) ((*(SUPERTABLE)->info)(w, DBI_GETRECSIZE, lp)) #define SUPER_HEADERSIZE(w, fp) ((*(SUPERTABLE)->info)(w, DBI_GETHEADERSIZE, fp)) -#define SUPER_LUPDATE(w, fp) ((*(SUPERTABLE)->info)(w, DBI_LASTUPDATE, fp )) -#define SUPER_SETDELIM(w, fp) ((*(SUPERTABLE)->info)(w, DBI_SETDELIMITER, fp)) -#define SUPER_GETDELIM(w, fp) ((*(SUPERTABLE)->info)(w, DBI_GETDELIMITER, fp)) -#define SUPER_TABLEEXT(w, fp) ((*(SUPERTABLE)->info)(w, DBI_TABLEEXT, fp)) +#define SUPER_LUPDATE(w, fp) ((*(SUPERTABLE)->info)(w, DBI_LASTUPDATE, fp )) +#define SUPER_SETDELIM(w, fp) ((*(SUPERTABLE)->info)(w, DBI_SETDELIMITER, fp)) +#define SUPER_GETDELIM(w, fp) ((*(SUPERTABLE)->info)(w, DBI_GETDELIMITER, fp)) +#define SUPER_TABLEEXT(w, fp) ((*(SUPERTABLE)->info)(w, DBI_TABLEEXT, fp)) typedef void (*RDDENTRY)( ULONG *nCount, RDDFUNCS *p); typedef void (*WORKAREA_FUNCTION)( AREAP workarea ); -#define RDD_REGISTER struct _rddRegister +#define RDD_REGISTER struct _rddRegister RDD_REGISTER { - RDD_REGISTER *next; - RDD_REGISTER *prev; - RDDENTRY rddEntry; - char RDDdriver[ HARBOUR_MAX_RDD_DRIVERNAME_LENGTH ]; + RDD_REGISTER *next; + RDD_REGISTER *prev; + RDDENTRY rddEntry; + char RDDdriver[ HARBOUR_MAX_RDD_DRIVERNAME_LENGTH ]; }; -char *hb_default_rdd( void ); -ULONG max_workarea( void ); -ULONG SetWorkAreaNumber( ULONG n ); -AREAP getCurrentWorkArea( void ); -RDD_REGISTER *findRDD( char *cRDD ); -void all_workareas( WORKAREA_FUNCTION func ); -AREAP createNewWorkArea( void ); -BOOL is_inUse( AREAP p); -void AttachRDDtoThisWorkarea( AREAP workarea, char *cRDD); -ULONG LookupAliasName( char *cAlias ); +char *hb_default_rdd( void ); +ULONG max_workarea( void ); +ULONG SetWorkAreaNumber( ULONG n ); +AREAP getCurrentWorkArea( void ); +RDD_REGISTER *findRDD( char *cRDD ); +void all_workareas( WORKAREA_FUNCTION func ); +AREAP createNewWorkArea( void ); +BOOL is_inUse( AREAP p); +void AttachRDDtoThisWorkarea( AREAP workarea, char *cRDD); +ULONG LookupAliasName( char *cAlias ); #endif #endif /* HB_RDD_API_ */ diff --git a/harbour/include/set.h b/harbour/include/set.h index 7741acbc72..794827e438 100644 --- a/harbour/include/set.h +++ b/harbour/include/set.h @@ -29,6 +29,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit their web site at http://www.gnu.org/). + V 1.19 Victor Szel #include changed to #include "x". V 1.18 David G. Holm Added INKEY_EXTENDED to allow some platforms to select between normal and extended key codes. @@ -70,7 +71,7 @@ #ifndef HB_SET_H_ #define HB_SET_H_ -#include +#include "hbdefs.h" HARBOUR HB_SET( void ); HARBOUR HB_SETCENTURY( void ); diff --git a/harbour/makefile.b16 b/harbour/makefile.b16 index e0b77f0c16..5b285b0489 100644 --- a/harbour/makefile.b16 +++ b/harbour/makefile.b16 @@ -17,7 +17,7 @@ harbour.lib : arrays.obj asort.obj classes.obj codebloc.obj dates.obj \ errorapi.obj errorsys.obj extend.obj files.obj \ hardcr.obj initsymb.obj itemapi.obj math.obj memvars.obj \ mathx.obj mtran.obj objfunc.obj set.obj setcolor.obj stringp.obj \ - strings.obj stringsx.obj strcmp.obj tclass.obj transfrm.obj + strings.obj stringsx.obj tclass.obj transfrm.obj libs\b16\terminal.lib : console.obj @@ -56,7 +56,6 @@ mtran.obj : mtran.c extend.h hbdefs.h objfunc.obj : objfunc.c extend.h hbdefs.h set.obj : set.c extend.h hbdefs.h setcolor.obj : setcolor.c extend.h hbdefs.h init.h pcode.h -strcmp.obj : strcmp.c extend.h hbdefs.h stringp.obj : stringp.c extend.h hbdefs.h strings.obj : strings.c extend.h hbdefs.h stringsx.obj : stringsx.c extend.h hbdefs.h diff --git a/harbour/makefile.b31 b/harbour/makefile.b31 index 9f98f38b69..7329d1c06e 100644 --- a/harbour/makefile.b31 +++ b/harbour/makefile.b31 @@ -19,7 +19,7 @@ harbour.lib : arrays.obj asort.obj classes.obj codebloc.obj copyfile.obj \ error.obj errorapi.obj errorsys.obj extend.obj \ files.obj gtapi.obj hardcr.obj initsymb.obj itemapi.obj \ math.obj memvars.obj mtran.obj msguk.obj objfunc.obj \ - set.obj setcolor.obj strings.obj strcmp.obj symbols.obj \ + set.obj setcolor.obj strings.obj symbols.obj \ tclass.obj transfrm.obj hbtools.lib : dates2.obj datesx.obj debug.obj hb_f.obj io.obj mathx.obj \ @@ -65,7 +65,6 @@ mtran.obj : mtran.c extend.h hbdefs.h objfunc.obj : objfunc.prg extend.h hbdefs.h init.h pcode.h set.obj : set.c extend.h hbdefs.h set.h setcolor.obj : setcolor.c extend.h hbdefs.h init.h pcode.h -strcmp.obj : strcmp.c extend.h hbdefs.h set.h strings.obj : strings.c extend.h hbdefs.h set.h symbols.obj : symbols.asm tclass.obj : tclass.prg extend.h hbdefs.h init.h pcode.h diff --git a/harbour/makefile.b32 b/harbour/makefile.b32 index b932a6548e..0a178a2754 100644 --- a/harbour/makefile.b32 +++ b/harbour/makefile.b32 @@ -19,7 +19,7 @@ harbour.lib : arrays.obj asort.obj classes.obj codebloc.obj \ hardcr.obj hb_f.obj initsymb.obj inkey.obj itemapi.obj memvars.obj \ math.obj mathx.obj msguk.obj mtran.obj objfunc.obj \ set.obj setcolor.obj symbols.obj strings.obj stringp.obj \ - stringsx.obj strcmp.obj tclass.obj transfrm.obj copyfile.obj + stringsx.obj tclass.obj transfrm.obj copyfile.obj symbols.obj : symbols.asm @@ -55,7 +55,6 @@ mtran.obj : mtran.c extend.h hbdefs.h objfunc.obj : objfunc.c extend.h hbdefs.h set.obj : set.c extend.h hbdefs.h setcolor.obj : setcolor.c extend.h hbdefs.h init.h pcode.h -strcmp.obj : strcmp.c extend.h hbdefs.h stringp.obj : stringp.c extend.h hbdefs.h strings.obj : strings.c extend.h hbdefs.h stringsx.obj : stringsx.c extend.h hbdefs.h diff --git a/harbour/makefile.b40 b/harbour/makefile.b40 index ced5d8b412..5c620f6c05 100644 --- a/harbour/makefile.b40 +++ b/harbour/makefile.b40 @@ -19,7 +19,7 @@ harbour.lib : arrays.obj asort.obj classes.obj codebloc.obj \ hardcr.obj hb_f.obj initsymb.obj itemapi.obj memvars.obj \ math.obj mathx.obj msguk.obj mtran.obj objfunc.obj \ set.obj setcolor.obj symbols.obj strings.obj stringp.obj \ - stringsx.obj strcmp.obj tclass.obj transfrm.obj copyfile.obj + stringsx.obj tclass.obj transfrm.obj copyfile.obj symbols.obj : symbols.asm @@ -54,7 +54,6 @@ mtran.obj : mtran.c extend.h hbdefs.h objfunc.obj : objfunc.c extend.h hbdefs.h set.obj : set.c extend.h hbdefs.h setcolor.obj : setcolor.c extend.h hbdefs.h init.h pcode.h -strcmp.obj : strcmp.c extend.h hbdefs.h stringp.obj : stringp.c extend.h hbdefs.h strings.obj : strings.c extend.h hbdefs.h stringsx.obj : stringsx.c extend.h hbdefs.h diff --git a/harbour/makefile.vc b/harbour/makefile.vc index 99a9250c5f..01e33b6821 100644 --- a/harbour/makefile.vc +++ b/harbour/makefile.vc @@ -77,7 +77,6 @@ HARBOUR_LIB_OBJS = \ $(OBJ_DIR)\objfunc.obj \ $(OBJ_DIR)\set.obj \ $(OBJ_DIR)\setcolor.obj \ - $(OBJ_DIR)\strcmp.obj \ $(OBJ_DIR)\strings.obj \ $(OBJ_DIR)\tclass.obj \ $(OBJ_DIR)\transfrm.obj @@ -284,9 +283,6 @@ $(OBJ_DIR)\set.obj : $(RTL_DIR)\set.c $(OBJ_DIR)\setcolor.obj : $(RTL_DIR)\setcolor.c $(CC) $(CLIBFLAGS) -Fo$@ $** -$(OBJ_DIR)\strcmp.obj : $(RTL_DIR)\strcmp.c - $(CC) $(CLIBFLAGS) -Fo$@ $** - $(OBJ_DIR)\strings.obj : $(RTL_DIR)\strings.c $(CC) $(CLIBFLAGS) -Fo$@ $** diff --git a/harbour/source/compiler/genobj32.c b/harbour/source/compiler/genobj32.c index cc0f3e3296..1abb264ab6 100644 --- a/harbour/source/compiler/genobj32.c +++ b/harbour/source/compiler/genobj32.c @@ -27,10 +27,10 @@ #include #include -#include -#include -#include -#include +#include "hbdefs.h" +#include "compiler.h" +#include "extend.h" +#include "pcode.h" static void CompiledFileName( FILE * hObjFile, char * szFileName ); static void CompilerVersion( FILE * hObjFile, char * szVersion ); @@ -56,7 +56,7 @@ static void GenerateSymbolsSegment( FILE * hObjFile ); extern FUNCTIONS functions, funcalls; extern SYMBOLS symbols; -extern int _iQuiet, _iStartProc; +extern int _bQuiet, _bStartProc; static BYTE prgFunction[] = { 0x68, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x83, 0xC4, 0x08, 0xC3 }; @@ -74,7 +74,7 @@ void GenObj32( char * szObjFileName, char * szFileName ) return; } - if( ! _iQuiet ) + if( ! _bQuiet ) printf( "\ngenerating Windows/Dos OBJ 32 bits..." ); CompiledFileName( hObjFile, szFileName ); @@ -88,20 +88,20 @@ void GenObj32( char * szObjFileName, char * szFileName ) fclose( hObjFile ); - if( ! _iQuiet ) + if( ! _bQuiet ) printf( "\n%s -> done!\n", szObjFileName ); } static ULONG GetSymbolsSize( void ) { - return ( symbols.iCount - ( _iStartProc ? 0: 1 ) ) * sizeof( SYMBOL ); + return ( symbols.iCount - ( _bStartProc ? 0: 1 ) ) * sizeof( SYMBOL ); } static PCOMSYMBOL GetFirstSymbol( void ) { PCOMSYMBOL pSymbol = symbols.pFirst; - if( ! _iStartProc ) + if( ! _bStartProc ) pSymbol = pSymbol->pNext; return pSymbol; @@ -123,7 +123,7 @@ static ULONG GetPCodesSize( void ) ULONG ulTotal = 0; PFUNCTION pFunction = functions.pFirst; - if( ! _iStartProc ) + if( ! _bStartProc ) pFunction = pFunction->pNext; while( pFunction ) @@ -245,9 +245,9 @@ static void GenerateDataSegment( FILE * hObjFile ) static void GenerateCodeSegment( FILE * hObjFile ) { - WORD wFunctions = functions.iCount - ( _iStartProc ? 0: 1 ); + WORD wFunctions = functions.iCount - ( _bStartProc ? 0: 1 ); ULONG ulSize = wFunctions * sizeof( prgFunction ); - PFUNCTION pFunc = ( _iStartProc ? functions.pFirst: functions.pFirst->pNext ); + PFUNCTION pFunc = ( _bStartProc ? functions.pFirst: functions.pFirst->pNext ); WORD w = 0; DefineSegment( hObjFile, 2, /* "_TEXT" position + 1 into localNames */ @@ -449,9 +449,9 @@ static void CodeSegment( FILE * hObjFile, BYTE * prgCode, ULONG ulPrgLen, WORD w WORD wTotalLen = ( ulPrgLen * wFunctions ) + 4; ULONG ul; PFUNCTION pFunction = functions.pFirst; - ULONG ulPCodeOffset = ( symbols.iCount - ( _iStartProc ? 0: 1 ) ) * sizeof( SYMBOL ); + ULONG ulPCodeOffset = ( symbols.iCount - ( _bStartProc ? 0: 1 ) ) * sizeof( SYMBOL ); - if( ! _iStartProc ) + if( ! _bStartProc ) pFunction = pFunction->pNext; putbyte( 0xA0, hObjFile ); @@ -492,7 +492,7 @@ static void DataSegment( FILE * hObjFile, BYTE * symbol, WORD wSymLen, WORD wSym ULONG ulSymbolNameOffset = GetSymbolsSize() + GetPCodesSize(); ULONG ulFunctionOffset; - if( ! _iStartProc ) + if( ! _bStartProc ) pFunction = pFunction->pNext; putbyte( 0xA0, hObjFile ); diff --git a/harbour/source/compiler/harbour.l b/harbour/source/compiler/harbour.l index cac01e1357..f9da7bb5c8 100644 --- a/harbour/source/compiler/harbour.l +++ b/harbour/source/compiler/harbour.l @@ -65,8 +65,8 @@ int yy_lex_input( char *, int ); #define YY_INPUT( buf, result, max_size ) result = yy_lex_input( buf, max_size ); /* variables defined in harbour.y */ -extern int _iQuiet; -extern int _iRestrictSymbolLength; +extern int _bQuiet; +extern int _bRestrictSymbolLength; extern WORD _wSeqCounter; extern WORD _wForCounter; extern WORD _wIfCounter; @@ -213,7 +213,7 @@ Separator {SpaceTab} {SpaceTab} ; -\n.* _iState=LOOKUP; yyless( 1 ); ++iLine; if( ! _iQuiet ) printf( "\rline: %i", iLine ); return '\n'; +\n.* _iState=LOOKUP; yyless( 1 ); ++iLine; if( ! _bQuiet ) printf( "\rline: %i", iLine ); return '\n'; %{ /* ************************************************************************ */ %} @@ -1176,7 +1176,7 @@ Separator {SpaceTab} yytext[yyleng] = 0; { - if( _iRestrictSymbolLength && strlen( yytext ) > 10 ) + if( _bRestrictSymbolLength && strlen( yytext ) > 10 ) { yytext[ 10 ] = 0; yyleng = 10; @@ -1218,7 +1218,7 @@ Separator {SpaceTab} } {Identifier} { - if( _iRestrictSymbolLength && strlen( yytext ) > 10 ) + if( _bRestrictSymbolLength && strlen( yytext ) > 10 ) { yytext[ 10 ] = 0; yyleng = 10; diff --git a/harbour/source/compiler/harbour.y b/harbour/source/compiler/harbour.y index 4eb59f7238..62bd51683f 100644 --- a/harbour/source/compiler/harbour.y +++ b/harbour/source/compiler/harbour.y @@ -48,7 +48,7 @@ #include "compiler.h" #include "hberrors.h" #include "hbpp.h" -#include "version.h" +#include "hbver.h" #define debug_msg( x, z ) @@ -219,7 +219,7 @@ void MessageFix( char * szMsgName ); /* fix a generated message to an object void MessageDupl( char * szMsgName ); /* fix a one generated message to an object and duplicate */ void PopId( char * szVarName ); /* generates the pcode to pop a value from the virtual machine stack onto a variable */ void PushDouble( double fNumber, BYTE bDec ); /* Pushes a number on the virtual machine stack */ -void PushFunCall( char * ); /* generates the pcode to push function's call */ +void PushFunCall( char * ); /* generates the pcode to push function's call */ void PushId( char * szVarName ); /* generates the pcode to push a variable value to the virtual machine stack */ void PushIdByRef( char * szVarName ); /* generates the pcode to push a variable by reference to the virtual machine stack */ void PushInteger( int iNumber ); /* Pushes a integer number on the virtual machine stack */ @@ -422,16 +422,17 @@ FILES files; FUNCTIONS functions, funcalls; PFUNCTION _pInitFunc; SYMBOLS symbols; -int _iStartProc = 1; /* holds if we need to create the starting procedure */ -int _iLineNumbers = 1; /* holds if we need pcodes with line numbers */ -int _iQuiet = 0; /* quiet mode */ -int _iSyntaxCheckOnly = 0; /* syntax check only */ -int _iLanguage = LANG_C; /* default Harbour generated output language */ -int _iRestrictSymbolLength = 0; /* generate 10 chars max symbols length */ -int _iShortCuts = 1; /* .and. & .or. expressions shortcuts */ -int _iWarnings = 0; /* enable parse warnings */ -int _iAutoMemvarAssume = 0; /* holds if undeclared variables are automatically assumed MEMVAR */ -int _iForceMemvars = 0; /* holds if memvars are assumed when accesing undeclared variable */ + +BOOL _bStartProc = TRUE; /* holds if we need to create the starting procedure */ +BOOL _bLineNumbers = TRUE; /* holds if we need pcodes with line numbers */ +BOOL _bQuiet = FALSE; /* quiet mode */ +BOOL _bSyntaxCheckOnly = FALSE; /* syntax check only */ +int _iLanguage = LANG_C; /* default Harbour generated output language */ +BOOL _bRestrictSymbolLength = FALSE; /* generate 10 chars max symbols length */ +BOOL _bShortCuts = TRUE; /* .and. & .or. expressions shortcuts */ +BOOL _bWarnings = FALSE; /* enable parse warnings */ +BOOL _bAutoMemvarAssume = FALSE; /* holds if undeclared variables are automatically assumed MEMVAR */ +BOOL _bForceMemvars = FALSE; /* holds if memvars are assumed when accesing undeclared variable */ WORD _wSeqCounter = 0; WORD _wForCounter = 0; @@ -440,10 +441,10 @@ WORD _wWhileCounter = 0; WORD _wCaseCounter = 0; LONG _lMessageFix = 0; /* Position of the message which needs to be changed */ #ifdef HARBOUR_OBJ_GENERATION -int _iObj32 = 0; /* generate OBJ 32 bits */ +BOOL _bObj32 = FALSE; /* generate OBJ 32 bits */ #endif -WORD _wStatics = 0; /* number of defined statics variables on the PRG */ -PRETURN pReturns = 0; /* list of multiple returns from a function */ +WORD _wStatics = 0; /* number of defined statics variables on the PRG */ +PRETURN pReturns = 0; /* list of multiple returns from a function */ PEXTERN pExterns = 0; PTR_LOOPEXIT pLoops = 0; PATHNAMES *_pIncludePath = NULL; @@ -516,7 +517,7 @@ extern int _iState; /* current parser state (defined in harbour.l */ Main : { Line(); } Source { FixReturns(); /* fix all previous function returns offsets */ - if( ! _iQuiet ) printf( "\nsyntax ok\n" ); + if( ! _bQuiet ) printf( "\nsyntax ok\n" ); } Source : Crlf @@ -694,7 +695,7 @@ Expression : NIL { PushNil(); } IfInline : IIF '(' Expression ',' { $$ = JumpFalse( 0 ); } IfInlExp ',' { $$ = Jump( 0 ); JumpHere( $5 ); } IfInlExp ')' { JumpHere( $8 ); - if( _iWarnings ) + if( _bWarnings ) { PSTACK_VAL_TYPE pFree; @@ -715,7 +716,7 @@ IfInline : IIF '(' Expression ',' { $$ = JumpFalse( 0 ); } IfInlExp ',' { $$ = Jump( 0 ); JumpHere( $5 ); } IfInlExp ')' { JumpHere( $8 ); - if( _iWarnings ) + if( _bWarnings ) { PSTACK_VAL_TYPE pFree; @@ -843,10 +844,10 @@ Operators : Expression '=' Expression { GenPCode1( HB_P_EQUAL ); } /* comp | Expression '%' Expression { GenPCode1( HB_P_MODULUS ); } | Expression LE Expression { GenPCode1( HB_P_LESSEQUAL ); } | Expression GE Expression { GenPCode1( HB_P_GREATEREQUAL ); } - | Expression AND { if( _iShortCuts ){ Duplicate(); $$ = JumpFalse( 0 ); } } - Expression { GenPCode1( HB_P_AND ); if( _iShortCuts ) JumpHere( $3 ); } - | Expression OR { if( _iShortCuts ){ Duplicate(); $$ = JumpTrue( 0 ); } } - Expression { GenPCode1( HB_P_OR ); if( _iShortCuts ) JumpHere( $3 ); } + | Expression AND { if( _bShortCuts ){ Duplicate(); $$ = JumpFalse( 0 ); } } + Expression { GenPCode1( HB_P_AND ); if( _bShortCuts ) JumpHere( $3 ); } + | Expression OR { if( _bShortCuts ){ Duplicate(); $$ = JumpTrue( 0 ); } } + Expression { GenPCode1( HB_P_OR ); if( _bShortCuts ) JumpHere( $3 ); } | Expression EQ Expression { GenPCode1( HB_P_EXACTLYEQUAL ); } | Expression NE1 Expression { GenPCode1( HB_P_NOTEQUAL ); } | Expression NE2 Expression { GenPCode1( HB_P_NOTEQUAL ); } @@ -1148,7 +1149,7 @@ void GenError( char* _szErrors[], char cPrefix, int iError, char * szError1, cha void GenWarning( int iWarning, char * szWarning1, char * szWarning2 ) { - if( _iWarnings && iWarning < WARN_ASSIGN_SUSPECT ) /*TODO add switch to set level */ + if( _bWarnings && iWarning < WARN_ASSIGN_SUSPECT ) /*TODO add switch to set level */ { char * szLine = ( char * ) OurMalloc( 160 ); /*2 lines of text */ printf( "\r%s(%i) ", files.pLast->szFileName, iLine ); @@ -1189,12 +1190,12 @@ int harbour_main( int argc, char * argv[] ) { case '1': if( argv[ iArg ][ 2 ] == '0' ) - _iRestrictSymbolLength = 1; + _bRestrictSymbolLength = TRUE; break; case 'a': case 'A': - _iAutoMemvarAssume =1; + _bAutoMemvarAssume = TRUE; break; case 'd': @@ -1220,7 +1221,7 @@ int harbour_main( int argc, char * argv[] ) { char * szUpper = yy_strupr( yy_strdup( &argv[ iArg ][ 2 ] ) ); if( ! strcmp( szUpper, "OBJ32" ) ) - _iObj32 = 1; + _bObj32 = TRUE; free( szUpper ); } break; @@ -1267,12 +1268,12 @@ int harbour_main( int argc, char * argv[] ) case 'l': case 'L': - _iLineNumbers = 0; + _bLineNumbers = FALSE; break; case 'n': case 'N': - _iStartProc = 0; + _bStartProc = FALSE; break; case 'o': @@ -1288,22 +1289,22 @@ int harbour_main( int argc, char * argv[] ) case 'q': case 'Q': - _iQuiet = 1; + _bQuiet = TRUE; break; case 's': case 'S': - _iSyntaxCheckOnly = 1; + _bSyntaxCheckOnly = TRUE; break; case 'v': case 'V': - _iForceMemvars =1; + _bForceMemvars = TRUE; break; case 'w': case 'W': - _iWarnings = 1; + _bWarnings = TRUE; break; case 'y': @@ -1313,7 +1314,7 @@ int harbour_main( int argc, char * argv[] ) case 'z': case 'Z': - _iShortCuts = 0; + _bShortCuts = FALSE; break; default: @@ -1382,7 +1383,7 @@ int harbour_main( int argc, char * argv[] ) /* Generate the starting procedure frame */ - if( _iStartProc ) + if( _bStartProc ) FunDef( yy_strupr( yy_strdup( _pFileName->name ) ), FS_PUBLIC, FUN_PROCEDURE ); else /* Don't pass the name of module if the code for starting procedure @@ -1398,9 +1399,9 @@ int harbour_main( int argc, char * argv[] ) files.pLast = NULL; #ifdef HARBOUR_OBJ_GENERATION - if( ! _iSyntaxCheckOnly && ! _iObj32 ) + if( ! _bSyntaxCheckOnly && ! _bObj32 ) #else - if( ! _iSyntaxCheckOnly ) + if( ! _bSyntaxCheckOnly ) #endif { if( _pInitFunc ) @@ -1454,7 +1455,7 @@ int harbour_main( int argc, char * argv[] ) } } #ifdef HARBOUR_OBJ_GENERATION - if( _iObj32 ) + if( _bObj32 ) { _pFileName->extension = ".obj"; MakeFilename( szFileName, _pFileName ); @@ -1703,7 +1704,7 @@ void AddVar( char * szVarName ) PVAR pVar, pLastVar; PFUNCTION pFunc =functions.pLast; - if( ! _iStartProc && functions.iCount <= 1 && iVarScope == VS_LOCAL ) + if( ! _bStartProc && functions.iCount <= 1 && iVarScope == VS_LOCAL ) { /* Variable declaration is outside of function/procedure body. In this case only STATIC and PARAMETERS variables are allowed. */ @@ -1760,7 +1761,7 @@ void AddVar( char * szVarName ) PCOMSYMBOL pSym; WORD wPos; - if( _iAutoMemvarAssume || iVarScope == VS_MEMVAR ) + if( _bAutoMemvarAssume || iVarScope == VS_MEMVAR ) { /** add this variable to the list of MEMVAR variables */ @@ -1906,7 +1907,7 @@ int Include( char * szFileName, PATHNAMES *pSearch ) { pFileName->path =pSearch->szPath; MakeFilename( szFName, pFileName ); - yyin = fopen( szFName, "r" ); + yyin = fopen( szFName, "r" ); if( ! yyin ) { pSearch = pSearch->pNext; @@ -1920,11 +1921,11 @@ int Include( char * szFileName, PATHNAMES *pSearch ) return 0; } - if( !_iQuiet ) + if( !_bQuiet ) printf( "Harbour compiler build %i (%04d.%02d.%02d)\n", hb_build, hb_year, hb_month, hb_day ); - if( ! _iQuiet ) + if( ! _bQuiet ) printf( "\nparsing file %s\n", szFileName ); pFile = ( PFILE ) OurMalloc( sizeof( _FILE ) ); @@ -1962,7 +1963,7 @@ int yywrap( void ) /* handles the EOF of the currently processed file */ fclose( files.pLast->handle ); files.pLast = ( PFILE ) ( ( PFILE ) files.pLast )->pPrev; iLine = files.pLast->iLine; - if( ! _iQuiet ) + if( ! _bQuiet ) printf( "\nparsing file %s\n", files.pLast->szFileName ); #ifdef __cplusplus yy_delete_buffer( (YY_BUFFER_STATE) ( ( PFILE ) pLast )->pBuffer ); @@ -1985,7 +1986,7 @@ void Duplicate( void ) { GenPCode1( HB_P_DUPLICATE ); - if( _iWarnings ) + if( _bWarnings ) { PSTACK_VAL_TYPE pNewStackType; @@ -2048,13 +2049,13 @@ void FunDef( char * szFunName, SYMBOLSCOPE cScope, int iType ) if( pFunc ) { /* The name of a function/procedure is already defined */ - if( ( pFunc != functions.pFirst ) || _iStartProc ) + if( ( pFunc != functions.pFirst ) || _bStartProc ) /* it is not a starting procedure that was automatically created */ GenError( _szCErrors, 'E', ERR_FUNC_DUPL, szFunName, NULL ); } pFunction = (char * *)RESERVED_FUNC( szFunName ); - if( pFunction && !( functions.iCount==0 && !_iStartProc ) ) + if( pFunction && !( functions.iCount==0 && !_bStartProc ) ) { /* We are ignoring it when it is the name of PRG file and we are * not creating implicit starting procedure @@ -2134,13 +2135,13 @@ void GenCCode( char *szFileName, char *szName ) /* generates the C languag return; } - if( ! _iQuiet ) + if( ! _bQuiet ) printf( "\nGenerating C language output...\n" ); fprintf( yyc, "#include \"pcode.h\"\n" ); - fprintf( yyc, "#include \n\n" ); + fprintf( yyc, "#include \"init.h\"\n\n" ); - if( ! _iStartProc ) + if( ! _bStartProc ) pFunc = pFunc->pNext; /* No implicit starting procedure */ /* write functions prototypes for PRG defined functions */ @@ -2171,7 +2172,7 @@ void GenCCode( char *szFileName, char *szName ) /* generates the C languag yy_strupr( _pFileName->name ); fprintf( yyc, "\n\nHB_INIT_SYMBOLS_BEGIN( %s__InitSymbols )\n", _pFileName->name ); - if( ! _iStartProc ) + if( ! _bStartProc ) pSym = pSym->pNext; /* starting procedure is always the first symbol */ wSym = 0; /* symbols counter */ @@ -2229,7 +2230,7 @@ void GenCCode( char *szFileName, char *szName ) /* generates the C languag /* Generate functions data */ pFunc = functions.pFirst; - if( ! _iStartProc ) + if( ! _bStartProc ) pFunc = pFunc->pNext; /* No implicit starting procedure */ while( pFunc ) { @@ -2854,7 +2855,7 @@ void GenCCode( char *szFileName, char *szName ) /* generates the C languag while( pSym ) pSym = KillSymbol( pSym ); - if( ! _iQuiet ) + if( ! _bQuiet ) printf( "%s -> done!\n", szFileName ); } @@ -3022,7 +3023,7 @@ WORD GetVarPos( PVAR pVars, char * szVarName ) /* returns the order + 1 of a var { if( pVars->szName && ! strcmp( pVars->szName, szVarName ) ) { - if( _iWarnings ) + if( _bWarnings ) { PSTACK_VAL_TYPE pNewStackType; @@ -3158,7 +3159,7 @@ int GetStaticVarPos( char *szVarName ) * Note: It is not possible to have global static variables when * implicit starting procedure is defined */ - if( !_iStartProc ) + if( !_bStartProc ) { iPos =GetVarPos( functions.pFirst->pStatics, szVarName ); if( iPos ) @@ -3180,7 +3181,7 @@ WORD GetAliasedVarPos( PVAR pVars, char *szAlias, char *szVarName ) { if( pVars->szName && ! strcmp( pVars->szName, szVarName ) ) { - if( _iWarnings ) + if( _bWarnings ) { PSTACK_VAL_TYPE pNewStackType; @@ -3232,7 +3233,7 @@ int GetFieldVarPos( char *szVarName ) /* If not found on the list declared in current function then check * the global list (only if there will be no starting procedure) */ - if( ! iVar && ! _iStartProc ) + if( ! iVar && ! _bStartProc ) iVar =GetAliasedVarPos( functions.pFirst->pFields, NULL, szVarName ); return iVar; @@ -3261,7 +3262,7 @@ int GetMemvarPos( char *szVarName ) /* if not found on the list declared in current function then check * the global list (only if there will be no starting procedure) */ - if( ! iVar && ! _iStartProc ) + if( ! iVar && ! _bStartProc ) iVar =GetAliasedVarPos( functions.pFirst->pMemvars, NULL, szVarName ); return iVar; @@ -3269,7 +3270,7 @@ int GetMemvarPos( char *szVarName ) WORD FixSymbolPos( WORD wCompilePos ) { - return (_iStartProc ? wCompilePos-1 : wCompilePos-2); + return (_bStartProc ? wCompilePos-1 : wCompilePos-2); } @@ -3319,7 +3320,7 @@ PCOMSYMBOL GetSymbolOrd( WORD wSymbol ) /* returns a symbol based on its index WORD GetFunctionPos( char * szFunctionName ) /* return 0 if not found or order + 1 */ { PFUNCTION pFunc = functions.pFirst; - WORD wFunction = _iStartProc; + WORD wFunction = _bStartProc; while( pFunc ) { @@ -3343,7 +3344,7 @@ void Inc( void ) { GenPCode1( HB_P_INC ); - if( _iWarnings ) + if( _bWarnings ) { char sType[2]; @@ -3374,7 +3375,7 @@ WORD JumpFalse( int iOffset ) { GenPCode3( HB_P_JUMPFALSE, LOBYTE( iOffset ), HIBYTE( iOffset ) ); - if( _iWarnings ) + if( _bWarnings ) { PSTACK_VAL_TYPE pFree; char sType[2]; @@ -3389,9 +3390,9 @@ WORD JumpFalse( int iOffset ) /* compile time Operand value */ if( pStackValType && pStackValType->cType == ' ' ) - GenWarning( WARN_LOGICAL_SUSPECT, NULL, NULL ); + GenWarning( WARN_LOGICAL_SUSPECT, NULL, NULL ); else if( pStackValType && pStackValType->cType != 'L') - GenWarning( WARN_LOGICAL_TYPE, sType, NULL ); + GenWarning( WARN_LOGICAL_TYPE, sType, NULL ); /* compile time assignment value has to be released */ pFree = pStackValType; @@ -3428,7 +3429,7 @@ WORD JumpTrue( int iOffset ) { GenPCode3( HB_P_JUMPTRUE, LOBYTE( iOffset ), HIBYTE( iOffset ) ); - if( _iWarnings ) + if( _bWarnings ) { PSTACK_VAL_TYPE pFree; char sType[2]; @@ -3443,9 +3444,9 @@ WORD JumpTrue( int iOffset ) /* compile time Operand value */ if( pStackValType && pStackValType->cType == ' ' ) - GenWarning( WARN_LOGICAL_SUSPECT, NULL, NULL ); + GenWarning( WARN_LOGICAL_SUSPECT, NULL, NULL ); else if( pStackValType && pStackValType->cType != 'L') - GenWarning( WARN_LOGICAL_TYPE, sType, NULL ); + GenWarning( WARN_LOGICAL_TYPE, sType, NULL ); /* compile time assignment value has to be released */ pFree = pStackValType; @@ -3467,7 +3468,7 @@ WORD JumpTrue( int iOffset ) void Line( void ) /* generates the pcode with the currently compiled source code line */ { - if( _iLineNumbers ) + if( _bLineNumbers ) GenPCode3( HB_P_LINE, LOBYTE( iLine ), HIBYTE( iLine ) ); } @@ -3477,14 +3478,14 @@ void LineBody( void ) /* generates the pcode with the currently compiled source /* except EXTERNAL */ if( _iState != EXTERN ) { - if( ! _iStartProc && functions.iCount <= 1 ) + if( ! _bStartProc && functions.iCount <= 1 ) { GenError( _szCErrors, 'E', ERR_OUTSIDE, NULL, NULL ); } } functions.pLast->bFlags |= FUN_STATEMENTS; - if( _iLineNumbers ) + if( _bLineNumbers ) GenPCode3( HB_P_LINE, LOBYTE( iLine ), HIBYTE( iLine ) ); } @@ -3496,7 +3497,7 @@ void MemvarPCode( BYTE bPCode, char * szVarName ) WORD wVar; PCOMSYMBOL pVar; - if( _iForceMemvars ) + if( _bForceMemvars ) { wVar =GetMemvarPos( szVarName ); if( ! wVar ) @@ -3537,7 +3538,7 @@ void Message( char * szMsgName ) /* sends a message to an object */ pSym->cScope |= FS_MESSAGE; GenPCode3( HB_P_MESSAGE, LOBYTE( wSym ), HIBYTE( wSym ) ); - if( _iWarnings ) + if( _bWarnings ) { PSTACK_VAL_TYPE pNewStackType; char cType; @@ -3615,7 +3616,7 @@ void PopId( char * szVarName ) /* generates the pcode to pop a value from the vi } } - if( _iWarnings ) + if( _bWarnings ) { PSTACK_VAL_TYPE pVarType, pFree; char sType[2]; @@ -3628,16 +3629,16 @@ void PopId( char * szVarName ) /* generates the pcode to pop a value from the vi sType[0] = pVarType->cType; sType[1] = 0; - /* skip back to the assigned value */ - pStackValType = pStackValType->pPrev; + /* skip back to the assigned value */ + pStackValType = pStackValType->pPrev; } else debug_msg( "\n***PopId() Compile time stack overflow\n", NULL ); if( pVarType && pStackValType && pVarType->cType != ' ' && pStackValType->cType == ' ' ) - GenWarning( WARN_ASSIGN_SUSPECT, szVarName, sType ); + GenWarning( WARN_ASSIGN_SUSPECT, szVarName, sType ); else if( pVarType && pStackValType && pVarType->cType != ' ' && pVarType->cType != pStackValType->cType ) - GenWarning( WARN_ASSIGN_TYPE, szVarName, sType ); + GenWarning( WARN_ASSIGN_TYPE, szVarName, sType ); /* compile time variable has to be released */ if( pVarType ) @@ -3696,7 +3697,7 @@ void PushId( char * szVarName ) /* generates the pcode to push a variable value } } - if( _iWarnings ) + if( _bWarnings ) { PSTACK_VAL_TYPE pNewStackType; @@ -3746,7 +3747,7 @@ void PushLogical( int iTrueFalse ) /* pushes a logical value on the virtual mach else GenPCode1( HB_P_FALSE ); - if( _iWarnings ) + if( _bWarnings ) { PSTACK_VAL_TYPE pNewStackType; @@ -3763,7 +3764,7 @@ void PushNil( void ) { GenPCode1( HB_P_PUSHNIL ); - if( _iWarnings ) + if( _bWarnings ) { PSTACK_VAL_TYPE pNewStackType; @@ -3783,7 +3784,7 @@ void PushDouble( double dNumber, BYTE bDec ) GenPCodeN( ( BYTE * ) &dNumber, sizeof( double ) ); GenPCode1( bDec ); - if( _iWarnings ) + if( _bWarnings ) { PSTACK_VAL_TYPE pNewStackType; @@ -3820,7 +3821,7 @@ void PushInteger( int iNumber ) else GenPCode1( HB_P_ZERO ); - if( _iWarnings ) + if( _bWarnings ) { PSTACK_VAL_TYPE pNewStackType; @@ -3847,7 +3848,7 @@ void PushLong( long lNumber ) else GenPCode1( HB_P_ZERO ); - if( _iWarnings ) + if( _bWarnings ) { PSTACK_VAL_TYPE pNewStackType; @@ -3868,7 +3869,7 @@ void PushString( char * szText ) GenPCode3( HB_P_PUSHSTR, LOBYTE(wStrLen), HIBYTE(wStrLen) ); GenPCodeN( ( BYTE * ) szText, wStrLen ); - if( _iWarnings ) + if( _bWarnings ) { PSTACK_VAL_TYPE pNewStackType; @@ -3913,7 +3914,7 @@ void PushSymbol( char * szSymbolName, int iIsFunction ) } GenPCode3( HB_P_PUSHSYM, LOBYTE( wSym ), HIBYTE( wSym ) ); - if( _iWarnings ) + if( _bWarnings ) { PSTACK_VAL_TYPE pNewStackType; char cType; @@ -3951,7 +3952,7 @@ void Dec( void ) { GenPCode1( HB_P_DEC ); - if( _iWarnings ) + if( _bWarnings ) { char sType[2]; @@ -3979,7 +3980,7 @@ void Do( BYTE bParams ) { GenPCode3( HB_P_DO, bParams, 0 ); - if( _iWarnings ) + if( _bWarnings ) { PSTACK_VAL_TYPE pFree; int i; @@ -3995,7 +3996,7 @@ void Do( BYTE bParams ) else debug_msg( "\n***Do() Compile time stack overflow\n", NULL ); - if( pFree ) + if( pFree ) { OurFree( (void *) pFree ); } @@ -4045,7 +4046,7 @@ void FixReturns( void ) /* fixes all last defined function returns jumps offsets { PRETURN pLast = pReturns, pDelete; - if( _iWarnings && functions.pLast ) + if( _bWarnings && functions.pLast ) { PVAR pVar; @@ -4116,7 +4117,7 @@ void Function( BYTE bParams ) { GenPCode3( HB_P_FUNCTION, bParams, 0 ); - if( _iWarnings ) + if( _bWarnings ) { PSTACK_VAL_TYPE pFree; int i; @@ -4132,7 +4133,7 @@ void Function( BYTE bParams ) else debug_msg( "\n***Function() parameter %i Compile time stack overflow\n", i ); - if( pFree ) + if( pFree ) { OurFree( (void *) pFree ); } @@ -4158,7 +4159,7 @@ void GenArray( WORD wElements ) { GenPCode3( HB_P_GENARRAY, LOBYTE( wElements ), HIBYTE( wElements ) ); - if( _iWarnings ) + if( _bWarnings ) { PSTACK_VAL_TYPE pFree; WORD wIndex; @@ -4205,7 +4206,7 @@ void GenPCode1( BYTE byte ) PFUNCTION pFunc = functions.pLast; /* get the currently defined Clipper function */ /* Releasing value consumed by HB_P_ARRAYPUT */ - if( _iWarnings ) + if( _bWarnings ) { if( byte == HB_P_PUSHSELF ) { @@ -4222,13 +4223,13 @@ void GenPCode1( BYTE byte ) { PSTACK_VAL_TYPE pFree; - /* Releasing compile time assignment value */ + /* Releasing compile time assignment value */ pFree = pStackValType; debug_msg( "\n***---ArrayPut()\n", NULL ); if( pStackValType ) pStackValType = pStackValType->pPrev; - else + else debug_msg( "\n***HB_P_ARRAYPUT Compile time stack overflow\n", NULL ); if( pFree ) @@ -4236,7 +4237,7 @@ void GenPCode1( BYTE byte ) OurFree( (void *) pFree ); } - /* Releasing compile time array element index value */ + /* Releasing compile time array element index value */ pFree = pStackValType; debug_msg( "\n***---HB_P_ARRAYPUT\n", NULL ); @@ -4588,7 +4589,7 @@ void CodeBlockEnd() pVar = pCodeblock->pLocals; while( pVar ) { - if( _iWarnings && pFunc->szName && pVar->szName && ! pVar->iUsed ) + if( _bWarnings && pFunc->szName && pVar->szName && ! pVar->iUsed ) GenWarning( WARN_BLOCKVAR_NOT_USED, pVar->szName, pFunc->szName ); /* free used variables */ @@ -4599,11 +4600,11 @@ void CodeBlockEnd() } OurFree( (void *) pCodeblock ); - if( _iWarnings ) + if( _bWarnings ) { if( pStackValType ) - /* reusing the place holder of the result value */ - pStackValType->cType = 'B'; + /* reusing the place holder of the result value */ + pStackValType->cType = 'B'; else debug_msg( "\n***CodeBlockEnd() Compile time stack overflow\n", NULL ); } @@ -4690,7 +4691,7 @@ void StaticDefEnd( WORD wCount ) _wStatics += wCount; iVarScope =VS_LOCAL; - if( _iWarnings ) + if( _bWarnings ) { PSTACK_VAL_TYPE pFree; @@ -4921,12 +4922,12 @@ void GenPortObj( char *szFileName, char *szName ) if( 0 && szName ) printf("/* just to keep compiler silent */" ); #endif - if( ! _iQuiet ) + if( ! _bQuiet ) printf( "\ngenerating portable object file...\n" ); /* writes the symbol table */ - if( ! _iStartProc ) + if( ! _bStartProc ) pSym = pSym->pNext; /* starting procedure is always the first symbol */ lSymbols = 0; /* Count number of symbols */ @@ -4941,7 +4942,7 @@ void GenPortObj( char *szFileName, char *szName ) fputc( (BYTE) ( ( lSymbols >> 24 ) & 255 ), yyc ); pSym = symbols.pFirst; - if( ! _iStartProc ) + if( ! _bStartProc ) pSym = pSym->pNext; /* starting procedure is always the first symbol */ while( pSym ) @@ -4979,7 +4980,7 @@ void GenPortObj( char *szFileName, char *szName ) } pFunc = functions.pFirst; - if( ! _iStartProc ) + if( ! _bStartProc ) pFunc = pFunc->pNext; lSymbols = 0; /* Count number of symbols */ @@ -4996,7 +4997,7 @@ void GenPortObj( char *szFileName, char *szName ) /* Generate functions data */ pFunc = functions.pFirst; - if( ! _iStartProc ) + if( ! _bStartProc ) pFunc = pFunc->pNext; /* No implicit starting procedure */ while( pFunc ) @@ -5195,7 +5196,7 @@ void GenPortObj( char *szFileName, char *szName ) fclose( yyc ); - if( ! _iQuiet ) + if( ! _bQuiet ) printf( "%s -> done!\n", szFileName ); } diff --git a/harbour/source/hbpp/harb.h b/harbour/source/hbpp/harb.h index d84adcd4a2..fd39af6c36 100644 --- a/harbour/source/hbpp/harb.h +++ b/harbour/source/hbpp/harb.h @@ -5,8 +5,8 @@ #ifndef HB_HARB_H_ #define HB_HARB_H_ -#include -#include +#include "hbsetup.h" +#include "hbdefs.h" #include "hbpp.h" /* includes common definitions shared by preprocessor and harbour.y */ #define PATH_DELIMITER "/\\" diff --git a/harbour/source/hbpp/preproc.c b/harbour/source/hbpp/preproc.c index 1de1a55968..6727fcde1d 100644 --- a/harbour/source/hbpp/preproc.c +++ b/harbour/source/hbpp/preproc.c @@ -34,11 +34,11 @@ */ -#include -#include -#include #include -#include +#include "hbsetup.h" +#include "extend.h" +#include "itemapi.h" +#include "init.h" #include "harb.h" #define SKIPTABSPACES(sptr) while ( *sptr == ' ' || *sptr == '\t' ) (sptr)++ diff --git a/harbour/source/odbc/odbc.c b/harbour/source/odbc/odbc.c index 4667efd961..48e0e18a40 100644 --- a/harbour/source/odbc/odbc.c +++ b/harbour/source/odbc/odbc.c @@ -37,10 +37,10 @@ #include #include #include -#include -#include #include -#include +#include "extend.h" +#include "itemapi.h" +#include "init.h" #include "harb.h" #include #include diff --git a/harbour/source/rdd/dbcmd.c b/harbour/source/rdd/dbcmd.c index c659ca7946..7a082d0e4b 100644 --- a/harbour/source/rdd/dbcmd.c +++ b/harbour/source/rdd/dbcmd.c @@ -22,14 +22,14 @@ You can contact me at: bruno@issnet.net */ -#include -#include -#include -#include -#include -#include -#include -#include +#include "extend.h" +#include "init.h" +#include "itemapi.h" +#include "errorapi.h" +#include "set.h" +#include "rdd.api" +#include "ctoharb.h" +#include "set.ch" #define HARBOUR_MAX_RDD_DRIVERNAME_LENGTH 32 diff --git a/harbour/source/rdd/dbfntx1.c b/harbour/source/rdd/dbfntx1.c index abf205061a..00c6887041 100644 --- a/harbour/source/rdd/dbfntx1.c +++ b/harbour/source/rdd/dbfntx1.c @@ -22,9 +22,9 @@ You can contact me at: bruno@issnet.net */ -#include -#include -#include +#include "extend.h" +#include "init.h" +#include "rdd.api" HARBOUR HB_REQUEST_DBFNTX1( void ); HARBOUR HB_DBFNTX_GETFUNCTABLE( void ); diff --git a/harbour/source/rtl/Makefile b/harbour/source/rtl/Makefile index 26cbf6a301..60d9e0fbb2 100644 --- a/harbour/source/rtl/Makefile +++ b/harbour/source/rtl/Makefile @@ -26,7 +26,6 @@ C_SOURCES=\ mtran.c \ set.c \ setcolor.c \ - strcmp.c \ strings.c \ transfrm.c \ \ diff --git a/harbour/source/rtl/arrays.c b/harbour/source/rtl/arrays.c index eae43904b3..2880b29bfc 100644 --- a/harbour/source/rtl/arrays.c +++ b/harbour/source/rtl/arrays.c @@ -22,12 +22,12 @@ You can contact me at: alinares@fivetech.com */ -#include -#include -#include -#include -#include -#include +#include "itemapi.h" +#include "extend.h" +#include "errorapi.h" +#include "ctoharb.h" +#include "init.h" +#include "dates.h" HARBOUR HB_AADD(void); HARBOUR HB_ACLONE(void); @@ -179,7 +179,7 @@ void hb_arrayNew( PHB_ITEM pItem, ULONG ulLen ) /* creates a new array */ PBASEARRAY pBaseArray = ( PBASEARRAY ) hb_xgrab( sizeof( BASEARRAY ) ); ULONG ul; - ItemRelease( pItem ); + hb_itemClear( pItem ); pItem->type = IT_ARRAY; @@ -204,7 +204,7 @@ void hb_arrayAdd( PHB_ITEM pArray, PHB_ITEM pValue ) PBASEARRAY pBaseArray = ( PBASEARRAY ) pArray->item.asArray.value; hb_arraySize( pArray, pBaseArray->ulLen + 1 ); pBaseArray = ( PBASEARRAY ) pArray->item.asArray.value; - ItemCopy( pBaseArray->pItems + ( pBaseArray->ulLen - 1 ), pValue ); + hb_itemCopy( pBaseArray->pItems + ( pBaseArray->ulLen - 1 ), pValue ); } void hb_arrayGet( PHB_ITEM pArray, ULONG ulIndex, PHB_ITEM pItem ) @@ -212,7 +212,7 @@ void hb_arrayGet( PHB_ITEM pArray, ULONG ulIndex, PHB_ITEM pItem ) if( IS_ARRAY( pArray ) ) { if( ulIndex <= ( unsigned )hb_arrayLen( pArray ) ) - ItemCopy( pItem, pArray->item.asArray.value->pItems + ( ulIndex - 1 ) ); + hb_itemCopy( pItem, pArray->item.asArray.value->pItems + ( ulIndex - 1 ) ); else { hb_errorRT_BASE(EG_BOUND, 1132, NULL, hb_ErrorNatDescription(EG_ARRACCESS)); @@ -298,10 +298,10 @@ int hb_arrayGetType( PHB_ITEM pArray, ULONG ulIndex ) void hb_arrayLast( PHB_ITEM pArray, PHB_ITEM pResult ) { if ( pArray->item.asArray.value->ulLen ) - ItemCopy( pResult, pArray->item.asArray.value->pItems + + hb_itemCopy( pResult, pArray->item.asArray.value->pItems + ( pArray->item.asArray.value->ulLen - 1 ) ); else - ItemRelease( pResult ); + hb_itemClear( pResult ); } ULONG hb_arrayLen( PHB_ITEM pArray ) @@ -320,7 +320,7 @@ void hb_arraySet( PHB_ITEM pArray, ULONG ulIndex, PHB_ITEM pItem ) if( IS_ARRAY( pArray ) ) { if( ulIndex <= ( unsigned )hb_arrayLen( pArray ) ) - ItemCopy( pArray->item.asArray.value->pItems + ( ulIndex - 1 ), pItem ); + hb_itemCopy( pArray->item.asArray.value->pItems + ( ulIndex - 1 ), pItem ); else { hb_errorRT_BASE(EG_BOUND, 1133, NULL, hb_ErrorNatDescription(EG_ARRASSIGN)); @@ -359,7 +359,7 @@ void hb_arraySize( PHB_ITEM pArray, ULONG ulLen ) { /* release old items */ for( ul = ulLen; ul < pBaseArray->ulLen; ul++ ) - ItemRelease( pBaseArray->pItems + ul ); + hb_itemClear( pBaseArray->pItems + ul ); pBaseArray->pItems = ( PHB_ITEM )hb_xrealloc( pBaseArray->pItems, sizeof( HB_ITEM ) * ulLen ); } @@ -387,7 +387,7 @@ void hb_arrayFill( PHB_ITEM pArray, PHB_ITEM pValue, ULONG ulStart, ULONG ulCoun pBaseArray = pArray->item.asArray.value; for ( ; ulCount > 0; ulCount --, ulStart ++ ) /* set value items */ - ItemCopy( pBaseArray->pItems + ( ulStart - 1 ), pValue ); + hb_itemCopy( pBaseArray->pItems + ( ulStart - 1 ), pValue ); } else { @@ -405,12 +405,12 @@ void hb_arrayDel( PHB_ITEM pArray, ULONG ulIndex ) { PBASEARRAY pBaseArray = pArray->item.asArray.value; - ItemRelease( pBaseArray->pItems + ( ulIndex - 1 ) ); + hb_itemClear( pBaseArray->pItems + ( ulIndex - 1 ) ); for ( ulIndex --; ulIndex < ulLen; ulIndex ++ ) /* move items */ - ItemCopy( pBaseArray->pItems + ulIndex, pBaseArray->pItems + ( ulIndex + 1 ) ); + hb_itemCopy( pBaseArray->pItems + ulIndex, pBaseArray->pItems + ( ulIndex + 1 ) ); - ItemRelease( pBaseArray->pItems + ( ulLen - 1 ) ); + hb_itemClear( pBaseArray->pItems + ( ulLen - 1 ) ); } else { @@ -433,12 +433,12 @@ void hb_arrayIns( PHB_ITEM pArray, ULONG ulIndex ) { PBASEARRAY pBaseArray = pArray->item.asArray.value; - ItemRelease( pBaseArray->pItems + ( ulLen - 1 ) ); + hb_itemClear( pBaseArray->pItems + ( ulLen - 1 ) ); for ( ulLen --; ulLen >= ulIndex; ulLen -- ) /* move items */ - ItemCopy( pBaseArray->pItems + ulLen, pBaseArray->pItems + ( ulLen - 1 ) ); + hb_itemCopy( pBaseArray->pItems + ulLen, pBaseArray->pItems + ( ulLen - 1 ) ); - ItemRelease( pBaseArray->pItems + ulLen ); + hb_itemClear( pBaseArray->pItems + ulLen ); } else { @@ -570,7 +570,7 @@ void hb_arrayRelease( PHB_ITEM pArray ) if( !pBaseArray->wSuperCast ) { for ( ul = 0; ul < ulLen; ul ++ ) - ItemRelease( pBaseArray->pItems + ul ); + hb_itemClear( pBaseArray->pItems + ul ); if( pBaseArray->pItems ) hb_xfree( pBaseArray->pItems ); @@ -615,7 +615,7 @@ void hb_arrayCopy( PHB_ITEM pSrcArray, PHB_ITEM pDstArray, ULONG ulStart, for ( ulTarget --, ulStart --; ulCount > 0; ulCount --, ulStart ++ ) { - ItemCopy( pDstBaseArray->pItems + ( ulTarget + ulStart ), pSrcBaseArray->pItems + ulStart ); + hb_itemCopy( pDstBaseArray->pItems + ( ulTarget + ulStart ), pSrcBaseArray->pItems + ulStart ); } } else @@ -678,7 +678,7 @@ HARBOUR HB_AADD( void ) if ( pArray ) hb_arrayAdd( pArray, pValue ); - ItemCopy( &stack.Return, pValue ); + hb_itemCopy( &stack.Return, pValue ); } HARBOUR HB_ASIZE( void ) @@ -688,7 +688,7 @@ HARBOUR HB_ASIZE( void ) if ( pArray ) { hb_arraySize( pArray, hb_parnl( 2 ) ); - ItemCopy( &stack.Return, pArray ); /* ASize() returns the array itself */ + hb_itemCopy( &stack.Return, pArray ); /* ASize() returns the array itself */ } else hb_ret(); /* QUESTION: Should we raise an error here ? */ @@ -711,7 +711,7 @@ HARBOUR HB_AINS( void ) if ( pArray ) { hb_arrayIns( pArray, hb_parnl( 2 ) ); - ItemCopy( &stack.Return, pArray ); /* AIns() returns the array itself */ + hb_itemCopy( &stack.Return, pArray ); /* AIns() returns the array itself */ } else hb_ret(); @@ -724,7 +724,7 @@ HARBOUR HB_ADEL( void ) if ( pArray ) { hb_arrayDel( pArray, hb_parnl( 2 ) ); - ItemCopy( &stack.Return, pArray ); /* ADel() returns the array itself */ + hb_itemCopy( &stack.Return, pArray ); /* ADel() returns the array itself */ } else hb_ret(); @@ -737,7 +737,7 @@ HARBOUR HB_AFILL( void ) if ( pArray ) { hb_arrayFill( pArray, hb_param( 2, IT_ANY ), hb_parnl( 3 ), hb_parnl( 4 ) ); - ItemCopy( &stack.Return, pArray ); /* AFill() returns the array itself */ + hb_itemCopy( &stack.Return, pArray ); /* AFill() returns the array itself */ } else hb_ret(); @@ -761,7 +761,7 @@ HARBOUR HB_AEVAL( void ) if ( pArray ) { hb_arrayEval( pArray, bBlock, hb_parnl( 3 ), hb_parnl( 4 ) ); - ItemCopy( &stack.Return, pArray ); /* AEval() returns the array itself */ + hb_itemCopy( &stack.Return, pArray ); /* AEval() returns the array itself */ } else hb_ret(); @@ -775,7 +775,7 @@ HARBOUR HB_ACOPY( void ) if ( pSrcArray && pDstArray ) { hb_arrayCopy( pSrcArray, pDstArray, hb_parnl( 3 ), hb_parnl( 4 ), hb_parnl( 5 ) ); - ItemCopy( &stack.Return, pDstArray ); /* ACopy() returns the target array */ + hb_itemCopy( &stack.Return, pDstArray ); /* ACopy() returns the target array */ } else hb_ret(); @@ -788,8 +788,8 @@ HARBOUR HB_ACLONE( void ) if ( pSrcArray ) { PHB_ITEM pDstArray = hb_arrayClone( pSrcArray ); - ItemCopy( &stack.Return, pDstArray ); /* AClone() returns the new array */ - ItemRelease( pDstArray ); + hb_itemCopy( &stack.Return, pDstArray ); /* AClone() returns the new array */ + hb_itemClear( pDstArray ); hb_xfree( pDstArray ); } else diff --git a/harbour/source/rtl/classes.c b/harbour/source/rtl/classes.c index fdfb411eb1..b26a2297d4 100644 --- a/harbour/source/rtl/classes.c +++ b/harbour/source/rtl/classes.c @@ -42,11 +42,11 @@ * __WDATAINC */ -#include -#include -#include -#include -#include +#include "extend.h" +#include "errorapi.h" +#include "itemapi.h" +#include "ctoharb.h" +#include "init.h" #define MET_METHOD 0 #define MET_DATA 1 @@ -108,7 +108,7 @@ static void DictRealloc( PCLASS ); static HARBOUR EvalInline( void ); static HARBOUR GetClassData( void ); static HARBOUR GetData( void ); - HARBOURFUNC GetMethod( PHB_ITEM, PSYMBOL ); + HARBOURFUNC hb_GetMethod( PHB_ITEM, PSYMBOL ); ULONG hb_isMessage( PHB_ITEM, char *); HARBOUR HB_ISMESSAGE( void ); HARBOUR HB_OCLONE( void ); @@ -237,7 +237,7 @@ HARBOUR HB_CLASSADD(void) if( pInit && !IS_NIL( pInit )) /* Initializer found */ { pNewMeth->pInitValue = hb_itemNew( NULL ); - ItemCopy( pNewMeth->pInitValue, pInit ); + hb_itemCopy( pNewMeth->pInitValue, pInit ); } } break; @@ -506,7 +506,7 @@ static HARBOUR ClassName( void ) PHB_ITEM pItemRef; if( IS_BYREF( stack.pBase + 1 ) ) /* Variables by reference */ - pItemRef = ItemUnRef( stack.pBase + 1 ); + pItemRef = hb_itemUnRef( stack.pBase + 1 ); else pItemRef = stack.pBase + 1; @@ -561,7 +561,7 @@ static HARBOUR ClassSel(void) if( ( ! wClass ) && IS_BYREF( stack.pBase + 1 ) ) { /* Variables by reference */ - pItemRef = ItemUnRef( stack.pBase + 1 ); + pItemRef = hb_itemUnRef( stack.pBase + 1 ); if( IS_ARRAY( pItemRef ) ) wClass = pItemRef->item.asArray.value->wClass; } @@ -626,7 +626,7 @@ static HARBOUR EvalInline( void ) Push( hb_param( w, IT_ANY ) ); Do( hb_pcount() + 1 ); /* Self is also an argument */ - ItemRelease( &block ); /* Release block */ + hb_itemClear( &block ); /* Release block */ } @@ -724,11 +724,11 @@ static HARBOUR GetData( void ) /* - * = GetMethod( , ) + * = hb_GetMethod( , ) * * Internal function to the function pointer of a message of an object */ -HARBOURFUNC GetMethod( PHB_ITEM pObject, PSYMBOL pMessage ) +HARBOURFUNC hb_GetMethod( PHB_ITEM pObject, PSYMBOL pMessage ) { WORD wAt, wLimit, wMask; WORD wClass; @@ -795,7 +795,7 @@ HARBOURFUNC GetMethod( PHB_ITEM pObject, PSYMBOL pMessage ) ULONG hb_isMessage( PHB_ITEM pObject, char *szString ) { PSYMBOL pMessage = hb_GetDynSym( szString )->pSymbol; - return( (ULONG) GetMethod( pObject, pMessage ) ); + return( (ULONG) hb_GetMethod( pObject, pMessage ) ); } /* Get funcptr of message */ @@ -831,7 +831,7 @@ HARBOUR HB_OCLONE( void ) { PHB_ITEM pDstObject = hb_arrayClone( pSrcObject ); - ItemCopy( &stack.Return, pDstObject ); + hb_itemCopy( &stack.Return, pDstObject ); hb_itemRelease( pDstObject ); } else @@ -932,7 +932,7 @@ static HARBOUR SelectSuper( void ) pNewBase->wHolders = 1; /* New item is returned */ pNewBase->wSuperCast = TRUE; /* Do not dispose pItems !! */ /* A bit dirty, but KISS. */ - ItemCopy( &stack.Return, pSuper ); + hb_itemCopy( &stack.Return, pSuper ); hb_itemRelease( pSuper ); } @@ -951,7 +951,7 @@ static HARBOUR SetClassData( void ) { hb_arraySet( pClasses[ wClass - 1 ].pClassDatas, pMethod->wData, pReturn ); - ItemCopy( &stack.Return, pReturn ); + hb_itemCopy( &stack.Return, pReturn ); } } @@ -969,9 +969,9 @@ static HARBOUR SetData( void ) if( wIndex > ( WORD ) hb_arrayLen( pObject ) ) /* Resize needed */ - hb_arraySize( pObject, wIndex ); /* Make large enough */ + hb_arraySize( pObject, wIndex ); /* Make large enough */ hb_arraySet( pObject, wIndex, pReturn ); - ItemCopy( &stack.Return, pReturn ); + hb_itemCopy( &stack.Return, pReturn ); } diff --git a/harbour/source/rtl/codebloc.c b/harbour/source/rtl/codebloc.c index 7e0c1c14a8..acec487717 100644 --- a/harbour/source/rtl/codebloc.c +++ b/harbour/source/rtl/codebloc.c @@ -35,7 +35,7 @@ /* The Harbour implementation of codeblocks */ -#include +#include "extend.h" #include extern STACK stack; @@ -205,7 +205,7 @@ PHB_ITEM hb_CodeblockGetVar( PHB_ITEM pItem, LONG iItemPos ) { HB_CODEBLOCK_PTR pCBlock = pItem->item.asBlock.value; /* local variables accessed in a codeblock are always stored as reference */ - return ItemUnRef( pCBlock->pLocals -iItemPos -1 ); + return hb_itemUnRef( pCBlock->pLocals -iItemPos -1 ); } /* Get local variable passed by reference diff --git a/harbour/source/rtl/console.c b/harbour/source/rtl/console.c index 8aac09f95b..ff096af9e8 100644 --- a/harbour/source/rtl/console.c +++ b/harbour/source/rtl/console.c @@ -42,12 +42,12 @@ #include #endif -#include -#include -#include -#include -#include -#include +#include "hbsetup.h" +#include "extend.h" +#include "ctoharb.h" +#include "init.h" +#include "dates.h" +#include "set.h" #if defined(__GNUC__) #include @@ -61,7 +61,7 @@ #include #endif #endif -#include /* HARBOUR_USE_GTAPI is checked inside gtapi.h, so that +#include "gtapi.h" /* HARBOUR_USE_GTAPI is checked inside gtapi.h, so that we can always get the border styles */ #define ACCEPT_BUFFER_LEN 256 /*length of input buffer for ACCEPT command */ diff --git a/harbour/source/rtl/copyfile.c b/harbour/source/rtl/copyfile.c index 412185e5fd..eb22e0da70 100644 --- a/harbour/source/rtl/copyfile.c +++ b/harbour/source/rtl/copyfile.c @@ -22,12 +22,12 @@ You can contact me at: andij@aonlippo.co.id */ -#include -#include -#include -#include -#include -#include +#include "itemapi.h" +#include "extend.h" +#include "errorapi.h" +#include "ctoharb.h" +#include "filesys.h" +#include "init.h" #ifdef OS_UNIX_COMPATIBLE #include diff --git a/harbour/source/rtl/dates.c b/harbour/source/rtl/dates.c index 4ca7577841..0c24d4a319 100644 --- a/harbour/source/rtl/dates.c +++ b/harbour/source/rtl/dates.c @@ -34,13 +34,13 @@ * hb_dow(), HB_DOW() */ -#include -#include -#include -#include -#include -#include -#include +#include "hbsetup.h" +#include "extend.h" +#include "init.h" +#include "errorapi.h" +#include "itemapi.h" +#include "set.h" +#include "dates.h" #include #include #if defined(__TURBOC__) || defined(__BORLANDC__) || defined(__DJGPP__) @@ -94,11 +94,11 @@ double hb__seconds( void ) _ftime( &tb ); oTime = localtime(&tb.time); - return( ( oTime->tm_hour * 3600 ) + - ( oTime->tm_min * 60 ) + - oTime->tm_sec + + return( ( oTime->tm_hour * 3600 ) + + ( oTime->tm_min * 60 ) + + oTime->tm_sec + ( (double) tb.millitm /1000 ) ); -#else +#else time_t t; struct tm *oTime; time(&t); diff --git a/harbour/source/rtl/descend.c b/harbour/source/rtl/descend.c index 61da37afb0..2fe5a91ecc 100644 --- a/harbour/source/rtl/descend.c +++ b/harbour/source/rtl/descend.c @@ -31,10 +31,10 @@ You can contact me at: dezac@corevia.com */ -#include -#include +#include "extend.h" +#include "itemapi.h" #include -#include +#include "init.h" extern STACK stack; @@ -46,7 +46,7 @@ HB_INIT_SYMBOLS_END( Descend__InitSymbols ); #if ! defined(__GNUC__) #pragma Descend__InitSymbols #endif - + char *hb_strdescend( char *string ) { char *s; diff --git a/harbour/source/rtl/dir.c b/harbour/source/rtl/dir.c index c3a5aa746a..5956e5977b 100644 --- a/harbour/source/rtl/dir.c +++ b/harbour/source/rtl/dir.c @@ -18,12 +18,12 @@ #define INCL_DOSERRORS #endif -#include -#include +#include "hbsetup.h" +#include "extend.h" #include #include -#include -#include +#include "itemapi.h" +#include "init.h" #if defined(__GNUC__) #include @@ -234,7 +234,7 @@ HARBOUR HB_DIRECTORY( void ) } } -/* redundant +/* redundant if (strlen(pfext) < 1) pfext[0] = '\0'; */ @@ -341,11 +341,11 @@ HARBOUR HB_DIRECTORY( void ) ftime = statbuf.st_mtime; ft = localtime(&ftime); - sprintf(ddate, "%04d%02d%02d", + sprintf(ddate, "%04d%02d%02d", ft->tm_year+1900, ft->tm_mon + 1, ft->tm_mday); sprintf(ttime, "%02d:%02d:%02d", - ft->tm_hour, ft->tm_min, ft->tm_sec); + ft->tm_hour, ft->tm_min, ft->tm_sec); /* debug code @@ -357,21 +357,21 @@ HARBOUR HB_DIRECTORY( void ) #if defined(OS_UNIX_COMPATIBLE) /* GNU C on Linux or on other UNIX */ - aatrib[ 0 ] = '\0'; - if( S_ISREG(statbuf.st_mode) ) - strcat( aatrib, "A" ); - if( S_ISDIR(statbuf.st_mode) ) - strcat( aatrib, "D" ); - if( S_ISLNK(statbuf.st_mode) ) - strcat( aatrib, "L" ); - if( S_ISCHR(statbuf.st_mode) ) - strcat( aatrib, "C" ); - if( S_ISBLK(statbuf.st_mode) ) - strcat( aatrib, "B" ); - if( S_ISFIFO(statbuf.st_mode) ) - strcat( aatrib, "F" ); - if( S_ISSOCK(statbuf.st_mode) ) - strcat( aatrib, "K" ); + aatrib[ 0 ] = '\0'; + if( S_ISREG(statbuf.st_mode) ) + strcat( aatrib, "A" ); + if( S_ISDIR(statbuf.st_mode) ) + strcat( aatrib, "D" ); + if( S_ISLNK(statbuf.st_mode) ) + strcat( aatrib, "L" ); + if( S_ISCHR(statbuf.st_mode) ) + strcat( aatrib, "C" ); + if( S_ISBLK(statbuf.st_mode) ) + strcat( aatrib, "B" ); + if( S_ISFIFO(statbuf.st_mode) ) + strcat( aatrib, "F" ); + if( S_ISSOCK(statbuf.st_mode) ) + strcat( aatrib, "K" ); #else #if defined(__IBMCPP__) attrib = entry.attrFile; @@ -478,7 +478,7 @@ HARBOUR HB_DIRECTORY( void ) closedir( dir ); #endif - ItemCopy( &stack.Return, pdir ); /* DIRECTORY() returns an array */ + hb_itemCopy( &stack.Return, pdir ); /* DIRECTORY() returns an array */ hb_itemRelease(pdir); diff --git a/harbour/source/rtl/environ.c b/harbour/source/rtl/environ.c index 5b3b9d1c51..5728808295 100644 --- a/harbour/source/rtl/environ.c +++ b/harbour/source/rtl/environ.c @@ -15,10 +15,10 @@ #define INCL_DOSMISC #endif -#include -#include -#include -#include +#include "extend.h" +#include "init.h" +#include "errorapi.h" +#include "hbver.h" #if defined(__TURBOC__) || defined(__BORLANDC__) || defined(__MSC__) || defined(_MSC_VER) || defined(__DJGPP__) #include diff --git a/harbour/source/rtl/errorapi.c b/harbour/source/rtl/errorapi.c index bf5c58718a..10cf779074 100644 --- a/harbour/source/rtl/errorapi.c +++ b/harbour/source/rtl/errorapi.c @@ -22,10 +22,10 @@ You can contact me at: alinares@fivetech.com */ -#include -#include -#include -#include +#include "extend.h" +#include "ctoharb.h" +#include "itemapi.h" +#include "errorapi.h" extern HB_ITEM errorBlock; extern STACK stack; @@ -39,7 +39,7 @@ PHB_ITEM hb_errNew( void ) PushNil(); Do( 0 ); - ItemCopy( pReturn, &stack.Return ); + hb_itemCopy( pReturn, &stack.Return ); return pReturn; } diff --git a/harbour/source/rtl/extend.c b/harbour/source/rtl/extend.c index eb89b43714..87a38653e5 100644 --- a/harbour/source/rtl/extend.c +++ b/harbour/source/rtl/extend.c @@ -25,11 +25,11 @@ #ifndef __MPW__ #include #endif -#include +#include "set.h" #include -#include -#include -#include +#include "extend.h" +#include "dates.h" +#include "item.api" extern STACK stack; @@ -62,7 +62,7 @@ PHB_ITEM hb_param( int iParam, WORD wMask ) pLocal = stack.pBase + 1 + iParam; if( wType & IT_BYREF ) - return ItemUnRef( pLocal ); + return hb_itemUnRef( pLocal ); else return pLocal; } @@ -92,7 +92,7 @@ char * hb_parc( int iParam, ... ) pItem = stack.pBase + 1 + iParam; if( IS_BYREF( pItem ) ) - pItem = ItemUnRef( pItem ); + pItem = hb_itemUnRef( pItem ); if( IS_ARRAY( pItem ) ) { @@ -123,21 +123,21 @@ ULONG hb_parclen( int iParam, ... ) if( ( iParam <= hb_pcount() ) || ( iParam == -1 ) ) { if( iParam == -1 ) - pItem = &stack.Return; + pItem = &stack.Return; else if( iParam < -1 ) - return 0; + return 0; else - pItem = stack.pBase + 1 + iParam; + pItem = stack.pBase + 1 + iParam; if( IS_BYREF( pItem ) ) - pItem = ItemUnRef( pItem ); + pItem = hb_itemUnRef( pItem ); if( IS_ARRAY( pItem ) ) { if( wArrayIndex ) - return hb_arrayGetStringLen( pItem, wArrayIndex ); + return hb_arrayGetStringLen( pItem, wArrayIndex ); else - return 0; + return 0; } else if( IS_STRING( pItem ) ) return pItem->item.asString.length; @@ -162,14 +162,14 @@ char * hb_pards( int iParam, ... ) if( ( iParam <= hb_pcount() ) || ( iParam == -1 ) ) { if( iParam == -1 ) - pItem = &stack.Return; + pItem = &stack.Return; else if( iParam < -1 ) - return " "; + return " "; else - pItem = stack.pBase + 1 + iParam; + pItem = stack.pBase + 1 + iParam; if( IS_BYREF( pItem ) ) - pItem = ItemUnRef( pItem ); + pItem = hb_itemUnRef( pItem ); if( IS_ARRAY( pItem ) ) { @@ -192,7 +192,7 @@ char * hb_pards( int iParam, ... ) stack.szDate[ 5 ] = ( lMonth % 10 ) + '0'; stack.szDate[ 6 ] = ( lDay / 10 ) + '0'; - stack.szDate[ 7 ] = ( lDay % 10 ) + '0'; + stack.szDate[ 7 ] = ( lDay % 10 ) + '0'; stack.szDate[ 8 ] = 0; return stack.szDate; /* this guaranties good behavior when multithreading */ @@ -216,14 +216,14 @@ int hb_parl( int iParam, ... ) if( ( iParam <= hb_pcount() ) || ( iParam == -1 ) ) { if( iParam == -1 ) - pItem = &stack.Return; + pItem = &stack.Return; else if( iParam < -1 ) - return 0; + return 0; else - pItem = stack.pBase + 1 + iParam; + pItem = stack.pBase + 1 + iParam; if( IS_BYREF( pItem ) ) - pItem = ItemUnRef( pItem ); + pItem = hb_itemUnRef( pItem ); if( IS_ARRAY( pItem ) ) { @@ -255,14 +255,14 @@ double hb_parnd( int iParam, ... ) if( ( iParam <= hb_pcount() ) || ( iParam == -1 ) ) { if( iParam == -1 ) - pItem = &stack.Return; + pItem = &stack.Return; else if( iParam < -1 ) - return 0; + return 0; else - pItem = stack.pBase + 1 + iParam; + pItem = stack.pBase + 1 + iParam; if( IS_BYREF( pItem ) ) - pItem = ItemUnRef( pItem ); + pItem = hb_itemUnRef( pItem ); if( IS_ARRAY( pItem ) ) { @@ -281,7 +281,7 @@ double hb_parnd( int iParam, ... ) return pItem->item.asDouble.value; else - return 0; + return 0; } return 0; } @@ -299,21 +299,21 @@ int hb_parni( int iParam, ... ) if( ( iParam <= hb_pcount() ) || ( iParam == -1 ) ) { if( iParam == -1 ) - pItem = &stack.Return; + pItem = &stack.Return; else if( iParam < -1 ) - return 0; + return 0; else - pItem = stack.pBase + 1 + iParam; + pItem = stack.pBase + 1 + iParam; if( IS_BYREF( pItem ) ) - pItem = ItemUnRef( pItem ); + pItem = hb_itemUnRef( pItem ); if( IS_ARRAY( pItem ) ) { - if( wArrayIndex ) - return (long) hb_arrayGetDouble( pItem, wArrayIndex ); - else - return 0; + if( wArrayIndex ) + return (long) hb_arrayGetDouble( pItem, wArrayIndex ); + else + return 0; } else if( IS_INTEGER( pItem ) ) @@ -344,21 +344,21 @@ long hb_parnl( int iParam, ... ) if( ( iParam <= hb_pcount() ) || ( iParam == -1 ) ) { if( iParam == -1 ) - pItem = &stack.Return; + pItem = &stack.Return; else if( iParam < -1 ) - return 0; + return 0; else - pItem = stack.pBase + 1 + iParam; + pItem = stack.pBase + 1 + iParam; if( IS_BYREF( pItem ) ) - pItem = ItemUnRef( pItem ); + pItem = hb_itemUnRef( pItem ); if( IS_ARRAY( pItem ) ) { - if( wArrayIndex ) - return (long) hb_arrayGetDouble( pItem, wArrayIndex ); - else - return 0; + if( wArrayIndex ) + return (long) hb_arrayGetDouble( pItem, wArrayIndex ); + else + return 0; } else if( IS_INTEGER( pItem ) ) @@ -384,9 +384,9 @@ ULONG hb_parinfa( int iParamNum, ULONG uiArrayIndex ) if( pArray ) { if( ! uiArrayIndex ) - return hb_arrayLen( pArray ); + return hb_arrayLen( pArray ); else - return (long) hb_arrayGetType( pArray, uiArrayIndex ); + return (long) hb_arrayGetType( pArray, uiArrayIndex ); } else return 0; /* QUESTION: should we raise an error here ? */ @@ -400,12 +400,12 @@ WORD hb_parinfo( int iParam ) { if( ( iParam <= hb_pcount() ) || ( iParam == -1 ) ) { - if( iParam == -1 ) - return stack.Return.type; - else if( iParam < -1 ) - return 0; - else - return ( stack.pBase + 1 + iParam )->type; + if( iParam == -1 ) + return stack.Return.type; + else if( iParam < -1 ) + return 0; + else + return ( stack.pBase + 1 + iParam )->type; } else return 0; @@ -421,7 +421,7 @@ WORD hb_pcount( void ) void hb_ret( void ) { - ItemRelease( &stack.Return ); + hb_itemClear( &stack.Return ); } void hb_reta( ULONG ulLen ) /* undocumented hb_reta() */ @@ -433,7 +433,7 @@ void hb_retc( char * szText ) { ULONG ulLen = strlen( szText ); - ItemRelease( &stack.Return ); + hb_itemClear( &stack.Return ); stack.Return.type = IT_STRING; stack.Return.item.asString.length = ulLen; stack.Return.item.asString.value = ( char * ) hb_xgrab( ulLen + 1 ); @@ -442,7 +442,7 @@ void hb_retc( char * szText ) void hb_retclen( char * szText, ULONG ulLen ) { - ItemRelease( &stack.Return ); + hb_itemClear( &stack.Return ); stack.Return.type = IT_STRING; stack.Return.item.asString.length = ulLen; stack.Return.item.asString.value = ( char * ) hb_xgrab( ulLen + 1 ); @@ -465,7 +465,7 @@ void hb_retds( char * szDate ) /* szDate must have yyyymmdd format */ else lDay = lMonth = lYear = 0; /* Date string missing or bad length, so force an empty date */ - ItemRelease( &stack.Return ); + hb_itemClear( &stack.Return ); stack.Return.type = IT_DATE; stack.Return.item.asDate.length = 8; @@ -477,7 +477,7 @@ void hb_retds( char * szDate ) /* szDate must have yyyymmdd format */ void hb_retnd( double dNumber ) { - ItemRelease( &stack.Return ); + hb_itemClear( &stack.Return ); stack.Return.type = IT_DOUBLE; if( dNumber > 10000000000.0 ) stack.Return.item.asDouble.length = 20; @@ -489,7 +489,7 @@ void hb_retnd( double dNumber ) void hb_retni( int iNumber ) { - ItemRelease( &stack.Return ); + hb_itemClear( &stack.Return ); stack.Return.type = IT_INTEGER; stack.Return.item.asInteger.length = 10; stack.Return.item.asInteger.decimal = 0; @@ -498,7 +498,7 @@ void hb_retni( int iNumber ) void hb_retl( int iTrueFalse ) { - ItemRelease( &stack.Return ); + hb_itemClear( &stack.Return ); stack.Return.type = IT_LOGICAL; stack.Return.item.asLogical.length = 3; stack.Return.item.asLogical.value = iTrueFalse; @@ -506,7 +506,7 @@ void hb_retl( int iTrueFalse ) void hb_retnl( long lNumber ) { - ItemRelease( &stack.Return ); + hb_itemClear( &stack.Return ); stack.Return.type = IT_LONG; stack.Return.item.asLong.length = 10; stack.Return.item.asLong.decimal = 0; @@ -530,7 +530,7 @@ void hb_storc( char * szText, int iParam, ... ) { pItem = &stack.Return; ulLen = strlen( szText ); - ItemRelease( pItem ); + hb_itemClear( pItem ); pItem->type = IT_STRING; pItem->item.asString.length = ulLen; pItem->item.asString.value = ( char * ) hb_xgrab( ulLen + 1 ); @@ -555,8 +555,8 @@ void hb_storc( char * szText, int iParam, ... ) else if( IS_BYREF( pItem ) ) { ulLen = strlen( szText ); - pItemRef = ItemUnRef( pItem ); - ItemRelease( pItemRef ); + pItemRef = hb_itemUnRef( pItem ); + hb_itemClear( pItemRef ); pItemRef->type = IT_STRING; pItemRef->item.asString.length = ulLen; pItemRef->item.asString.value = ( char * ) hb_xgrab( ulLen + 1 ); @@ -580,7 +580,7 @@ void hb_storclen( char * fixText, WORD wLength, int iParam, ... ) if( iParam == -1 ) { pItem = &stack.Return; - ItemRelease( pItem ); + hb_itemClear( pItem ); pItem->type = IT_STRING; pItem->item.asString.length = wLength; pItem->item.asString.value = ( char * ) hb_xgrab( wLength + 1 ); @@ -605,8 +605,8 @@ void hb_storclen( char * fixText, WORD wLength, int iParam, ... ) } else if( IS_BYREF( pItem ) ) { - pItemRef = ItemUnRef( pItem ); - ItemRelease( pItemRef ); + pItemRef = hb_itemUnRef( pItem ); + hb_itemClear( pItemRef ); pItemRef->type = IT_STRING; pItemRef->item.asString.length = wLength; pItemRef->item.asString.value = ( char * ) hb_xgrab( wLength + 1 ); @@ -643,7 +643,7 @@ void hb_stords( char * szDate, int iParam, ... ) /* szDate must have yyyymmdd fo if( iParam == -1 ) { pItem = &stack.Return; - ItemRelease( pItem ); + hb_itemClear( pItem ); pItem->type = IT_DATE; pItem->item.asDate.length = 8; pItem->item.asDate.value = hb_dateEncode( lDay, lMonth, lYear ); @@ -664,8 +664,8 @@ void hb_stords( char * szDate, int iParam, ... ) /* szDate must have yyyymmdd fo } else if( IS_BYREF( pItem ) ) { - pItemRef = ItemUnRef( pItem ); - ItemRelease( pItemRef ); + pItemRef = hb_itemUnRef( pItem ); + hb_itemClear( pItemRef ); pItemRef->type = IT_DATE; pItemRef->item.asDate.length = 8; pItemRef->item.asDate.value = hb_dateEncode( lDay, lMonth, lYear ); @@ -687,16 +687,16 @@ void hb_storl( int iLogical, int iParam, ... ) { if( iParam == -1 ) { - pItem = &stack.Return; - ItemRelease( pItem ); - pItem->type = IT_LOGICAL; - pItem->item.asLogical.length = 3; - pItem->item.asLogical.value = iLogical; + pItem = &stack.Return; + hb_itemClear( pItem ); + pItem->type = IT_LOGICAL; + pItem->item.asLogical.length = 3; + pItem->item.asLogical.value = iLogical; } else if( iParam < -1 ) - return; + return; else - pItem = stack.pBase + 1 + iParam; + pItem = stack.pBase + 1 + iParam; if( IS_ARRAY( pItem ) && wArrayIndex ) { @@ -709,8 +709,8 @@ void hb_storl( int iLogical, int iParam, ... ) } else if( IS_BYREF( pItem ) ) { - pItemRef = ItemUnRef( pItem ); - ItemRelease( pItemRef ); + pItemRef = hb_itemUnRef( pItem ); + hb_itemClear( pItemRef ); pItemRef->type = IT_LOGICAL; pItemRef->item.asLogical.length = 3; pItemRef->item.asLogical.value = iLogical; @@ -733,7 +733,7 @@ void hb_storni( int iValue, int iParam, ... ) if( iParam == -1 ) { pItem = &stack.Return; - ItemRelease( pItem ); + hb_itemClear( pItem ); pItem->type = IT_INTEGER; pItem->item.asInteger.length = 10; pItem->item.asInteger.decimal = 0; @@ -756,8 +756,8 @@ void hb_storni( int iValue, int iParam, ... ) } else if( IS_BYREF( pItem ) ) { - pItemRef = ItemUnRef( pItem ); - ItemRelease( pItemRef ); + pItemRef = hb_itemUnRef( pItem ); + hb_itemClear( pItemRef ); pItemRef->type = IT_INTEGER; pItemRef->item.asInteger.length = 10; pItemRef->item.asInteger.decimal = 0; @@ -781,7 +781,7 @@ void hb_stornl( long lValue, int iParam, ... ) if( iParam == -1 ) { pItem = &stack.Return; - ItemRelease( pItem ); + hb_itemClear( pItem ); pItem->type = IT_LONG; pItem->item.asLong.length = 10; pItem->item.asLong.decimal = 0; @@ -804,8 +804,8 @@ void hb_stornl( long lValue, int iParam, ... ) } else if( IS_BYREF( pItem ) ) { - pItemRef = ItemUnRef( pItem ); - ItemRelease( pItemRef ); + pItemRef = hb_itemUnRef( pItem ); + hb_itemClear( pItemRef ); pItemRef->type = IT_LONG; pItemRef->item.asLong.length = 10; pItemRef->item.asLong.decimal = 0; @@ -829,7 +829,7 @@ void hb_stornd( double dValue, int iParam, ... ) if( iParam == -1 ) { pItem = &stack.Return; - ItemRelease( pItem ); + hb_itemClear( pItem ); pItem->type = IT_DOUBLE; if( dValue > 10000000000.0 ) pItem->item.asDouble.length = 20; @@ -858,8 +858,8 @@ void hb_stornd( double dValue, int iParam, ... ) } else if( IS_BYREF( pItem ) ) { - pItemRef = ItemUnRef( pItem ); - ItemRelease( pItemRef ); + pItemRef = hb_itemUnRef( pItem ); + hb_itemClear( pItemRef ); pItemRef->type = IT_DOUBLE; if( dValue > 10000000000.0 ) pItemRef->item.asDouble.length = 20; diff --git a/harbour/source/rtl/files.c b/harbour/source/rtl/files.c index 87687590fe..423db2ae39 100644 --- a/harbour/source/rtl/files.c +++ b/harbour/source/rtl/files.c @@ -2,11 +2,11 @@ * $Id$ */ -#include -#include -#include +#include "extend.h" +#include "init.h" +#include "filesys.h" #include -#include +#include "errorapi.h" #if defined(__CYGNUS__) #include diff --git a/harbour/source/rtl/gt/gtdos.c b/harbour/source/rtl/gt/gtdos.c index 943ca321dc..9df31ba7cb 100644 --- a/harbour/source/rtl/gt/gtdos.c +++ b/harbour/source/rtl/gt/gtdos.c @@ -11,7 +11,7 @@ #include #include -#include +#include "gtapi.h" #if defined(__POWERC) || (defined(__TURBOC__) && !defined(__BORLANDC__)) || \ (defined(__ZTC__) && !defined(__SC__)) diff --git a/harbour/source/rtl/gt/gtos2.c b/harbour/source/rtl/gt/gtos2.c index 54a0e36d43..97de29791a 100644 --- a/harbour/source/rtl/gt/gtos2.c +++ b/harbour/source/rtl/gt/gtos2.c @@ -15,7 +15,7 @@ #include #include -#include +#include "gtapi.h" #ifndef KBDTRF_FINAL_CHAR_IN #define KBDTRF_FINAL_CHAR_IN FINAL_CHAR_IN diff --git a/harbour/source/rtl/gt/gtwin.c b/harbour/source/rtl/gt/gtwin.c index 48ad9c7e81..6b7dd42ba6 100644 --- a/harbour/source/rtl/gt/gtwin.c +++ b/harbour/source/rtl/gt/gtwin.c @@ -19,7 +19,7 @@ #endif /* __GNUC__ */ #include -#include +#include "gtapi.h" #if ! defined(__GNUC__) #ifdef __CYGWIN32__ diff --git a/harbour/source/rtl/gt/gtxxx.c b/harbour/source/rtl/gt/gtxxx.c index dbb8b80936..5c7a7eb86b 100644 --- a/harbour/source/rtl/gt/gtxxx.c +++ b/harbour/source/rtl/gt/gtxxx.c @@ -11,7 +11,7 @@ /* TODO: include any standard headers here */ -#include +#include "gtapi.h" void gtInit(void) { diff --git a/harbour/source/rtl/gtapi.c b/harbour/source/rtl/gtapi.c index 151c104b79..f9e3132a48 100644 --- a/harbour/source/rtl/gtapi.c +++ b/harbour/source/rtl/gtapi.c @@ -42,8 +42,8 @@ * changed to allow unlimited color pairs. */ -#include -#include +#include "set.h" +#include "gtapi.h" /* TODO: functions not implemented yet int hb_gtPostExt(void); @@ -64,7 +64,7 @@ int *_Color; /* masks: 0x0007 Background 0x0800 Underline background 0x8000 Underline foreground */ -int _ColorCount; +int _ColorCount; /* gt API functions */ @@ -114,7 +114,7 @@ int hb_gtBox (USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, char for (tmp = 0; *pbyFrame && tmp < 9; tmp++) cPadChar = pszBox[tmp] = *pbyFrame++; while (tmp < 8) pszBox[tmp++] = cPadChar; pszBox[tmp] = '\0'; - + /* Ensure that box is drawn from top left to bottom right. */ if( uiTop > uiBottom ) { @@ -397,10 +397,10 @@ int hb_gtGetColorStr(char * fpColorString) { if( ( nColor & 1 ) != 0 ) sColors[k++] = 'B'; - + if( ( nColor & 2 ) != 0 ) sColors[k++] = 'G'; - + if( ( nColor & 4 ) != 0 ) sColors[k++] = 'R'; } diff --git a/harbour/source/rtl/hardcr.c b/harbour/source/rtl/hardcr.c index 4df9d15b73..71dbc40f23 100644 --- a/harbour/source/rtl/hardcr.c +++ b/harbour/source/rtl/hardcr.c @@ -31,9 +31,9 @@ You can contact me at: dezac@corevia.com */ -#include +#include "extend.h" #include -#include +#include "init.h" #define CHR_HARD1 (char)141 #define CHR_HARD2 (char)10 diff --git a/harbour/source/rtl/inkey.c b/harbour/source/rtl/inkey.c index e79089e601..00db3f7fcd 100644 --- a/harbour/source/rtl/inkey.c +++ b/harbour/source/rtl/inkey.c @@ -29,6 +29,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit their web site at http://www.gnu.org/). + V 1.3 Victor Szel #include changed to #include "x". + V 1.2 Gonzalo Diethelm ? V 1.1 David G. Holm Committed to CVS. V 1.0 David G. Holm Initial version. */ diff --git a/harbour/source/rtl/itemapi.c b/harbour/source/rtl/itemapi.c index 3d59a40f40..50d353d93b 100644 --- a/harbour/source/rtl/itemapi.c +++ b/harbour/source/rtl/itemapi.c @@ -22,11 +22,11 @@ You can contact me at: alinares@fivetech.com */ -#include -#include -#include -#include -#include +#include "extend.h" +#include "itemapi.h" +#include "ctoharb.h" +#include "dates.h" +#include "set.h" extern STACK stack; extern SYMBOL symEval; @@ -39,7 +39,7 @@ BOOL hb_evalNew( PEVALINFO pEvalInfo, PHB_ITEM pItem ) { memset( pEvalInfo, 0, sizeof( EVALINFO ) ); pEvalInfo->pItems[ 0 ] = hb_itemNew( 0 ); - ItemCopy( pEvalInfo->pItems[ 0 ], pItem ); + hb_itemCopy( pEvalInfo->pItems[ 0 ], pItem ); bResult = TRUE; } return bResult; @@ -57,7 +57,7 @@ BOOL hb_evalPutParam( PEVALINFO pEvalInfo, PHB_ITEM pItem ) if( ! pEvalInfo->pItems[ w ] ) { pEvalInfo->pItems[ w ] = hb_itemNew( 0 ); - ItemCopy( pEvalInfo->pItems[ w ], pItem ); + hb_itemCopy( pEvalInfo->pItems[ w ], pItem ); bResult = TRUE; break; } @@ -95,7 +95,7 @@ PHB_ITEM hb_evalLaunch( PEVALINFO pEvalInfo ) Push( pEvalInfo->pItems[ w++ ] ); Do( w - 1 ); pResult = hb_itemNew( 0 ); - ItemCopy( pResult, &stack.Return ); + hb_itemCopy( pResult, &stack.Return ); } else if( IS_BLOCK( pEvalInfo->pItems[ 0 ] ) ) { @@ -105,7 +105,7 @@ PHB_ITEM hb_evalLaunch( PEVALINFO pEvalInfo ) Push( pEvalInfo->pItems[ w++ ] ); Do( w - 1 ); pResult = hb_itemNew( 0 ); - ItemCopy( pResult, &stack.Return ); + hb_itemCopy( pResult, &stack.Return ); } } return pResult; @@ -129,7 +129,7 @@ PHB_ITEM hb_itemParam( WORD wParam ) PHB_ITEM pNew = hb_itemNew( 0 ); if( hb_param( wParam, IT_ANY ) ) - ItemCopy(pNew, hb_param( wParam, IT_ANY )); + hb_itemCopy(pNew, hb_param( wParam, IT_ANY )); return pNew; } @@ -140,7 +140,7 @@ BOOL hb_itemRelease( PHB_ITEM pItem ) if( pItem ) { - ItemRelease(pItem); + hb_itemClear(pItem); hb_xfree( pItem ); bResult = TRUE; } @@ -174,7 +174,7 @@ PHB_ITEM hb_itemArrayPut( PHB_ITEM pArray, ULONG ulIndex, PHB_ITEM pItem ) PHB_ITEM hb_itemPutC( PHB_ITEM pItem, char * szText ) { if( pItem ) - ItemRelease( pItem ); /* warning: this is hvm.c one not this one */ + hb_itemClear( pItem ); /* warning: this is hvm.c one not this one */ else pItem = hb_itemNew(0); @@ -188,7 +188,7 @@ PHB_ITEM hb_itemPutC( PHB_ITEM pItem, char * szText ) PHB_ITEM hb_itemPutCL( PHB_ITEM pItem, char * nszText, ULONG ulLen ) { if( pItem ) - ItemRelease( pItem ); /* warning: this is hvm.c one not this one */ + hb_itemClear( pItem ); /* warning: this is hvm.c one not this one */ else pItem = hb_itemNew(0); @@ -311,7 +311,7 @@ long hb_itemGetNL( PHB_ITEM pItem ) PHB_ITEM hb_itemReturn( PHB_ITEM pItem ) { if( pItem ) - ItemCopy(&stack.Return, pItem); + hb_itemCopy(&stack.Return, pItem); return pItem; } @@ -321,7 +321,7 @@ PHB_ITEM hb_itemPutDS( PHB_ITEM pItem, char *szDate ) long lDay, lMonth, lYear; if( pItem ) - ItemRelease( pItem ); /* warning: this is hvm.c one not this one */ + hb_itemClear( pItem ); /* warning: this is hvm.c one not this one */ else pItem = hb_itemNew(0); @@ -330,7 +330,7 @@ PHB_ITEM hb_itemPutDS( PHB_ITEM pItem, char *szDate ) lYear = ((szDate[ 0 ] - '0') * 1000) + ((szDate[ 1 ] - '0') * 100) + ((szDate[ 2 ] - '0') * 10) + (szDate[ 3 ] - '0'); - ItemRelease( pItem ); + hb_itemClear( pItem ); pItem->type = IT_DATE; pItem->item.asDate.length = 8; /* QUESTION: Is this ok ? we are going to use a long to store the date */ @@ -344,7 +344,7 @@ PHB_ITEM hb_itemPutDS( PHB_ITEM pItem, char *szDate ) PHB_ITEM hb_itemPutL( PHB_ITEM pItem, BOOL bValue ) { if( pItem ) - ItemRelease( pItem ); /* warning: this is hvm.c one not this one */ + hb_itemClear( pItem ); /* warning: this is hvm.c one not this one */ else pItem = hb_itemNew(0); @@ -357,7 +357,7 @@ PHB_ITEM hb_itemPutL( PHB_ITEM pItem, BOOL bValue ) PHB_ITEM hb_itemPutND( PHB_ITEM pItem, double dNumber ) { if( pItem ) - ItemRelease( pItem ); /* warning: this is hvm.c one not this one */ + hb_itemClear( pItem ); /* warning: this is hvm.c one not this one */ else pItem = hb_itemNew(0); @@ -372,7 +372,7 @@ PHB_ITEM hb_itemPutND( PHB_ITEM pItem, double dNumber ) PHB_ITEM hb_itemPutNL( PHB_ITEM pItem, long lNumber ) { if( pItem ) - ItemRelease( pItem ); /* warning: this is hvm.c one not this one */ + hb_itemClear( pItem ); /* warning: this is hvm.c one not this one */ else pItem = hb_itemNew(0); @@ -399,3 +399,158 @@ WORD hb_itemType( PHB_ITEM pItem ) { return pItem->type; } + +/* Internal API, not standard Clipper */ + +void hb_itemClear( PHB_ITEM pItem ) +{ + if( IS_STRING( pItem ) ) + { + if( pItem->item.asString.value ) + { + hb_xfree( pItem->item.asString.value ); + pItem->item.asString.value = NULL; + } + pItem->item.asString.length = 0; + } + else if( IS_ARRAY( pItem ) && pItem->item.asArray.value ) + { + if( --( pItem->item.asArray.value )->wHolders == 0 ) + hb_arrayRelease( pItem ); + } + else if( IS_BLOCK( pItem ) ) + { + hb_CodeblockDelete( pItem ); + } + else if( IS_MEMVAR( pItem ) ) + hb_MemvarValueDecRef( pItem->item.asMemvar.value ); + + pItem->type = IT_NIL; +} + +/* Internal API, not standard Clipper */ + +void hb_itemCopy( PHB_ITEM pDest, PHB_ITEM pSource ) +{ + hb_itemClear( pDest ); + + if( pDest == pSource ) + { + printf( "an item was going to be copied to itself from hb_itemCopy()\n" ); + exit( 1 ); + } + + memcpy( pDest, pSource, sizeof( HB_ITEM ) ); + + if( IS_STRING( pSource ) ) + { + pDest->item.asString.value = ( char * ) hb_xgrab( pSource->item.asString.length + 1 ); + memcpy( pDest->item.asString.value, pSource->item.asString.value, pSource->item.asString.length ); + pDest->item.asString.value[ pSource->item.asString.length ] = 0; + } + + else if( IS_ARRAY( pSource ) ) + ( pSource->item.asArray.value )->wHolders++; + + else if( IS_BLOCK( pSource ) ) + { + hb_CodeblockCopy( pDest, pSource ); + } + else if( IS_MEMVAR( pSource ) ) + { + hb_MemvarValueIncRef( pSource->item.asMemvar.value ); + } +} + +/* Internal API, not standard Clipper */ +/* De-references item passed by the reference */ + +PHB_ITEM hb_itemUnRef( PHB_ITEM pItem ) +{ + while( IS_BYREF( pItem ) ) + { + if( IS_MEMVAR( pItem ) ) + { + HB_VALUE_PTR pValue; + + pValue =*(pItem->item.asMemvar.itemsbase) + pItem->item.asMemvar.offset + + pItem->item.asMemvar.value; + pItem =&pValue->item; + } + else + { + if( pItem->item.asRefer.value >= 0 ) + pItem =*(pItem->item.asRefer.itemsbase) + pItem->item.asRefer.offset + + pItem->item.asRefer.value; + else + { + /* local variable referenced in a codeblock + */ + pItem =hb_CodeblockGetRef( *(pItem->item.asRefer.itemsbase) + pItem->item.asRefer.offset, + pItem ); + } + } + } + + return pItem; +} + +/* Internal API, not standard Clipper */ + +/* + * StrCmp. String comparision functions + * + * hb_itemStrCmp : Copyright (C) 1999 Eddie Runia (eddie@runia.com) + */ + +/* Check whether two strings are equal (0), smaller (-1), or greater (1) */ +int hb_itemStrCmp( PHB_ITEM pFirst, PHB_ITEM pSecond, BOOL bForceExact ) +{ + char *szFirst = pFirst->item.asString.value; + char *szSecond = pSecond->item.asString.value; + ULONG lLenFirst = pFirst->item.asString.length; + ULONG lLenSecond = pSecond->item.asString.length; + long lMinLen; + long lCounter; + int iRet = 0; /* Current status */ + + if (hb_set.HB_SET_EXACT && !bForceExact) + { /* SET EXACT ON and not using == */ + /* Don't include trailing spaces */ + while( lLenFirst > 0 && szFirst[ lLenFirst - 1 ] == ' ') lLenFirst--; + while( lLenSecond > 0 && szSecond[ lLenSecond - 1 ] == ' ') lLenSecond--; + } + lMinLen = lLenFirst < lLenSecond ? lLenFirst : lLenSecond; + if( lMinLen ) /* One of the strings is empty */ + { + for( lCounter = 0; lCounter < lMinLen && !iRet; lCounter++ ) + { + if( *szFirst != *szSecond ) /* Difference found */ + iRet = (*szFirst < *szSecond) ? -1 : 1; + else /* TODO : #define some constants*/ + { + szFirst++; + szSecond++; + } + } + if( hb_set.HB_SET_EXACT || bForceExact || lLenSecond > lCounter ) + { /* Force an exact comparison */ + if( !iRet && lLenFirst != lLenSecond ) + /* If length is different ! */ + iRet = (lLenFirst < lLenSecond) ? -1 : 1; + } + } + else + { + if( lLenFirst != lLenSecond ) /* Both empty ? */ + { + if( hb_set.HB_SET_EXACT || bForceExact ) + iRet = (lLenFirst < lLenSecond) ? -1 : 1; + else + iRet = (lLenSecond == 0) ? 0 : -1; + } + else + iRet = 0; /* Both empty => Equal ! */ + } + return(iRet); +} diff --git a/harbour/source/rtl/math.c b/harbour/source/rtl/math.c index eb81733ccb..98c9a146be 100644 --- a/harbour/source/rtl/math.c +++ b/harbour/source/rtl/math.c @@ -8,10 +8,10 @@ See doc/hdr_tpl.txt, Version 1.2 or later, for licensing terms. */ -#include -#include -#include -#include +#include "extend.h" +#include "init.h" +#include "set.h" +#include "errorapi.h" #include extern STACK stack; diff --git a/harbour/source/rtl/memvars.c b/harbour/source/rtl/memvars.c index 4a021defa9..6b1f26c083 100644 --- a/harbour/source/rtl/memvars.c +++ b/harbour/source/rtl/memvars.c @@ -33,10 +33,10 @@ */ -#include #include -#include -#include +#include "extend.h" +#include "errorapi.h" +#include "error.ch" #define VS_PRIVATE 64 #define VS_PUBLIC 128 @@ -88,7 +88,7 @@ void hb_MemvarsRelease( void ) { if( _globalTable[ ulCnt ].counter ) { - ItemRelease( &_globalTable[ ulCnt ].item ); + hb_itemClear( &_globalTable[ ulCnt ].item ); _globalTable[ ulCnt ].counter =0; } --ulCnt; @@ -178,7 +178,7 @@ HB_HANDLE hb_MemvarValueNew( HB_ITEM_PTR pSource, int iTrueMemvar ) if( pSource ) { if( iTrueMemvar ) - ItemCopy( &pValue->item, pSource ); + hb_itemCopy( &pValue->item, pSource ); else memcpy( &pValue->item, pSource, sizeof(HB_ITEM) ); } @@ -297,7 +297,7 @@ void hb_MemvarValueDecRef( HB_HANDLE hValue ) { if( --pValue->counter == 0 ) { - ItemRelease( &pValue->item ); + hb_itemClear( &pValue->item ); if( _globalFirstFree > hValue ) { if( (_globalLastFree - hValue) == 1 ) @@ -356,9 +356,9 @@ void hb_MemvarSetValue( PSYMBOL pMemvarSymb, HB_ITEM_PTR pItem ) /* value is already created */ HB_ITEM_PTR pSetItem = &_globalTable[ pDyn->hMemvar ].item; if( IS_BYREF(pSetItem) ) - ItemCopy( ItemUnRef(pSetItem), pItem ); + hb_itemCopy( hb_itemUnRef(pSetItem), pItem ); else - ItemCopy( pSetItem, pItem ); + hb_itemCopy( pSetItem, pItem ); } else { @@ -388,9 +388,9 @@ void hb_MemvarGetValue( HB_ITEM_PTR pItem, PSYMBOL pMemvarSymb ) */ HB_ITEM_PTR pGetItem = &_globalTable[ pDyn->hMemvar ].item; if( IS_BYREF(pGetItem) ) - ItemCopy( pItem, ItemUnRef(pGetItem) ); + hb_itemCopy( pItem, hb_itemUnRef(pGetItem) ); else - ItemCopy( pItem, pGetItem ); + hb_itemCopy( pItem, pGetItem ); } else /* variable is not initialized */ hb_errorRT_BASE( EG_NOVAR, 1003, NULL, pMemvarSymb->szName ); @@ -582,7 +582,7 @@ HARBOUR HB___MVPUBLIC( void ) { hb_arrayGet( pMemvar, j, &VarItem ); hb_MemvarCreateFromItem( &VarItem, VS_PUBLIC, NULL ); - ItemRelease( &VarItem ); + hb_itemClear( &VarItem ); } } else @@ -655,7 +655,7 @@ HARBOUR HB___MVPRIVATE( void ) { hb_arrayGet( pMemvar, j, &VarItem ); hb_MemvarCreateFromItem( &VarItem, VS_PRIVATE, NULL ); - ItemRelease( &VarItem ); + hb_itemClear( &VarItem ); } } else @@ -718,7 +718,7 @@ HARBOUR HB___MVXRELEASE( void ) { hb_arrayGet( pMemvar, j, &VarItem ); hb_MemvarRelease( &VarItem ); - ItemRelease( &VarItem ); + hb_itemClear( &VarItem ); } } else diff --git a/harbour/source/rtl/mtran.c b/harbour/source/rtl/mtran.c index 24d8445647..296b6120df 100644 --- a/harbour/source/rtl/mtran.c +++ b/harbour/source/rtl/mtran.c @@ -30,8 +30,8 @@ You can contact me at: dezac@corevia.com */ -#include -#include +#include "extend.h" +#include "init.h" #include #define CHR_HARD1 (char)141 diff --git a/harbour/source/rtl/natmsg/msgbas.c b/harbour/source/rtl/natmsg/msgbas.c index 23eb46cc4f..237dfbf372 100644 --- a/harbour/source/rtl/natmsg/msgbas.c +++ b/harbour/source/rtl/natmsg/msgbas.c @@ -6,7 +6,7 @@ * Language support unit for Basque */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { "Urtarrila", "Otsaila", "Martxoa", diff --git a/harbour/source/rtl/natmsg/msgcat.c b/harbour/source/rtl/natmsg/msgcat.c index e70bf3de82..caf8d9edb3 100644 --- a/harbour/source/rtl/natmsg/msgcat.c +++ b/harbour/source/rtl/natmsg/msgcat.c @@ -7,7 +7,7 @@ * */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { "Xaner", "Febrer", "Mars", diff --git a/harbour/source/rtl/natmsg/msgcz852.c b/harbour/source/rtl/natmsg/msgcz852.c index a23baa1ba9..4d035565df 100644 --- a/harbour/source/rtl/natmsg/msgcz852.c +++ b/harbour/source/rtl/natmsg/msgcz852.c @@ -5,7 +5,7 @@ /* Czech language module (2 char. ISO language code: CZ) */ /* Codepage: Latin II - 852 */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { diff --git a/harbour/source/rtl/natmsg/msgczkam.c b/harbour/source/rtl/natmsg/msgczkam.c index 034e3d520d..5206cb428e 100644 --- a/harbour/source/rtl/natmsg/msgczkam.c +++ b/harbour/source/rtl/natmsg/msgczkam.c @@ -5,7 +5,7 @@ /* Czech language module (2 char. ISO language code: CZ) */ /* Codepage: Czech - Kamenickych (CS2) */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { diff --git a/harbour/source/rtl/natmsg/msgdut.c b/harbour/source/rtl/natmsg/msgdut.c index 0edcf63e67..360fad14eb 100644 --- a/harbour/source/rtl/natmsg/msgdut.c +++ b/harbour/source/rtl/natmsg/msgdut.c @@ -2,7 +2,7 @@ * $Id$ */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { "januari", "februari", "maart", diff --git a/harbour/source/rtl/natmsg/msgeo.c b/harbour/source/rtl/natmsg/msgeo.c index 917a9baf6c..9507f64969 100644 --- a/harbour/source/rtl/natmsg/msgeo.c +++ b/harbour/source/rtl/natmsg/msgeo.c @@ -3,7 +3,7 @@ * Codepage: N/A */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { "Jaunaro", "Februaro", "Marto", diff --git a/harbour/source/rtl/natmsg/msgfre.c b/harbour/source/rtl/natmsg/msgfre.c index ce443492fb..5b52bb7af8 100644 --- a/harbour/source/rtl/natmsg/msgfre.c +++ b/harbour/source/rtl/natmsg/msgfre.c @@ -7,7 +7,7 @@ * */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { "Janvier", "F‚vrier", "Mars", diff --git a/harbour/source/rtl/natmsg/msggal.c b/harbour/source/rtl/natmsg/msggal.c index d51627ff57..325bbfc7ce 100644 --- a/harbour/source/rtl/natmsg/msggal.c +++ b/harbour/source/rtl/natmsg/msggal.c @@ -7,7 +7,7 @@ * */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { "Xaneiro", "Febreiro", "Marzal", diff --git a/harbour/source/rtl/natmsg/msgger.c b/harbour/source/rtl/natmsg/msgger.c index 3bbe56292b..c3b2d7d19e 100644 --- a/harbour/source/rtl/natmsg/msgger.c +++ b/harbour/source/rtl/natmsg/msgger.c @@ -2,7 +2,7 @@ * $Id$ */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { "Januar", "Februar", "März", diff --git a/harbour/source/rtl/natmsg/msghu.c b/harbour/source/rtl/natmsg/msghu.c index ca9c43142d..1d60f3bd49 100644 --- a/harbour/source/rtl/natmsg/msghu.c +++ b/harbour/source/rtl/natmsg/msghu.c @@ -34,7 +34,7 @@ /* TODO: Decide which codepage to use, and how to implement the whole codepage issue */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { diff --git a/harbour/source/rtl/natmsg/msgia.c b/harbour/source/rtl/natmsg/msgia.c index c860b8a5de..4834a75deb 100644 --- a/harbour/source/rtl/natmsg/msgia.c +++ b/harbour/source/rtl/natmsg/msgia.c @@ -5,7 +5,7 @@ /* Indonesian language module */ /* Codepage: N/A */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { "Januari", "Februari", "Maret", diff --git a/harbour/source/rtl/natmsg/msgita.c b/harbour/source/rtl/natmsg/msgita.c index 4378857394..72b883a1f0 100644 --- a/harbour/source/rtl/natmsg/msgita.c +++ b/harbour/source/rtl/natmsg/msgita.c @@ -7,7 +7,7 @@ * */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { "Gennaio", "Febbraio", "Marzo", diff --git a/harbour/source/rtl/natmsg/msgkor.c b/harbour/source/rtl/natmsg/msgkor.c index d85f7c7f75..b28fce20f2 100644 --- a/harbour/source/rtl/natmsg/msgkor.c +++ b/harbour/source/rtl/natmsg/msgkor.c @@ -4,7 +4,7 @@ /* Korea language module */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { "1¿ù", "2¿ù", "3¿ù", diff --git a/harbour/source/rtl/natmsg/msgpl852.c b/harbour/source/rtl/natmsg/msgpl852.c index d7cf969408..e9f1696464 100644 --- a/harbour/source/rtl/natmsg/msgpl852.c +++ b/harbour/source/rtl/natmsg/msgpl852.c @@ -5,7 +5,7 @@ /* Polish language module - Polskoj©zyczny moduˆ dla Harbour */ /* Codepage: Latin II - 852 */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { "Styczeä", "Luty", "Marzec", diff --git a/harbour/source/rtl/natmsg/msgpliso.c b/harbour/source/rtl/natmsg/msgpliso.c index 3c84f38e66..eca56fd4e0 100644 --- a/harbour/source/rtl/natmsg/msgpliso.c +++ b/harbour/source/rtl/natmsg/msgpliso.c @@ -5,7 +5,7 @@ /* Polish language module - Polskojêzyczny modu³ dla Harbour */ /* Codepage: ISO-8859-2 */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { "Styczeñ", "Luty", "Marzec", diff --git a/harbour/source/rtl/natmsg/msgplmaz.c b/harbour/source/rtl/natmsg/msgplmaz.c index 3b821005e4..390cb1af18 100644 --- a/harbour/source/rtl/natmsg/msgplmaz.c +++ b/harbour/source/rtl/natmsg/msgplmaz.c @@ -5,7 +5,7 @@ /* Polish language module - Polskoj‘zyczny modu’ dla Harbour */ /* Codepage: Mazowia */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { "Stycze¤", "Luty", "Marzec", diff --git a/harbour/source/rtl/natmsg/msgpor.c b/harbour/source/rtl/natmsg/msgpor.c index e0ea7bfe98..bf5cdcfe5c 100644 --- a/harbour/source/rtl/natmsg/msgpor.c +++ b/harbour/source/rtl/natmsg/msgpor.c @@ -2,7 +2,7 @@ * $Id$ */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { "Janeiro", "Fevereiro", "Março", diff --git a/harbour/source/rtl/natmsg/msgr1251.c b/harbour/source/rtl/natmsg/msgr1251.c index c306bac53a..5fca302986 100644 --- a/harbour/source/rtl/natmsg/msgr1251.c +++ b/harbour/source/rtl/natmsg/msgr1251.c @@ -2,7 +2,7 @@ * $Id$ */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { "ßíâàðü", "Ôåâðàëü", "Ìàðò", diff --git a/harbour/source/rtl/natmsg/msgru866.c b/harbour/source/rtl/natmsg/msgru866.c index 33f45af033..3099df0d0e 100644 --- a/harbour/source/rtl/natmsg/msgru866.c +++ b/harbour/source/rtl/natmsg/msgru866.c @@ -2,7 +2,7 @@ * $Id$ */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { "Ÿ­¢ àì", "”¥¢à «ì", "Œ àâ", diff --git a/harbour/source/rtl/natmsg/msgspa.c b/harbour/source/rtl/natmsg/msgspa.c index 0ff1dd110b..88146e18de 100644 --- a/harbour/source/rtl/natmsg/msgspa.c +++ b/harbour/source/rtl/natmsg/msgspa.c @@ -2,7 +2,7 @@ * $Id$ */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { "Enero", "Febrero", "Marzo", diff --git a/harbour/source/rtl/natmsg/msguk.c b/harbour/source/rtl/natmsg/msguk.c index cebe8a6351..d6c96fb8b6 100644 --- a/harbour/source/rtl/natmsg/msguk.c +++ b/harbour/source/rtl/natmsg/msguk.c @@ -5,7 +5,7 @@ /* English language module */ /* Codepage: N/A */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { "January", "February", "March", diff --git a/harbour/source/rtl/natmsg/msgyu852.c b/harbour/source/rtl/natmsg/msgyu852.c index 7fbc309107..26813e698e 100644 --- a/harbour/source/rtl/natmsg/msgyu852.c +++ b/harbour/source/rtl/natmsg/msgyu852.c @@ -5,7 +5,7 @@ /* Serbian language module (2 char. ISO language code: YU) */ /* Codepage: Latin II - 852 */ -#include +#include "hbdefs.h" char *hb_monthsname[ 12 ] = { diff --git a/harbour/source/rtl/set.c b/harbour/source/rtl/set.c index 42f6f22453..ffb6ccb240 100644 --- a/harbour/source/rtl/set.c +++ b/harbour/source/rtl/set.c @@ -29,6 +29,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit their web site at http://www.gnu.org/). + V 1.51 Victor Szel #include changed to #include "x". V 1.49 Paul Tucker Changed parameter passing checks in call to hb_setColor() to account for no or NIL parameters. @@ -160,15 +161,15 @@ #endif #include -#include -#include -#include +#include "extend.h" +#include "init.h" +#include "errorapi.h" #include #ifndef __MPW__ #include #endif -#include -#include +#include "set.h" +#include "inkey.h" #include #ifndef O_BINARY diff --git a/harbour/source/rtl/setcolor.c b/harbour/source/rtl/setcolor.c index 1f6b9fcd43..772b15f735 100644 --- a/harbour/source/rtl/setcolor.c +++ b/harbour/source/rtl/setcolor.c @@ -23,10 +23,10 @@ */ #include "pcode.h" -#include -#include +#include "init.h" +#include "set.h" #ifdef HARBOUR_USE_GTAPI - #include + #include "gtapi.h" #else static char old_string[ sizeof( hb_set.HB_SET_COLOR ) ]; #endif @@ -45,7 +45,7 @@ char *hb_setColor( char *sColor ) if( sColor != (char *)0 ) { - #ifdef HARBOUR_USE_GTAPI + #ifdef HARBOUR_USE_GTAPI hb_gtSetColorStr( sColor ); #else strncpy (hb_set.HB_SET_COLOR, sColor, sizeof( hb_set.HB_SET_COLOR ) ); @@ -53,7 +53,7 @@ char *hb_setColor( char *sColor ) hb_strUpper( hb_set.HB_SET_COLOR, strlen( hb_set.HB_SET_COLOR ) ); #endif } -#ifdef HARBOUR_USE_GTAPI +#ifdef HARBOUR_USE_GTAPI return hb_set.HB_SET_COLOR; #else return old_string; diff --git a/harbour/source/rtl/strings.c b/harbour/source/rtl/strings.c index 83e5d637c9..028bb44013 100644 --- a/harbour/source/rtl/strings.c +++ b/harbour/source/rtl/strings.c @@ -22,15 +22,15 @@ You can contact me at: alinares@fivetech.com */ -#include -#include -#include -#include -#include -#include +#include "hbsetup.h" +#include "dates.h" +#include "extend.h" +#include "init.h" +#include "itemapi.h" +#include "errorapi.h" #include #include -#include +#include "set.h" extern STACK stack; @@ -119,6 +119,36 @@ BOOL hb_strempty( char * szText, ULONG ulLen ) return bRetVal; } +/* Harbour Project source code + http://www.Harbour-Project.org/ + The following function is Copyright 1999 David G. Holm : + hb_stricmp(). + See doc/hdr_tpl.txt, Version 1.2 or later, for licensing terms. +*/ + +int hb_stricmp( const char *s1, const char *s2 ) +{ + int rc = 0, c1, c2; + USHORT l1, l2, count; + l1 = strlen( s1 ); + l2 = strlen( s2 ); + if( l1 < l2 ) count = l1; + else count = l2; + while( rc == 0 && count > 0 ) + { + count--; + c1 = toupper( *s1++ ); + c2 = toupper( *s2++ ); + if( c1 != c2 ) rc = ( c1 < c2 ? -1 : 1 ); + } + if( rc == 0 && l1 != l2 ) + { + if( l1 < l2 ) rc = -1; + else rc = 1; + } + return rc; +} + /* determines if first char of string is letter */ /* TEST: QOUT( "isalpha( 'hello' ) = ", isalpha( 'hello' ) ) */ /* TEST: QOUT( "isalpha( '12345' ) = ", isalpha( '12345' ) ) */ @@ -607,10 +637,10 @@ HARBOUR HB_LEFT( void ) if( pLen ) { - long lLen = hb_parnl(2); + LONG lLen = hb_parnl(2); - if( lLen > pText->item.asString.length ) - lLen = pText->item.asString.length; + if( lLen > (LONG)pText->item.asString.length ) + lLen = (LONG)pText->item.asString.length; else if( lLen < 0 ) lLen = 0; @@ -647,10 +677,10 @@ HARBOUR HB_RIGHT( void ) if( pLen ) { - long lLen = hb_parnl(2); + LONG lLen = hb_parnl(2); - if( lLen > pText->item.asString.length ) - lLen = pText->item.asString.length; + if( lLen > (LONG)pText->item.asString.length ) + lLen = (LONG)pText->item.asString.length; else if( lLen < 0 ) lLen = 0; @@ -687,11 +717,11 @@ HARBOUR HB_SUBSTR( void ) if( pText && pPos ) { - long lPos = hb_parnl(2); + LONG lPos = hb_parnl(2); if( lPos < 0 ) { - lPos += pText->item.asString.length; + lPos += (LONG)pText->item.asString.length; if( lPos < 0 ) lPos = 0; } @@ -700,20 +730,20 @@ HARBOUR HB_SUBSTR( void ) lPos--; } - if( lPos < pText->item.asString.length ) + if( lPos < (LONG)pText->item.asString.length ) { PHB_ITEM pLen = hb_param(3, IT_NUMERIC); - long lLen; + LONG lLen; if( pLen ) { lLen = hb_parnl(3); - if( lLen > pText->item.asString.length - lPos ) - lLen = pText->item.asString.length - lPos; + if( lLen > (LONG)pText->item.asString.length - lPos ) + lLen = (LONG)pText->item.asString.length - lPos; } else - lLen = pText->item.asString.length - lPos; + lLen = (LONG)pText->item.asString.length - lPos; if( lLen > 0 ) hb_retclen(pText->item.asString.value + lPos, lLen); @@ -753,9 +783,9 @@ HARBOUR HB_LOWER( void ) if( pText ) { - long lLen = pText->item.asString.length; + ULONG ulLen = pText->item.asString.length; - hb_retclen(hb_strLower(pText->item.asString.value, lLen), lLen); + hb_retclen(hb_strLower(pText->item.asString.value, ulLen), ulLen); } else { @@ -787,9 +817,9 @@ HARBOUR HB_UPPER( void ) if( pText ) { - long lLen = pText->item.asString.length; + ULONG ulLen = pText->item.asString.length; - hb_retclen(hb_strUpper(pText->item.asString.value, lLen), lLen); + hb_retclen(hb_strUpper(pText->item.asString.value, ulLen), ulLen); } else { diff --git a/harbour/source/rtl/transfrm.c b/harbour/source/rtl/transfrm.c index 19197ab0e7..85f97d168e 100644 --- a/harbour/source/rtl/transfrm.c +++ b/harbour/source/rtl/transfrm.c @@ -34,13 +34,13 @@ * partial copyright with regards to string handling */ -#include -#include -#include -#include +#include "extend.h" +#include "init.h" +#include "errorapi.h" +#include "ctoharb.h" #include -#include -#include +#include "dates.h" +#include "set.h" /* */ /* Transform( xValue, cPicture ) */ @@ -621,21 +621,21 @@ HARBOUR HB_TRANSFORM( void ) { pItem = NumDefault( (double) pExp->item.asInteger.value ); hb_retclen( pItem->item.asString.value, pItem->item.asInteger.length ); - ItemRelease( pItem ); + hb_itemClear( pItem ); break; } case IT_LONG: { pItem = NumDefault( (double) pExp->item.asLong.value ); hb_retclen( pItem->item.asString.value, pItem->item.asLong.length ); - ItemRelease( pItem ); + hb_itemClear( pItem ); break; } case IT_DOUBLE: { pItem = NumDefault( (double) pExp->item.asDouble.value ); hb_retclen( pItem->item.asString.value, pItem->item.asDouble.length ); - ItemRelease( pItem ); + hb_itemClear( pItem ); break; } case IT_DATE: diff --git a/harbour/source/runner/runner.c b/harbour/source/runner/runner.c index 6071a1e026..70501769a9 100644 --- a/harbour/source/runner/runner.c +++ b/harbour/source/runner/runner.c @@ -24,10 +24,9 @@ */ #include "pcode.h" - -#include +#include "errorapi.h" +#include "init.h" #include -#include /* #if INTEL32 */ static BYTE prgFunction[] = { 0x68, 0x00, 0x00, 0x00, 0x00, diff --git a/harbour/source/tools/asciisum.c b/harbour/source/tools/asciisum.c index 44b0950587..9cfa6125f4 100644 --- a/harbour/source/tools/asciisum.c +++ b/harbour/source/tools/asciisum.c @@ -38,7 +38,7 @@ * $END$ */ -#include +#include "extend.h" HARBOUR HB_GT_ASCIISUM( void ) { diff --git a/harbour/source/tools/ascpos.c b/harbour/source/tools/ascpos.c index 9ee88e6f18..b3f6ae446d 100644 --- a/harbour/source/tools/ascpos.c +++ b/harbour/source/tools/ascpos.c @@ -50,7 +50,7 @@ * $END$ */ -#include +#include "extend.h" HARBOUR HB_GT_ASCPOS( void ) { diff --git a/harbour/source/tools/atdiff.c b/harbour/source/tools/atdiff.c index 5a1dd37103..2d58b0ec36 100644 --- a/harbour/source/tools/atdiff.c +++ b/harbour/source/tools/atdiff.c @@ -48,7 +48,7 @@ */ -#include +#include "extend.h" HARBOUR HB_GT_ATDIFF( void ) { diff --git a/harbour/source/tools/chareven.c b/harbour/source/tools/chareven.c index 13dc965133..7c6ec2eb6a 100644 --- a/harbour/source/tools/chareven.c +++ b/harbour/source/tools/chareven.c @@ -44,7 +44,7 @@ * $END$ */ -#include +#include "extend.h" HARBOUR HB_GT_CHAREVEN( void ) { diff --git a/harbour/source/tools/charmix.c b/harbour/source/tools/charmix.c index 86221cad65..59de4a57f4 100644 --- a/harbour/source/tools/charmix.c +++ b/harbour/source/tools/charmix.c @@ -48,7 +48,7 @@ * $END$ */ -#include +#include "extend.h" HARBOUR HB_GT_CHARMIX( void ) { diff --git a/harbour/source/tools/charodd.c b/harbour/source/tools/charodd.c index 8f14b5cbca..dc008889fe 100644 --- a/harbour/source/tools/charodd.c +++ b/harbour/source/tools/charodd.c @@ -44,7 +44,7 @@ * $END$ */ -#include +#include "extend.h" HARBOUR HB_GT_CHARODD( void ) { diff --git a/harbour/source/tools/chrcount.c b/harbour/source/tools/chrcount.c index aec82bf41b..f614562a8b 100644 --- a/harbour/source/tools/chrcount.c +++ b/harbour/source/tools/chrcount.c @@ -45,7 +45,7 @@ * $END$ */ -#include +#include "extend.h" HARBOUR HB_GT_CHRCOUNT( void ) { diff --git a/harbour/source/tools/chrfirst.c b/harbour/source/tools/chrfirst.c index 0c08813115..da8219706f 100644 --- a/harbour/source/tools/chrfirst.c +++ b/harbour/source/tools/chrfirst.c @@ -44,7 +44,7 @@ * $END$ */ -#include +#include "extend.h" HARBOUR HB_GT_CHRFIRST( void ) { diff --git a/harbour/source/tools/chrtotal.c b/harbour/source/tools/chrtotal.c index b0cb0ef548..c0051b13e9 100644 --- a/harbour/source/tools/chrtotal.c +++ b/harbour/source/tools/chrtotal.c @@ -49,7 +49,7 @@ * $END$ */ -#include +#include "extend.h" HARBOUR HB_GT_CHRTOTAL( void ) { diff --git a/harbour/source/tools/dates2.c b/harbour/source/tools/dates2.c index 786bf709cd..b303114a22 100644 --- a/harbour/source/tools/dates2.c +++ b/harbour/source/tools/dates2.c @@ -36,13 +36,13 @@ HB_EOM(), HB_BOM(), HB_WOM(), HB_DOY(), HB_WOY(), HB_EOY(), HB_BOY() */ -#include -#include -#include -#include #include #include -#include +#include "extend.h" +#include "errorapi.h" +#include "init.h" +#include "itemapi.h" +#include "dates.h" HARBOUR HB_ADAYS(void); HARBOUR HB_AMONTHS(void); diff --git a/harbour/source/tools/datesx.c b/harbour/source/tools/datesx.c index 6c5c0b7d45..4015d2177f 100644 --- a/harbour/source/tools/datesx.c +++ b/harbour/source/tools/datesx.c @@ -2,7 +2,7 @@ * $Id$ */ -#include +#include "extend.h" #include HARBOUR HB_DATETIME( void ) diff --git a/harbour/source/tools/debug.c b/harbour/source/tools/debug.c index aaf8bf56b8..70b3eebb1b 100644 --- a/harbour/source/tools/debug.c +++ b/harbour/source/tools/debug.c @@ -37,10 +37,10 @@ * $Date$ 1999/05/06 * $End$ */ -#include -#include #include -#include +#include "extend.h" +#include "ctoharb.h" +#include "itemapi.h" extern STACK stack; /* External data used */ extern HB_ITEM aStatics; @@ -57,7 +57,7 @@ HARBOUR HB___ASTATIC(void) { PHB_ITEM pStatics = hb_arrayClone( &aStatics ); - ItemCopy( &stack.Return, pStatics ); + hb_itemCopy( &stack.Return, pStatics ); hb_itemRelease( pStatics ); } @@ -96,7 +96,7 @@ void AddToArray( PHB_ITEM pItem, PHB_ITEM pReturn, WORD wPos ) sprintf( pTemp->item.asString.value, "[%s]", pItem->item.asSymbol.value->szName ); hb_itemArrayPut( pReturn, wPos, pTemp ); - ItemRelease( pTemp ); /* Get rid of temporary str.*/ + hb_itemClear( pTemp ); /* Get rid of temporary str.*/ hb_xfree( pTemp ); } else /* Normal types */ @@ -138,7 +138,7 @@ HARBOUR HB___AGLOBALSTACK(void) for( pItem = stack.pItems; pItem <= stack.pPos; pItem++ ) AddToArray( pItem, pReturn, wPos++ ); hb_itemReturn( pReturn ); - ItemRelease( pReturn ); + hb_itemClear( pReturn ); hb_xfree( pReturn ); } @@ -187,7 +187,7 @@ HARBOUR HB___ASTACK(void) for( pItem = pBase; pItem < stack.pBase; pItem++ ) AddToArray( pItem, pReturn, wPos++ ); hb_itemReturn( pReturn ); - ItemRelease( pReturn ); + hb_itemClear( pReturn ); hb_xfree( pReturn ); } @@ -212,7 +212,7 @@ HARBOUR HB___APARAM(void) for( pItem = pBase+2; wLen--; pItem++ ) AddToArray( pItem, pReturn, wPos++ ); hb_itemReturn( pReturn ); - ItemRelease( pReturn ); + hb_itemClear( pReturn ); hb_xfree( pReturn ); } diff --git a/harbour/source/tools/hb_f.c b/harbour/source/tools/hb_f.c index 246f304b8b..b76100c39b 100644 --- a/harbour/source/tools/hb_f.c +++ b/harbour/source/tools/hb_f.c @@ -24,7 +24,7 @@ /* please run $(HARBOUR)\tests\working\testhbf.prg for testing */ -#include +#include "filesys.api" #define b_size 1024 #define c_size 4096 diff --git a/harbour/source/tools/io.c b/harbour/source/tools/io.c index c57b936b07..faabe8760d 100644 --- a/harbour/source/tools/io.c +++ b/harbour/source/tools/io.c @@ -2,7 +2,7 @@ * $Id$ */ -#include +#include "extend.h" #include #include #include @@ -41,7 +41,7 @@ HARBOUR HB_RENFILE(void) * $CATEGORY$ * DOS * $ONELINER$ - * + * * $SYNTAX$ * CD() * $ARGUMENTS$ @@ -49,7 +49,7 @@ HARBOUR HB_RENFILE(void) * $RETURNS$ * .T. IF SUCEFUL * .F. IF NOT - * + * * $DESCRIPTION$ * CHANGE THE CURRENT DIRECTORY * $EXAMPLES$ @@ -58,9 +58,9 @@ HARBOUR HB_RENFILE(void) * ELSE * RETURN(.F.) * ENDIF - * + * * $SEEALSO$ - * + * * $INCLUDE$ * extend.h dos.h dir.h bios.h internal.h * $END$ @@ -74,7 +74,7 @@ HARBOUR HB_RENFILE(void) * $CATEGORY$ * DOS * $ONELINER$ - * + * * $SYNTAX$ * MD() * $ARGUMENTS$ @@ -82,7 +82,7 @@ HARBOUR HB_RENFILE(void) * $RETURNS$ * .T. IF SUCEFUL * .F. IF NOT - * + * * $DESCRIPTION$ * CREATE A DIRECTORY * $EXAMPLES$ @@ -91,9 +91,9 @@ HARBOUR HB_RENFILE(void) * ELSE * RETURN(.F.) * ENDIF - * + * * $SEEALSO$ - * + * * $INCLUDE$ * extend.h dos.h dir.h bios.h internal.h * $END$ @@ -105,7 +105,7 @@ HARBOUR HB_RENFILE(void) * $CATEGORY$ * DOS * $ONELINER$ - * + * * $SYNTAX$ * RD() * $ARGUMENTS$ @@ -113,7 +113,7 @@ HARBOUR HB_RENFILE(void) * $RETURNS$ * .T. IF SUCEFUL * .F. IF NOT - * + * * $DESCRIPTION$ * REMOVE A DIRECTORY * $EXAMPLES$ @@ -122,9 +122,9 @@ HARBOUR HB_RENFILE(void) * ELSE * RETURN(.F.) * ENDIF - * + * * $SEEALSO$ - * + * * $INCLUDE$ * extend.h dos.h dir.h bios.h internal.h * $END$ @@ -168,7 +168,7 @@ HARBOUR HB_RD(void) * $CATEGORY$ * DOS * $ONELINER$ - * + * * $SYNTAX$ * RD() * $ARGUMENTS$ @@ -176,7 +176,7 @@ HARBOUR HB_RD(void) * $RETURNS$ * .T. IF SUCEFUL * .F. IF NOT - * + * * $DESCRIPTION$ * VERIFY IF A FILE EXISTS * $EXAMPLES$ @@ -185,9 +185,9 @@ HARBOUR HB_RD(void) * ELSE * RETURN(.F.) * ENDIF - * + * * $SEEALSO$ - * + * * $INCLUDE$ * extend.h dos.h dir.h bios.h internal.h * $END$ @@ -207,7 +207,7 @@ HARBOUR HB_FILE(void) _retl(TRUE); } else - { + { _retl(FALSE); } } diff --git a/harbour/source/tools/mathx.c b/harbour/source/tools/mathx.c index cd94a7290b..efa2e1b94f 100644 --- a/harbour/source/tools/mathx.c +++ b/harbour/source/tools/mathx.c @@ -2,7 +2,7 @@ * $Id$ */ -#include +#include "extend.h" #include #ifndef M_PI_2 diff --git a/harbour/source/tools/strcount.c b/harbour/source/tools/strcount.c index 4f3ccaba00..157aea414d 100644 --- a/harbour/source/tools/strcount.c +++ b/harbour/source/tools/strcount.c @@ -49,7 +49,7 @@ * $END$ */ -#include +#include "extend.h" HARBOUR HB_GT_STRCOUNT( void ) { diff --git a/harbour/source/tools/strcspn.c b/harbour/source/tools/strcspn.c index 9e36077564..ca410d2f07 100644 --- a/harbour/source/tools/strcspn.c +++ b/harbour/source/tools/strcspn.c @@ -44,7 +44,7 @@ */ -#include +#include "extend.h" HARBOUR HB_GT_STRCSPN( void ) { diff --git a/harbour/source/tools/strdiff.c b/harbour/source/tools/strdiff.c index 584a902a4d..f695ab358a 100644 --- a/harbour/source/tools/strdiff.c +++ b/harbour/source/tools/strdiff.c @@ -48,7 +48,7 @@ * $END$ */ -#include +#include "extend.h" HARBOUR HB_GT_STRDIFF( void ) { diff --git a/harbour/source/tools/strexpan.c b/harbour/source/tools/strexpan.c index cf1240a8ba..c646fc643e 100644 --- a/harbour/source/tools/strexpan.c +++ b/harbour/source/tools/strexpan.c @@ -49,7 +49,7 @@ */ -#include +#include "extend.h" HARBOUR HB_GT_STREXPAND( void ) { diff --git a/harbour/source/tools/stringsx.c b/harbour/source/tools/stringsx.c index ffab745af8..a696445bd2 100644 --- a/harbour/source/tools/stringsx.c +++ b/harbour/source/tools/stringsx.c @@ -2,7 +2,7 @@ * $Id$ */ -#include +#include "extend.h" #include /* TODO: search this file for TODO and find 'em! */ diff --git a/harbour/source/tools/strleft.c b/harbour/source/tools/strleft.c index 0d4469a937..6855bb5b03 100644 --- a/harbour/source/tools/strleft.c +++ b/harbour/source/tools/strleft.c @@ -49,7 +49,7 @@ */ -#include +#include "extend.h" HARBOUR HB_GT_STRLEFT( void ) diff --git a/harbour/source/tools/strpbrk.c b/harbour/source/tools/strpbrk.c index a1578e6695..c065a999a1 100644 --- a/harbour/source/tools/strpbrk.c +++ b/harbour/source/tools/strpbrk.c @@ -45,7 +45,7 @@ */ -#include +#include "extend.h" HARBOUR HB_GT_STRPBRK( void ) diff --git a/harbour/source/tools/strright.c b/harbour/source/tools/strright.c index 5b46e495b8..0cfa65ecdd 100644 --- a/harbour/source/tools/strright.c +++ b/harbour/source/tools/strright.c @@ -49,7 +49,7 @@ */ -#include +#include "extend.h" HARBOUR HB_GT_STRRIGHT( void ) diff --git a/harbour/source/vm/dynsym.c b/harbour/source/vm/dynsym.c index 808b857313..18b7da3334 100644 --- a/harbour/source/vm/dynsym.c +++ b/harbour/source/vm/dynsym.c @@ -26,7 +26,7 @@ * */ -#include +#include "extend.h" #include typedef struct @@ -77,6 +77,14 @@ static WORD hb_strgreater( char * sz1, char * sz2 ) return SYM_EQUAL; } +static void hb_strupr( char * szText ) +{ + char *p; + + for( p = szText; *p; p++ ) + *p = toupper( *p ); +} + PSYMBOL hb_NewSymbol( char * szName ) /* Create a new symbol */ { PSYMBOL pSymbol = ( PSYMBOL ) hb_xgrab( sizeof( SYMBOL ) ); @@ -138,14 +146,6 @@ PDYNSYM hb_NewDynSym( PSYMBOL pSymbol ) /* creates a new dynamic symbol */ return pDynSym; } -static void hb_strupr( char * szText ) -{ - char *p; - - for( p = szText; *p; p++ ) - *p = toupper( *p ); -} - PDYNSYM hb_GetDynSym( char * szName ) /* finds and creates a symbol if not found */ { PDYNSYM pDynSym; diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index 9a2783be7a..0c66cf4404 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -81,8 +81,6 @@ void Greater( void ); /* checks if the latest - 1 value is greater than void GreaterEqual( void ); /* checks if the latest - 1 value is greater than or equal the latest, removes both and leaves result */ void Inc( void ); /* increment the latest numeric value on the stack */ void Instring( void ); /* check whether string 1 is contained in string 2 */ -void ItemCopy( PHB_ITEM pDest, PHB_ITEM pSource ); /* copies an item to one place to another respecting its containts */ -PHB_ITEM ItemUnRef( PHB_ITEM pItem ); /* de-references passed variable */ void Less( void ); /* checks if the latest - 1 value is less than the latest, removes both and leaves result */ void LessEqual( void ); /* checks if the latest - 1 value is less than or equal the latest, removes both and leaves result */ void Line( WORD wLine ); /* keeps track of the currently processed PRG line */ @@ -150,33 +148,10 @@ void StackPush( void ); /* pushes an item on to the stack */ void StackInit( void ); /* initializes the stack */ void StackShow( void ); /* show the types of the items on the stack for debugging purposes */ -HB_CODEBLOCK_PTR hb_CodeblockNew( BYTE *, WORD, WORD *, PSYMBOL ); -void hb_CodeblockDelete( PHB_ITEM ); -PHB_ITEM hb_CodeblockGetVar( PHB_ITEM, LONG ); -PHB_ITEM hb_CodeblockGetRef( PHB_ITEM, PHB_ITEM ); -void hb_CodeblockEvaluate( PHB_ITEM ); -void hb_CodeblockCopy( PHB_ITEM, PHB_ITEM ); - -/* Initialisation and closing memvars subsystem */ -void hb_MemvarsInit( void ); -void hb_MemvarsRelease( void ); -void hb_MemvarValueIncRef( HB_HANDLE ); -void hb_MemvarValueDecRef( HB_HANDLE ); -void hb_MemvarSetValue( PSYMBOL, HB_ITEM_PTR ); -void hb_MemvarGetValue( HB_ITEM_PTR, PSYMBOL ); -void hb_MemvarGetRefer( HB_ITEM_PTR, PSYMBOL ); -void hb_MemvarNewSymbol( PSYMBOL ); -ULONG hb_MemvarGetPrivatesBase( void ); -void hb_MemvarSetPrivatesBase( ULONG ); - void InitSymbolTable( void ); /* initialization of runtime support symbols */ static void ForceLink( void ); -ULONG hb_isMessage( PHB_ITEM, char * ); -ULONG hb_strAt( char *, long, char *, long ); -PHB_ITEM hb_itemReturn( PHB_ITEM ); - #define STACK_INITHB_ITEMS 100 #define STACK_EXPANDHB_ITEMS 20 @@ -281,9 +256,9 @@ BYTE bErrorLevel = 0; /* application exit errorlevel */ DoExitFunctions(); /* process defined EXIT functions */ hb_rddRelease(); /* release RDD */ - ItemRelease( &stack.Return ); + hb_itemClear( &stack.Return ); hb_arrayRelease( &aStatics ); - ItemRelease( &errorBlock ); + hb_itemClear( &errorBlock ); ReleaseClasses(); ReleaseLocalSymbols(); /* releases the local modules linked list */ hb_ReleaseDynamicSymbols(); /* releases the dynamic symbol table */ @@ -688,8 +663,8 @@ void ArrayAt( void ) hb_arrayGet( pArray, dIndex, &item ); StackPop(); - ItemCopy( stack.pPos, &item ); - ItemRelease( &item ); + hb_itemCopy( stack.pPos, &item ); + hb_itemClear( &item ); StackPush(); } @@ -713,7 +688,7 @@ void ArrayPut( void ) /* QUESTION: Should we raise an error here ? */ hb_arraySet( pArray, ulIndex, pValue ); - ItemCopy( pArray, pValue ); /* places pValue at pArray position */ + hb_itemCopy( pArray, pValue ); /* places pValue at pArray position */ StackPop(); StackPop(); } @@ -783,7 +758,7 @@ void Do( WORD wParams ) if( pSym == &( symEval ) && IS_BLOCK( pSelf ) ) pFunc = pSym->pFunPtr; /* __EVAL method = function */ else - pFunc = GetMethod( pSelf, pSym ); + pFunc = hb_GetMethod( pSelf, pSym ); if( ! pFunc ) { @@ -845,15 +820,15 @@ HARBOUR DoBlock( void ) void Duplicate( void ) { - ItemCopy( stack.pPos, stack.pPos - 1 ); + hb_itemCopy( stack.pPos, stack.pPos - 1 ); StackPush(); } void DuplTwo( void ) { - ItemCopy( stack.pPos, stack.pPos - 2 ); + hb_itemCopy( stack.pPos, stack.pPos - 2 ); StackPush(); - ItemCopy( stack.pPos, stack.pPos - 2 ); + hb_itemCopy( stack.pPos, stack.pPos - 2 ); StackPush(); } @@ -883,7 +858,7 @@ HARBOUR HB_EVAL( void ) void EndBlock( void ) { StackPop(); - ItemCopy( &stack.Return, stack.pPos ); + hb_itemCopy( &stack.Return, stack.pPos ); HB_DEBUG( "EndBlock\n" ); } @@ -996,7 +971,7 @@ void FuncPtr( void ) /* pushes a function address pointer. Removes the symbol f void Function( WORD wParams ) { Do( wParams ); - ItemCopy( stack.pPos, &stack.Return ); + hb_itemCopy( stack.pPos, &stack.Return ); StackPush(); } @@ -1008,14 +983,14 @@ void GenArray( WORD wElements ) /* generates a wElements Array and fills it from itArray.type = IT_NIL; hb_arrayNew( &itArray, wElements ); for( w = 0; w < wElements; w++ ) - ItemCopy( itArray.item.asArray.value->pItems + w, + hb_itemCopy( itArray.item.asArray.value->pItems + w, stack.pPos - wElements + w ); for( w = 0; w < wElements; w++ ) StackPop(); - ItemCopy( stack.pPos, &itArray ); - ItemRelease( &itArray ); + hb_itemCopy( stack.pPos, &itArray ); + hb_itemClear( &itArray ); StackPush(); } @@ -1133,32 +1108,6 @@ void Inc( void ) } } -void ItemRelease( PHB_ITEM pItem ) -{ - if( IS_STRING( pItem ) ) - { - if( pItem->item.asString.value ) - { - hb_xfree( pItem->item.asString.value ); - pItem->item.asString.value = NULL; - } - pItem->item.asString.length = 0; - } - else if( IS_ARRAY( pItem ) && pItem->item.asArray.value ) - { - if( --( pItem->item.asArray.value )->wHolders == 0 ) - hb_arrayRelease( pItem ); - } - else if( IS_BLOCK( pItem ) ) - { - hb_CodeblockDelete( pItem ); - } - else if( IS_MEMVAR( pItem ) ) - hb_MemvarValueDecRef( pItem->item.asMemvar.value ); - - pItem->type = IT_NIL; -} - void Instring( void ) { PHB_ITEM pItem1 = stack.pPos - 2; @@ -1179,72 +1128,6 @@ void Instring( void ) } } -void ItemCopy( PHB_ITEM pDest, PHB_ITEM pSource ) -{ - ItemRelease( pDest ); - - if( pDest == pSource ) - { - printf( "an item was going to be copied to itself from ItemCopy()\n" ); - exit( 1 ); - } - - memcpy( pDest, pSource, sizeof( HB_ITEM ) ); - - if( IS_STRING( pSource ) ) - { - pDest->item.asString.value = ( char * ) hb_xgrab( pSource->item.asString.length + 1 ); - memcpy( pDest->item.asString.value, pSource->item.asString.value, pSource->item.asString.length ); - pDest->item.asString.value[ pSource->item.asString.length ] = 0; - } - - else if( IS_ARRAY( pSource ) ) - ( pSource->item.asArray.value )->wHolders++; - - else if( IS_BLOCK( pSource ) ) - { - hb_CodeblockCopy( pDest, pSource ); - } - else if( IS_MEMVAR( pSource ) ) - { - hb_MemvarValueIncRef( pSource->item.asMemvar.value ); - } -} - -/* De-references item passed by the reference - * - */ -PHB_ITEM ItemUnRef( PHB_ITEM pItem ) -{ - while( IS_BYREF( pItem ) ) - { - if( IS_MEMVAR( pItem ) ) - { - HB_VALUE_PTR pValue; - - pValue =*(pItem->item.asMemvar.itemsbase) + pItem->item.asMemvar.offset + - pItem->item.asMemvar.value; - pItem =&pValue->item; - } - else - { - if( pItem->item.asRefer.value >= 0 ) - pItem =*(pItem->item.asRefer.itemsbase) + pItem->item.asRefer.offset + - pItem->item.asRefer.value; - else - { - /* local variable referenced in a codeblock - */ - pItem =hb_CodeblockGetRef( *(pItem->item.asRefer.itemsbase) + pItem->item.asRefer.offset, - pItem ); - } - } - } - - return pItem; -} - - void Less( void ) { double dNumber1, dNumber2; @@ -1339,8 +1222,8 @@ void LessEqual( void ) void Message( PSYMBOL pSymMsg ) /* sends a message to an object */ { - ItemCopy( stack.pPos, stack.pPos - 1 ); /* moves the object forward */ - ItemRelease( stack.pPos - 1 ); + hb_itemCopy( stack.pPos, stack.pPos - 1 ); /* moves the object forward */ + hb_itemClear( stack.pPos - 1 ); ( stack.pPos - 1 )->type = IT_SYMBOL; ( stack.pPos - 1 )->item.asSymbol.value = pSymMsg; ( stack.pPos - 1 )->item.asSymbol.stackbase = ( stack.pPos - 1 ) - stack.pItems; @@ -1640,17 +1523,17 @@ void PopLocal( SHORT iLocal ) /* local variable or local parameter */ pLocal = stack.pBase + 1 + iLocal; if( IS_BYREF( pLocal ) ) - ItemCopy( ItemUnRef( pLocal ), stack.pPos ); + hb_itemCopy( hb_itemUnRef( pLocal ), stack.pPos ); else - ItemCopy( pLocal, stack.pPos ); + hb_itemCopy( pLocal, stack.pPos ); } else /* local variable referenced in a codeblock * stack.pBase+1 points to a codeblock that is currently evaluated */ - ItemCopy( hb_CodeblockGetVar( stack.pBase + 1, iLocal ), stack.pPos ); + hb_itemCopy( hb_CodeblockGetVar( stack.pBase + 1, iLocal ), stack.pPos ); - ItemRelease( stack.pPos ); + hb_itemClear( stack.pPos ); HB_DEBUG( "PopLocal\n" ); } @@ -1671,7 +1554,7 @@ void PopMemvar( PSYMBOL pSym ) { StackPop(); hb_MemvarSetValue( pSym, stack.pPos ); - ItemRelease( stack.pPos ); + hb_itemClear( stack.pPos ); HB_DEBUG( "PopMemvar\n" ); } @@ -1718,11 +1601,11 @@ void PopStatic( WORD wStatic ) pStatic = aStatics.item.asArray.value->pItems + stack.iStatics + wStatic - 1; if( IS_BYREF( pStatic ) ) - ItemCopy( ItemUnRef( pStatic ), stack.pPos ); + hb_itemCopy( hb_itemUnRef( pStatic ), stack.pPos ); else - ItemCopy( pStatic, stack.pPos ); + hb_itemCopy( pStatic, stack.pPos ); - ItemRelease( stack.pPos ); + hb_itemClear( stack.pPos ); HB_DEBUG( "PopStatic\n" ); } @@ -1737,7 +1620,7 @@ void Power( void ) void PushLogical( int iTrueFalse ) { - ItemRelease( stack.pPos ); + hb_itemClear( stack.pPos ); stack.pPos->type = IT_LOGICAL; stack.pPos->item.asLogical.value = iTrueFalse; StackPush(); @@ -1753,15 +1636,15 @@ void PushLocal( SHORT iLocal ) /* local variable or local parameter */ pLocal = stack.pBase + 1 + iLocal; if( IS_BYREF( pLocal ) ) - ItemCopy( stack.pPos, ItemUnRef( pLocal ) ); + hb_itemCopy( stack.pPos, hb_itemUnRef( pLocal ) ); else - ItemCopy( stack.pPos, pLocal ); + hb_itemCopy( stack.pPos, pLocal ); } else /* local variable referenced in a codeblock * stack.pBase+1 points to a codeblock that is currently evaluated */ - ItemCopy( stack.pPos, hb_CodeblockGetVar( stack.pBase + 1, (LONG)iLocal ) ); + hb_itemCopy( stack.pPos, hb_CodeblockGetVar( stack.pBase + 1, (LONG)iLocal ) ); StackPush(); HB_DEBUG2( "PushLocal %i\n", iLocal ); @@ -1769,7 +1652,7 @@ void PushLocal( SHORT iLocal ) void PushLocalByRef( SHORT iLocal ) { - ItemRelease( stack.pPos ); + hb_itemClear( stack.pPos ); stack.pPos->type = IT_BYREF; /* we store its stack offset instead of a pointer to support a dynamic stack */ stack.pPos->item.asRefer.value = iLocal; @@ -1782,7 +1665,7 @@ void PushLocalByRef( SHORT iLocal ) void PushMemvar( PSYMBOL pSym ) { - ItemRelease( stack.pPos ); + hb_itemClear( stack.pPos ); hb_MemvarGetValue( stack.pPos, pSym ); StackPush(); HB_DEBUG( "PushMemvar\n" ); @@ -1790,7 +1673,7 @@ void PushMemvar( PSYMBOL pSym ) void PushMemvarByRef( PSYMBOL pSym ) { - ItemRelease( stack.pPos ); + hb_itemClear( stack.pPos ); hb_MemvarGetRefer( stack.pPos, pSym ); StackPush(); HB_DEBUG( "PushMemvar\n" ); @@ -1798,7 +1681,7 @@ void PushMemvarByRef( PSYMBOL pSym ) void PushNil( void ) { - ItemRelease( stack.pPos ); + hb_itemClear( stack.pPos ); StackPush(); HB_DEBUG( "PushNil\n" ); } @@ -1824,16 +1707,16 @@ void PushStatic( WORD wStatic ) pStatic = aStatics.item.asArray.value->pItems + stack.iStatics + wStatic - 1; if( IS_BYREF(pStatic) ) - ItemCopy( stack.pPos, ItemUnRef(pStatic) ); + hb_itemCopy( stack.pPos, hb_itemUnRef(pStatic) ); else - ItemCopy( stack.pPos, pStatic ); + hb_itemCopy( stack.pPos, pStatic ); StackPush(); HB_DEBUG2( "PushStatic %i\n", wStatic ); } void PushStaticByRef( WORD wStatic ) { - ItemRelease( stack.pPos ); + hb_itemClear( stack.pPos ); stack.pPos->type = IT_BYREF; /* we store the offset instead of a pointer to support a dynamic stack */ stack.pPos->item.asRefer.value = wStatic -1; @@ -1851,7 +1734,7 @@ void PushString( char * szText, ULONG length ) memcpy (szTemp, szText, length); szTemp[ length ] = 0; - ItemRelease( stack.pPos ); + hb_itemClear( stack.pPos ); stack.pPos->type = IT_STRING; stack.pPos->item.asString.length = length; stack.pPos->item.asString.value = szTemp; @@ -1861,7 +1744,7 @@ void PushString( char * szText, ULONG length ) void PushSymbol( PSYMBOL pSym ) { - ItemRelease( stack.pPos ); + hb_itemClear( stack.pPos ); stack.pPos->type = IT_SYMBOL; stack.pPos->item.asSymbol.value = pSym; stack.pPos->item.asSymbol.stackbase = stack.pPos - stack.pItems; @@ -1871,7 +1754,7 @@ void PushSymbol( PSYMBOL pSym ) void Push( PHB_ITEM pItem ) { - ItemCopy( stack.pPos, pItem ); + hb_itemCopy( stack.pPos, pItem ); StackPush(); HB_DEBUG( "Push\n" ); } @@ -1886,7 +1769,7 @@ void PushBlock( BYTE * pCode, PSYMBOL pSymbols ) { WORD wLocals; - ItemRelease( stack.pPos ); + hb_itemClear( stack.pPos ); stack.pPos->type = IT_BLOCK; wLocals =pCode[ 5 ] + ( pCode[ 6 ] * 256 ); @@ -1911,7 +1794,7 @@ void PushBlock( BYTE * pCode, PSYMBOL pSymbols ) void PushDate( LONG lDate ) { - ItemRelease( stack.pPos ); + hb_itemClear( stack.pPos ); stack.pPos->type = IT_DATE; stack.pPos->item.asDate.value = lDate; StackPush(); @@ -1920,7 +1803,7 @@ void PushDate( LONG lDate ) void PushDouble( double dNumber, WORD wDec ) { - ItemRelease( stack.pPos ); + hb_itemClear( stack.pPos ); stack.pPos->type = IT_DOUBLE; stack.pPos->item.asDouble.value = dNumber; if( dNumber >= 10000000000.0 ) stack.pPos->item.asDouble.length = 20; @@ -1932,7 +1815,7 @@ void PushDouble( double dNumber, WORD wDec ) void PushInteger( int iNumber ) { - ItemRelease( stack.pPos ); + hb_itemClear( stack.pPos ); stack.pPos->type = IT_INTEGER; stack.pPos->item.asInteger.value = iNumber; stack.pPos->item.asInteger.length = 10; @@ -1943,7 +1826,7 @@ void PushInteger( int iNumber ) void PushLong( long lNumber ) { - ItemRelease( stack.pPos ); + hb_itemClear( stack.pPos ); stack.pPos->type = IT_LONG; stack.pPos->item.asLong.value = lNumber; stack.pPos->item.asLong.length = 10; @@ -1955,13 +1838,13 @@ void PushLong( long lNumber ) void RetValue( void ) { StackPop(); - ItemCopy( &stack.Return, stack.pPos ); + hb_itemCopy( &stack.Return, stack.pPos ); HB_DEBUG( "RetValue\n" ); } void StackPop( void ) { - ItemRelease( stack.pPos ); + hb_itemClear( stack.pPos ); if( --stack.pPos < stack.pItems ) { @@ -2018,7 +1901,7 @@ void StackInit( void ) HB_DEBUG( "StackInit\n" ); } - void StackShow( void ) +void StackShow( void ) { PHB_ITEM p; @@ -2247,6 +2130,9 @@ void DoInitFunctions( int argc, char * argv[] ) } while( pLastSymbols ); } +/* ----------------------------- */ +/* TODO: Put these to /source/rtl/?.c */ + HARBOUR HB_LEN( void ) { PHB_ITEM pItem; @@ -2323,7 +2209,6 @@ HARBOUR HB_EMPTY(void) hb_retl( TRUE ); } - HARBOUR HB_VALTYPE( void ) { PHB_ITEM pItem; @@ -2379,13 +2264,13 @@ HARBOUR HB_ERRORBLOCK(void) PHB_ITEM pNewErrorBlock = hb_param( 1, IT_BLOCK ); oldError.type = IT_NIL; - ItemCopy( &oldError, &errorBlock ); + hb_itemCopy( &oldError, &errorBlock ); if( pNewErrorBlock ) - ItemCopy( &errorBlock, pNewErrorBlock ); + hb_itemCopy( &errorBlock, pNewErrorBlock ); - ItemCopy( &stack.Return, &oldError ); - ItemRelease( &oldError ); + hb_itemCopy( &stack.Return, &oldError ); + hb_itemClear( &oldError ); } HARBOUR HB_PROCNAME(void) diff --git a/harbour/tests/working/rtl_test.prg b/harbour/tests/working/rtl_test.prg index d091a5cd26..e71307b009 100644 --- a/harbour/tests/working/rtl_test.prg +++ b/harbour/tests/working/rtl_test.prg @@ -36,110 +36,144 @@ /* TODO: Add checks for string parameters with embedded NUL character */ /* TODO: Add test cases for other string functions */ -/* TODO: Incorporate tests from TEST\WORKING\STRING*.PRG */ +/* TODO: Incorporate tests from test/working/string*.prg */ -#translate SHOW_TEST() => fWrite(1, PadR(StrTran(<(x)>, Chr(0), "."), 40) + " -> " + '"' + StrTran(, Chr(0), ".") + '"' + Chr(13) + Chr(10)) -#translate SHOW_LINE() => fWrite(1, Chr(13) + Chr(10)) +#translate TEST_LINE(, ) => TEST_CALL(<(x)>, {|| }, ) -#define NUL Chr(0) +STATIC snPass := 0 +STATIC snFail := 0 FUNCTION Main() - SHOW_TEST( Str(At("", "")) ) // 1 - SHOW_TEST( Str(At("", "ABCDEF")) ) // 1 - SHOW_TEST( Str(At("ABCDEF", "")) ) // 0 - SHOW_TEST( Str(At("AB", "AB")) ) // 1 - SHOW_TEST( Str(At("AB", "AAB")) ) // 2 - SHOW_TEST( Str(At("A", "ABCDEF")) ) // 1 - SHOW_TEST( Str(At("F", "ABCDEF")) ) // 6 - SHOW_TEST( Str(At("D", "ABCDEF")) ) // 4 - SHOW_TEST( Str(At("X", "ABCDEF")) ) // 0 - SHOW_TEST( Str(At("AB", "ABCDEF")) ) // 1 - SHOW_TEST( Str(At("AA", "ABCDEF")) ) // 0 - SHOW_TEST( Str(At("ABCDEF", "ABCDEF")) ) // 1 - SHOW_TEST( Str(At("BCDEF", "ABCDEF")) ) // 2 - SHOW_TEST( Str(At("BCDEFG", "ABCDEF")) ) // 0 - SHOW_TEST( Str(At("ABCDEFG", "ABCDEF")) ) // 0 - SHOW_TEST( Str(At("FI", "ABCDEF")) ) // 0 + TEST_LINE( At("", "") , 1 ) + TEST_LINE( At("", "ABCDEF") , 1 ) + TEST_LINE( At("ABCDEF", "") , 0 ) + TEST_LINE( At("AB", "AB") , 1 ) + TEST_LINE( At("AB", "AAB") , 2 ) + TEST_LINE( At("A", "ABCDEF") , 1 ) + TEST_LINE( At("F", "ABCDEF") , 6 ) + TEST_LINE( At("D", "ABCDEF") , 4 ) + TEST_LINE( At("X", "ABCDEF") , 0 ) + TEST_LINE( At("AB", "ABCDEF") , 1 ) + TEST_LINE( At("AA", "ABCDEF") , 0 ) + TEST_LINE( At("ABCDEF", "ABCDEF") , 1 ) + TEST_LINE( At("BCDEF", "ABCDEF") , 2 ) + TEST_LINE( At("BCDEFG", "ABCDEF") , 0 ) + TEST_LINE( At("ABCDEFG", "ABCDEF") , 0 ) + TEST_LINE( At("FI", "ABCDEF") , 0 ) - SHOW_TEST( SubStr("abcdef", 0, -1) ) // "" - SHOW_TEST( SubStr("abcdef", 0, 0) ) // "" - SHOW_TEST( SubStr("abcdef", 0, 1) ) // "a" - SHOW_TEST( SubStr("abcdef", 0, 7) ) // "abcdef" - SHOW_TEST( SubStr("abcdef", 0) ) // "abcdef" - SHOW_TEST( SubStr("abcdef", 2, -1) ) // "" - SHOW_TEST( SubStr("abcdef", 2, 0) ) // "" - SHOW_TEST( SubStr("abcdef", 2, 1) ) // "b" - SHOW_TEST( SubStr("abcdef", 2, 7) ) // "bcdef" - SHOW_TEST( SubStr("abcdef", 2) ) // "bcdef" - SHOW_TEST( SubStr("abcdef", -2, -1) ) // "" - SHOW_TEST( SubStr("abcdef", -2, 0) ) // "" - SHOW_TEST( SubStr("abcdef", -2, 1) ) // "e" - SHOW_TEST( SubStr("abcdef", -2, 7) ) // "ef" - SHOW_TEST( SubStr("abcdef", -2) ) // "ef" - SHOW_TEST( SubStr("abcdef", 10, -1) ) // "" - SHOW_TEST( SubStr("abcdef", 10, 0) ) // "" - SHOW_TEST( SubStr("abcdef", 10, 1) ) // "" - SHOW_TEST( SubStr("abcdef", 10, 7) ) // "" - SHOW_TEST( SubStr("abcdef", 10) ) // "" - SHOW_TEST( SubStr("abcdef", -10, -1) ) // "" - SHOW_TEST( SubStr("abcdef", -10, 0) ) // "" - SHOW_TEST( SubStr("abcdef", -10, 1) ) // "a" - SHOW_TEST( SubStr("abcdef", -10, 7) ) // "abcdef" - SHOW_TEST( SubStr("abcdef", -10, 15) ) // "abcdef" - SHOW_TEST( SubStr("abcdef", -10) ) // "abcdef" + TEST_LINE( SubStr("abcdef", 0, -1) , "" ) + TEST_LINE( SubStr("abcdef", 0, 0) , "" ) + TEST_LINE( SubStr("abcdef", 0, 1) , "a" ) + TEST_LINE( SubStr("abcdef", 0, 7) , "abcdef" ) + TEST_LINE( SubStr("abcdef", 0) , "abcdef" ) + TEST_LINE( SubStr("abcdef", 2, -1) , "" ) + TEST_LINE( SubStr("abcdef", 2, 0) , "" ) + TEST_LINE( SubStr("abcdef", 2, 1) , "b" ) + TEST_LINE( SubStr("abcdef", 2, 7) , "bcdef" ) + TEST_LINE( SubStr("abcdef", 2) , "bcdef" ) + TEST_LINE( SubStr("abcdef", -2, -1) , "" ) + TEST_LINE( SubStr("abcdef", -2, 0) , "" ) + TEST_LINE( SubStr("abcdef", -2, 1) , "e" ) + TEST_LINE( SubStr("abcdef", -2, 7) , "ef" ) + TEST_LINE( SubStr("abcdef", -2) , "ef" ) + TEST_LINE( SubStr("abcdef", 10, -1) , "" ) + TEST_LINE( SubStr("abcdef", 10, 0) , "" ) + TEST_LINE( SubStr("abcdef", 10, 1) , "" ) + TEST_LINE( SubStr("abcdef", 10, 7) , "" ) + TEST_LINE( SubStr("abcdef", 10) , "" ) + TEST_LINE( SubStr("abcdef", -10, -1) , "" ) + TEST_LINE( SubStr("abcdef", -10, 0) , "" ) + TEST_LINE( SubStr("abcdef", -10, 1) , "a" ) + TEST_LINE( SubStr("abcdef", -10, 7) , "abcdef" ) + TEST_LINE( SubStr("abcdef", -10, 15) , "abcdef" ) + TEST_LINE( SubStr("abcdef", -10) , "abcdef" ) - SHOW_LINE() + TEST_LINE( Left("abcdef", -10) , "" ) + TEST_LINE( Left("abcdef", -2) , "" ) + TEST_LINE( Left("abcdef", 0) , "" ) + TEST_LINE( Left("abcdef", 2) , "ab" ) + TEST_LINE( Left("abcdef", 10) , "abcdef" ) - SHOW_TEST( Left("abcdef", -10) ) // "" - SHOW_TEST( Left("abcdef", -2) ) // "" - SHOW_TEST( Left("abcdef", 0) ) // "" - SHOW_TEST( Left("abcdef", 2) ) // "ab" - SHOW_TEST( Left("abcdef", 10) ) // "abcdef" + TEST_LINE( Right("abcdef", -10) , "" ) + TEST_LINE( Right("abcdef", -2) , "" ) + TEST_LINE( Right("abcdef", 0) , "" ) + TEST_LINE( Right("abcdef", 2) , "ef" ) + TEST_LINE( Right("abcdef", 10) , "abcdef" ) - SHOW_LINE() + TEST_LINE( PadR("abcdef", -5) , "" ) + TEST_LINE( PadR("abcdef", 0) , "" ) + TEST_LINE( PadR("abcdef", 5) , "abcde" ) + TEST_LINE( PadR("abcdef", 10) , "abcdef " ) + TEST_LINE( PadR("abcdef", 10, "1") , "abcdef1111" ) + TEST_LINE( PadR("abcdef", 10, "12") , "abcdef1111" ) - SHOW_TEST( Right("abcdef", -10) ) // "" - SHOW_TEST( Right("abcdef", -2) ) // "" - SHOW_TEST( Right("abcdef", 0) ) // "" - SHOW_TEST( Right("abcdef", 2) ) // "ef" - SHOW_TEST( Right("abcdef", 10) ) // "abcdef" + TEST_LINE( PadL("abcdef", -5) , "" ) + TEST_LINE( PadL("abcdef", 0) , "" ) + TEST_LINE( PadL("abcdef", 5) , "abcde" ) /* QUESTION: CA-Clipper "bug", should return: "bcdef" ? */ + TEST_LINE( PadL("abcdef", 10) , " abcdef" ) + TEST_LINE( PadL("abcdef", 10, "1") , "1111abcdef" ) + TEST_LINE( PadL("abcdef", 10, "12") , "1111abcdef" ) - SHOW_LINE() - - SHOW_TEST( PadR("abcdef", -5) ) // "" - SHOW_TEST( PadR("abcdef", 0) ) // "" - SHOW_TEST( PadR("abcdef", 5) ) // "abcde" - SHOW_TEST( PadR("abcdef", 10) ) // "abcdef " - SHOW_TEST( PadR("abcdef", 10, "1") ) // "abcdef1111" - SHOW_TEST( PadR("abcdef", 10, "12") ) // "abcdef1111" - - SHOW_LINE() - - SHOW_TEST( PadL("abcdef", -5) ) // "" - SHOW_TEST( PadL("abcdef", 0) ) // "" - SHOW_TEST( PadL("abcdef", 5) ) // "abcde" /* QUESTION: CA-Clipper "bug", should return: "bcdef" ? */ - SHOW_TEST( PadL("abcdef", 10) ) // " abcdef" - SHOW_TEST( PadL("abcdef", 10, "1") ) // "1111abcdef" - SHOW_TEST( PadL("abcdef", 10, "12") ) // "1111abcdef" - - SHOW_LINE() - - SHOW_TEST( PadC("abcdef", -5) ) // "" - SHOW_TEST( PadC("abcdef", 0) ) // "" - SHOW_TEST( PadC("abcdef", 2) ) // "ab" /* QUESTION: CA-Clipper "bug", should return: "cd" ? */ - SHOW_TEST( PadC("abcdef", 5) ) // "abcde" - SHOW_TEST( PadC("abcdef", 10) ) // " abcdef " - SHOW_TEST( PadC("abcdef", 10, "1") ) // "11abcdef11" - SHOW_TEST( PadC("abcdef", 10, "12") ) // "11abcdef11" - - SHOW_LINE() + TEST_LINE( PadC("abcdef", -5) , "" ) + TEST_LINE( PadC("abcdef", 0) , "" ) + TEST_LINE( PadC("abcdef", 2) , "ab" ) /* QUESTION: CA-Clipper "bug", should return: "cd" ? */ + TEST_LINE( PadC("abcdef", 5) , "abcde" ) + TEST_LINE( PadC("abcdef", 10) , " abcdef " ) + TEST_LINE( PadC("abcdef", 10, "1") , "11abcdef11" ) + TEST_LINE( PadC("abcdef", 10, "12") , "11abcdef11" ) /* TODO: These could be more complete */ - SHOW_TEST( SubStr("ab" + NUL + "def", 2, 3) ) - SHOW_TEST( Left("ab" + NUL + "def", 5) ) - SHOW_TEST( Right("ab" + NUL + "def", 5) ) + TEST_LINE( SubStr("ab" + Chr(0) + "def", 2, 3) , "b" + Chr(0) + "d" ) + TEST_LINE( Left("ab" + Chr(0) + "def", 5) , "ab" + Chr(0) + "de") + TEST_LINE( Right("ab" + Chr(0) + "def", 5) , "b" + Chr(0) + "def") + + /* Show results */ + + TEST_STAT() RETURN NIL +STATIC FUNCTION TEST_CALL(cBlock, bBlock, xResultExpected) + LOCAL xResult := Eval(bBlock) + + fWrite(1, PadR(StrTran(cBlock, Chr(0), "."), 40) + " -> " +; + PadR('"' + StrTran(XToStr(xResult), Chr(0), ".") + '"', 15) + " " +; + PadR('"' + StrTran(XToStr(xResultExpected), Chr(0), ".") + '"', 15)) + + IF xResult == xResultExpected + snPass++ + ELSE + fWrite(1, "! *FAIL* !") + snFail++ + ENDIF + + fWrite(1, Chr(13) + Chr(10)) + + RETURN NIL + +STATIC FUNCTION TEST_STAT() + + fWrite(1, Chr(13) + Chr(10) +; + "Test calls passed: " + Str(snPass) + Chr(13) + Chr(10) +; + "Test calls failed: " + Str(snFail) + Chr(13) + Chr(10)) + + RETURN NIL + +STATIC FUNCTION XToStr(xValue) + LOCAL cType := ValType(xValue) + + DO CASE + CASE cType == "C" ; RETURN xValue + CASE cType == "N" ; RETURN LTrim(Str(xValue)) + CASE cType == "D" ; RETURN DToC(xValue) + CASE cType == "L" ; RETURN iif(xValue, ".T.", ".F.") + CASE cType == "O" ; RETURN xValue:className + " Object" + CASE cType == "U" ; RETURN "NIL" + CASE cType == "B" ; RETURN "{||...}" + CASE cType == "A" ; RETURN "{...}" + CASE cType == "M" ; RETURN xValue + ENDCASE + + RETURN "" diff --git a/harbour/tests/working/strsub.prg b/harbour/tests/working/strsub.prg index 2484e9d1ee..418f3d435b 100644 --- a/harbour/tests/working/strsub.prg +++ b/harbour/tests/working/strsub.prg @@ -33,7 +33,7 @@ function main() QOut( ">" + " " - "B " + "<" ) // "B " QOut() - __Accept( "Press a key to raise an error!" ) + __Accept( "Press to raise an error!" ) QOut( a - i ) return nil