From 35d723904d28e1f9ebc91f6052449903e8766703 Mon Sep 17 00:00:00 2001 From: "Alexander S.Kresin" Date: Mon, 8 Mar 2004 16:49:56 +0000 Subject: [PATCH] 2004-03-08 19:50 UTC+0300 Alexander Kresin --- harbour/ChangeLog | 3952 +-------------------------- harbour/ChangeLog.014 | 3935 ++++++++++++++++++++++++++ harbour/include/hbapifs.h | 1 + harbour/include/hbmath.h | 2 + harbour/include/hbrddcdx.h | 23 +- harbour/include/hbrdddbf.h | 46 +- harbour/include/hbrdddbt.h | 2 +- harbour/include/hbrddfpt.h | 32 +- harbour/include/hbrddntx.h | 2 + harbour/include/hbset.h | 9 +- harbour/makefile.bc | 5 + harbour/makefile.nt | 1 + harbour/makefile.vc | 1 + harbour/source/rdd/dbf1.c | 443 ++- harbour/source/rdd/dbfcdx/dbfcdx1.c | 1304 +++++---- harbour/source/rdd/dbfcdx/dbfcdx1.h | 5 +- harbour/source/rdd/dbffpt/dbffpt1.c | 191 +- harbour/source/rdd/dbfntx/dbfntx1.c | 15 +- harbour/source/rtl/Makefile | 1 + harbour/source/rtl/filesys.c | 45 + harbour/source/rtl/hbrandom.c | 141 + harbour/source/rtl/set.c | 15 + 22 files changed, 5503 insertions(+), 4668 deletions(-) create mode 100644 harbour/ChangeLog.014 create mode 100644 harbour/source/rtl/hbrandom.c diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f8390c077e..ac72d06c76 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,3931 +8,39 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ -2004-02-27 12:37 UTC+0100 Viktor Szakats +2004-03-08 19:50 UTC+0300 Alexander Kresin - * source/rtl/teditor.prg - ! Fixed a Bound error in GetParagraph which came up when - using in wrap mode, in the last line I guess. - Note that this just fixed the bound error, not the possible - real problem. - -2004-02-21 8:14 UTC+0100 Viktor Szakats - - * source/common/hbffind.c - * source/rtl/direct.c - + Completely rearranged, so that the platform specific stuff - is kept in one function. Redundant code removed. - * Attrib filters needed to make DIRECTORY() CA-Cl*pper - compatible have been moved to the low-level file-find - functions. - + Added label support for Win32. - ! Fix for Win32. It has been made compatible with the - C RTL _dos_findfirst pattern matching, which is what - CA-Clipper is compatible with. - * Adding space to the stringified attribute list on - HB_FA_NORMAL removed, since it's not compatible, and it - doesn't get executed anyway, since HB_FA_NORMAL == 0. - * UNIX part formatted. - ; All this means that file find API is fixed now and compatible - with CA-Cl*pper on the lower level. Heavily tested under - Win32, and probably easy to fix for any other platforms - now in case of incompatibility. Changes has be merged from - an older version of the file, so please double chk your - changes/platforms. - ; Note that other file-find API based functions will also - automatically benefit from the above changes, like FILE()/ - hb_fsFile(). - -2004-02-21 7:39 UTC+0100 Viktor Szakats - - * source/rtl/memoread.c - * Previous change reverted. hb_retc( NULL ) was intentional - and is an optimized version of hb_retc( "" ). Both will return - an empty string. - % hb_fsClose() calls reduced. - - * src/rtl/tbcolumn.prg - * src/rtl/tbrowse.prg - ! :SetColumn() retval made compatible. - ! :ColWidth() retval made compatible. - % Using array functions to speed up a few things. - % Got rid of the predefined 4096 long array in every - columns plus the browse object. - ; More and more incompatibilities are popping up, some - of them quite strange, and only coming up in a large - app's sophisticated browse stressing environment. - - Removing rightmost column while active will do RTE, - - If headsep is initialized after the columns and cargo, - browse will sometimes behave strangely (headsep value - disappears??) - - Moving columns off the visible area will screw up - internals. - - Modifying columns is slow because of the unconditional - :configure() calls. - -2004-02-20 8:55 UTC-0800 Luis Krause Mantilla - * contrib/mysql/mysql.c - ! Fixed declaration for filelength() from int to long to match io.h - * source/rtl/memofile.c - ! Changed return values for empty or failed calles to MemoRead() to return an - empty string instead of a NULL - ! Close file when MemoRead() was successful, but file was empty (was being left open) - Above solutions reported and provided by David Arturo Macías Corona. Thanks! - -2004-02-19 12:48 UTC-0800 Luis Krause Mantilla - * contrib/rdd_ads/adsfunc.c - ! fixed casting in adsShowError() - * contrib/rdd_ads/ads1.c - ! adsSeek() now raises a runtime error 1201 if no index is active - ! adsOrderListAdd() sets order to 0 if an invalid or non-existent tag is provided - The above two were added to keep Clipper compatibility - + Added 5th param to commonError() in order to provide uiFlags, like other RDD's - * source/rdd/dbfcdx/dbfcdx1.c - * source/rdd/dbfntx/dbfntx1.c - ! Fixed error code returned by hb_cdxSeek() and ntxSeek() to 1201 (was 1020) - so it returns same error code as Clipper - -2004-02-17 9:22 UTC-0800 Luis Krause Mantilla - * contrib/rdd_ads/adsfunc.c - + Forgot to mention Brian Hays' implicit record locking fix/workaround is also - included in my previous ADS update. The function name is adsTestRecLocks() - -2004-02-16 17:40 UTC-0800 Luis Krause Mantilla - * contrib/rdd_ads/ads1.c - * contrib/rdd_ads/adsfunc.c - * contrib/rdd_ads/adsmgmnt.c - * contrib/rdd_ads/ace.h - * contrib/rdd_ads/rddads.h - * contrib/rdd_ads/doc/en/adsfuncs.txt - ! Renamed Data Dictionary functions for consistency: - adsAddTable() to adsDDAddTale() - adsAddUserToGroup to adsDDAddUserToGroup() - ! Moved adsGetNumActiveLinks() inside the ADS_REQUIRE_VERSION6 to avoid - compile errors with ADS version older than v. 6.0 - + Syncronized with xHarbour - Thanks to Brian Hays, Toninho, et. al. - added the following functions: - adsConnect60() - adsCopyTableContents() - adsDDCreate() - adsDDCreateUser() - adsDDGetDatabaseProperty() - adsDDGetUserProperty() - adsDDSetDatabaseProperty() - adsGetTableCharType() - adsMGGetLockOwner() - -2004-02-16 15:52 UTC+0100 Viktor Szakats - - * src/rtl/set.c - ! Fixed an incompatibility in Set(_SET_EXIT) which caused - ReadExit() to set the SET value even if called without - a parameter. Similar incompatibility can exist with other - sets, but I didn't chk them. - Now ReadExit() works as expected. - - * src/rtl/tbrowse.prg - ! Typo. - -2004-02-16 10:52 UTC+0100 Viktor Szakats - - * src/rtl/tbrowse.prg - + :ColorRect() partial support added. The missing part is - that in C52 :ColorRect() will update the screen probably - using some internal buffers for the data, because - the skipblock for example is not evaluated. - - * src/rtl/filesys.c - * Some cleanup, optim, comments, added static. - -2004-02-15 14:02 UTC-0800 Luis Krause Mantilla - * hrbdll.bc - + added references to cdphu852.c cdphuwin.c and errorint.c - Could a MSVC user update hrbdll.vc - -2004-02-15 16:35 UTC+0100 Viktor Szakats - - * src/rtl/tbrowse.prg - ! Fixed to not display headsep/footsep when there's no - header/footer. - ! Fixed to display headsep/footsep with the width of - colsep. - - * makefile.bc - ! Added DEBUG_LIB for Harbour exes to make them compile - in debug mode. - - * souce/rtl/gtapi.c - ! hb_gtSetColorStr() previous change reverted. The mistake - was on my side most probably. - -2004-02-15 05:25 UTC+0100 Viktor Szakats - - * source/rtl/tbrowse.prg - ! :Moved() fixed to always DeHilite() (independently from - the autolite value). This is in sync with C52 docs - (see autolite .ng), and testing has shown it to be - compatible. Only :stabilize should be affected by the - autolite setting. - + TODO: added about missing ColorRect functionality. - -2004-02-15 05:12 UTC+0100 Viktor Szakats - - * source/rtl/tbrowse.prg - ! Fixed color handling to take into account ::defcolor - of TBColumn. Now TBrowse coloring is C52 compatible. - For speed wierd cases are not handled like if the value - of ::defcolor is improper. - - * source/rtl/tgetlist.prg - * source/rtl/ttopbar.prg - * source/rtl/tbrowse.prg - ! DevPos() -> SetPos() (TBrowse() had plenty of them) - ! Few missing color params added to DispOut*() - -2004-02-15 04:20 UTC+0100 Viktor Szakats - - * source/rtl/tget.prg - ! :display() fixed to always evaluate the get block before - displaying like in C52. - - * include/hbapifs.h - + HB_FFIND structure extended for future changes. - -2004-02-15 03:42 UTC+0100 Viktor Szakats - - * source/rdd/dbcmd.c - ! FIELDPUT() Fixed to accept and ignore field NIL values - without runtime error. C52 compatible. - -2004-02-14 19:14 UTC+0100 Viktor Szakats - - * source/rtl/tbrowse.prg - ! SetColumnWidth() fixed for multi-line headers. - -2004-02-14 05:33 UTC+0100 Viktor Szakats - - * include/hbapigt.h - * source/rtl/gt_tpl/gt_tpl.c - * source/rtl/gtwin/gtwin.c - * source/rtl/gtcgi/gtcgi.c - * source/rtl/gtcrs/gtcrs.c - * source/rtl/gtdos/gtdos.c - * source/rtl/gtos2/gtos2.c - * source/rtl/gtpca/gtpca.c - * source/rtl/gtsln/gtsln.c - * source/rtl/gtstd/gtstd.c - + Following low-level GT API functions added (for completeness): - hb_gt_GetCharAttr( SHORT uiRow, SHORT uiCol, BYTE * pbyChar, BYTE * pbyAttr ); - "static hb_gt_xGetXY()" functionality copied where available. - * Parameter of previously added functions changed from USHORT to SHORT - (to support moving windows out of screen) - + "static hb_gt_xPutch()" code copied to hb_gt_PutCharAttr() where available. - ! Added bounds checking to GTWIN new functions. - -2004-02-14 04:28 UTC+0100 Viktor Szakats - - * include/hbapigt.h - * source/rtl/gt_tpl/gt_tpl.c - + Following low-level GT API functions added to support - 3rd party GT high-level layers/replacements and 3rd - party screen handling libraries: - hb_gt_PutCharAttr( USHORT uiRow, USHORT uiCol, BYTE byChar, BYTE byAttr ); - hb_gt_PutChar( USHORT uiRow, USHORT uiCol, BYTE byChar ); - hb_gt_PutAttr( USHORT uiRow, USHORT uiCol, BYTE byAttr ); - hb_gt_GetChar( USHORT uiRow, USHORT uiCol, BYTE * pbyChar ); - hb_gt_GetAttr( USHORT uiRow, USHORT uiCol, BYTE * pbyAttr ); - - * source/rtl/gtwin/gtwin.c - * Above functions completed for the Win Terminal driver. - - * source/rtl/gtcgi/gtcgi.c - * source/rtl/gtcrs/gtcrs.c - * source/rtl/gtdos/gtdos.c - * source/rtl/gtos2/gtos2.c - * source/rtl/gtpca/gtpca.c - * source/rtl/gtsln/gtsln.c - * source/rtl/gtstd/gtstd.c - * Skeletons added for the above new functions. - -2004-02-14 03:00 UTC+0100 Viktor Szakats - - * makefile.bc - ! Fixed compilation of dbgbrwsr - - * source/pp/ppcore.c - * source/rtl/round.c - * source/rdd/dbfcdx/dbfcdx1.c - ! Fixed errors when compiled with HB_TRACE - - * source/common/hbffind.c - * Formatting. - -2004-02-13 23:57 UTC+0100 Viktor Szakats - - + source/codepage/cdphu852.c - + source/codepage/cdphuwin.c - * source/codepage/Makefile - * makefile.bc - * makefile.nt - * makefile.vc - + Added Hungarian 852 and Windows sorting codepages. - - * source/rtl/errorapi.c - + source/rtl/errorint.c - * source/rtl/Makefile - * makefile.bc - * makefile.nt - * makefile.vc - + hb_errInternal() put in a separate source file, to ease - replacing/override it in link-time, this may be useful - for GUI apps, logging or something like this. - -2004-02-13 23:36 UTC+0100 Viktor Szakats - - * source/vm/hvm.c - ! hb_vmPopAliasedVar() - Fixed to be case-insensitive. - % hb_vmPushAliasedVar() - Case-insensitive handling speed up. - * unsigned long -> ULONG - - * source/rtl/idle.c - * include/hbapi.h - + Made hb_releaseCPU() public. - - * source/rtl/filesys.c - * include/hbapifs.h - + Added return value to hb_fsSetDevMode(), this way it's - fully compatible with the CA-Clipper _tdevraw() call. - - * source/rtl/philes53.c - ! FSETDEVMOD() now returns a numeric instead of NIL. The - returned value is always 0 now. Note added about this - incompatibility with C53. - - * source/common/hbver.c - ! Mistyped defines related to compatibilty fixed. - - * source/rtl/strcase.c - ! Incorrect assigment warnings fixed. - -2004-02-13 21:56 UTC+0100 Viktor Szakats - - * souce/rtl/gtapi.c - ! hb_gtSetColorStr() removed one suspicious assigment which - showed incompatible with CA-Cl*pper, where CLR_UNSELECTED - was made equal to CLR_ENHANCED if missing from the color string. - * Using HB_CLR_ constants instead of literals. - - * source/rtl/tget.prg - ! :ColorSpec() method unselected color defaulting fixed. - - * source/compiler/hbusage.c - * Bumped year to 2004. - -2004-02-12 13:42 UTC-0800 Luis Krause Mantilla - * hrbdll.bc - + added missing references - - deleted obsolete refrerences - -2004-02-11 13:40 UTC+0100 Ryszard Glab - + source/debug/dbgbrwsr.prg - + The new file with TDbgBrowser class which inherits - from TBrowse - - * hrbdll.bc - * hrbdll.vc - * makefile.bc - * makefile.nt - * makefile.vc - * source/debug/Makefile - + added the reference to dbgbrwsr.prg - - * source/debug/dbgmenu.prg - + added "Run at Startup' option - - * source/debug/dbgtwin.prg - * source/debug/debugger.prg - * source/debug/tbrwtext.prg - + added "Run at Startup' option - if it is enabled then - the debugged application runs until ALTD() is called or - Alt+D keys pressed (Clipper compatibility - the default - option). If it is disabled the the debugger shows up at - the first code line with the debug info. - This setting is stored in the initialization file - (init.cld) as 'Options NoRunAtStartup'. - * fixed more display/refreshing issues - * fixed quiting the debugger - - * source/rtl/alert.prg - * fixed bug with messages longer then 60 bytes - - * source/vm/hvm.c - * hb_vmDebugEndProc() is called before the eval stack - is cleaned - this allows to handle INIT/EXIT procedures - correctly - -2004-02-05 18:49 UTC-0800 Luis Krause Mantilla - * source/vm/debug.c - + add wrappers (some 3rd-party-libs still use these ones) for: - __VMSTKGLIST() - __VMSTKGCOUNT() - Thanks Andi! - -2004-01-30 15:30 UTC+0100 Ryszard Glab - * source/pp/ppcore.c - * fixed compilation of &(exp) in normal stringify - markers (this fixes INDEX ON bug reported by Jorge) - -2004-01-30 10:40 UTC+0100 Ryszard Glab - * source/rtl/teditor.prg - * the current line is still visible after the window resizing - - * source/debug/debugger.prg - * fixed refreshing of variables' monitor window - * fixed some save/restore screen issues - -2004-01-29 20:15 UTC-0800 Luis Krause Mantilla - * contrib/rdd_ads/ace.h - + added missing definition for adsGetNumActiveLinks() - -2004-01-29 18:45 UTC-0800 Luis Krause Mantilla - * source/vm/debug.c - + add wrappers (some 3rd-party-libs still use these ones) for: - __VMSTKLCOUNT() - __VMPARLLIST() - __VMSTKLLIST() - __VMVARLGET() - __VMVARLSET() - * source/vm/hvm.c - + add wrappers (some 3rd-party-libs still use these ones) for: - __VMVARSLIST() - __VMVARSLEN() - __VMVARSGET() - __VMVARSSET() - Thanks Andi! - -2004-01-29 18:30 UTC-0800 Luis Krause Mantilla - * contrib/rdd_ads/adsfunc.c - + Added 3 ADS functions: adsGetNumOpenTables(), adsShowError() and adsGetNumActiveLinks() - -2004-01-28 11:10 UTC+0100 Ryszard Glab - * source/compiler/harbour.c - * removed duplicated line causing memory leak - reported by Andi - -2004-01-27 19:10 UTC+0100 Ryszard Glab - * source/compiler/harbour.c - * fixed generation of pcode in codeblocks with no - local variables or parameters - - * source/debug/debugger.prg - * fixed refreshing of variables in monitor window - -2004-01-27 16:10 UTC+0100 Ryszard Glab - * source/compiler/harbour.c - * the compiler generates module name inside - '(_INITSTATICS)' function if -B option is used - - * source/vm/hvm.c - * fixed hb_vmStaticName, hb_dbg_vmVarSGet, - hb_dbg_varSSet to use the static variables frame - - * source/debug/dbgtmenu.prg - * source/debug/dbgtmitm.prg - * source/debug/debugger.prg - * fixed parsing of : in watchpoint - expressions - * fixed monitoring of static variables - the - debugger displays now static variables defined - in the current debugged prg file - -2004-01-26 19:30 UTC+0100 Ryszard Glab - * include/hbextern.ch - * tests/debugtst.prg - * tests/funcarr.prg - * tests/inherit.prg - * tests/objarr.prg - * tests/objasign.prg - *replaced '__vm*' functions with 'hb_dbg_vm*' names - -2004-01-26 8:30 UTC-0800 Luis Krause Mantilla - * source/rtl/tget.prg - ! Fixed bug in get class when using "@9" picture with strings - -2004-01-26 11:45 UTC+0100 Ryszard Glab - * source/compiler/harbour.c - *fixed generation of codeblock's pcode with debugging info - - * source/debug/dbgmenu.prg - * source/debug/dbgtmenu.prg - * source/debug/dbgtmitm.prg - * source/debug/dbgtwin.prg - * source/debug/debugger.prg - * source/debug/tbrwtext.prg - *added Tracepoint support - *added support for PPO files - *added monitoring of local variables used in a codeblock - *local variables are displayed correctly when the - callstack window is browsed - *other minor fixes - - * source/vm/debug.c - *renamed '__vm*' functions to 'hb_dbg_*' - *fixed support for local variables inside of codeblock - - * source/vm/hvm.c - *added 'hb_dbg_ProcLevel' function which return the - size of procedure stack calls (the debugger support) - -2004-01-25 10:11 UTC+0100 Antonio Linares - * makefile.nt - * makefile.vc - * minor fix for hbverdir module - -2004-01-22 18:30 UTC+0100 Ryszard Glab - * source/debug/dbgmenu.prg - * source/debug/dbgtwin.prg - * source/debug/debugger.prg - *added Watchpoints support - - * source/vm/debug.c - *added item de-referencing to __vmVarLGet - -2004-01-21 18:40 UTC+0100 Ryszard Glab - +include/hbdebug.ch - *added a missing file - -2004-01-21 18:35 UTC+0100 Ryszard Glab - * source/compiler/harbour.y - *fixed generation of line number's pcode related to - the debugger - - * source/debug/dbgmenu.prg - * source/debug/debugger.prg - *added support for 'Run to cursor" command - *minor fixes in breakpoints handling (some code - lines are not allowed to set a breakpoint and - run to cursor) - -2004-01-21 15:30 UTC+0100 Ryszard Glab - * source/compiler/harbour.y - *fixed generation of line number's pcode related to - the debugger - - * source/debug/dbgmenu.prg - * source/debug/debugger.prg - *fixed TRACE command - *added support for 'Codeblock trace' option - * other minor fixes to make the debugger usable - - Additionally in my previous commit (2004-01-20 19:15) - * source/vm/hvm.c - *added call for hb_inkeyPoll to the main pcode execution - loop to correctly support Alt-D, Alt-C and Ctrl-C - requests (only if HB_GUI is not defined) - it is - called every 256 opcodes - -2004-01-20 19:15 UTC+0100 Ryszard Glab - * include/hbcomp.h - * include/hbexprb.c - * source/macro/macrob.c - * source/compiler/exproptb.c - * source/compiler/genc.c - * source/compiler/gencli.c - * source/compiler/harbour.c - * source/compiler/harbour.y - * source/compiler/hbfix.c - *when debug information is requested then the compiler generates - correct pcode with static variable name (it was correct if - -gc1 or -gc2 options were used previously) - *the pcode of a codeblock contains the module name (in debug mode) - - + include/hbdebug.ch - *a new file with a definition of __dbgEntry call modes - - * source/debug/debugger.prg - * source/vm/hvm.c - *changed parameters passed to __dbgEntry function to make the - function more flexible - *fixed monitoring of local and static variables - *when a codeblock is eveluated then debugger shows the code - where the codeblock was created - - * source/rtl/tbrowse.prg - *'configure' method recalculates the width of columns - - * include/hbapi.h - * source/vm/codebloc.c - * source/vm/itemapi.c - * source/vm/memvars.c - *code clean-up and optimalization related to codeblocks - - * source/rtl/gtcrs/Makefile - * source/rtl/gtcrs/gtcrs.c - + source/rtl/gtcrs/charmap.prg - *added possibility to load a character mapping using HB_GT_CHARMAP - - + source/rtl/gtcrs/debug.map - *an example character mapping - -2004-01-08 18:45 UTC-0500 David G. Holm - * contrib/Makefile - + Added a section for rsxnt, which is unable to compile Ole and odbc. - - Removed odbc from default section, because it includes the windows.h - include file, which is unlikely to exist on non-Windows systems. - - * contrib/odbc/odbc.c - ! Added type overrides for MSVC. - -2004-01-08 16:45 UTC-0500 David G. Holm - * source/rtl/filesys.c - ! Usage of fdatasync updated to match current POSIX specification. - -2004-01-08 16:00 UTC-0500 David G. Holm - * source/rtl/filesys.c - + Added an error return check to fdatasync when using POSIX - synchronized I/O, so that if unimplemented, the slower - method will be used to ensure that the file gets flushed. - - * utils/hbpp/hbpp.c - ! Removed another refererence to malloc.h, which is obsoleted by - stdlib.h and doesn't even exist in gcc 3.x implementations. - -2003-12-25 19:40 UTC-0800 Luis Krause Mantilla - * include/hbapifs.ch - * source/rtl/direct.c - * source/common/hbffind.c - ! Fixed bug in Directory( "c:\*.*" ) that returned 0 when hidden files were present - Borrowed from xHarbour - -2003-12-13 17:05 UTC+0100 Ryszard Glab - * source/vm/codebloc.c - * fixed initialization of detached variables - -2003-12-12 11:45 UTC-0800 Luis Krause Mantilla - * source/rdd/dbcmd.c - ! Fixed dbSelectArea() bug reported by Giovi Verrua - Thanks to Ryszard for the heads-up - -2003-12-10 18:20 UTC-0500 David G. Holm - - * utils/hbver/hbverfix.c - ! Fixes for problems found after testing on FreeBSD. - -2003-12-10 17:30 UTC-0500 David G. Holm - - * source/compiler/harbour.c - * source/compiler/harbour.sly - * source/compiler/harbour.y - * source/rtl/isprint.c - * source/vm/fm.c - * source/vm/hvm.c - ! Never include malloc.h, because: 1) It been obsoleted by stdlib.h - in Standard C; and 2) The use of malloc.h is forbidden in GCC 3.x. - -2003-12-05 16:05 UTC+0100 Ryszard Glab - * source/rtl/gtcrs/gtcrs.c - * characters with code > 128 are displayed correctly now - - * tests/codebl.prg - * updated test for detached codeblock parameters - (Notice that we are not compatible with Clipper here - there - is no need do duplicate Clipper bug, IMHO) - -2003-12-03 17:28 UTC-0800 Luis Krause Mantilla - * source/rdd/dbcmd.c - ! Fixed OrdKeyNo() bug that set RecNo() to LastRec() + 1 - reported by Roberto López - borrowed from xharbour - -2003-12-03 14:24 UTC-0800 Luis Krause Mantilla - * include/hbapirdd.h - * source/rdd/dbcmd.c - ! Fixed dbCreate() bug that closed an open dbf with same name as newly created dbf in a different folder - reported by Giovi Verrua - borrowed from xharbour - -2003-12-02 15:57 UTC+0100 Tomaz Zupan - * bin/pack_src.sh - + Added missing directories to script - -2003-12-02 15:23 UTC+0100 Lorenzo Fiorini - * source/vm/hvm.c - * source/vm/mainwin.c - * bin/bld.bat - * config/dos/watcom.cf - + config/w32/watcom.cf - ! added support to OpenWatcom DOS/Win32 borrowed from xHarbour - -2003-11-24 18:32 UTC+0100 Lorenzo Fiorini - * source/compiler/gencobj.c - ! fixed to allow = for the C compiler options - ( suggested by Przemyslaw Czerpak ) - ! added support of OpenWatcom C - ! cleaned the verbose option - * source/rdd/dbfcdx/dbfcdx1.h - ! changed to allow OpenWatcom C build - ( suggested by Przemyslaw Czerpak ) - * source/vm/itemapi.c - ! added support of OpenWatcom C - -2003-11-14 16:45 UTC+0100 Ryszard Glab - * include/hbmath.h - * fixed to compile under OpenWatcom - - * source/vm/memvars.c - * fixed to release PUBLIC variables correctly - (when RELEASE command is used) - - -2003-10-12 17:35 UTC-0500 David G. Holm - - * utils/hbver/hbverfix.c - ! Include closing quote in string built by szReplaceQuoted. - ! Strip newline chars from end of log entry. - -2003-10-12 17:15 UTC-0500 David G. Holm - - * utils/hbver/hbverfix.c - ! Use the standard ENOENT instead of the DOS-centric ENOFILE. - ! Resolved three print format warnings. - -2003-11-12 13:35 UTC+0200 Chen Kedem - * doc/dirstruc.txt - + Add a lines for source/rdd/dbfdbt, source/rdd/dbffpt, utils/hbver - - * doc/es/dbstrux.txt - - Remove embedded TABs - -2003-10-11 18:35 UTC-0500 David G. Holm - - * makefile.bc - * makefile.nt - * makefile.vc - * include/hbver.h - * utils/Makefile - + utils/hbver/Makefile - + utils/hbver/hbverfix.c - This is a first pass at a utility to automatically update include/hbver.h. - The ChangeLog-related fields are updated automatically. One of the version- - related fields can be updated using one of three command line options (/iv - for major version, /im for minor version, or /ir for program revision). The - minimal debug output can be suppressed by using the /d-1 option or verbose - debug output can be seen by using the /d1 option. Help is obtained using - either of the /h or /? options. - -2003-11-10 15:54 UTC+0100 Maurilio Longo - borrowed from xHarbour trying to hunt down a memory leak on an utility of mine - - 2003-11-10 12:19 UTC+0100 Przemyslaw Czerpak - * include/hbrddcdx.h - * source/rdd/dbfcdx/dbfcdx1.c - ! possible memory leak fixed - * small improvment in balancing - - -2003-11-10 13:20 UTC+0100 Maurilio Longo - * contrib/btree/hb_btree.c - + added _CLIPDEFS_H define to let it compile on OS/2 GCC - * contrib/libct/bit1.c - * contrib/libct/bit3.c - * contrib/libct/ct.h - + added _CLIPDEFS_H define to let it compile on OS/2 GCC - * changed redefined base tipes to C ones, like WORD -> long, bit3.c was already - partly fixed before this one - * contrib/libnf/chdir.c - * contrib/libnf/dispc.c - * contrib/libnf/getenvrn.c - * contrib/libnf/kspeed.c - * contrib/libnf/mouse.c - * contrib/libnf/rmdir.c - + added _CLIPDEFS_H define to let it compile on OS/2 GCC, now it compiles, but a lot - of functions are DOS only - -2003-11-10 12:25 UTC+0100 Ryszard Glab - * include/hbcomp.h - * source/compiler/cmdcheck.c - * source/compiler/genc.c - * source/compiler/harbour.c - * source/compiler/hbusage.c - * source/vm/hvm.c - * doc/en/compiler.txt - * fixed to correctly generate an address for far jumps - * fixed optimalization of far jumps - + added a new switch -kJ to disable jump optimalization and - NOOP pcode removal (optimalization is enabled by default) - - -2003-11-09 00:50 UTC+0300 Alexander Kresin - * source/pp/pptable.c - + SET MBLOCKSIZE TO - SET MEMOBLOCK TO - SET MFILEEXT TO - SET AUTOSHARE TO [] - SET AUTORDER TO [] - SET STRICTREAD - New DBFFPT related commands, added by Przemyslaw Czerpak - synced with xHarbour. - - * include/hbdefs.h - * source/rdd/dbcmd.c - * source/rdd/dbfcdx/dbfcdx1.c - ! Some DBFCDX fixes by Przemyslaw Czerpak - synced with xHarbour. - - * source/rdd/dbfntx/dbfntx1.c - ! Bug fixed, which appeared while conditional indexing of a parent file in relation. - -2003-10-22 13:26 UTC-0800 Luis Krause Mantilla - * source/rdd/rddord.prg - + ORDSETRELATION() - * source/rtl/dummy.prg - + removed implemented fzuns - * Latest RDD changes, has been made by Przemyslaw Czerpak - synced with xHarbour. - -2003-11-06 11:40 UTC+0100 Ryszard Glab - * source/compiler/harbour.l - * enabled support for break[] (if not full Clipper - compatibility mode was requested) - - * include/hbexpra.c - * include/hbexprb.c - * include/hbexprc.c - * include/hbexprop.h - * source/common/expropt2.c - * source/compiler/expropta.c - * source/compiler/exproptb.c - * source/compiler/exproptc.c - * source/macro/macroa.c - * source/macro/macrob.c - * source/macro/macroc.c - * fixed optimalization of literal strings that contain macro - operator - strings are not joined if the left argument of - '+' operator contains '&' - for example: - CHR(38)+'text' -> will no longer look for 'text' variable - '&var'+'iable' -> will look for 'var' variable instead of - 'variable' - - + added optimalization of ASC function - for example: - ASC('&') will be replaced with 38 - - + added optimalization of LEN function - for example: - LEN("123") will be replaced with 3 - LEN( {1,2} ) will be replaced with 2 - Optimalization od ASC, LEN is disabled if strict Clipper - mode is requested (-kc) - - * source/compiler/harbour.c - * support for strings as array of bytes is disabled by default now - (use -ks to enable it) - - * source/vm/cmdarg.c - * source/vm/hvm.c - * support for strings as array of bytes is disabled by default now - (use //FLAGS:s to enable it) - -2003-11-06 11:00 UTC+0300 Alexander Kresin - * source/vm/hvm.c - * RDD initialization added ( made by Przemyslaw Czerpak ) - I forgot to - upload it yesterday. - -2003-11-05 23:35 UTC+0300 Alexander Kresin - * makefile.bc - * makefile.nt - * makefile.vc - * Makefiles has been updated due to RDD changes - -2003-11-05 22:50 UTC+0300 Alexander Kresin - * config/global.cf - * include/hbapirdd.h - * include/hbapi.h - * include/hbapifs.h - * include/hbdefs.h - * include/hbrddcdx.h - * include/hbrddntx.h - * include/hbrdddbf.h - * include/hbrdddel.h - * include/hbrddsdf.h - + include/hbdbferr.h - + include/hbrdddbt.h - + include/hbrddfpt.h - - * source/rtl/filesys.c - * source/rtl/spfiles.c - * source/rtl/filehb.c - - * source/rdd/dbcmd.c - * source/rdd/dbf1.c - * source/rdd/delim1.c - * source/rdd/rddsys.prg - * source/rdd/sdf1.c - * source/rdd/workarea.c - - * source/rdd/dbfcdx/dbfcdx0.prg - * source/rdd/dbfcdx/dbfcdx1.c - * source/rdd/dbfcdx/dbfcdx1.h - - source/rdd/dbfcdx/dbfcdx2.h - - * source/rdd/dbfntx/dbfntx1.c - - + source/rdd/dbfdbt/ - + source/rdd/dbfdbt/dbfdbt0.prg - + source/rdd/dbfdbt/dbfdbt1.c - - + source/rdd/dbffpt/ - + source/rdd/dbffpt/dbffpt0.prg - + source/rdd/dbffpt/dbffpt1.c - * Latest RDD changes, has been made by Przemyslaw Czerpak - synced with xHarbour. - -2003-10-30 19:50 UTC+0100 Ryszard Glab - * source/compiler/harbour.l - * source/compiler/harbour.y - *Fixed support for DO [WITH ...] command - The procedure name is not "uppercased" - For example: - DO MyProc - The compiler look for MyProc.prg file now - (instead of MYPROC.prg) - -2003-10-30 10:45 UTC+0100 Tomaz Zupan - * source/rtl/alert.prg - ! Reverted changes from 2003-09-07 - -2003-10-29 20:15 UTC+0100 Ryszard Glab - * include/hbexprb.c - * source/compiler/exproptb.c - * source/macro/macrob.c - *fixed generation of pcode for {|| &var} - *see below - - * include/hbcomp.h - * source/compiler/cmdcheck.c - * source/compiler/harbour.c - * source/compiler/harbour.y - * source/compiler/hbusage.c - * doc/en/compiler.txt - *added support for DO WITH @variable - *a new compatibility flag -ks was added to enable support for - strings as array of bytes (it is enabled by default). The support - for strings as bytes array is disabled if you use -kc switch - (Clipper compatibility mode) - *when xbase mode is not used (-kc or -kch) then compiler doesn't - generate the pcode for these xbase extended features - For example: - memv:="2,3" - a:={1, &memv, 4} - will generate a runtime 'syntax error' without -kx switch - or will create an array with four elements if -kx was used. - The above rule will apply also for: - var[&index] - func( &argument ) - (expr1, ¯o ) - Notice that the xbase mode is enabled by default. - - * source/rtl/gtapi.c - *fixed GPF in hb_gtBox() when no string was passed - - * source/rtl/gtcrs/gtcrs.c - *improved recognition of xterm compatible terminals - - * source/rtl/gtcrs/Makefile - * source/rtl/gtcrs/kbdcrs.c - + source/rtl/gtcrs/keymap.prg - + source/rtl/gtcrs/eterm.map - + source/rtl/gtcrs/linux.map - *the support for runtime definition of keycodes mapping was added - (translation from terminal key sequences into INKEY() codes) - +eterm.map and linux.map are example files with keycode mapping - +HB_GT_KEYMAP() function was added - - * include/hbapi.h - *Changed declaration of hb_cmdargProcessVM() - - * include/hbapigt.h - * include/hbvm.h - * source/rtl/inkey.c - * source/vm/cmdarg.c - * source/vm/hvm.c - *new function hb_vmFlagEnabled() to query compatibility - at runtime - *new internal command line arguments were added to control - application at runtime: - //FLAGS:switches - this flag controls compatibility issues of the virtual - machine - Available switches: - c - Clipper compatibility - h - Harbour extensions (enabled by default) - s - enable support for strings as array of bytes (enabled - by default) - For example: - myapp //FLAGS:ch - will disable support for strings as array of bytes - - //CANCEL:key - //CANCELEX:keyex - this flag allows change the keycode of application cancel - request (usually Alt-C) - using normal INKEY() keycodes - or extended keycodes (CANCELEX) - For example: - myapp //CANCEL:304 - will change Alt-c into Alt-b for cancelling (Alt-c is used - to insert polish diactric letter) - - * tests/keywords.prg - *fixed to suppress warnings for FIELD and IN keywords if passed - by reference - -2003-10-25 14:45 UTC+0100 Ryszard Glab - * include/hbexprb.c - * source/compiler/exproptb.c - * fixed to stop 'function defined but not used' warning with SIMPLEX - - * source/compiler/harbour.l - * enhanced to support nested '[]' strings created with dumb stingify - match marker (full Clipper compatibility with Flex) - - * source/pp/ppcomp.c - * source/pp/ppcore.c - * fixed support for stingify match markers - full Clipper - compatibility - - * tests/Makefile - * testpp.prg was added into BAD_PRG_SOURCES - - * tests/codebl.prg - * test for references of codeblock parameters was added - - + tests/testpp.prg - * new file to test stringify match markers (this file will - not run - compile it only) - -2003-10-24 11:50 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! Minor fix for calculating the maximum keys number in index page. - Some 3rd party engines ( Crystal Reports ) had problems opening - ntx'es, created by Harbour. - -2003-10-23 15:40 UTC+0100 Ryszard Glab - * source/compiler/harbour.l - * fixed codeblock scanning - this should cure random GPFs - -2003-10-23 11:00 UTC+0100 Ryszard Glab - * include/hbexprc.c - * source/compiler/exproptc.c - * a variable pbUseTextSubst is initialized correctly when - compiled with macro support - - * source/compiler/harbour.l - * (char *) cast was added - - * source/vm/itemapi.c - * check for a loop in variable de-referencing was added - The following code: - var := IIF( .T., @var, var ) - is causing that the variable is referencing itself - (valid syntax in Clipper) - - * source/vm/macro.c - * fixed to link correctly with WATCOM linker - - -2003-10-23 10:30 UTC+0300 Alexander Kresin - * source/rtl/strcase.c - ! hb_strncpyUpper() and hb_strncpyUpperTrim() fixed. - -2003-10-22 9:49 UTC-0800 Luis Krause Mantilla - * makefile.bc - * $(OBJ_DIR)\msgsrwin.obj added to LANG.LIB dependencies section. - -2003-10-22 13:55 UTC+0300 Alexander Kresin - * makefile.bc - * makefile.nt - * makefile.vc - * lang/msgsrwin.c and symbol.prg ( to makefile.nt only ) added. - * source/rdd/dbcmd.c - ! Ordscope() fixed - first parameter is TOPSCOPE by default now. - -2003-10-21 10:23 UTC-0800 Luis Krause Mantilla - * source/vm/codebloc.c - ! Fixed detached local bug (borrowed from xharbour) - * source/rdd/dbcmd.c - ! Fixed bug in __dbLocate() with When clause (borrowed from xharbour) - -2003-10-20 13:45 UTC+0100 Ryszard Glab - * .cvsignore - * Restored previous version - - * include/hbexpra.c - * include/hbexprb.c - * include/hbexprc.c - * include/hbexprop.h - * source/common/expropt1.c - * source/compiler/exproptb.c - * source/compiler/exproptc.c - * source/compiler/harbour.sly - * fixed declaration mismatch in Simplex version - * fixed generation of string's pcode - (introduced with my previous changes) - - * source/pp/ppcore.c - * fixed support for stringify match markers <""> and <()> in Flex - version (for example &var.1 have to be expanded into "&var.1" - instead of var.1 since this is not a valid Clipper expression) - NOTICE! In Simplex version this is not fixed because it is - used as a hack to correctly support macro variables in GET - command. - - * tests/testget.prg - * MEMVAR declaration was added - -2003-10-20 11:37 UTC+0300 Alexander Kresin - * include/hbapi.h - * The declaration of hb_objSendMsg() added. - * source/rdd/dbfntx/dbfntx1.c - ! bug fixed in soft seeking. - -2003-10-17 18:08 UTC+0100 Ryszard Glab - - * include/hbapi.h - * include/hbcomp.h - * include/hbexpra.c - * include/hbexprb.c - * include/hbexprc.c - * include/hbexprop.h - * source/common/expropt1.c - * source/compiler/expropta.c - * source/compiler/exproptb.c - * source/compiler/exproptc.c - * source/compiler/harbour.c - * source/compiler/harbour.l - * source/compiler/harbour.sly - * source/compiler/harbour.y - * source/compiler/hbgenerr.c - * source/macro/macro.y - * source/macro/macroa.c - * source/macro/macrob.c - * source/macro/macroc.c - * Fixed support for late/early evaluation of macro exressions in - a codeblock (Flex version) (see tests/tstblock.prg for a sample) - Harbour(flex) is now full Clipper compatible here. - - * config/dos/watcom.cf - * source/rdd/dbfcdx/dbfcdx1.h - * source/common/hbffind.c - * include/hbrddcdx.h - * include/hbmath.h - * Changed to compile correctly with WATCOM compilers - -2003-10-16 13:17 UTC+0100 Antonio Linares - * source/rtl/round.c - ! hb_numRound() completely redesigned - Source code provided by Vicente Aranzana. - - Vicente Aranzana kindly requests to have CVS developer access rights. - -2003-10-10 10:00 UTC+0100 Antonio Linares - * source/rtl/round.c - ! changes on round() function, proposed by Vicente Aranzana. - Based on his tests, the changes are working ok. - -2003-10-08 14:24 UTC+0300 Alexander Kresin - * Makefile - * contrib/Makefile - * Makefiles are changed to build some contribution libraries. - * source/vm/classes.c - * hb_objSendMsg() function added ( borrowed from xHarbour ). - It makes it more easy to set/get values of object variables, - execute object methods from the C level. - -2003-10-07 12:06 UTC+0200 Chen Kedem - * doc/whatsnew.txt - * Update build 43 release date - -2003-10-04 20:18 UTC+0300 Alexander Kresin - * contrib/ole/ole2.c - * Some changes needed for Mingw. - + contrib/ole/Makefile - + Makefile added. - -2003-09-29 16:12 UTC-0800 Luis Krause Mantilla - * contrib/rdd_ads/adsfunc.c - * contrib/rdd_ads/doc/en/adsfuncs.txt - + Added 2 (ignored) & 3rd params to adsKeyNo() in order to perform - like OrdKeyNo() for other RDD's. The default remains ADS_IGNOREFILTERS - for compatibility (like adsKeyCount() does). - Updated documentation in adsfuncs.txt - -2003-09-29 22:10 UTC+0300 Alexander Kresin - *source/rtl/strcase.c - ! hb_strncpyUpperTrim() is fixed ( borrowed from xHarbour ). - * include/hbver.h - * Release info has been corrected again ... - -2003-09-29 15:20 UTC+0300 Alexander Kresin - *source/rtl/strcase.c - ! hb_strncpyUpper() is fixed ( borrowed from xHarbour ). - * make_tgz.sh - * bin/pack_src.sh - * release info changed - * include/hbver.h - * Release info has been corrected again :). - -2003-09-29 11:47 UTC+0300 Chen Kedem - * doc/whatsnew.txt - + Added information about builds 10..25, 43 based on information - found on the Harbour site and the mail list. - -2003-09-29 11:25 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - * Signature byte for ntx files is changed to be Clipper compatible. - * include/hbver.h - * Release info has been corrected - -2003-09-29 09:10 UTC+0200 Tomaz Zupan - * harbour.spec - * Release info has been changed. - -2003-09-26 22:10 UTC+0300 Alexander Kresin - * source/compiler/hbusage.c - ! Year has been changed in copyright statement ( 2003 instead of 2002 ). - * include/hbver.h - * Release info has been changed. - -2003-09-26 09:18 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! Bug fixed in ntxSeek(), reported by Przemyslaw Czerpak - - index unlocking wasn't present in some occasions. - -2003-09-22 17:07 UTC-0800 Luis Krause Mantilla - * contrib/rdd_ads/adsfunc.c - ! fixed parameter error handling in AdsSetAOF (borrowed from xHarbour) - -2003-09-18 16:33 UTC-0800 Luis Krause Mantilla - * contrib/rdd_ads/ads1.c - ! Fixed bug when passing a numeric to adsCustomizeAOF() (Nil and - array worked ok). Thanks to Brian Hays for the fix. - * include/ads.ch - ! The ROLLBACK TRANSACTION command was translating to - AdsRollbackTransaction() instead of just AdsRollback() - -2003-09-18 10:20 UTC+0100 Antonio Linares - * source/rdd/dbcmd.c - ! Fixed several places more where hb_strncpyUpper() was wrongly used - -2003-09-18 10:00 UTC+0100 Antonio Linares - * source/rdd/dbcmd.c - ! definition required for MSVC - * source/rdd/dbfcdx/dbfcdx1.c - ! some typecastings required for MSVC - -2003-09-17 21:41 UTC+0100 Antonio Linares - * source/rdd/dbcmd.c - ! fixed bug on hb_strncpyUpper() use from DbUseArea() - -2003-09-17 10:54 UTC-0800 Luis Krause Mantilla - * source/rtl/tget.prg - ! Fixed bug in unTransform() method that truncated - trailing spaces in variable when using "@R" template - Borrowed from xharbour by Andi Jahja: - * source/common/reserved.c - * utils/hbdoc/genrtf.prg - * utils/hbdoc/genng.prg - + Add option to omit reserved words by adding -DHB_RESERVED_OFF (default is ON) - - /* - This may be useful when one is working with pCode DLL where he must redefine - reserved words as dummy functions in the DLL. - */ - -2003-09-15 12:50 UTC+0300 Alexander Kresin - * source/rdd/dbf1.c - * source/rdd/dbfntx/dbfntx1.c - ! Bug fixed in hb_IncString(), reported by Przemyslaw Czerpak - - now this function respects the national sorting rules. - ! Bug fixed in hb_ntxTagKeyNo(), reported by Przemyslaw Czerpak - - index unlocking wasn't present in some occasions. - ! Bug fixed with scoping, reported by Giovi Verrua. - -2003-09-11 11:30 UTC+0200 Przemyslaw Czerpak - * harbour.spec - * small fix in auto platform detection (thanks to Tomaz Zupan) - * make_tgz.sh - * added auto platform detection - -2003-09-11 01:00 UTC+0200 Tomaz Zupan - * harbour.spec - * swiched back to gtcrs - -2003-09-11 00:47 UTC+0200 Tomaz Zupan - * harbour.spec - * Added automatic platform resolution (borrowed from courier-imap project) - * make_rpm.sh - * small fix needed to work with Mandrake Linux - -2003-09-10 23:27 UTC+0200 Przemyslaw Czerpak - * harbour.spec - * make_tgz.sh - * small fix - -2003-09-10 21:37 UTC+0200 Przemyslaw Czerpak - * harbour.spec - + new spec file. It creates four binary RPMs with shared and - static libs core harbour compiler and tools and with Ron's PP - which allow to run xBase files as scripts on *nix platform - and new tool hbcmp, hbcc, hblnk, hbmk. - For details see README.RPM - Please remember that PP has poor GPL license. It is noticed in RPM - headers. - - + hbgtmk.sh - + simple script which connect to SourceForge CVS takes sources and - build RPMs from them. - - + make_rpm.sh - + script for checking dependences and making RPMs - - + make_tgz.sh - + script for making binary package for this Linux distro which don't - support RPM - - + bin/hb-mkslib.sh - + script for building shared libs from static ones and/or object files - - + bin/pack_src.sh - + script for packing harbour sources - - * Makefile - * source/compiler/harbour.c - * source/common/hbver.c - * source/vm/cmdarg.c - * source/vm/fm.c - * source/vm/hvm.c - * changes for some new futures in hb{cmp,lnk,mk} tools - - * contrib/libct/datetime.prg - - redundant STOD removed (this function is part of RTL) - - * contrib/dot/pp.prg - * contrib/dot/pp.txt - * contrib/dot/pp_harb.ch - * contrib/dot/rp_dot.ch - * contrib/dot/rp_run.ch - * upadting for runing xBase files as scripts. - -All this changes (except Ron's PP) are my work borrowed from xHarbour. - -2003-09-10 15:00 UTC-0400 David G. Holm - * config/dos/bcc16.cf - * config/os2/icc.cf - ! Disabled the LONGLONG and UNLONGLONG definitions in hbdefs.h, which - only work for GCC and Windows, by defining HB_LONG_LONG_OFF. - * source/common/hbstr.c - * source/compiler/harbour.l - * source/rtl/val.c - ! Moved the duplicate definitions of hb_strVal to source/common/hbstr.c. - * source/rtl/symbol.prg - ! Removed static declarations from GETSYMBOLPOINTER, GETSYMBOLNAME, and - SYMBOL_EXEC in order to eliminate static vs. extern errors in os2/icc - builds. - * source/rdd/dbfcdx/dbfcdx1.c - ! Corrected two instances of (unsigned char *) typecasts on hb_fs... - functions, which use BYTE * parameters, not unsigned char * (the - distinction is very important for those builds that use C++ mode. - -2003-09-10 09:45 UTC-0300 Antonio Carlos Pantaglione - * source/vm/arrayshb.c - ! More clipper compatible on ADel(). - -2003-09-09 14:16 UTC+0300 Alexander Kresin - * source/pp/ppcore.c - ! Bug fixed in preprocessor, reported by Randy Portnoff. - -2003-09-07 13:58 UTC+0200 Tomaz Zupan - * source/rtl/gtcrs/gtcrs.c - ! fixed displaying of boxes in xterm - * source/rtl/alert.prg - ! changed BoxString parameter while displaying box to NIL. It - is needed to corectly display alert box in xterm. - -2003-08-29 07:03 UTC+0100 Antonio Linares - * source/vm/hvm.c - ! Fix implemented for -0.0 on hb_vmPushDouble() as proposed by - Alejandro de Garate , and on hb_PushDoubleConst() - (I guess this place may be a source for such bug too). - - This fix should solve the bug described by Don Lowenstein regarding -0.0 result - . - -2003-08-24 14:30 UTC+0200 Tomaz Zupan - * utils/hbdoc/genhtm.prg - * removed trailing EOL from category name, because category is also used - as file name. - -2003-08-23 13:20 UTC+0200 Tomaz Zupan - * utils/hbdoc/ffile1.prg - ! fixed end of line handling now it works on platforma other than windows - * utils/hbdoc/genhtm.prg - ! fixed getitem function (in certain situation it returned NIL instead - of logical value and prevented it to try access array beyond its bounds) - * Changed backslashes into slashes (\ -> /) - * utils/hbdoc/hbdoc.prg - * doc/genhtm.rsp - * Changed backslashes into slashes (\ -> /) - -2003-08-22 12:10 UTC+0100 Antonio Linares - + source/rtl/color53.prg - + source/rtl/mssgline.prg - ! modules borrowed from xharbour (required for recent ttopbar.prg changes) - - * makefile.bc - * makefile.nt - * makefile.vc - * source/rtl/Makefile - + added modules mssgline.prg and color53.prg - - * include/hbapicdp.h - + Added hb_cdpchrcmp() prototype - - * include/hbdefs.h - + Added support for ULONLONG - - * include/hbrddcdx.h - * source/rdd/dbfcdx/dbfcdx1.c - * source/rdd/dbfcdx/dbfcdx2.h - + Freeing pages implemented - + redistributing keys implemented - * small speed improvement - ! And many bug fixes - (changes borrowed from xharbour - developed by Przemyslaw Czerpak ) - - * source/rtl/cdpapi.c - ! sync with xharbour (changes required for DBFCDX improvements) - -2003-08-22 11:26 UTC+0100 Antonio Linares - * source/rtl/ttopbar.prg - ! some required formating - -2003-08-21 13:36 UTC+0100 Antonio Linares - * source/rtl/ttopbar.prg - + MenuModal() implementation - changes borrowed from xHarbour, - which borrowed used Class TopBarMenu from Harbour. - - With this function, David Macias reported bug of missing functions, is - answered, as the functions names should not be truncated to 10 chars, - also MAKEDIR() should be used instead of DIRMAKE(), and MemoSetSuper() - implementation is pending on RDD experts development. - -2003-08-21 12:37 UTC+0100 Antonio Linares - * source/rtl/teditor.prg - ! Modified to allow inherited classes to properly manage K_ESC - * source/rtl/memoedit.prg - ! K_ESC and CTRL-W Clipper compatible management - - MemoEdit() bugs described by David Macias, already fixed. - - The only difference there is with Clipper is that Clipper does not shows - the message "Abort Edit? (Y/N)" if the text has not been modified, but - Class HBEditor does not provides a DATA lModified by now. - -2003-08-21 11:29 UTC+0100 Antonio Linares - * contrib/samples/environ.c - ! Fixed GPF on missing dot for FileExt() use - - Bug described by David Macias, and he confirmed the fix too, with this change. - -2003-08-19 23:00 UTC+0300 Alexander Kresin - + harbour.spec - spec file to build rpm is added. - * source/debug/debugger.prg - ! Fix, provided by Lorenzo Fiorini - -2003-08-07 22:50 UTC+0300 Alexander Kresin - * source/rdd/dbcmd.c - ! Fix in LOCATE REST WHILE ... FOR ..., provided by Alexander Prostoserdov - * source/rdd/dbfntx/dbfntx1.c - * support of binary keys implemented. - -2003-08-04 14:00 UTC-0400 David G. Holm - * source/rtl/gtapi.c - ! Enforce Clipper compatibility for SCROLL by only calling hb_gt_Scroll - from hb_gtScroll if left <= right and top <= bottom. - -2003-07-30 14:30 UTC-0400 David G. Holm - * include/set.ch - ! Indicate that there are six (6) Harbour SET extensions. - -2003-07-30 08:28 UTC+0300 Chen Kedem - * doc/en/set.txt - + Added _SET_EOF text from the changelog entry written by - David G. Holm and mark it Harbour extension. - -2003-07-28 22:00 UTC-0400 David G. Holm - * include/hbset.h - * include/set.ch - * source/pp/pptable.c - * source/rtl/dbdelim.prg - * source/rtl/dbsdf.prg - * source/rtl/set.c - + New SET value named _SET_EOF. Defaults to FALSE on UN*X, but defaults - to TRUE on everything else. If set to FALSE, then CHR(26) does not get - written when using COPY TO DELIMITED, COPY TO SDF, or when closing any - of the various text files that are created using various SET values. - -2003-07-21 11:10 UTC-0300 Antonio Carlos Pantaglione - * source/rtl/transfrm.c - ! Fixed the problem with @E and negative numbers. - - local nValue := -134.24 - msginfo( Val( AllTrim( Transform( nValue, "@E 99,999.99" ) ) ) ) - msginfo( Val( AllTrim( Transform( nValue, "@E99,999.99" ) ) ) ) - - Thanks to Enrico Maria Giordano for this fix. - -2003-07-17 23:00 UTC-0300 Antonio Carlos Pantaglione - * source/rtl/transfrm.c - ! Removed some old commented lines - - * contrib/rdd_ads/adsfunc.c - ! Update transaction functions - ! Add AdsCacheRecords function - - * source/rdd/dbcmd.c - ! Modified error handling to allow retry if alias is not exist during - DBSelectArea() for Clipper compatibility. (Reported by Giovi Verrua) - * source/vm/hvm.c - ! More Clipper compatible to handle FOR-NEXT loops. - Changes by Andi Jahja, borrow from xharbour - -2003-07-17 17:43 UTC-0400 Alejandro de Garate - * doc/en/memo.txt - + Added MEMOREAD(), MEMOWRIT() documentation - * doc/es/memo.txt - + Added MEMOREAD(), MEMOWRIT() documentation - -2003-07-17 17:34 UTC-0400 Alejandro de Garate - * source/rtl/memofile.c - + Added an optional 3rd parameter to MEMOWRIT(), , to decide - at run-time if EOF char should be written. - -2003-07-16 13:00 UTC-0300 Antonio Carlos Pantaglione - * contrib/rdd_ads/ads1.c - ! Changes in adsPutValue for speed(). Tested with - ADS Local 6.2, not tested with prior versions of ADS. - -2003-07-14 13:50 UTC-0300 Antonio Carlos Pantaglione - * contrib/rdd_ads/ads1.c - * contrib/rdd_ads/adsfunc.c - ! Changes in adsGetValue and AdsKeyCount() for speed(). Tested with - ADS Local 6.2, not tested with prior versions of ADS. - -2003-07-14 14:39 UTC+0100 Antonio Linares - * source/vm/classes.c - + HB_SETCLSHANDLE() implemented - - Syntax: HB_SetClsHandle( , ) --> - - Real dirty function, though very usefull under certain circunstances: - It allows to change the class handle of an object into another class handle, - so the object behaves like a different Class of object. - Based on objects.lib SetClsHandle(). - -2003-07-14 09:10 UTC-0300 Antonio Carlos Pantaglione - * source/rtl/memoline.c - ! Fixed a bug by missed () in HB_CHAR_SOFT1 compare. - -2003-07-13 14:13 UTC-0400 Alejandro de Garate - + doc/es/gnulice.txt - + doc/es/hvm.txt - + doc/es/input.txt - + doc/es/macro.txt - + doc/es/memvar2.txt - + doc/es/misc.txt - + doc/es/nation.txt - + doc/es/objfunc.txt - + doc/es/rdd.txt - + doc/es/sayget.txt - + doc/es/subcodes.txt - + doc/es/tbrowse.txt - + doc/es/tclass.txt - + doc/es/tgetlist.txt - + doc/es/tlabel.txt - + doc/es/treport.txt - + doc/es/var.txt - + Added new doc files in spanish - -2003-07-13 14:08 UTC-0400 Alejandro de Garate - * doc/es/Makefile - + gnulice.txt - + hvm.txt - + input.txt - + macro.txt - + memvar2.txt - + misc.txt - + nation.txt - + objfunc.txt - + rdd.txt - + sayget.txt - + subcodes.txt - + tbrowse.txt - + tclass.txt - + tgetlist.txt - + tlabel.txt - + treport.txt - + var.txt - + Added references to new doc files - -2003-07-13 12:32 UTC-0400 Alejandro de Garate - * doc/es/lang.txt - ! Fixed accents, etc, minor formating. Now in sync with english version - -2003-07-13 12:24 UTC-0400 Alejandro de Garate - * doc/es/hbpplib.txt - * doc/es/howtobsd.txt - * doc/es/idle.txt - * doc/es/license.txt - * doc/es/math.txt - * doc/es/memo.txt - * doc/es/pcode.txt - * doc/es/pragma.txt - * doc/es/readme.txt - * doc/es/setmode.txt - * doc/es/simplex.txt - * doc/es/statics.txt - * doc/es/strotype.txt - * doc/es/tracing.txt - * doc/es/vm.txt - ! Fixed errors, misspelling, accents, etc, minor formating - -2003-07-13 10:52 UTC-0400 Alejandro de Garate - * doc/es/array.txt - * doc/es/binnum.txt - * doc/es/browse.txt - * doc/es/clipper.txt - * doc/es/cmdline.txt - * doc/es/codebloc.txt - * doc/es/command.txt - * doc/es/compiler.txt - * doc/es/datetime.txt - * doc/es/dbdelim.txt - * doc/es/dbsdf.txt - * doc/es/dbstrux.txt - * doc/es/dir.txt - * doc/es/dirstruc.txt - * doc/es/diskspac.txt - * doc/es/error.txt - * doc/es/eval.txt - * doc/es/garbage.txt - * doc/es/harbext.txt - * doc/es/hb_set.txt - ! Fixed errors, misspelling, accents, etc, minor formating - -2003-07-12 13:02 UTC+0100 Antonio Linares - * source/rtl/philes.c - ! FRead() bug fixed, introduced cause 1 byte length strings optimization - - Bug described by Guy Roussin: - - function main( cFile ) - local nH - local cBuf:=" " - local cBlock := "{|| Alert( 'test' ) }" - nH:=fopen(cFile,0) - while fread(nH,@cBuf,1)>0 ; end - fclose(nH) - eval( &( cBlock ) ) - return(NIL) - -2003-07-12 10:06 UTC+0100 Antonio Linares - * source/debug/debugger.prg - * source/rtl/philes.c - ! Enhancements developed by Lorenzo Fiorini. - - Lorenzo: Please supply us a description of what you have implemented. - -2003-07-10 17:43 UTC-0300 Antonio Carlos Pantaglione - * source/rtl/memoline.c - ! Fixed bug with soft returns. Clipper compatible. - -2003-07-09 07:20 UTC-0300 Antonio Carlos Pantaglione - * source/rtl/transfrm.c - ! Fix with numeric values and pictures with spaces and pictures with - severals dot. Changes by Walter Negro, borrow from xharbour. - The return values are compliant with Clipper. - eg: Transform( 1234, "9 999" ) - eg: Transform( 123.123456, "999.99.99.99" ) - PS: I comment ALL old lines with //Toninho@fwi and. If all is Ok, I delete it. - -2003-07-08 23:00 UTC-0300 Antonio Carlos Pantaglione - ! Sync with changes made in xHarbour by Walter Negro - * contrib/rdd_ads/ace.h - ! Fix warning in declaration of function - * contrib/rdd_ads/ads1.c - * contrib/rdd_ads/adsfunc.c - ! Fix error and potential error of AE_INSUFFICIENT_BUFFER in - some functions. - The len of buffer should include the NULL char. - ! Fix, now adsGoTo() test if the new position is EOF. - -2003-07-08 14:25 UTC-0300 Antonio Carlos Pantaglione - * contrib/rdd_ads/ads1.c - ! Fixed: deleted() return TRUE when is at eof(), borrow from xHarbour. - -2003-07-08 11:27 UTC+0300 Chen Kedem - * doc/en/lang.txt - + Added the following to HB_LANGSELECT() list of supported ID's: - Slovenian 437 - -2003-08-03 10:20 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! Bug fixed in ntxOrderListRebuild - sometimes GPF appared if packing/reindexing - was made after intensive replace operations. - -2003-07-07 11:12 UTC-0300 Antonio Carlos Pantaglione - * include/hbclass.ch - + Added support for PROCEDURE CLASS syntax. - -2003-07-03 15:00 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! Bug fixed in ntxZap. - -2003-07-03 11:46 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! Bug fixed, which appeared after switching between orders and following skipping. - -2003-07-03 10:54 UTC+0300 Alexander Kresin - + source/codepage/cdpsl437.c - + source/lang/msgsl437.c - + New codepage and lang modules for Slovenian 7bit 437, provided by - Mitja Podgornik - * source/codepage/cdpsl852.c - * source/codepage/cdpsliso.c - * source/codepage/cdpslwin.c - ! Some fixes, provided by Mitja Podgornik - * makefile.bc - * makefile.nt - * makefile.vc - * source/codepage/Makefile - * source/lang/Makefile - * Makefiles updated. - -2003-07-03 10:00 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! Bug fixed - there was memory leak after INDEX ON ... ADDITIVE if there - were no open indexes - * source/rdd/dbf1.c - ! Problem fixed for the cases when the field name exceeds 10 characters. - * Codepage translation added for memo fields. - * source/codepage/cdppt850.c - * source/codepage/cdpptiso.c - ! Comment delimiters bug fixed. - -2003-07-02 11:35 UTC-0300 Antonio Carlos Pantaglione - * source/compiler/harbour.slx - ! Add 'static' in definition of hb_comp_SLX_InterceptAction and - hb_comp_SLX_CustomAction. - -2003-07-02 09:25 UTC+0100 Antonio Linares - * makefile.nt - * makefile.vc - + Added gencli.c module - - * include/hbcomp.h - + Added hb_compGenILCode() prototype - - * source/compiler/gencli.c - * source/rdd/dbf1.c - + Added some MSVC required typecasts - - * source/rdd/dbfcdx/dbfcdx1.c - + Added most recent Horacio's development - -2003-06-30 10:50 UTC-0300 Antonio Carlos Pantaglione - * source/contrib/rdd_ads/ads1.c - ! Fixed problem on adsGoTo() method when using ADT files. Borrow from xHarbour. - -2003-06-30 18:33 UTC+0100 Antonio Linares - * source/compiler/gencli.c - + Added support for multidimensional arrays for Harbour.NET - ! .NET IL implementation for HB_ARRAYGEN, HB_P_FUNCTIONSHORT, HB_P_ARRAYPUSH - ! Enhanced HB_DOSHORT - + Added ObjArrayGen(), ObjArrayPush() and LEN() (Len() support just for arrays). - - Notice: I want to publically thank Microsoft tech support forums for .NET. There - are great guys there providing superb tech support. - - This code is already working ok with Harbour.NET: - - function Main() - - local a := { 123, "hello", { "nested", "array", { 5, "more" } }, .t., "another" } - - ? a[ 1 ] - ? a[ 3 ][ 2 ] - ? a[ 3 ][ 3 ][ 2 ] - ? a[ 5 ] - - ? "done!" - - return nil - - Warning: Arrays elements assignment is not implemented yet. - -2003-06-28 22:52 UTC+0100 Antonio Linares - * source/compiler/gencli.c - + Added support for logical values management - ! .NET IL implementation for HB_P_TRUE, HB_P_FALSE, HB_P_NOT - + Added ObjNot( object ) for HB_P_NOT support - -2003-06-28 14:41 UTC+0100 Antonio Linares - * source/compiler/gencli.c - + do case implemented for Harbour.NET - ! .NET IL implementation for HB_P_JUMP, HB_P_EXACTLYEQUAL - + Added ObjExactlyEqual( object, object ) for HB_P_EXACTLYEQUAL support - -2003-06-28 11:56 UTC+0100 Antonio Linares - * source/compiler/gencli.c - + for...next loops implemented for Harbour.NET - ! .NET IL implementation for HB_P_PUSHLONG, HB_P_FORTEST - + Added ObjForTest( object, object, object ) for HB_P_FORTEST support - -2003-06-28 01:10 UTC+0100 Antonio Linares - * source/compiler/gencli.c - + .NET IL implementation for HB_P_JUMPFALSENEAR, HB_P_JUMPNEAR - + Added labels to each IL generated source code line - + Added ObjLessEqual( object, object ) for "<=" operator support - ! AddObjects() renamed into ObjAdd( object, object ) for "+" operator support. - - Notice: Some "nop" has been added to match Harbour opcodes offsets. We may remove - them later on. This code is working ok: - - function Main() - - local n := 11 - - if n <= 10 - ? "less-equal 10" - else - ? n - ? "greater 10" - endif - - n = 5 - - if n <= 10 - ? n - ? "less-equal 10" - else - ? "greater " - endif - - ? "done!" - - return nil - -2003-06-27 16:07 UTC+0100 Antonio Linares - * source/compiler/gencli.c - ! .NET IL implementation for HB_P_PLUS - ! New .NET function AddObjects() for adding "object" type variables - - Notice: As Harbour.NET uses IL "object" type for storing variables, the - new implemented AddObjects() functions is used for adding variables. This - code already works ok: - - function Main() - - local n := 10, c := "Hello World" - - ? n + 20 - ? c + " from Harbour.NET" - ? "done!" - - return nil - - Warning: Date variables type have not been implemented in AddObjects() yet, and - also it is not generating an error when adding different types values. - -2003-06-27 12:13 UTC+0100 Antonio Linares - * source/compiler/gencli.c - ! .NET IL implementation for HB_P_PUSHBYTE - - Notice: This opcode is responsible for placing a byte onto the stack. - As all Harbour variables are going to be managed as object type (meanwhile - we don't implement strong typing), a box (to turn a value into an object) - process is also performed. We may check later on if this is needed for all - processes. - - This test already works: - - function Main() - - local n := 123 - - ? n - - ? 10 - - return nil - -2003-06-27 10:21 UTC+0100 Antonio Linares - * source/compiler/gencli.c - ! .NET IL implementation for HB_P_POPLOCALNEAR and HB_P_PUSHLOCALNEAR - - Notice: These opcodes are responsable for loading the values on the locals and - also for pushing the locals contents onto the virtual machine stack. - - You can already run tests like this: - - function Main() - - local c := "Hello world from Harbour.NET !" - - ? c - - return nil - - Remember the process to build a .NET app: - - Harbour.exe -gi -n hello.prg --> hello.il - ilasm.exe hello.il --> hello.exe (for .NET) - -2003-06-27 09:13 UTC+0100 Antonio Linares - * source/compiler/gencli.c - ! .NET IL implementation for HB_P_FRAME - - Notice: HB_P_FRAME is generated for declaring locals and params. On IL - only locals are declared. Params are declared on the same (function) method - declaration. Strong typing is not supported yet. - - To test it simply declare several locals, compile using /gi and check the - .IL created file. - -2003-06-25 08:32 UTC+0100 Antonio Linares - * source/compiler/gencli.c - ! object type use implementation for QOUT() - - Notice: Harbour (as Clipper) any type value vars support is implemented - through the use of IL object type. I consulted this idea with Miguel de - Icaza and he agreed. - - So all variables types are declared as object, unless strong typing is - required ( AS ... ), then we will use specific types instead of object one. - -2003-06-23 17:56 UTC+0100 Antonio Linares - * source/compiler/gencli.c - ! Some quick & dirty implementations, to provide an IL overview - - Notice: Hello.prg already works on .NET :-) - -2003-06-23 15:10 UTC+0200 Tomaz Zupan - * source/compiler/Makefile - + Added gencli.c - * source/rtl/Makefile - + Added symbol.prg - -2003-06-23 13:15 UTC+0100 Antonio Linares - * source/compiler/gencli.c - ! The IL fun begins :-) - - Notice: Of course don't even try to compile the resulting IL generated files - yet, but you can start reviewing the so-early design already :-) - -2003-06-23 10:53 UTC+0100 Antonio Linares - * makefile.bc - + gencli.c module added - - Please update other makefiles. - -2003-06-23 10:20 UTC+0100 Antonio Linares - + source/compiler/gencli.c - ! Compiler .NET .il source generation - * It is just a copy of genc.c with some minor changes, just to set a - starting point for IL generation. - - * include/hbcomp.h - * source/compiler/cmdcheck.c - * source/compiler/harbour.c - * source/compiler/hbusage.c - + Added support for IL generation - - Warning: This is not even an early prototype :-) More coming soon... - -2003-06-23 10:05 UTC+0300 Chen Kedem - * doc/en/lang.txt - + Added the following to HB_LANGSELECT() list of supported ID's: - Serbian Windows-1251 - - * source/lang/msghe862.c - * source/lang/msghewin.c - ! fix Hebrew typo - - * source/lang/msgsrwin.c - ! add missings commas - -2003-06-18 02:05 UTC+0200 Przemyslaw Czerpak - * source/codepage/Makefile - * source/codepage/cdpesdos.c - * source/codepage/cdpeswin.c - * source/codepage/cdpgedos.c - * source/codepage/cdppliso.c - * source/codepage/cdpplmaz.c - * source/codepage/cdpplwin.c - * source/codepage/cdpslwin.c - - source/codepage/cdpla850.c - + source/codepage/cdppt850.c - + source/codepage/cdpptiso.c - * makefile.bc - * makefile.nt - * makefile.vc - * corrections in code page description. - - removed cdpla850.c ("PT" codepage) - + PT850 and PTISO codepages added. - * makefiles updated - Sorry, I cannot test all of them. - -2003-06-18 00:10 UTC+0200 Przemyslaw Czerpak - * include/hbapilng.h - * include/hblang.ch - * source/lang/Makefile - * source/lang/msg_tpl.c - * source/lang/msgca.c - * source/lang/msgcs852.c - * source/lang/msgcsiso.c - * source/lang/msgcskam.c - * source/lang/msgcswin.c - * source/lang/msgde.c - * source/lang/msgdewin.c - * source/lang/msgen.c - * source/lang/msgeo.c - * source/lang/msges.c - * source/lang/msgeswin.c - * source/lang/msgeu.c - * source/lang/msgfr.c - * source/lang/msggl.c - * source/lang/msghe862.c - * source/lang/msghewin.c - * source/lang/msghr852.c - * source/lang/msghriso.c - * source/lang/msghu852.c - * source/lang/msghucwi.c - * source/lang/msghuwin.c - * source/lang/msgid.c - * source/lang/msgis850.c - * source/lang/msgit.c - * source/lang/msgko.c - * source/lang/msgpl852.c - * source/lang/msgpliso.c - * source/lang/msgplmaz.c - * source/lang/msgplwin.c - * source/lang/msgpt.c - * source/lang/msgro.c - * source/lang/msgru866.c - * source/lang/msgrukoi.c - * source/lang/msgruwin.c - * source/lang/msgsl852.c - * source/lang/msgsliso.c - * source/lang/msgslwin.c - * source/lang/msgsr852.c - * source/lang/msgsriso.c - * source/lang/msgzhb5.c - * source/lang/msgzhgb.c - + source/lang/msgsrwin.c - ! bug fixed in national msg system and new localization added - (borrowed from xHarbour) - - + tests/langmsg.prg - * simple test program for national messages - I have to ask developpers to run it and check their national messages - -2003-06-17 21:50 UTC+0300 Alexander Kresin - * source/rtl/cdpapi.c - ! Bug fixed in hb_cdpTranslate() and hb_cdpnTranslate() - * source/rdd/dbf1.c - * RDD works Ok now, if field names in dbf are in lower case ( this - may be if dbf created by other dbms ) - * source/codepage/cdprukoi.c - ! Bug fixed. - -2003-06-17 17:22 UTC+0100 Antonio Linares - * source/debug/debugger.prg - * source/debug/dbgwa.prg - ! some fixes implemented by Ian Anderson - -2003-06-17 09:08 UTC+0300 Chen Kedem - * doc/en/lang.txt - + Added the following to HB_LANGSELECT() list of supported ID's: - German ANSI, Spanish ANSI, Polish Windows-1250, Slovenian 852, - Slovenian ISO-8859-2, Slovenian Windows-1250 - -2003-06-16 21:16 UTC+0300 Alexander Kresin - * source/rtl/cdpapi.c - ! Bug fixed in hb_cdpTranslate() and hb_cdpnTranslate() - * source/lang/msg_tpl.c - * source/lang/msgca.c - * source/lang/msgcs852.c - * source/lang/msgcsiso.c - * source/lang/msgcskam.c - * source/lang/msgcswin.c - * source/lang/msgde.c - * source/lang/msgdewin.c - * source/lang/msgeo.c - * source/lang/msges.c - * source/lang/msgeswin.c - * source/lang/msgeu.c - * source/lang/msgfr.c - * source/lang/msggl.c - * source/lang/msghe862.c - * source/lang/msghewin.c - * source/lang/msghr852.c - * source/lang/msghriso.c - * source/lang/msghu852.c - * source/lang/msghucwi.c - * source/lang/msghuwin.c - * source/lang/msgid.c - * source/lang/msgis850.c - * source/lang/msgit.c - * source/lang/msgko.c - * source/lang/msgpt.c - * source/lang/msgro.c - * source/lang/msgsr852.c - * source/lang/msgsr852.c - * source/lang/msgzhb5.c - * source/lang/msgzhgb.c - ! Missing comma inserted. - + source/lang/msgsl852.c - + source/lang/msgsliso.c - + source/lang/msgslwin.c - + Slovenian language files added, provided by Mitja Podgornik - + source/codepage/cdpsl852.c - + source/codepage/cdpsliso.c - + source/codepage/cdpslwin.c - + Slovenian codepage files added, provided by Mitja Podgornik - Collating sequences are also valid for Croatian, Macedonian and Serbian (latin) language. - * source/codepage/Makefile - * source/lang/Makefile - * makefile.bc - * makefile.nt - * makefile.vc - * Makefiles are changed to compile new lang and codepage files. - -2003-06-15 14:20 UTC+0200 Przemyslaw Czerpak - * source/lang/msgen.c - * source/lang/msgpl852.c - * source/lang/msgpliso.c - * source/lang/msgplmaz.c - ! the bug reported by Alexander in msgru* fixed. - + source/lang/msgplwin.c - + added msgplwin (cp1250) - - * source/rtl/inkey.c - * removed dirty hack which degrease performance of inkey() on *nix - platforms. - -2003-06-14 21:25 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! Bug fixed, related to seek with lLast and go bottom with scope set. - * source/lang/msgru866.c - * source/lang/msgrukoi.c - * source/lang/msgruwin.c - ! Bugs fixed. - -2003-06-14 15:48 UTC+0100 Antonio Linares - * source/debug/debugger.prg - ! Some enhancements by Ian Anderson, but modified as they were implemented - on an older Harbour version source code. - ! Some improvements. - - * source/debug/dbgtwin.prg - ! some changes by Ian Anderson - - Warning: Work in progress. Thanks Ian. - -2003-06-14 15:22 UTC+0100 Antonio Linares - * source/rtl/transfrm.c - ! temporary fix waiting for users feedback - - It fixes the reported bug: - - function Main() - - local nValue := -134.24 - - ? AllTrim( Transform( nValue, "@E 99,999.99" ) ) // Harbour returns "- 134,24" - ? AllTrim( Transform( nValue, "@E99,999.99" ) ) // and Clipper "-134.24" - - return nil - - Notice that a Val() of the first wrong returned value generates zero, meanwhile - the second one returns the original nValue, as expected. - -2003-06-14 09:23 UTC+0100 Antonio Linares - * include/hbrddcdx.h - * source/rdd/dbfcdx/dbfcdx1.c - * source/rdd/dbfcdx/dbfcdx1.h - * source/rdd/dbfcdx/dbfcdx2.h - ! Recent changes and enhancements on DBFCDX from Horacio. - - Thanks Horacio! - -2003-06-09 11:26 UTC+0100 Antonio Linares - * source/rtl/tget.prg - ! fix on Method Picture() provided by Lorenzo Fiorini - -2003-06-09 00:38 UTC+0100 Antonio Linares - * source/debug/debugger.prg - + CallStack navigation support. - ! Improved variables editing. - -2003-06-06 15:53 UTC+0200 Tomaz Zupan - * source/rtl/console.c - + Added a PRG-callable functions HB_GETSTDIN and HB_GETSTDOUT, - to get stdin and stdout file handle. - -2003-06-06 10:51 UTC+0100 Antonio Linares - * makefile.bc - * makefile.vc - ! symbol module added - - Notice: Please update other make files. - -2003-06-06 09:35 UTC+0100 Antonio Linares - + source/rtl/symbol.prg - ! Harbour implementation of Class(y) Class Symbol - -2003-05-31 21:04 UTC+0100 Antonio Linares - * source/rtl/teditor.prg - ! several improvements for the debugger: - - The source code viewer does not leave a different block color when - scrolling. - - The source code is displayed from the first line (Clipper compatibility). - -2003-05-31 17:55 UTC+0100 Antonio Linares - * source/rtl/tget.prg - ! fixed behavior when pressing "." or "," on a non decimals number - - Now editing a number without decimals and pressing "." or ",", the - cursor goes to the latest GET visual pos (Clipper compatibility). - -2003-05-31 15:45 UTC+0100 Antonio Linares - * source/rtl/tget.prg - ! Some fixes for PICTURE "9" - - Now editing a character var does not allows to type "-". It allows - both "+" and "-" for numeric var. (Clipper compatibility). - -2003-05-30 12:39 UTC+0100 Antonio Linares - * contrib/rdd_ads/ads1.c - ! managed 7008 open error - - This fixes the not issued error when doing: - - USE "any" NEW SHARED ALIAS "Test" VIA "ADS" - USE "any" NEW EXCLUSIVE ALIAS "Test2" VIA "ADS" // An error must raise here - - We still need to know if there is a way to know the OS code when - ADS returns 7008 error code when opening a DBF. - -2003-05-30 09:37 UTC+0100 Antonio Linares - - * contrib/htmllib/Makefile.bc - ! some minor fixes. - - * source/compiler/harbour.l - ! hb_strVal() used instead of atof() - - This fixes the MSVC incompatibility using RTL Val() and compiled - decimal values. - - Warning: There are two more modules on Harbour that still use atof(). - We should move hb_strVal() to source/common and also make the replace - on those places. - - * source/debug/dbgtmenu.prg - ! Minor fix to allow new Classes inherit from this one. - - * source/rtl/pushbtn.prg - ! sync with xHarbour. - - - -2003-05-28 13:00 UTC-0400 David G. Holm - * contrib/rdd_ads/ads1.c - * contrib/rdd_ads/adsfunc.c - ! Minor changes to minimize MSVC++ type overrides. - ! Added MSVC++ type overrides to the ADS version functions. - -2003-05-26 18:40 UTC+0200 Przemyslaw Czerpak - * source/pp/ppcore.c - * allow to compile file with on *nix platforms. - It's dirty hack but works good for me and resolves one of the - most important problem with common CLIPPER and Harbour - (and other XBASE compatible compilers like FlagShip and CLIP) - sources - only Harbour cannot compile files with . - - * source/compiler/cmdcheck.c - ! fix which allow to use file names with '-' char in '-o' option - - * source/rtl/diskspac.c - + added support for diskspace on UNIX platforms - (first parameter is path name, if omitted "/" is checked) - -2003-05-26 15:50 UTC+0200 Przemyslaw Czerpak - * source/rtl/cdpapi.c - * small correction in s_en_codepage = { ... } - - + source/codepage/cdpplwin.c - * source/codepage/Makefile - + new Polish codepage PLWIN - CP1250 based - - * source/rtl/gt.c - + new .prg function HB_GT_VERSION() which returns GT name. - - * source/rtl/seconds.c - + new function added SECONDSCPU(n) which reports how many CPU and/or - system seconds have elapsed since the beginning of the program execution. - n == 1 utime -> user CPU time of the current process - n == 2 stime -> system CPU time behalf of the current process - n == 3 u + s -> sum of utime + stime (default) - n == 11 cutime -> sum of the user CPU time of the current + child process - n == 12 cstime -> sum of the system CPU time of the current + child process - n == 13 cu+cs -> sum of cutime + cstime - I have to ask someone similar with Windows to add support for this - function. I found 'GetProcessTimes' in WIN API which can be used for - NT based platforms but I cannot find anything for WIN 9X/ME. - -2003-05-22 23:45 UTC-0400 David G. Holm - * contrib/rdd_ads/ads1.c - * contrib/rdd_ads/adsfunc.c - * contrib/rdd_ads/rddads.h - + Added support for DBINFO(DBI_DB_VERSION), DBINFO(DBI_RDD_VERSION), - and ADSVERSION([]) (but only for nType == 0 and nType == 3 - and without date and time information for nType == 3). - -2003-05-21 20:34 UTC+0100 Antonio Linares - * source/vm/hvm.c - ! Fixed arrays comparison. Now it is Clipper compatible. - Bug reported by Randy Portnoff - -2003-05-21 19:50 UTC+0100 Antonio Linares - * source/vm/memvars.c - ! default path support for __MVSave() and __MVRestore() - implemented by Alexander Prostoserdov. - -2003-05-21 18:03 UTC+0100 Antonio Linares - * source/debug/dbgtarr.prg - * source/debug/dbgtobj.prg - ! several fixes when debugging arrays - - * source/debug/debugger.prg - ! several fixes - -2003-05-15 21:35 UTC+0300 Alexander Kresin - * tests/testrdd2.prg - * some changes, provided by Randy Portnoff - * contrib/rdd_ads/ads1.c - ! adsInfo() fixed for DBI_GETHEADERSIZE, so Header() returns now correct - value ( for dbf tables ) - -2003-05-15 12:44 UTC+0100 Antonio Linares - + source/rtl/tget.prg - ! minor fix - -2003-05-15 12:40 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! Minor fix - * source/rdd/dbf1.c - * DBI_FILEHANDLE and DBI_MEMOHANDLE added to dbInfo() - -2003-05-15 09:33 UTC+0100 Antonio Linares - + source/rtl/tget.prg - ! some fixes - ! some changes borrowed from xHarbour - - tests/testread.prg is working fine again. - -2003-05-09 23:30 UTC-0400 David G. Holm - * config/doc.cf - * config/header.cf - ! Fixes to deal with situation where installation - directories are left undefined to avoid installation. - -2003-05-09 20:30 UTC-0400 David G. Holm - * config/doc.cf - ! Removed an extra layer of "protection" that resulted in an - error message when HB_DOC_INSTALL is not defined, instead - of a simple "nothing to do" message. - -2003-05-09 20:30 UTC-0400 David G. Holm - * Makefile - + config/doc.cf - + doc/Makefile - * doc/gmake.txt - + doc/en/Makefile - + doc/es/Makefile - + Added the ability to install files from doc directory using - the new environment variable HB_DOC_INSTALL, which is left - undefined by default. All files from doc, doc/en, and doc/es - are installed if the HB_DOC_INSTALL variable is defined when - you run 'make install'. - -2003-05-09 17:20 UTC-0400 David G. Holm - * source/rtl/idle.c - + Added a PRG-callable function wrapper for hb_releaseCPU() and - named it HB_RELEASECPU. - -2003-05-09 14:40 UTC-0400 David G. Holm - * source/rdd/dbcmd.c - ! Fixed the FIELDPOS function to truncate long field names, - instead of ignoring them. - -2003-05-08 15:30 UTC-0400 David G. Holm - * source/compiler/harbour.sly - ! Fixed $3 in EmptyStatements to read $2. - -2003-05-07 14:45 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! OrdkeyCount() and OrdKeyNo() now returns physical records number and - position if there is no index opened or current order is 0 - * source/rtl/set.c - ! two warnings fixed. - -2003-05-06 15:35 UTC+0300 Alexander Kresin - * source/rtl/is.c - ! Bug fixed: ISUPPER, ISLOWER and ISALPHA with chr(0) argument - returned TRUE. - Patch provided by Przemyslaw Czerpak - -2003-05-06 12:55 UTC+0200 Przemyslaw Czerpak - * source/rtl/set.c - ! Fixed very serious bug in set(_SET_ALTFILE, "") and - set(_SET_EXTRAFILE, "") which can caused corrupting any files - open by Harbour compiled program - -2003-05-06 12:45 UTC+0300 Alexander Kresin - * contrib/rdd_ads/ads1.c - ! Bug fixed in adsOrderListClear() - the current order is set to 0 now - -2003-05-06 10:45 UTC+0300 Alexander Kresin - * include/hbapicdp.h - * source/rtl/cdpapi.c - * source/vm/itemapi.c - * source/rdd/dbfntx/dbfntx1.c - ! Some fix, regarding strings comparison via CODEPAGE API - -2003-05-01 21:19 UTC+0100 Antonio Linares - + source/codepage/cdpesdos.c - + source/codepage/cdpeswin.c - ! Added missing char - -2003-05-01 13:55 UTC+0100 Antonio Linares - + source/rdd/dbcmd.c - ! DbCreate() always returns nil. - - This fixes the bug reported by Marco Braida on sourceforge - -2003-05-01 12:10 UTC+0100 Antonio Linares - + source/codepage/cdpesdos.c - ! codepage support for Spanish MS-DOS - - + source/codepage/cdpeswin.c - ! codepage support for Spanish Windows - - + source/lang/msgeswin.c - ! language messages support for Spanish Windows - - * makefile.bc - * makefile.nt - * makefile.vc - * source/codepage/makefile - * source/lang/makefile - ! updated for cdpesdos.c, cdpeswin.c and msgeswin.c - -2003-04-28 23:00 UTC+0100 Antonio Linares - * source/rtl/tget.prg - ! numbers editing bug (side effect from previous change) fixed - - When typing a number, the second digit was overwriting the previous one. - -2003-04-28 21:00 UTC+0100 Antonio Linares - * source/debug/debugger.prg - ! aCallStack properly set when using trace mode (K_F10) - - This fixes the debugger bug reported by Guy Roussin. - -2003-04-27 15:09 UTC+0300 Chen Kedem - * doc/dirstruc.txt - + Add a line about contrib/ole - -2003-04-27 01:33 UTC+0100 Antonio Linares - * source/rtl/filesys.c - ! hb_fsOpen() minor fix for MSVC - - This fixes the DbUseArea() MSVC bug reported by Vicente. - -2003-04-24 14:35 UTC-0400 David G. Holm - * source/vm/itemapi.c - ! Added non-finite test for w32/msvc, which fixes the new problem - where all double values were displayed as if they had overflowed. - -2003-04-23 23:11 UTC+0100 Antonio Linares - * source/rtl/tget.prg - ! PICTURE "#" allows "." keystroke - - * source/rdd/dbfntx/dbfntx1.c - ! some castings for MSVC - -2003-04-19 12:00 UTC+0100 Antonio Linares - * source/rtl/tget.prg - ! Class TGet Data Pos behavior modified to make it Clipper compatible - Test sample provided on the Harbour mailing list - -2003-04-18 14:10 UTC+0300 Alexander Kresin - * source/rdd/dbf1.c - ! Bug fixed - there was unrecoverable error if file opening failed - due to access denied. - * source/rdd/dbfntx/dbfntx1.c - * Added reporting of OS error code if index opening failed - -2003-04-17 15:50 UTC+0300 Alexander Kresin - * source/pp/ppcore.c - ! Fixed some problems with a long ( few Kb ) directives. - -2003-04-16 19:15 UTC-0400 David G. Holm - * source/vm/itemapi.c - * Simplified non-finite tests for BORLANDC > 1040 and DJGPP (there is no - need to also test s_dInfinity and -s_dInfinity when using a function - that tests whether or not the parameter value is finite). - ! Added non-finite tests for os2.gcc, os2.icc, w32.mingw32, and w32.rsxnt, - which fixes the problems that they had with evaluating str(log(-1)). - -2003-04-16 22:10 UTC+0300 Alexander Kresin - * include/hbrddntx.h - * source/rdd/dbfntx/dbfntx1.c - * Added possibility to save/load and use tag name as in Clipper's DBFNTX - -2003-04-16 14:50 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - * A bug in hb_ntxTagKeyCount() fixed - reported by Jos© Luis Capel - -2003-04-15 13:10 UTC+0300 Alexander Kresin - + contrib/ole - + contrib/ole/bldtest.bat - + contrib/ole/build32.bat - + contrib/ole/hbtest.prg - + contrib/ole/ole2.c - + contrib/ole/oleauto.prg - + With a kind permission of the author, José F. Giménez , - ole library for harbour added. - Some unused stuff is removed from the original files, few bug fixes are made. - -2003-04-14 14:45 UTC-0400 David G. Holm - * source/common/hbgete.c - ! Added #ifdef to allow OS/2 GCC to use PSZ and OS/2 VAC++ to use PCSZ for EnvValue. - -2003-04-13 10:23 UTC+0200 Tomaz Zupan - * contrib/odbc/todbc.prg - ! Better way to move to first record after fetching - -2003-04-13 10:02 UTC+0300 Chen Kedem - * doc/whatsnew.txt - + Add information about builds 38..42 according to information - found on the Harbour site and the developers mailing list - -2003-04-12 23:00 UTC+0200 Tomaz Zupan - * contrib/odbc/todbc.prg - ! If recordset is cached, move to first record after fetching - recordset to cache - -2003-04-09 21:40 UTC+0300 Alexander Kresin - * include/hbdbf.h - * include/hbrddcdx.h - * include/hbrdddbf.h - * include/hbrddntx.h - * source/rdd/dbf1.c - * source/rdd/dbfcdx/dbfcdx1.c - * Byte 29 in dbf header with codepage information is added for later - implementation. Currently this allows to keep codepage byte ( before - it was cleared while header updating ). - -2003-04-09 13:40 UTC+0300 Alexander Kresin - * include/hbexprb.c - * At() function is now Clipper compatible ( At( "","abc" ) ) - - borrowed from xHarbour - * source/rdd/workarea.c - ! Fixed hb_waRelEval() - When the current order is zero, relation works - by GOTO istead of SEEK, as Clipper does - - borrowed from xHarbour - * source/rdd/dbfntx/dbfntx1.c - ! Fix in indexing - when index expression includes fields from the child - related workarea - -2003-04-08 15:40 UTC-0400 David G. Holm - * contrib/Makefile - ! Added a build path for MSVC++. - * source/common/hbffind.c - ! Added #include for the HB_OS_WIN_32 branch. - * source/common/hbgete.c - ! Changed EnvValue from PSZ to PCSZ for IBM VAC++ compatibility. - * source/compiler/harbour.y - ! Added missing semicolons using patch provided by Jos Backus . - -2003-04-04 11:20 UTC+0300 Alexander Kresin - * source/pp/ppcore.c - * Handling of '*' comment now is more Clipper compatible - * include/hbver.h - * changed version information - -2003-04-03 18:34 UTC+0200 Maurilio Longo - * source/common/hbgete.c - ! fixed warning on OS/2 GCC - -2003-04-03 19:52 UTC+0300 Alexander Kresin - * source/codepage/cdpplmaz.c - ! Minor fix, provided by Jacek Kubica - -2003-04-02 19:35 UTC+0300 Alexander Kresin - * source/rtl/langapi.c - ! Memory leak is fixed. - -2003-04-02 14:18 UTC+0300 Alexander Kresin - * include/hbapicdp.h - * source/codepage/cdp_tpl.c - * source/codepage/cdpgedos.c - * source/codepage/Cdpgewin.c - * source/codepage/cdpla850.c - * source/codepage/cdppl852.c - * source/codepage/cdppliso.c - * source/codepage/cdpplmaz.c - * source/codepage/cdpru866.c - * source/codepage/cdprukoi.c - * source/codepage/cdpruwin.c - * source/rtl/cdpapi.c - ! Few fixes in codepage subsystem - -2003-04-01 16:12 UTC+0300 Alexander Kresin - * source/rtl/transfrm.c - * Transform() now uses codepages while converting to upper case. - -2003-03-27 11:34 UTC+0100 Antonio Linares - * include/hbapi.h - * source/vm/classes.c - * hb_clsIsParent() made public - -2003-03-27 18:35 UTC+0100 Antonio Linares - * source/rdd/dbcmd.c - * contrib/rdd_ads/adsfunc.c - * Minor type casting fixes for MSVC - -2003-03-26 16:55 UTC+0300 Alexander Kresin - * source/rdd/dbcmd.c - ! Bug fixed related to COPY TO .. FIELDS ..., reported by Lorenzo Fiorini - -2003-03-26 11:30 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! Bug fixed, reported by Andrew McCumiskey - -2003-03-25 21:35 UTC+0300 Alexander Kresin - + source/codepage/cdpgewin.c - * source/codepage/Makefile - + source/lang/cdpdewin.c - * source/lang/Makefile - * makefile.bc - * makefile.nt - * makefile.bc - Added German Win codepage and lang files, contributed by - Guenther Steiner - + tests/testrdd2.prg - + Added RDD test, contributed by Randy Portnoff - -2003-03-25 16:46 UTC+0100 Martin Vogel - * contrib/libct/dattime2.prg - * bug fix in function addmonth() - -2003-03-24 15:35 UTC+0300 Alexander Kresin - * source/rdd/dbcmd.c - ! bug fixed with improper using of hb_strUpper() - reported by Lorenzo Fiorini - * source/rtl/cdpapi.c - ! fix, provided by Przemyslaw Czerpak - -2003-03-22 11:25 UTC+0100 Antonio Linares - * source/compiler/harbour.y - * fix on recent If() changes - IIf() was accepted but If() not. Now it is ok. - -2003-03-17 15:30 UTC-0500 David G. Holm - * source/rtl/filesys.c - ! Added newline at end of file. - -2003-03-16 10:33 UTC+0100 Antonio Linares - * source/compiler/harbour.y - * If() inline accepts all kind of arguments - Changes borrowed from xHarbour. - - WARNING: We don't know for sure if these changes may bring any - undesirable side effects, so please do all the tests you can. - -2003-03-16 09:50 UTC+0100 Antonio Linares - * source/rtl/filesys.c - * Proper definition for HAVE_POSIX_IO for MSVC compiler. - This fixes the CurDrive() bug reported by Vicente Aranzana. - Please notice that neither Andi and David proposed solutions - have been used. - -2003-03-05 13:35 UTC+0300 Alexander Kresin - * source/vm/hvm.c - * source/vm/itemapi.c - * source/vm/asort.c - * Reverted changes, related to short strings optimization, because they - causes problems with arrays and inmplemented 1-byte length string - optimization, borrowed from xHarbour. - -2003-02-25 22:10 UTC+0300 Alexander Kresin - * contrib/rdd_ads/adsfunc.c - + Transaction processing functions added. - * contrib/rdd_ads/ads.ch - + New commands added: - BEGIN TRANSACTION - COMMIT TRANSACTION - ROLLBACK TRANSACTION - -2003-02-18 22:05 UTC+0100 Tomaz Zupan - * include/hbdbf.h - * include/hbdbsort.h - * include/hbexprc.c - * include/hboo.ch - * source/common/hbfhnd.c - * source/compiler/genc.c - * source/compiler/harbour.c - * source/compiler/hbfix.c - * source/compiler/hbpcode.c - * source/pp/ppcomp.c - * source/rdd/hbdbsort.c - * source/rtl/at.c - * source/rtl/descend.c - * source/rtl/memoline.c - * source/rtl/philes.c - * source/rtl/philesx.c - * source/rtl/strings.c - * source/rtl/gtcrs/gtcrs.c - * source/rtl/gtcrs/kbdcrs.c - * source/vm/debug.c - * source/vm/dynsym.c - * source/vm/eval.c - * source/vm/extend.c - * source/vm/macro.c - * source/vm/memvars.c - * source/vm/runner.c - ! Added newline to the end of file, to avoid annoying warning - -2003-02-18 23:05 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! Stupid bug is fixed, which was introduced recently - -2003-02-18 09:15 UTC+0300 Alexander Kresin - * contrib/rdd_ads/adsfunc.c - * Few type casts for MSVC - -2003-02-17 13:15 UTC-0500 David G. Holm - * source/rtl/dbdelim.c - ! Bug fix for EOL handling when using large import files, - provided by the author of the dbdelim append from code, - Marco Braida - -2003-02-15 11:00 UTC+0100 Tomaz Zupan - * config/linux/global.cf - - removed PRG_USR directive, because it is no longer needed - to compile dbfsdf.prg - * source/rtl/dbsdf.prg - + Automatic EOL recognition. FindEOL() recognises LF,CR+LF and CR - as newline delimiters - -2003-02-14 22:05 UTC+0100 Tomaz Zupan - * include/hbapi.h - * include/hbcomp.h - * include/hbmacro.h - * include/hbvm.h - * include/hbvmpub.h - ! Added newline to the end of file, to avoid annoying warning - -2003-02-14 15:25 UTC+0300 Alexander Kresin - * source/common/hbffind.c - ! Fixed a problem with compiling under DJGPP - -2003-02-14 13:15 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! Fixed few bugs, including problems with scopes and GPF under Linux - -2003-02-12 11:15 UTC+0300 Alexander Kresin - * source/rdd/dbcmd.c - * source/rdd/dbf1.c - ! Bug fixed: APPEND FROM gave an error if the file was opened already - -2003-02-12 10:00 UTC+0300 Alexander Kresin - + source/codepage/cdpgedos.c - + German dos codepage, provided by Guenther Steiner - * source/codepage/Makefile - * makefile.bc - * makefile.vc - * makefile.nt - * cdpgedos.c added - -2003-02-10 23:20 UTC+1 jf Lefebvre (mafact) - * source\compiler\harbour.y - Missing external declaration 'hb_compLocalGetPos' - * include/hbapirdd.h - added function missing declaration at line 1059. 'hb_rddFieldIndex' - used in source\rdd\dbfcdx\dbfcdx1.c(1223) - * rdd/dbcmd.c changed 1 type casting BYTE * to char * - added one type casting to BYTE * - - -2003-02-10 16:00 UTC-0500 David G. Holm - * source/rtl/filesys.c - ! I missed one place where the X__WIN32__ guard needs to be used - (in the hb_fsRename function). - -2003-02-05 23:45 UTC-0500 David G. Holm - * contrib/libct/makefile.bc - ! Added a rule to compile setlast.prg - * source/rtl/filesys.c - ! Always use X__WIN32__ when testing to see if the extended - Windows file handle conversion utilities should be used. - -2003-01-30 22:10 UTC+0300 Alexander Kresin - * source/vm/asort.c - ! Some fixes, which became necessary after optimization of string operations. - -2003-01-29 22:05 UTC+0300 Alexander Kresin - * include/hberrors.h - * include/hbpcode.h - * source/compiler/genc.c - * source/compiler/harbour.sly - * source/compiler/harbour.y - * source/compiler/hbfix.c - * source/compiler/hbpcode.c - * source/vm/hvm.c - * Added new pcode HB_P_LOCALNEARADDINT for using in FOR ... NEXT cycle, - it increases the speed of execution the cycle. - Borrowed from xHarbour. - -2003-01-28 22:20 UTC+0300 Alexander Kresin - * source/rdd/dbcmd.c - ! Fixed a bug with APPEND FROM ..., COPY TO..., when there was a memo field - -2003-01-28 13:05 UTC+0300 Alexander Kresin - * source/vm/hvm.c - ! Little fix to the previous change - -2003-01-28 11:25 UTC+0300 Alexander Kresin - * include/hbapi.h - * source/rtl/philes.c - * source/vm/itemapi.c - * source/vm/hvm.c - * Optimization of string operations. Now if the size of the string is less - than sizeof(short int *) - in most systems it is 4, it is kept in the - item itself, additional memory isn't allocated for it. - This leads to performance improvement and decreasing of memory - fragmentation/usage. - -2003-01-26 16:20 UTC+0300 Alexander Kresin - * include/hbapiitm.h - * source/vm/itemapi.c - * source/vm/hvm.c - * hb_itemMove() function added, which is intended for use instead of - the - hb_itemCopy( pDest,pSource ) - hb_itemClear( pSource ) - This allows to speed up some internal vm functions. - The idea was borrowed from xHarbour. - -2003-01-26 14:50 UTC+0300 Alexander Kresin - * include/hbrddcdx.h - * source/rdd/dbfcdx/dbfcdx2.h - * source/rdd/dbfcdx/dbfcdx1.c - * all last updates, made by Horacio Roldan in xHabour - -2003-01-24 17:47 UTC+0300 Alexander Kresin - * source/vm/maindllp.c - ! Minor fix. - -2003-01-24 14:00 UTC+0300 Alexander Kresin - * source/vm/hvm.c - * hb_inkeyPoll() is removed from hb_vmDo(), the code fragment with - hb_ReadKey() is added to hb_vmExecute() - borrowed from xHarbour. - * source/vm/estack.c - * source/vm/extend.c - * include/hbapi.h - * include/hstack.h - * HB_API_MACROS and HB_STACK_MACROS are default options now - borrowed from xHarbour. - * source/rtl/version.c - ! Memory leak fixed. - -2003-01-20 00:20 UTC+0100 Martin Vogel - * contrib/libct/Makefile - * contrib/libct/Makefile.bc - * contrib/libct/Makefile.vc - * contrib/libct/readme.txt - * contrib/libct/ctflist.txt - * contrib/libct/tests/Makefile - + contrib/libct/dattim2.prg - + contrib/libct/tests/datetime.prg - + addmonth(),ctodow(),ctomonth(),daysinmonth(),daystomonth(),dmy(), - doy(),isleap(),lastdayom(),ntocdow(),ntocmonth(),quarter(),week() - Thanks to Alan Secker for providing these - functions and the test program; small enhancements, mostly making - the functions interational, docu headers etc. added by me :-) - * contrib/libct/pos1.c - * interpretation of parameter in posalpha(),poslower(),posupper() and - posrange() corrected; thanks to Guenther Steiner - for reporting this bug - - * include/hblang.ch - + added constant definitions accessing language specific string via HB_LANG_MESSAGE() - - -2002-11-01 16:20 UTC-0300 Walter Negro - * include/hbexprb.c - ! Fix assign to array_at. - This resolve FOR n[1]:=1 TO 2 - Fix borrowed from xHarbour - -2003-01-10 17:30 UTC-0500 David G. Holm - * source/rtl/filesys.c - ! The MingW32 use of _LK_UNLOCK instead of _LK_UNLCK turned out to - be a bug in a MingW32 that has since been corrected, so the fix - has been reverted. Thanks go to Phil Krylov for - pointing this out. In order to allow this to work with the buggy - version of MingW32, I've added a #define _LK_UNLCK _LK_UNLOCK if - compiling for __MINGW32__ and _LK_UNLCK is not defined. - -2003-01-10 17:00 UTC-0500 David G. Holm - * source/rdd/dbfcdx/dbfcdx1.c - ! hb_fsDelete takes a BYTE * parameter, not an unsigned char * one. - * source/rtl/filesys.c - ! MingW32 uses _LK_UNLOCK, not _LK_UNLK. - * source/vm/itemapi.c - ! Borland C 3.1 and earlier do not support _isnan or _finite. - -2003-01-04 19:40 UTC-0300 Luiz Rafael Culik - * include/filesys.c - * When X__WIN32__ is defined FHANDLE is defined as Long - * source/rtl/filesys.c - % Properly Fix the usage os Native Windows File IO API. harbour apps with native WIN IO api has the same speed as Legacy api usage - * source/rtl/console.c - ! Minor Changes required to proper work of Windows File IO Native API - * source/common/hbffind.c - ! Corrected error return Values For DJGPP compiler for hb_fsFindNext() and hb_fsFindFirst() functions - ! Corrected error return Values For WIN32 for hb_fsFindNext() and hb_fsFindFirst() functions - With This Changes to console.c and filesys.c build with X__WIN32__ defined works properly - -2002-12-31 11:45 UTC-0500 David G. Holm - * include/hbver.h - * Updated the build number and the ChangeLog information. - -2002-12-30 16:50 UTC-0300 Horacio Roldan - * source/rdd/dbfcdx/dbfcdx1.c - ! fixed scope related bug, reported by Blue Face - + added support for the EVAL clause in INDEX - -2002-12-28 09:05 UTC-0300 Horacio Roldan - * source/rdd/dbfcdx/dbfcdx1.c - * source/rdd/dbfcdx/dbfcdx2.h - ! fixed bug (search path related), - reported by Jacek Potempa - ! fixed GPF bug reported by Alex Schaft - + added support for DBOI_KEYCOUNTRAW, DBOI_KEYNORAW == DBOI_RECNO, - DBOI_KEYTYPE, DBOI_KEYSIZE, DBOI_FULLPATH - ! fixed: DBOI_BAGNAME - ! fix return value when there's no active order to: DBOI_FILEHANDLE, - DBOI_ISCOND, DBOI_ISDESC, DBOI_UNIQUE, DBOI_POSITION, DBOI_RECNO, - DBOI_KEYNORAW, DBOI_KEYCOUNT, DBOI_KEYCOUNTRAW. - This makes ordKeyNo() = recno() and ordKeyCount() = lastrec() - in such case. Reported by Hernán Diego Ceccarelli - - + added helper function hb_cdxOrdListClear - ! structural index isn't closed anymore - ! fixed ordKeyNo() and ordKeyCount() to respect filters, they also - respect the set deleted but only when there is a filter (as C53) - ! fixed ordScope(0/1, ""), reported by Jean-Christophe AVARGUES and - Blue Face - - * source/rdd/workarea.c - ! fix to fieldname, reported by Luiz Rafael Culik - -2002-12-27 16:40 UTC-0800 Brian Hays - + added doc/windll.txt as an introduction to Windows - 32-bit dll creation with Harbour. - -2002-12-22 13:06 UTC+0200 Chen Kedem - * doc/dirstruc.txt - + Add a line about source/codepade - -2002-12-22 03:46 UTC-0300 Walter Negro - * source/rtl/set.c - ! Fix, reset PRINTFILE handle when close file. - -2002-12-18 14:00 UTC-0500 David G. Holm - * source/rtl/set.c - ! In the set_string function, when then item parameter is NIL use a - zero-length string (bug fix for SET PATH TO and SET DEFAULT TO). - -2002-12-17 10:50 UTC-0800 Brian Hays - * contrib/rdd_ads/ads.ch - - Removed commands for SET PATH, DEFAULT, DELETED, EXACT, - DATEFORMAT and EPOCH since these are handled by the - Set Listener functionality now. - + added new #define ADS_REQUIRE_VERSION6 to control version 6 - ace32.lib/linker requirements - - * contrib/rdd_ads/ads1.c - * created Set Listener support for - HB_SET_DATEFORMAT - HB_SET_DEFAULT - HB_SET_DELETED - HB_SET_EPOCH - HB_SET_EXACT - HB_SET_PATH - So whenever you call the Set() function or commands, - ADS is automatically updated. - - * added these fixes by Luiz Culik: - * Created bDictionary and adsConnectHandle to allow access - to ads data dictionaries; - * store pFieldInfo.uiDec = uiDec for doubles in adsCreateFields. - - * fixed initialization of dVal in adsGetValue - (fix by Ron Christie) - - * fixed Trace in ADS_GETFUNCTABLE(%i, %p), *uiCount, pTable)); - to show the contents of uiCount instead of the pointer address. - - * contrib/rdd_ads/adsfunc.c - * to test SetListener capabilities, added or upgraded - these functions to be classic "Set/Get" functions so - they return the prior ads setting: - AdsSetDeleted - AdsSetDefault - AdsSetSearchPath - AdsSetExact - NOTE! Because the Set() function now also controls - ADS, there is no reason for normal code to ever call - these functions. If you do, you may get ADS out of sync - with Harbour's settings and create unpredictable results. - - + added these funcs by Luiz Culik: - AdsAddTable() - AdsAddUser To Group() - AdsUseDictionary() - These are all protected by ADS_REQUIRE_VERSION6, so to use them - you must define it when compiling rddads. - - The data dictionary support is a work-in-progress and may need - to be re-thought, so don't get too dependent upon current - implementation. - - * contrib/rdd_ads/doc/en/adsfuncs.txt - + added documentation for functions in adsfunc.c - * contrib/rdd_ads/doc/en/readme.txt - + added explanation for using the Set() function call - as well as the equivalent commands for SET DEFAULT TO, - DATEFORMAT, DELETE, EXACT and EPOCH. - + added explanation of INDEXING and Progress Displays using - AdsRegCallBack() (and why EVAL/EVERY cannot be supported.) - -2002-12-17 12:40 UTC-0300 Walter Negro - * source/tget.prg - ! Fix, UpdateBuffer() should not actualize the variable if the value - was not modified. - - Reported by Francisco Gamboa and Horacio Roldan - -2002-12-07 21:45 UTC-0300 Luiz Rafael Culik - * source/rtl/menuto.prg - ! Fixed Color Parameters when only One color is passed - -2002-12-02 15:30 UTC-0500 David G. Holm - * config/linux/global.cf - ! Add to PRG_USR instead of replacing it. - * source/rtl/set.c - ! When adding a new listener, set the next pointer to NULL. - -2002-12-03 22:40 UTC+0300 Alexander Kresin - * makefile.bc - * makefile.nt - * Added lines, needed for compiling of cdpla850.c - * source/codepage/cdpla850.c - * source/codepage/Makefile - ! Minor fixes - -2002-11-01 12:00 UTC-0300 Luiz Rafael Culik - * source/rtl/dbsdf.prg - ! fixed importing/exporting on linux - * contrib/mysql/tmysql.prg - ! Applyed Fixes by Wang Shuming - * config/linux/global.cf - + PRG_USR=-DHB_LINUX macro Added to compile dbsdf.prg - -2002-11-28 15:10 UTC+0300 Alexander Kresin - * source/pp/ppcore.c - ! Bug fixed, related to list match markers - -2002-11-27 13:30 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! Bug fixed, reported by Carlos Andr©s - * source/rtl/cdpapi.c - ! Bug fixed in HB_TRANSLATE() - -2002-11-26 21:20 UTC+0100 Tomaz Zupan - * contrib/odbc/browodbc.prg - ! There was a bug in skipping, that threw an error when - dataset contained 0 rows - -2002-11-25 21:45 UTC-0300 Luiz Rafael Culik - * utils/hbmake/hbmake.prg - ! removed unused Var - * source/rtl/menuto.prg - ! minor formating - -2002-11-21 12:05 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - * DBOI_ORDERCOUNT is supported now - * hb_stackPop() is added in ntxOrderCreate() - * contrib/rdd_ads/ads1.c - * adsOrderCreate() created indexes as if ADDITIVE clause is specified, even - it was absent - is fixed now. - adsOrderCreate() respects current order if WHILE clause is specified - -2002-11-20 22:00 UTC-0300 Luiz Rafael Culik - * utils/hbmake/hbmake.prg - utils/hbmake/hbmlang.c - * Some sinc from xharbour hbmake.prg hbmlang.c - -2002-11-20 21:45 UTC-0300 Luiz Rafael Culik - * source/pp/pptable.c - + COLOR parameter to @...PROMPT - * source/rtl/menuto.prg - ! Added code to use the passed Color to the Prompt.This will allow - to make Color menus and Was Far Requested since this feature is an Alaska,Flagship and Max compiler - * tests/menuto.prg - * Changes the Test to Show the ability of menu items in colors - * contrib/mysql/tmysql.prg - * On method GetRow(nRow) of TMySQLQuery fixed Handling of Date - Retrived(The date is formated on Current SET DATE FORMAT) - -2002-11-20 21:56 UTC+0300 Alexander Kresin - * source/codepage/cdppl852.c - * source/codepage/cdppliso.c - * source/codepage/cdpplmaz.c - ! Minor fix in comment delimiters - * source/rdd/dbcmd.c - ! COPY TO ... FIELDS is fixed again - -2002-11-18 22:35 UTC+0300 Alexander Kresin - * source/rdd/dbcmd.c - ! COPY TO ... FIELDS ... is fixed - fields in the result dbf are in the - same secuence as in the FIELDS clause. - -2002-11-18 14:55 UTC+0300 Alexander Kresin - * include/hbrddapi.c - * source/rdd/dbcmd.c - * source/rdd/workarea.c - * source/rdd/dbfntx/dbfntx1.c - * source/pp/pptable.c - * contrib/rdd_ads/ads1.c - * WHILE clause implemented for ADS RDD - -2002-11-15 14:30 UTC+0300 Alexander Kresin - * include/hbcdpapi.c - * source/rtl/cdpapi.c - * source/codepage/cdpru866.c - * source/codepage/cdprukoi.c - * source/codepage/cdpruwin.c - * Some fixes and enhancements - + source/codepage/cdp_tpl.c - + Template file for codepages is added - + source/codepage/cdppl852.c - + source/codepage/cdppliso.c - + source/codepage/cdpplmaz.c - + Codepages for Polish language, provided by Jacek Kubica - * source/codepage/Makefile - * makefile.bc - * makefile.nt - * makefile.vc - * Changed to compile new Polish codepages - -2002-11-13 15:50 UTC-0300 Horacio Roldan - * include/hbrddcdx.h - * source/rdd/dbfcdx/dbfcdx1.c - * source/rdd/dbfcdx/dbfcdx1.h - * source/rdd/dbfcdx/dbfcdx2.h - ! fixed some declarations to avoid warnings, - removed unnecessary introduced casts - ! fixed skip bug reported by Andrzej - ! fixed bug when empty scope used - ! fixed posible index corruption when shared. - + added functions cdxError, hb_cdxOrderListRebuild, - hb_cdxIndexReindex - Now reindex works, as well as pack and zap. - -2002-11-13 12:25 UTC+0100 Antonio Linares - * include/hbexprb.c - ! strings as bytes arrays management (assignment) - ! changes borrowed from xHarbour - - * source/vm/hvm.c - ! strings as bytes arrays management (assignment) - -2002-11-12 14:32 UTC+0100 Antonio Linares - * source/vm/hvm.c - + strings as bytes arrays management implemented - - Notice: Assignment is not implemented yet! - -2002-11-12 12:55 UTC+0100 Antonio Linares - * source/vm/hvm.c - + ":=" operator overloading support for locals and statics variables. - -2002-11-12 10:23 UTC+0100 Antonio Linares - * source/vm/classes.c - * source/vm/hvm.c - + Added support for "[]" operator overloading - -2002-11-10 19:35 UTC-0300 Luiz Rafael Culik - *source/rtl/alert.prg - ! fix initialization of cold Var - -2002-11-08 13:19 UTC+0100 Ignacio Ortiz - * source/rtl/errorapi.c - !Fixed severity to 'can retry' on Base errors (as Clipper) - * source/rtl/mlcount.c - !Fixed bug reported Brian Hays (the solution is also from Brian) - -2002-11-07 22:05 UTC-0300 Luiz Rafael Culik - *source/rtl/alert.prg - ! due an little mistake i`ve posted xharbour code, i`ve reverted back to version 1.38 and applyed the patch -2002-11-07 08:30 UTC-0300 Luiz Rafael Culik - * source/rtl/alert.prg - ! minor fix to my change from yesterday - -2002-11-06 18:38 UTC-0300 Walter Negro - * source/rtl/achoice.prg - ! Fix, if no UDF is set, pressing an alpha key it - go to first item finding this letter without respecting - upper and lowercase. - Reported by Luiz Culik. - -2002-11-06 00:00 UTC-0500 Paul Tucker - * makefile.vc - * makefile.nt - * make_vc.bat - * clean now handled by make - * corrected param handling - * use /? for help - -2002-11-05 21:41 UTC-0300 Luiz Rafael Culik - * source/rtl/alert.prg - ! Fixed problem when Text to display has more then 60 chars and the Line Breaker character (;) dont exist - (You notice this behaviour on some erros produced by xharbour rdd) - -2002-11-05 19:01 UTC-0300 Walter Negro - * source/rtl/strcase.c - ! Fix call to toupper(), tolower(), forcing unsigned char. - For the correct working with DJGPP compiler. - * source/rtl/is.c - ! Fix call to isdigit() and isalpha(), islower() and isupper(), - forcing unsigned char. - For the correct working with DJGPP compiler. - -2002-11-05 14:38 UTC-0300 Walter Negro - * contrib/libct/setlast.prg - + Init version of SETLASTKEY() - * contrib/libct/screen1.c - ! Fix variable declaration. - * contrib/libct/Makefile - + setlast.prg - * contrib/libct/makefile.bc - + setlast.prg - * contrib/libct/makefile.vc - + setlast.prg - * contrib/libct/ctflist.txt - * passed setlastkey() to Started state. - * contrib/libnf/dispc.c - ! Fix variable declaration. - * contrib/libnf/ftattr.c - ! Fix variable declaration. - -2002-11-04 15:18 UTC-0500 Paul Tucker - * makefile.vc - * no more recursive nmake calls - * makefile.nt - * corrected one batch mode call - * make_vc.bat - * if building Harbour under NT, use the alternate makefile.nt - * for faster builds. - * if you would prefer not to use batch mode, - * run make_vc /y (just like nmake) - -2002-11-03 20:28 UTC+0300 Alexander Kresin - * source/rdd/dbcmd.c - * hb_rddFieldIndex() was declared as static - is changed now, because it is - called from dbfntx1.c - -2002-11-02 19:26 UTC+0300 Alexander Kresin - * include/hbrddntx.h - * source/rdd/dbfntx/dbfntx1.c - * The algorithm of key expression evaluation is optimized. Now, if it is - the field name only, macro/codeblock evaluation doesn't used - - SELF_GETVALUE is used instead. It leads to sensible indexing speedup - in case of such simplest index keys. - -2002-11-02 11:55 UTC+0300 Alexander Kresin - * source/rdd/dbcmd.c - ! hb_rddGetCurrentWorkAreaPointer() fixed as proposed Jacek Potempa - -2002-10-31 16:40 UTC-0300 Walter Negro - * source/rtl/tget.prg - ! Fix ::DeleteEnd() method. - It didn't erase the last character. - Reported by Luiz Rafael Culik. - -2002-10-29 20:45 UTC-0500 Paul Tucker - * source/rtl/gtwin/gtwin.c - * Win9x Tone() support currently only for Borland and MSVC compilers. - * The only issue for the moment, is if the calculation of TICKS is - * incorrect for other compilers. SEE dTicks in hb_gt_Tone(). - * Someone may wish to adapt the code above hb_gt_tone() in gtwin.c - * for other compilers. - -2002-10-29 16:20 UTC-0500 Paul Tucker - * makefile.vc - * slight re-ordering and added missed codepage.lib directive. - + makefile.nt - * make_vc.bat - * if building Harbour under NT, use the alternate makefile.nt - * for faster builds. - * Changelog - Changed date of following entry from 28 to 29. - -2002-10-29 11:10 UTC-0500 Paul Tucker - * source/rtl/gtwin/gtwin.c - * modified by Robert Haley to allow Tone() - * to work correctly under Win9x. - * source/vm/maindllp.c - * remove redundant returns. Set parc to return NULL not "" - * source/rtl/transform.c - * changed nFor decl to UINT - * source/rtl/defpath.c - * removed unneeded assignment to size - * source/rdd/dbfcdx/dbfcdx1.c - * removed unneeded assignement to uiLen - -2002-10-27 21:35 UTC+0100 J-F lefebvre - * source/rdd/dbf1.c - * added missing typecasting for msvc. - -2002-10-27 10:28 UTC+0200 Chen Kedem - * doc/en/lang.txt - + Added Russian KOI-8 to HB_LANGSELECT() list of supported ID's - -2002-10-25 14:30 UTC+0300 Alexander Kresin - * source/rtl/cdpapi.c - * source/codepage/cdpru866.c - * source/codepage/cdprukoi.c - * source/codepage/cdpruwin.c - * source/vm/hvm.c - * Memory for codepage tables is allocated dynamically now - this is needed - to provide a possibility of loading codepages from external file while - run-time. - * Possibility to have the same weight for some characters ( usually accented - and appropriate unaccented ) is implemented. - -2002-10-25 11:38 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! Few fixes, related to codepages support - ! Bug fixed ( setting controlling index doesn't caused movement to the - top logical record before ) - -2002-10-24 15:00 UTC-0300 Walter Negro - * source/Makefile - ! Add codepage to compilation - -2002-10-24 20:58 UTC+0300 Alexander Kresin - * include/hbapicdp.h - ! Minor fix - -2002-10-24 16:05 UTC+0300 Alexander Kresin - + include/hbapicdp.h - + added header file for codepage system - * include/hbapirdd.h - * include/hbrddcdx.h - * include/hbrdddbf.h - * include/hbrddntx.h - + source/lang/msgrukoi.c - + added a msg file for koi8-r - * source/lang/Makefile - * msgrukoi.c added to Makefile - + source/rtl/cdpapi.c - + added codepages api source - Functions HB_SETCODEPAGE() and HB_TRANSLATE() are implemented - * source/rtl/is.c - * source/rtl/strcase.c - * IsAlpha(), IsUpper(), IsLower(), Upper(), Lower() functions modified to - use codepages - * source/rdd/dbcmd.c - * source/rdd/dbf1.c - * source/rdd/dbstrux.prg - * source/rdd/dbfntx/dbfntx1.c - * Rdd sources are modified to use codepages - dbUseArea() and dbCreate() has new optional parameter - codepage id. - * source/pp/pptable.c - * Commands USE and CREATE FROM are changed - new optional clause - 'CODEPAGE ' is added - * source/vm/itemapi.c - * hb_itemStrCmp() is modified to use codepages - * source/Makefile - * makefile.bc - * makefile.vc - * makefiles are modified - -2002-10-24 15:40 UTC+0300 Alexander Kresin - + source/codepage - + directory for codepage source files is added - + source/codepage/cdpru866.c - + source/codepage/cdprukoi.c - + source/codepage/cdpruwin.c - + source/codepage/Makefile - + Files for Russian codepages and Makefile for codepage library are added - -2002-10-22 18:30 UTC-0400 David G. Holm - * source/rtl/set.c - ! Removed comment block that incorrectly commented out - the default case in the HB_SET switch block. - ! Fixed the previously commented out code that prevented - changing the new HB_SET_DIRSEPARATOR value. - * tests/set_test.prg - + Added tests to display the Harbour-specific SET values - and a test for changing the _SET_DIRSEPARATOR value. - -2002-10-22 17:30 UTC-0400 David G. Holm - * source/rdd/dbfcmd.c - * Made FIELDNAME Clipper compatible for the case where there is - no current workarea and when the field number does not exist. - -2002-10-22 02:00 UTC-0500 Paul Tucker - * source/rdd/dbcmd.c - ! corrected copy length in rddsetdefault - -2002-10-22 18:53 UTC+0100 Antonio Linares - * source/rtl/filesys.c - ! minor fix reported by José Fco. Pérez - -2002-10-22 12:00 UTC-0500 Paul Tucker - * source/rdd/dbcmd.c - ! Fix a problem with Select() that I introduced. - -2002-10-21 05:11 UTC+0100 Antonio Linares - * source/rtl/achoice.prg - ! minor fix - -2002-10-21 23:41 UTC-0300 Walter Negro - * source/rtl/achoice.prg - ! Reduce redundant code. - ! Fix default values of nBottom and nRight out of range. - ! Add control of value of nBottom and nRight. - * source/rtl/tget.prg - ! Fix ::Changed property to conform UPDATE() behaviour with that Clipper. - - Fixed by Andi Jahja in xHarbour - -2002-10-21 12:30 UTC-0500 Paul Tucker - * source/rdd/dbfcdx/dbfcdx1.c - ! added some long needed typecasts. - ! corrected for index on/to without a tag - * source/rdd/dbfntx/dbfntx1.c - * source/rdd/dbfcdx/dbfcdx1.c - * source/common/hbffind.c - * source/common/hbfsapi.c - ! some strncpy changes. - -2002-10-21 12:00 UTC-0500 Paul Tucker - + tests/vidtest.prg by Brian Dukes - * source/rdd/dbcmd.c - * source/rdd/workarea.c - * source/rdd/dbf1.c - ! modified string copy operations for efficiency where appropriate. - -2002-10-21 10:20 UTC+0300 Alexander Kresin - * contrib/rdd_ads/adsfunc.c - ! Few fixes - checking for hb_parc() return value - -2002-10-20 22:50 UTC-0500 Paul Tucker - * source/rtl/inkey.c - ! reduce keyboard polling to <= once per tick. - ! Screen updating flies. - * source/rtl/philes.c - ! comparison to TRUE is not consistant with bool type in FREAD - -2002-10-20 16:18 UTC-0500 Paul Tucker - * source/rdd/dbfntx/dbfntx1.c - ! removed unused pLastPages - -2002-10-20 15:16 UTC-0500 Paul Tucker - * source/rdd/dbcmd.c - ! Just a few changes for efficiency... - -2002-10-20 22:40 UTC+0300 Alexander Kresin - * source/rdd/dbcmd.c - ! Yet another fix related to the hb_parc() changes - -2002-10-20 21:12 UTC+0300 Alexander Kresin - * source/rdd/dbcmd.c - ! Few fixes related to the latest hb_parc() changes - * source/rdd/dbfntx/dbfntx1.c - ! Bug fixed in indexing - -2002-10-19 16:50 UTC-0500 Paul Tucker - * include/hbdefs.h - * Added definition for UINT - * include/hbapigt.h - * source/rtl/gtapi.c - * source/rtl/saverest.c - * source/rtl/xsavescr.c - * source/rtl/gtdos/gtdos.c - * source/rtl/gtsln/gtsln.c - * source/rtl/gtos2/gtos2.c - * source/rtl/gtwin/gtwin.c - ! Properly account for the fact that hb_gt_rectsize returns an int - (ok, so we treat it as UINT, but this is better than USHORT) - * source/rtl/gtwin/gtwin.c - * New, highly optimized Windows console gt driver - written by Przemyslaw Czerpak - with some (?) fixes suggested by Peter Rees - and Marek Paliwoda - -2002-10-19 16:26 UTC-0500 Paul Tucker - * source/rtl/box.c - * source/rtl/disksphb.c - * source/rtl/errorapi - * source/rtl/fnsplit - * source/rtl/setcolor - ! Simplified some calls to hb_parc() - -2002-10-19 21:40 UTC+0100 Martin Vogel - * contrib/libct/Makefile - * contrib/libct/Makefile.bc - * contrib/libct/Makefile.vc - * contrib/libct/ctflist.txt - + contrib/libct/invertwin.prg - + INVERTWIN() function provided by Marek Horodyski - -2002-10-19 20:52 UTC+0100 Antonio Linares - * debug/debugger.prg - ! minor fix to BP (breakpoints) settings saved to file - - * debug/dbghelp.prg - ! mouse support added to debugger help - -2002-10-19 20:34 UTC+0100 Antonio Linares - * makefile.bc - + source/vm/maindllp.c added to the makefile - (don't know why this file was removed from it) - -2002-10-19 20:07 UTC+0100 Antonio Linares - * source/rtl/is.c - ! hb_parc() use made clipper compatible - -2002-10-19 16:20 UTC+0100 Antonio Linares - * source/rdd/dbcmd.c - ! some fixes on hb_parc() use from DbCreate() - - WARNING: Cause recent fix to hb_parc() to make it Clipper compatible, - hb_parc() result must be checked before using the returned value. - - REQUEST: Alexander, Horacio and Brian, as the RDDs captains, please review - all hb_parc() use from the RDDs source code, to asure hb_parc() - result is properly tested. - -2002-10-19 13:27 UTC+0100 Antonio Linares - * include/hbapi.h - * include/hbtypes.h - * source/vm/extend.c - * source/vm/maindllp.c - ! all hb_stor... functions changed to return an int value - - Notice: These changes fixes the extend API compatibility issues - with Clipper reported by gabor salai - -2002-10-19 12:53 UTC+0100 Antonio Linares - * source/vm/extend.c - ! minor fix to hb_parc() - - Notice: This change fixes the hb_parc() bug described by John Skelton - -2002-10-19 12:20 UTC+0100 Antonio Linares - * source/rtl/philes.c - ! FRead() fix for dynamic strings use with more than one holder - - Notice: This change fixes the FRead() bug described by Randy Portnoff - - -2002-10-19 11:16 UTC+0100 Antonio Linares - * include/hbtypes.h - ! minor change to avoid compiling errors if using -DHB_API_MACROS - -2002-10-17 14:40 UTC-0300 Luiz Rafael Culik - * source/rtl/tbrowse.prg - ! Fixed SetColumnMethod() that was not using all Display Area(The nWidthMax variable was substraced by 2) - -2002-10-17 15:00 UTC+0700 Andi Jahja - * source/compiler/harbour.sly - * source/compiler/harbour.y - ! Add missing third parameter on calls of hb_compGenPushSymbol() - -2002-10-16 1:50 UTC-0800 Brian Hays - * include/dbInfo.ch - ! added comments - -2002-10-14 17:10 UTC-0300 Walter Negro - * source/rtl/tget.prg - ! fixed get (value and display) involving negative with decimal - number whose value is less than 1, in some pictures. - -2002-10-14 17:40 UTC+0100 Antonio Linares - * include/hbcomp.h - * include/hbexprb.c - * include/hbmacro.h - * include/hbvmpub.h - * source/compiler/genc.c - * source/compiler/harbour.c - * source/vm/dynsym.c - * source/vm/hvm.c - * source/vm/macro.c - ! bug fixed when accesing an aliased expression from within a static - function with the same name as the alias. - ! changes borrowed from xharbour - - WARNING: All PRGs must be recompiled as defined value HB_FS_PUBLIC - has changed !!! - -2002-10-14 11:45 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! bug fixed in scopes, when the last record of current order was in the scope - ! bug fixed in error handling while index creating - - * source/rdd/dbfcdx/dbfcdx1.c - ! bug fixed in error handling while index creating ( the same as in dbfntx ) - -2002-10-14 0:10 UTC-0800 Brian Hays - * contrib/rdd_ads/rddads.h - * contrib/rdd_ads/ads1.c - * created iFileType to pArea so each workarea knows - whether it's ADT or CDX or NTX - * contrib/rdd_ads/adsfunc.c - - removed the 'far' from a char far * added in last post - - * include/dbstruct.ch - Added a note that it's also used by C code - #included it in hbapirdd.h (where I removed redundancies) - * include/ord.ch - + include/dbInfo.ch - * moved all the DBI_*, DBRI_* and DBOI_* constants to the - new dbInfo.ch, and included this in ord.ch and hbapirdd.h - * include/hbapirdd.h - * removed the redundancies, included dbinfo.ch and dbstruct.ch - - -2002-10-12 19:00 UTC-0300 Luiz Rafael Culik - * contrib/mysql/mysql.c - ! Fixed Buffer sizes on DATATOSQL() and FILETOSQLBINARY() It was leading to GPF due buffer underflow. - Many thanks to Peter Rees - -2002-10-11 21:35 UTC-0300 Horacio Roldan - * source/rdd/dbfcdx/dbfcdx1.h - * source/rdd/dbfcdx/dbfcdx2.h - * source/rdd/dbfcdx/dbfcdx1.c - ! fixed bug reported by Richard Chidiak - + added function hb_cdxMacroRun - ! fixed bug reported by Peter Rees. - * changed index creation and updating: - some spaces in keys aren't compressed now, so ADS can read - the indexes. (it couldn't with some special keys) - -2002-10-07 13:22 UTC-0300 Gustavo Junior Alves - * source/rtl/filesys.c - * Fix to compile on MSVC - Thanks to Andi Jahja - -2002-10-06 21:29 UTC-0300 Gustavo Junior Alves - * source/rtl/filesys.c - * hb_filecase on hb_fsMkDir, hb_fsChDir and hb_fsRmDir - -2002-10-05 23:00 UTC-0300 Luiz Rafael Culik - * source/rtl/tget.prg - * Fixed small problem when using Mouse to select the editing get - -2002-10-04 15:552 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! Bug fixed in key appending with few open indexes - -2002-10-04 14:42 UTC+0300 Alexander Kresin - * source/rdd/dbcmd.c - ! Bug fixed in COPY TO, APPEND FROM with aliased fields - -2002-10-04 13:58 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! Few bugs fixed, related to OrdKeyNo() and OrdKeyCount() - -2002-10-03 0:40 UTC-0800 Brian Hays - * contrib/rdd_ads/ace.h - + added (void) to AdsApplicationExit( void ); - This removes a compiler warning about missing the prototype. - Let me know if this creates a problem with any other compilers. - - * contrib/rdd_ads/adsfunc.c - + added AdsGetLastError() contrib. by Randy Portnoff (Thanks!) - - * contrib/rdd_ads/ads1.c - * Cleaned up adsPutValue and adsGetValue formatting, - * Fixed fieldname length references - * Removed errant setting of uiLen in adsGetValue since these - are set in adsOpen now. - * adsOrderInfo(DBOI_KEYVAL): fixed ntx handling of numerics - Added special decoding for keys of Negative values. - * adsCreate: fixed fielddefs buffer sizing - * adsOpen: fixed fieldname length references - set uiLen of extended types - - * adsInfo: reformatted, prepared for fleshing out the rest - of the options. - Added support for dbinfo(DBI_ISFLOCK) - -2002-10-01 08:25 UTC+0300 Chen Kedem - * doc/es/browse.txt - * doc/es/cmdline.txt - * doc/es/dbstrux.txt - ! columns in
need to be at least 3 spaces apart - -2002-09-30 16:46 UTC+0300 Chen Kedem - * doc/en/input.txt - * doc/en/lang.txt - * doc/en/menu.txt - * doc/en/objfunc.txt - ! columns in
need to be at least 3 spaces apart - -2002-09-29 12:00 UTC+0700 Andi Jahja - * source/rtl/tget.prg - ! fixed get (value and display) involving negative (with decimal) - number whose value is less than 1. - -2002-09-28 21:50 UTC-0300 Horacio Roldan - * source/compiler/hbusage.c - ! fixed a bug in the list of hb_compPrintCredits ;-) - -2002-09-28 01:55 UTC-0300 Horacio Roldan - * include/hbapirdd.h - * include/hbrdddbf.h - * include/hbrddcdx.h - * include/hbrddntx.h - * source/rdd/dbcmd.c - * source/rdd/workarea.c - * contrib/rdd_ads/ads1.c - * contrib/rdd_ads/rddads.h - + Changed fieldname max length handling, - it is now a workarea property. (set by the RDD) - (in ADS, this is just a patch) - -2002-09-28 01:50 UTC-0300 Horacio Roldan - * source/rdd/dbfcdx/dbfcdx1.h - * source/rdd/dbfcdx/dbfcdx1.c - ! changed key in-memory management. - this fixes trimmed key problems, reported by Lorenzo Fiorini. - ! fixed error reported by Gianni Santamarina. - * source/rdd/dbf1.c - ! fixed some typos - -2002-09-26 12:30 UTC-0300 Horacio Roldan - * include/hbapi.h - - removed filecase() definition from Extend API - * include/hbapifs.h - - added filecase() definition to FS API - * include/hbset.h - * source/rtl/set.c - * source/rtl/filesys.c - ! fixed GPF, fixed MSVC typecast, - changed settings from strings to numeric constants. - -2002-09-25 18:47 UTC-0300 Horacio Roldan - * source/rdd/rtl/file.c - * source/rdd/rtl/filesys.c - ! added some missing casts. - -2002-09-25 17:15 UTC-0300 Horacio Roldan - * source/rdd/rtl/file.c - * source/rdd/rtl/filesys.c - ! fixed GPF, hb_xfree must be used for hb_xgrab memory. - -2002-09-25 20:00 GMT+0100 Martin Vogel - * contrib/libct/color.prg - ! fixed initialization bug reported by Marek Horodyski - -2002-09-25 13:15 UTC-0300 Gustavo Junior Alves - * source/rtl/file.c - * source/rtl/filesys.c - ! Allow last changes to compile under MSVC - ! Change strdup to hb_strdup and rindex (BSD) to strrchr (POSIX) - -2002-09-23 11:00 UTC-0300 Gustavo Junior Alves - * include/hbapi.h - * include/hbset.h - * include/set.ch - * source/pp/pptable.c - * source/rtl/file.c - * source/rtl/filesys.c - * source/rtl/set.c - ! Implement SET FILECASE, DIRCASE and DIRSEPARATOR - * source/pp/ppcore.c - ! Fix a core dump on HB_TR_DEBUG PrevSquare - -2002-09-22 16:40 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! Bug fixed introduced in previous fix :) - -2002-09-22 12:25 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! Bug fixed in key append - -2002-09-21 12:20 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! Bug fixed, related to seeking while set deleted on is set - -2002-09-20 23:55 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! Bug fixed, related to softseek - -2002-09-20 14:50 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! Bug fixed in ntxZap() - -2002-09-20 12:32 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - * include/hbrddntx.h - * Improved algorithm of record append in shared mode - that should result - in better speed. - * Maximum number of keys in the index page is now Clipper compatible - - as I just discovered for myself, in Clipper it is already ( hm... I forgot - appropriate English word - is divided by 2 ). - -2002-09-19 00:35 UTC-0300 Horacio Roldan - * source/rdd/dbfcdx/dbfcdx2.h - * source/rdd/dbfcdx/dbfcdx1.c - + added function hb_cdxGetTagNumber - ! fixed some castings and warnings reported by - Larry Sevilla, Luiz and Andy. - ! fixed controlling order after ordCreate() - ! fixed controlling order after ordListAdd() - This fixes the controlling order after: - USE name INDEX name - SET INDEX TO name - INDEX ON key TAG tagname - * source/rdd/dbcmd.c - ! fix gpf in pack, reported by Jorge Mason. - * source/rdd/dbf1.c - + added support for DBI_FULLPATH and DBI_SHARED, - sent by Gianluca Piemonte. - -2002-09-18 16:00 UTC-0400 David G. Holm - * source/rdd/dbfcdx/dbfcdx1.c - ! Replaced non-existent _SORTSWAPPAGE used in hb_xgrab() type - override with the existing, and correct, LPSORTSWAPPAGE. - -2002-09-17 21:55 UTC-01 jf lefebvre (mafact) - * source/rdd/dbfcdx\dbfcdx1.c - ! Added needed typecasting for M$soft C - * source/vm/classes.c - ! Minor cosmetic change and syncro with xHarbour - -2002-09-13 23:30 UTC-0400 David G. Holm - * source/rtl/dbdelim.prg - ! Bug fix for fields that have an embedded delimiter. - -2002-09-13 22:20 UTC-0400 David G. Holm - * source/rtl/dbdelim.prg - ! Bug fixes for consecutive blank fields in a record and for - records that have no delimiters (either because there are - no character fields or because all of the character fields - are blank). - -2002-09-09 16:48 UTC+0300 Chen Kedem - * source/common/hbffind.c - - Remove redundant line which used FILE_ATTRIBUTE_NOT_CONTENT_INDEXED - from hb_fsAttToRaw(). The next line already use the explicit - value 0x00002000. Now Harbour complie with Borland BCB 3.0 - -2002-09-09 14:25 UTC+0100 Tomaz Zupan - * contrib/odbc/todbc.prg - + Added recordset caching. - -2002-09-07 14:38 UTC+0300 Alexander Kresin - * source/rdd/dbfntx/dbfntx1.c - ! GPF fixed, which appeared after pack operation if dbf became empty. - -2002-09-07 00:30 UTC-0300 Luiz Rafael Culik - * source/rtl/tget.prg - Added missing Caption DATA and init to "" - -2002-09-05 21:15 UTC-0300 Luiz Rafael Culik - * contrib/rdd_ads/ads1.c - ! Fixed Support for Long fields names in adscreate - ! Fixed Display for the follow type of fields when ADT format is USED - Autoinc -> 10 - Double/Curdouble 8(Official Size of field on Database)+2*HB_SET_DECIMALS value - -2002-09-05 18:46 UTC-0300 Horacio Roldan - * include/hbrddcdx.h - * source/rdd/dbfcdx/dbfcdx1.c - * source/rdd/dbfcdx/dbfcdx1.h - * source/rdd/dbfcdx/dbfcdx2.h - + added support for creating big indexes - hb_cdxSortSwapSavePage, hb_cdxSortSwapFillPage, - hb_cdxSortSwapRecurseDict, hb_cdxSortSwapSendWord - hb_cdxSortSwapBuildIndex, hb_cdxSortSwapGetNextKey; - + added hb_cdxKeyValCompare - ! fixed hb_cdxKeyGetItem for numeric keys - ! fixed hb_cdxTagExtNodeWrite - ! renamed some structs because td was confused - - * source/rdd/dbf1.c - synched with - 2002-08-31 20:38 UTC-0800 Ron Pinkas - * source/rdd/dbf1.c - ! Fixed hb_dbfLockFile() to release record locks before - attempting to lock the file. - 2002-08-31 15:24 UTC-0800 Ron Pinkas - * source/rdd/dbf1.c - ! Fixed hb_dbfLockRecord() to return success when area - alread has file lock. - -2002-09-04 17:56 UTC+0200 Maurilio Longo - * source/rtl/tbrowse.prg - ! Fixed cell padding inside ::DispCell(). Character or memo fields have to be - padded right. Number fields have to be padded left. - -2002-09-03 19:10 UTC+0200 Maurilio Longo - * source/rtl/teditor.prg - ! fixed line splitting when a character is deleted from a line and there is a - word wrapping limit. Please note that lines of text are treated differently - from the way clipper 5.x treats them, in particular when past EOL there is no - deletion from current line - * source/rtl/memoedit.prg - ! fixed cursor positiong and shaping when calling an user function - -2002-09-02 19:25 UTC-0400 David G. Holm - * ChangeLog + + ChangeLog + Started a new ChangeLog. - * source/rtl/ChangeLog.013 - + Renamed old ChangeLog, due to file size. - * source/rtl/dbdelim.prg - ! Code fix to handle the field delimiters, provided by the - APPEND FROM code author, Marco Braida . + * source/rtl/ChangeLog.014 + * Renamed old ChangeLog, due to file size. + * include/hbapifs.h + * include/hbmath.h + * include/hbrddcdx.h + * include/hbrdddbf.h + * include/hbrddntx.h + * include/hbrdddbt.h + * include/hbrddfpt.h + * include/hbset.h + + + source/rtl/hbrandom.c + * source/rtl/Makefile + * source/rtl/filesys.c + * source/rtl/set.c + * source/rdd/dbf1.c + * source/rdd/dbfntx/dbfntx1.c + * source/rdd/dbfcdx/dbfcdx1.c + * source/rdd/dbfcdx/dbfcdx1.h + * source/rdd/dbffpt/dbffpt1.c + + * Changes in DBF RDD, DBFCDX RDD, DBFFPT RDD, made by Przemyslaw Czerpak + and Giancarlo Niccolai, has been borrowed from xHarbour. + + * makefile.bc + * makefile.nt + * makefile.vc + * make files has been updated due to adding source/rtl/hbrandom.c. 2006-02-15 13:50 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/vm/hvm.c ! fixed memory leak I introduced changing Ryszard modifications diff --git a/harbour/ChangeLog.014 b/harbour/ChangeLog.014 new file mode 100644 index 0000000000..f593b44e85 --- /dev/null +++ b/harbour/ChangeLog.014 @@ -0,0 +1,3935 @@ +/* + * $Id$ + */ + +/* Use this format for the entry headers: + YYYY-MM-DD HH:MM UTC[-|+]hhmm Your Full Name + For example: + 2002-12-01 23:12 UTC+0100 Foo Bar +*/ + +2004-02-27 12:37 UTC+0100 Viktor Szakats + + * source/rtl/teditor.prg + ! Fixed a Bound error in GetParagraph which came up when + using in wrap mode, in the last line I guess. + Note that this just fixed the bound error, not the possible + real problem. + +2004-02-21 8:14 UTC+0100 Viktor Szakats + + * source/common/hbffind.c + * source/rtl/direct.c + + Completely rearranged, so that the platform specific stuff + is kept in one function. Redundant code removed. + * Attrib filters needed to make DIRECTORY() CA-Cl*pper + compatible have been moved to the low-level file-find + functions. + + Added label support for Win32. + ! Fix for Win32. It has been made compatible with the + C RTL _dos_findfirst pattern matching, which is what + CA-Clipper is compatible with. + * Adding space to the stringified attribute list on + HB_FA_NORMAL removed, since it's not compatible, and it + doesn't get executed anyway, since HB_FA_NORMAL == 0. + * UNIX part formatted. + ; All this means that file find API is fixed now and compatible + with CA-Cl*pper on the lower level. Heavily tested under + Win32, and probably easy to fix for any other platforms + now in case of incompatibility. Changes has be merged from + an older version of the file, so please double chk your + changes/platforms. + ; Note that other file-find API based functions will also + automatically benefit from the above changes, like FILE()/ + hb_fsFile(). + +2004-02-21 7:39 UTC+0100 Viktor Szakats + + * source/rtl/memoread.c + * Previous change reverted. hb_retc( NULL ) was intentional + and is an optimized version of hb_retc( "" ). Both will return + an empty string. + % hb_fsClose() calls reduced. + + * src/rtl/tbcolumn.prg + * src/rtl/tbrowse.prg + ! :SetColumn() retval made compatible. + ! :ColWidth() retval made compatible. + % Using array functions to speed up a few things. + % Got rid of the predefined 4096 long array in every + columns plus the browse object. + ; More and more incompatibilities are popping up, some + of them quite strange, and only coming up in a large + app's sophisticated browse stressing environment. + - Removing rightmost column while active will do RTE, + - If headsep is initialized after the columns and cargo, + browse will sometimes behave strangely (headsep value + disappears??) + - Moving columns off the visible area will screw up + internals. + - Modifying columns is slow because of the unconditional + :configure() calls. + +2004-02-20 8:55 UTC-0800 Luis Krause Mantilla + * contrib/mysql/mysql.c + ! Fixed declaration for filelength() from int to long to match io.h + * source/rtl/memofile.c + ! Changed return values for empty or failed calles to MemoRead() to return an + empty string instead of a NULL + ! Close file when MemoRead() was successful, but file was empty (was being left open) + Above solutions reported and provided by David Arturo Macías Corona. Thanks! + +2004-02-19 12:48 UTC-0800 Luis Krause Mantilla + * contrib/rdd_ads/adsfunc.c + ! fixed casting in adsShowError() + * contrib/rdd_ads/ads1.c + ! adsSeek() now raises a runtime error 1201 if no index is active + ! adsOrderListAdd() sets order to 0 if an invalid or non-existent tag is provided + The above two were added to keep Clipper compatibility + + Added 5th param to commonError() in order to provide uiFlags, like other RDD's + * source/rdd/dbfcdx/dbfcdx1.c + * source/rdd/dbfntx/dbfntx1.c + ! Fixed error code returned by hb_cdxSeek() and ntxSeek() to 1201 (was 1020) + so it returns same error code as Clipper + +2004-02-17 9:22 UTC-0800 Luis Krause Mantilla + * contrib/rdd_ads/adsfunc.c + + Forgot to mention Brian Hays' implicit record locking fix/workaround is also + included in my previous ADS update. The function name is adsTestRecLocks() + +2004-02-16 17:40 UTC-0800 Luis Krause Mantilla + * contrib/rdd_ads/ads1.c + * contrib/rdd_ads/adsfunc.c + * contrib/rdd_ads/adsmgmnt.c + * contrib/rdd_ads/ace.h + * contrib/rdd_ads/rddads.h + * contrib/rdd_ads/doc/en/adsfuncs.txt + ! Renamed Data Dictionary functions for consistency: + adsAddTable() to adsDDAddTale() + adsAddUserToGroup to adsDDAddUserToGroup() + ! Moved adsGetNumActiveLinks() inside the ADS_REQUIRE_VERSION6 to avoid + compile errors with ADS version older than v. 6.0 + + Syncronized with xHarbour - Thanks to Brian Hays, Toninho, et. al. + added the following functions: + adsConnect60() + adsCopyTableContents() + adsDDCreate() + adsDDCreateUser() + adsDDGetDatabaseProperty() + adsDDGetUserProperty() + adsDDSetDatabaseProperty() + adsGetTableCharType() + adsMGGetLockOwner() + +2004-02-16 15:52 UTC+0100 Viktor Szakats + + * src/rtl/set.c + ! Fixed an incompatibility in Set(_SET_EXIT) which caused + ReadExit() to set the SET value even if called without + a parameter. Similar incompatibility can exist with other + sets, but I didn't chk them. + Now ReadExit() works as expected. + + * src/rtl/tbrowse.prg + ! Typo. + +2004-02-16 10:52 UTC+0100 Viktor Szakats + + * src/rtl/tbrowse.prg + + :ColorRect() partial support added. The missing part is + that in C52 :ColorRect() will update the screen probably + using some internal buffers for the data, because + the skipblock for example is not evaluated. + + * src/rtl/filesys.c + * Some cleanup, optim, comments, added static. + +2004-02-15 14:02 UTC-0800 Luis Krause Mantilla + * hrbdll.bc + + added references to cdphu852.c cdphuwin.c and errorint.c + Could a MSVC user update hrbdll.vc + +2004-02-15 16:35 UTC+0100 Viktor Szakats + + * src/rtl/tbrowse.prg + ! Fixed to not display headsep/footsep when there's no + header/footer. + ! Fixed to display headsep/footsep with the width of + colsep. + + * makefile.bc + ! Added DEBUG_LIB for Harbour exes to make them compile + in debug mode. + + * souce/rtl/gtapi.c + ! hb_gtSetColorStr() previous change reverted. The mistake + was on my side most probably. + +2004-02-15 05:25 UTC+0100 Viktor Szakats + + * source/rtl/tbrowse.prg + ! :Moved() fixed to always DeHilite() (independently from + the autolite value). This is in sync with C52 docs + (see autolite .ng), and testing has shown it to be + compatible. Only :stabilize should be affected by the + autolite setting. + + TODO: added about missing ColorRect functionality. + +2004-02-15 05:12 UTC+0100 Viktor Szakats + + * source/rtl/tbrowse.prg + ! Fixed color handling to take into account ::defcolor + of TBColumn. Now TBrowse coloring is C52 compatible. + For speed wierd cases are not handled like if the value + of ::defcolor is improper. + + * source/rtl/tgetlist.prg + * source/rtl/ttopbar.prg + * source/rtl/tbrowse.prg + ! DevPos() -> SetPos() (TBrowse() had plenty of them) + ! Few missing color params added to DispOut*() + +2004-02-15 04:20 UTC+0100 Viktor Szakats + + * source/rtl/tget.prg + ! :display() fixed to always evaluate the get block before + displaying like in C52. + + * include/hbapifs.h + + HB_FFIND structure extended for future changes. + +2004-02-15 03:42 UTC+0100 Viktor Szakats + + * source/rdd/dbcmd.c + ! FIELDPUT() Fixed to accept and ignore field NIL values + without runtime error. C52 compatible. + +2004-02-14 19:14 UTC+0100 Viktor Szakats + + * source/rtl/tbrowse.prg + ! SetColumnWidth() fixed for multi-line headers. + +2004-02-14 05:33 UTC+0100 Viktor Szakats + + * include/hbapigt.h + * source/rtl/gt_tpl/gt_tpl.c + * source/rtl/gtwin/gtwin.c + * source/rtl/gtcgi/gtcgi.c + * source/rtl/gtcrs/gtcrs.c + * source/rtl/gtdos/gtdos.c + * source/rtl/gtos2/gtos2.c + * source/rtl/gtpca/gtpca.c + * source/rtl/gtsln/gtsln.c + * source/rtl/gtstd/gtstd.c + + Following low-level GT API functions added (for completeness): + hb_gt_GetCharAttr( SHORT uiRow, SHORT uiCol, BYTE * pbyChar, BYTE * pbyAttr ); + "static hb_gt_xGetXY()" functionality copied where available. + * Parameter of previously added functions changed from USHORT to SHORT + (to support moving windows out of screen) + + "static hb_gt_xPutch()" code copied to hb_gt_PutCharAttr() where available. + ! Added bounds checking to GTWIN new functions. + +2004-02-14 04:28 UTC+0100 Viktor Szakats + + * include/hbapigt.h + * source/rtl/gt_tpl/gt_tpl.c + + Following low-level GT API functions added to support + 3rd party GT high-level layers/replacements and 3rd + party screen handling libraries: + hb_gt_PutCharAttr( USHORT uiRow, USHORT uiCol, BYTE byChar, BYTE byAttr ); + hb_gt_PutChar( USHORT uiRow, USHORT uiCol, BYTE byChar ); + hb_gt_PutAttr( USHORT uiRow, USHORT uiCol, BYTE byAttr ); + hb_gt_GetChar( USHORT uiRow, USHORT uiCol, BYTE * pbyChar ); + hb_gt_GetAttr( USHORT uiRow, USHORT uiCol, BYTE * pbyAttr ); + + * source/rtl/gtwin/gtwin.c + * Above functions completed for the Win Terminal driver. + + * source/rtl/gtcgi/gtcgi.c + * source/rtl/gtcrs/gtcrs.c + * source/rtl/gtdos/gtdos.c + * source/rtl/gtos2/gtos2.c + * source/rtl/gtpca/gtpca.c + * source/rtl/gtsln/gtsln.c + * source/rtl/gtstd/gtstd.c + * Skeletons added for the above new functions. + +2004-02-14 03:00 UTC+0100 Viktor Szakats + + * makefile.bc + ! Fixed compilation of dbgbrwsr + + * source/pp/ppcore.c + * source/rtl/round.c + * source/rdd/dbfcdx/dbfcdx1.c + ! Fixed errors when compiled with HB_TRACE + + * source/common/hbffind.c + * Formatting. + +2004-02-13 23:57 UTC+0100 Viktor Szakats + + + source/codepage/cdphu852.c + + source/codepage/cdphuwin.c + * source/codepage/Makefile + * makefile.bc + * makefile.nt + * makefile.vc + + Added Hungarian 852 and Windows sorting codepages. + + * source/rtl/errorapi.c + + source/rtl/errorint.c + * source/rtl/Makefile + * makefile.bc + * makefile.nt + * makefile.vc + + hb_errInternal() put in a separate source file, to ease + replacing/override it in link-time, this may be useful + for GUI apps, logging or something like this. + +2004-02-13 23:36 UTC+0100 Viktor Szakats + + * source/vm/hvm.c + ! hb_vmPopAliasedVar() - Fixed to be case-insensitive. + % hb_vmPushAliasedVar() - Case-insensitive handling speed up. + * unsigned long -> ULONG + + * source/rtl/idle.c + * include/hbapi.h + + Made hb_releaseCPU() public. + + * source/rtl/filesys.c + * include/hbapifs.h + + Added return value to hb_fsSetDevMode(), this way it's + fully compatible with the CA-Clipper _tdevraw() call. + + * source/rtl/philes53.c + ! FSETDEVMOD() now returns a numeric instead of NIL. The + returned value is always 0 now. Note added about this + incompatibility with C53. + + * source/common/hbver.c + ! Mistyped defines related to compatibilty fixed. + + * source/rtl/strcase.c + ! Incorrect assigment warnings fixed. + +2004-02-13 21:56 UTC+0100 Viktor Szakats + + * souce/rtl/gtapi.c + ! hb_gtSetColorStr() removed one suspicious assigment which + showed incompatible with CA-Cl*pper, where CLR_UNSELECTED + was made equal to CLR_ENHANCED if missing from the color string. + * Using HB_CLR_ constants instead of literals. + + * source/rtl/tget.prg + ! :ColorSpec() method unselected color defaulting fixed. + + * source/compiler/hbusage.c + * Bumped year to 2004. + +2004-02-12 13:42 UTC-0800 Luis Krause Mantilla + * hrbdll.bc + + added missing references + - deleted obsolete refrerences + +2004-02-11 13:40 UTC+0100 Ryszard Glab + + source/debug/dbgbrwsr.prg + + The new file with TDbgBrowser class which inherits + from TBrowse + + * hrbdll.bc + * hrbdll.vc + * makefile.bc + * makefile.nt + * makefile.vc + * source/debug/Makefile + + added the reference to dbgbrwsr.prg + + * source/debug/dbgmenu.prg + + added "Run at Startup' option + + * source/debug/dbgtwin.prg + * source/debug/debugger.prg + * source/debug/tbrwtext.prg + + added "Run at Startup' option - if it is enabled then + the debugged application runs until ALTD() is called or + Alt+D keys pressed (Clipper compatibility - the default + option). If it is disabled the the debugger shows up at + the first code line with the debug info. + This setting is stored in the initialization file + (init.cld) as 'Options NoRunAtStartup'. + * fixed more display/refreshing issues + * fixed quiting the debugger + + * source/rtl/alert.prg + * fixed bug with messages longer then 60 bytes + + * source/vm/hvm.c + * hb_vmDebugEndProc() is called before the eval stack + is cleaned - this allows to handle INIT/EXIT procedures + correctly + +2004-02-05 18:49 UTC-0800 Luis Krause Mantilla + * source/vm/debug.c + + add wrappers (some 3rd-party-libs still use these ones) for: + __VMSTKGLIST() + __VMSTKGCOUNT() + Thanks Andi! + +2004-01-30 15:30 UTC+0100 Ryszard Glab + * source/pp/ppcore.c + * fixed compilation of &(exp) in normal stringify + markers (this fixes INDEX ON bug reported by Jorge) + +2004-01-30 10:40 UTC+0100 Ryszard Glab + * source/rtl/teditor.prg + * the current line is still visible after the window resizing + + * source/debug/debugger.prg + * fixed refreshing of variables' monitor window + * fixed some save/restore screen issues + +2004-01-29 20:15 UTC-0800 Luis Krause Mantilla + * contrib/rdd_ads/ace.h + + added missing definition for adsGetNumActiveLinks() + +2004-01-29 18:45 UTC-0800 Luis Krause Mantilla + * source/vm/debug.c + + add wrappers (some 3rd-party-libs still use these ones) for: + __VMSTKLCOUNT() + __VMPARLLIST() + __VMSTKLLIST() + __VMVARLGET() + __VMVARLSET() + * source/vm/hvm.c + + add wrappers (some 3rd-party-libs still use these ones) for: + __VMVARSLIST() + __VMVARSLEN() + __VMVARSGET() + __VMVARSSET() + Thanks Andi! + +2004-01-29 18:30 UTC-0800 Luis Krause Mantilla + * contrib/rdd_ads/adsfunc.c + + Added 3 ADS functions: adsGetNumOpenTables(), adsShowError() and adsGetNumActiveLinks() + +2004-01-28 11:10 UTC+0100 Ryszard Glab + * source/compiler/harbour.c + * removed duplicated line causing memory leak + reported by Andi + +2004-01-27 19:10 UTC+0100 Ryszard Glab + * source/compiler/harbour.c + * fixed generation of pcode in codeblocks with no + local variables or parameters + + * source/debug/debugger.prg + * fixed refreshing of variables in monitor window + +2004-01-27 16:10 UTC+0100 Ryszard Glab + * source/compiler/harbour.c + * the compiler generates module name inside + '(_INITSTATICS)' function if -B option is used + + * source/vm/hvm.c + * fixed hb_vmStaticName, hb_dbg_vmVarSGet, + hb_dbg_varSSet to use the static variables frame + + * source/debug/dbgtmenu.prg + * source/debug/dbgtmitm.prg + * source/debug/debugger.prg + * fixed parsing of : in watchpoint + expressions + * fixed monitoring of static variables - the + debugger displays now static variables defined + in the current debugged prg file + +2004-01-26 19:30 UTC+0100 Ryszard Glab + * include/hbextern.ch + * tests/debugtst.prg + * tests/funcarr.prg + * tests/inherit.prg + * tests/objarr.prg + * tests/objasign.prg + *replaced '__vm*' functions with 'hb_dbg_vm*' names + +2004-01-26 8:30 UTC-0800 Luis Krause Mantilla + * source/rtl/tget.prg + ! Fixed bug in get class when using "@9" picture with strings + +2004-01-26 11:45 UTC+0100 Ryszard Glab + * source/compiler/harbour.c + *fixed generation of codeblock's pcode with debugging info + + * source/debug/dbgmenu.prg + * source/debug/dbgtmenu.prg + * source/debug/dbgtmitm.prg + * source/debug/dbgtwin.prg + * source/debug/debugger.prg + * source/debug/tbrwtext.prg + *added Tracepoint support + *added support for PPO files + *added monitoring of local variables used in a codeblock + *local variables are displayed correctly when the + callstack window is browsed + *other minor fixes + + * source/vm/debug.c + *renamed '__vm*' functions to 'hb_dbg_*' + *fixed support for local variables inside of codeblock + + * source/vm/hvm.c + *added 'hb_dbg_ProcLevel' function which return the + size of procedure stack calls (the debugger support) + +2004-01-25 10:11 UTC+0100 Antonio Linares + * makefile.nt + * makefile.vc + * minor fix for hbverdir module + +2004-01-22 18:30 UTC+0100 Ryszard Glab + * source/debug/dbgmenu.prg + * source/debug/dbgtwin.prg + * source/debug/debugger.prg + *added Watchpoints support + + * source/vm/debug.c + *added item de-referencing to __vmVarLGet + +2004-01-21 18:40 UTC+0100 Ryszard Glab + +include/hbdebug.ch + *added a missing file + +2004-01-21 18:35 UTC+0100 Ryszard Glab + * source/compiler/harbour.y + *fixed generation of line number's pcode related to + the debugger + + * source/debug/dbgmenu.prg + * source/debug/debugger.prg + *added support for 'Run to cursor" command + *minor fixes in breakpoints handling (some code + lines are not allowed to set a breakpoint and + run to cursor) + +2004-01-21 15:30 UTC+0100 Ryszard Glab + * source/compiler/harbour.y + *fixed generation of line number's pcode related to + the debugger + + * source/debug/dbgmenu.prg + * source/debug/debugger.prg + *fixed TRACE command + *added support for 'Codeblock trace' option + * other minor fixes to make the debugger usable + + Additionally in my previous commit (2004-01-20 19:15) + * source/vm/hvm.c + *added call for hb_inkeyPoll to the main pcode execution + loop to correctly support Alt-D, Alt-C and Ctrl-C + requests (only if HB_GUI is not defined) - it is + called every 256 opcodes + +2004-01-20 19:15 UTC+0100 Ryszard Glab + * include/hbcomp.h + * include/hbexprb.c + * source/macro/macrob.c + * source/compiler/exproptb.c + * source/compiler/genc.c + * source/compiler/gencli.c + * source/compiler/harbour.c + * source/compiler/harbour.y + * source/compiler/hbfix.c + *when debug information is requested then the compiler generates + correct pcode with static variable name (it was correct if + -gc1 or -gc2 options were used previously) + *the pcode of a codeblock contains the module name (in debug mode) + + + include/hbdebug.ch + *a new file with a definition of __dbgEntry call modes + + * source/debug/debugger.prg + * source/vm/hvm.c + *changed parameters passed to __dbgEntry function to make the + function more flexible + *fixed monitoring of local and static variables + *when a codeblock is eveluated then debugger shows the code + where the codeblock was created + + * source/rtl/tbrowse.prg + *'configure' method recalculates the width of columns + + * include/hbapi.h + * source/vm/codebloc.c + * source/vm/itemapi.c + * source/vm/memvars.c + *code clean-up and optimalization related to codeblocks + + * source/rtl/gtcrs/Makefile + * source/rtl/gtcrs/gtcrs.c + + source/rtl/gtcrs/charmap.prg + *added possibility to load a character mapping using HB_GT_CHARMAP + + + source/rtl/gtcrs/debug.map + *an example character mapping + +2004-01-08 18:45 UTC-0500 David G. Holm + * contrib/Makefile + + Added a section for rsxnt, which is unable to compile Ole and odbc. + - Removed odbc from default section, because it includes the windows.h + include file, which is unlikely to exist on non-Windows systems. + + * contrib/odbc/odbc.c + ! Added type overrides for MSVC. + +2004-01-08 16:45 UTC-0500 David G. Holm + * source/rtl/filesys.c + ! Usage of fdatasync updated to match current POSIX specification. + +2004-01-08 16:00 UTC-0500 David G. Holm + * source/rtl/filesys.c + + Added an error return check to fdatasync when using POSIX + synchronized I/O, so that if unimplemented, the slower + method will be used to ensure that the file gets flushed. + + * utils/hbpp/hbpp.c + ! Removed another refererence to malloc.h, which is obsoleted by + stdlib.h and doesn't even exist in gcc 3.x implementations. + +2003-12-25 19:40 UTC-0800 Luis Krause Mantilla + * include/hbapifs.ch + * source/rtl/direct.c + * source/common/hbffind.c + ! Fixed bug in Directory( "c:\*.*" ) that returned 0 when hidden files were present + Borrowed from xHarbour + +2003-12-13 17:05 UTC+0100 Ryszard Glab + * source/vm/codebloc.c + * fixed initialization of detached variables + +2003-12-12 11:45 UTC-0800 Luis Krause Mantilla + * source/rdd/dbcmd.c + ! Fixed dbSelectArea() bug reported by Giovi Verrua + Thanks to Ryszard for the heads-up + +2003-12-10 18:20 UTC-0500 David G. Holm + + * utils/hbver/hbverfix.c + ! Fixes for problems found after testing on FreeBSD. + +2003-12-10 17:30 UTC-0500 David G. Holm + + * source/compiler/harbour.c + * source/compiler/harbour.sly + * source/compiler/harbour.y + * source/rtl/isprint.c + * source/vm/fm.c + * source/vm/hvm.c + ! Never include malloc.h, because: 1) It been obsoleted by stdlib.h + in Standard C; and 2) The use of malloc.h is forbidden in GCC 3.x. + +2003-12-05 16:05 UTC+0100 Ryszard Glab + * source/rtl/gtcrs/gtcrs.c + * characters with code > 128 are displayed correctly now + + * tests/codebl.prg + * updated test for detached codeblock parameters + (Notice that we are not compatible with Clipper here - there + is no need do duplicate Clipper bug, IMHO) + +2003-12-03 17:28 UTC-0800 Luis Krause Mantilla + * source/rdd/dbcmd.c + ! Fixed OrdKeyNo() bug that set RecNo() to LastRec() + 1 + reported by Roberto López - borrowed from xharbour + +2003-12-03 14:24 UTC-0800 Luis Krause Mantilla + * include/hbapirdd.h + * source/rdd/dbcmd.c + ! Fixed dbCreate() bug that closed an open dbf with same name as newly created dbf in a different folder + reported by Giovi Verrua - borrowed from xharbour + +2003-12-02 15:57 UTC+0100 Tomaz Zupan + * bin/pack_src.sh + + Added missing directories to script + +2003-12-02 15:23 UTC+0100 Lorenzo Fiorini + * source/vm/hvm.c + * source/vm/mainwin.c + * bin/bld.bat + * config/dos/watcom.cf + + config/w32/watcom.cf + ! added support to OpenWatcom DOS/Win32 borrowed from xHarbour + +2003-11-24 18:32 UTC+0100 Lorenzo Fiorini + * source/compiler/gencobj.c + ! fixed to allow = for the C compiler options + ( suggested by Przemyslaw Czerpak ) + ! added support of OpenWatcom C + ! cleaned the verbose option + * source/rdd/dbfcdx/dbfcdx1.h + ! changed to allow OpenWatcom C build + ( suggested by Przemyslaw Czerpak ) + * source/vm/itemapi.c + ! added support of OpenWatcom C + +2003-11-14 16:45 UTC+0100 Ryszard Glab + * include/hbmath.h + * fixed to compile under OpenWatcom + + * source/vm/memvars.c + * fixed to release PUBLIC variables correctly + (when RELEASE command is used) + + +2003-10-12 17:35 UTC-0500 David G. Holm + + * utils/hbver/hbverfix.c + ! Include closing quote in string built by szReplaceQuoted. + ! Strip newline chars from end of log entry. + +2003-10-12 17:15 UTC-0500 David G. Holm + + * utils/hbver/hbverfix.c + ! Use the standard ENOENT instead of the DOS-centric ENOFILE. + ! Resolved three print format warnings. + +2003-11-12 13:35 UTC+0200 Chen Kedem + * doc/dirstruc.txt + + Add a lines for source/rdd/dbfdbt, source/rdd/dbffpt, utils/hbver + + * doc/es/dbstrux.txt + - Remove embedded TABs + +2003-10-11 18:35 UTC-0500 David G. Holm + + * makefile.bc + * makefile.nt + * makefile.vc + * include/hbver.h + * utils/Makefile + + utils/hbver/Makefile + + utils/hbver/hbverfix.c + This is a first pass at a utility to automatically update include/hbver.h. + The ChangeLog-related fields are updated automatically. One of the version- + related fields can be updated using one of three command line options (/iv + for major version, /im for minor version, or /ir for program revision). The + minimal debug output can be suppressed by using the /d-1 option or verbose + debug output can be seen by using the /d1 option. Help is obtained using + either of the /h or /? options. + +2003-11-10 15:54 UTC+0100 Maurilio Longo + borrowed from xHarbour trying to hunt down a memory leak on an utility of mine + + 2003-11-10 12:19 UTC+0100 Przemyslaw Czerpak + * include/hbrddcdx.h + * source/rdd/dbfcdx/dbfcdx1.c + ! possible memory leak fixed + * small improvment in balancing + + +2003-11-10 13:20 UTC+0100 Maurilio Longo + * contrib/btree/hb_btree.c + + added _CLIPDEFS_H define to let it compile on OS/2 GCC + * contrib/libct/bit1.c + * contrib/libct/bit3.c + * contrib/libct/ct.h + + added _CLIPDEFS_H define to let it compile on OS/2 GCC + * changed redefined base tipes to C ones, like WORD -> long, bit3.c was already + partly fixed before this one + * contrib/libnf/chdir.c + * contrib/libnf/dispc.c + * contrib/libnf/getenvrn.c + * contrib/libnf/kspeed.c + * contrib/libnf/mouse.c + * contrib/libnf/rmdir.c + + added _CLIPDEFS_H define to let it compile on OS/2 GCC, now it compiles, but a lot + of functions are DOS only + +2003-11-10 12:25 UTC+0100 Ryszard Glab + * include/hbcomp.h + * source/compiler/cmdcheck.c + * source/compiler/genc.c + * source/compiler/harbour.c + * source/compiler/hbusage.c + * source/vm/hvm.c + * doc/en/compiler.txt + * fixed to correctly generate an address for far jumps + * fixed optimalization of far jumps + + added a new switch -kJ to disable jump optimalization and + NOOP pcode removal (optimalization is enabled by default) + + +2003-11-09 00:50 UTC+0300 Alexander Kresin + * source/pp/pptable.c + + SET MBLOCKSIZE TO + SET MEMOBLOCK TO + SET MFILEEXT TO + SET AUTOSHARE TO [] + SET AUTORDER TO [] + SET STRICTREAD + New DBFFPT related commands, added by Przemyslaw Czerpak - synced with xHarbour. + + * include/hbdefs.h + * source/rdd/dbcmd.c + * source/rdd/dbfcdx/dbfcdx1.c + ! Some DBFCDX fixes by Przemyslaw Czerpak - synced with xHarbour. + + * source/rdd/dbfntx/dbfntx1.c + ! Bug fixed, which appeared while conditional indexing of a parent file in relation. + +2003-10-22 13:26 UTC-0800 Luis Krause Mantilla + * source/rdd/rddord.prg + + ORDSETRELATION() + * source/rtl/dummy.prg + + removed implemented fzuns + * Latest RDD changes, has been made by Przemyslaw Czerpak - synced with xHarbour. + +2003-11-06 11:40 UTC+0100 Ryszard Glab + * source/compiler/harbour.l + * enabled support for break[] (if not full Clipper + compatibility mode was requested) + + * include/hbexpra.c + * include/hbexprb.c + * include/hbexprc.c + * include/hbexprop.h + * source/common/expropt2.c + * source/compiler/expropta.c + * source/compiler/exproptb.c + * source/compiler/exproptc.c + * source/macro/macroa.c + * source/macro/macrob.c + * source/macro/macroc.c + * fixed optimalization of literal strings that contain macro + operator - strings are not joined if the left argument of + '+' operator contains '&' + for example: + CHR(38)+'text' -> will no longer look for 'text' variable + '&var'+'iable' -> will look for 'var' variable instead of + 'variable' + + + added optimalization of ASC function + for example: + ASC('&') will be replaced with 38 + + + added optimalization of LEN function + for example: + LEN("123") will be replaced with 3 + LEN( {1,2} ) will be replaced with 2 + Optimalization od ASC, LEN is disabled if strict Clipper + mode is requested (-kc) + + * source/compiler/harbour.c + * support for strings as array of bytes is disabled by default now + (use -ks to enable it) + + * source/vm/cmdarg.c + * source/vm/hvm.c + * support for strings as array of bytes is disabled by default now + (use //FLAGS:s to enable it) + +2003-11-06 11:00 UTC+0300 Alexander Kresin + * source/vm/hvm.c + * RDD initialization added ( made by Przemyslaw Czerpak ) - I forgot to + upload it yesterday. + +2003-11-05 23:35 UTC+0300 Alexander Kresin + * makefile.bc + * makefile.nt + * makefile.vc + * Makefiles has been updated due to RDD changes + +2003-11-05 22:50 UTC+0300 Alexander Kresin + * config/global.cf + * include/hbapirdd.h + * include/hbapi.h + * include/hbapifs.h + * include/hbdefs.h + * include/hbrddcdx.h + * include/hbrddntx.h + * include/hbrdddbf.h + * include/hbrdddel.h + * include/hbrddsdf.h + + include/hbdbferr.h + + include/hbrdddbt.h + + include/hbrddfpt.h + + * source/rtl/filesys.c + * source/rtl/spfiles.c + * source/rtl/filehb.c + + * source/rdd/dbcmd.c + * source/rdd/dbf1.c + * source/rdd/delim1.c + * source/rdd/rddsys.prg + * source/rdd/sdf1.c + * source/rdd/workarea.c + + * source/rdd/dbfcdx/dbfcdx0.prg + * source/rdd/dbfcdx/dbfcdx1.c + * source/rdd/dbfcdx/dbfcdx1.h + - source/rdd/dbfcdx/dbfcdx2.h + + * source/rdd/dbfntx/dbfntx1.c + + + source/rdd/dbfdbt/ + + source/rdd/dbfdbt/dbfdbt0.prg + + source/rdd/dbfdbt/dbfdbt1.c + + + source/rdd/dbffpt/ + + source/rdd/dbffpt/dbffpt0.prg + + source/rdd/dbffpt/dbffpt1.c + * Latest RDD changes, has been made by Przemyslaw Czerpak - synced with xHarbour. + +2003-10-30 19:50 UTC+0100 Ryszard Glab + * source/compiler/harbour.l + * source/compiler/harbour.y + *Fixed support for DO [WITH ...] command + The procedure name is not "uppercased" + For example: + DO MyProc + The compiler look for MyProc.prg file now + (instead of MYPROC.prg) + +2003-10-30 10:45 UTC+0100 Tomaz Zupan + * source/rtl/alert.prg + ! Reverted changes from 2003-09-07 + +2003-10-29 20:15 UTC+0100 Ryszard Glab + * include/hbexprb.c + * source/compiler/exproptb.c + * source/macro/macrob.c + *fixed generation of pcode for {|| &var} + *see below + + * include/hbcomp.h + * source/compiler/cmdcheck.c + * source/compiler/harbour.c + * source/compiler/harbour.y + * source/compiler/hbusage.c + * doc/en/compiler.txt + *added support for DO WITH @variable + *a new compatibility flag -ks was added to enable support for + strings as array of bytes (it is enabled by default). The support + for strings as bytes array is disabled if you use -kc switch + (Clipper compatibility mode) + *when xbase mode is not used (-kc or -kch) then compiler doesn't + generate the pcode for these xbase extended features + For example: + memv:="2,3" + a:={1, &memv, 4} + will generate a runtime 'syntax error' without -kx switch + or will create an array with four elements if -kx was used. + The above rule will apply also for: + var[&index] + func( &argument ) + (expr1, ¯o ) + Notice that the xbase mode is enabled by default. + + * source/rtl/gtapi.c + *fixed GPF in hb_gtBox() when no string was passed + + * source/rtl/gtcrs/gtcrs.c + *improved recognition of xterm compatible terminals + + * source/rtl/gtcrs/Makefile + * source/rtl/gtcrs/kbdcrs.c + + source/rtl/gtcrs/keymap.prg + + source/rtl/gtcrs/eterm.map + + source/rtl/gtcrs/linux.map + *the support for runtime definition of keycodes mapping was added + (translation from terminal key sequences into INKEY() codes) + +eterm.map and linux.map are example files with keycode mapping + +HB_GT_KEYMAP() function was added + + * include/hbapi.h + *Changed declaration of hb_cmdargProcessVM() + + * include/hbapigt.h + * include/hbvm.h + * source/rtl/inkey.c + * source/vm/cmdarg.c + * source/vm/hvm.c + *new function hb_vmFlagEnabled() to query compatibility + at runtime + *new internal command line arguments were added to control + application at runtime: + //FLAGS:switches + this flag controls compatibility issues of the virtual + machine + Available switches: + c - Clipper compatibility + h - Harbour extensions (enabled by default) + s - enable support for strings as array of bytes (enabled + by default) + For example: + myapp //FLAGS:ch + will disable support for strings as array of bytes + + //CANCEL:key + //CANCELEX:keyex + this flag allows change the keycode of application cancel + request (usually Alt-C) - using normal INKEY() keycodes + or extended keycodes (CANCELEX) + For example: + myapp //CANCEL:304 + will change Alt-c into Alt-b for cancelling (Alt-c is used + to insert polish diactric letter) + + * tests/keywords.prg + *fixed to suppress warnings for FIELD and IN keywords if passed + by reference + +2003-10-25 14:45 UTC+0100 Ryszard Glab + * include/hbexprb.c + * source/compiler/exproptb.c + * fixed to stop 'function defined but not used' warning with SIMPLEX + + * source/compiler/harbour.l + * enhanced to support nested '[]' strings created with dumb stingify + match marker (full Clipper compatibility with Flex) + + * source/pp/ppcomp.c + * source/pp/ppcore.c + * fixed support for stingify match markers - full Clipper + compatibility + + * tests/Makefile + * testpp.prg was added into BAD_PRG_SOURCES + + * tests/codebl.prg + * test for references of codeblock parameters was added + + + tests/testpp.prg + * new file to test stringify match markers (this file will + not run - compile it only) + +2003-10-24 11:50 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! Minor fix for calculating the maximum keys number in index page. + Some 3rd party engines ( Crystal Reports ) had problems opening + ntx'es, created by Harbour. + +2003-10-23 15:40 UTC+0100 Ryszard Glab + * source/compiler/harbour.l + * fixed codeblock scanning - this should cure random GPFs + +2003-10-23 11:00 UTC+0100 Ryszard Glab + * include/hbexprc.c + * source/compiler/exproptc.c + * a variable pbUseTextSubst is initialized correctly when + compiled with macro support + + * source/compiler/harbour.l + * (char *) cast was added + + * source/vm/itemapi.c + * check for a loop in variable de-referencing was added + The following code: + var := IIF( .T., @var, var ) + is causing that the variable is referencing itself + (valid syntax in Clipper) + + * source/vm/macro.c + * fixed to link correctly with WATCOM linker + + +2003-10-23 10:30 UTC+0300 Alexander Kresin + * source/rtl/strcase.c + ! hb_strncpyUpper() and hb_strncpyUpperTrim() fixed. + +2003-10-22 9:49 UTC-0800 Luis Krause Mantilla + * makefile.bc + * $(OBJ_DIR)\msgsrwin.obj added to LANG.LIB dependencies section. + +2003-10-22 13:55 UTC+0300 Alexander Kresin + * makefile.bc + * makefile.nt + * makefile.vc + * lang/msgsrwin.c and symbol.prg ( to makefile.nt only ) added. + * source/rdd/dbcmd.c + ! Ordscope() fixed - first parameter is TOPSCOPE by default now. + +2003-10-21 10:23 UTC-0800 Luis Krause Mantilla + * source/vm/codebloc.c + ! Fixed detached local bug (borrowed from xharbour) + * source/rdd/dbcmd.c + ! Fixed bug in __dbLocate() with When clause (borrowed from xharbour) + +2003-10-20 13:45 UTC+0100 Ryszard Glab + * .cvsignore + * Restored previous version + + * include/hbexpra.c + * include/hbexprb.c + * include/hbexprc.c + * include/hbexprop.h + * source/common/expropt1.c + * source/compiler/exproptb.c + * source/compiler/exproptc.c + * source/compiler/harbour.sly + * fixed declaration mismatch in Simplex version + * fixed generation of string's pcode + (introduced with my previous changes) + + * source/pp/ppcore.c + * fixed support for stringify match markers <""> and <()> in Flex + version (for example &var.1 have to be expanded into "&var.1" + instead of var.1 since this is not a valid Clipper expression) + NOTICE! In Simplex version this is not fixed because it is + used as a hack to correctly support macro variables in GET + command. + + * tests/testget.prg + * MEMVAR declaration was added + +2003-10-20 11:37 UTC+0300 Alexander Kresin + * include/hbapi.h + * The declaration of hb_objSendMsg() added. + * source/rdd/dbfntx/dbfntx1.c + ! bug fixed in soft seeking. + +2003-10-17 18:08 UTC+0100 Ryszard Glab + + * include/hbapi.h + * include/hbcomp.h + * include/hbexpra.c + * include/hbexprb.c + * include/hbexprc.c + * include/hbexprop.h + * source/common/expropt1.c + * source/compiler/expropta.c + * source/compiler/exproptb.c + * source/compiler/exproptc.c + * source/compiler/harbour.c + * source/compiler/harbour.l + * source/compiler/harbour.sly + * source/compiler/harbour.y + * source/compiler/hbgenerr.c + * source/macro/macro.y + * source/macro/macroa.c + * source/macro/macrob.c + * source/macro/macroc.c + * Fixed support for late/early evaluation of macro exressions in + a codeblock (Flex version) (see tests/tstblock.prg for a sample) + Harbour(flex) is now full Clipper compatible here. + + * config/dos/watcom.cf + * source/rdd/dbfcdx/dbfcdx1.h + * source/common/hbffind.c + * include/hbrddcdx.h + * include/hbmath.h + * Changed to compile correctly with WATCOM compilers + +2003-10-16 13:17 UTC+0100 Antonio Linares + * source/rtl/round.c + ! hb_numRound() completely redesigned + Source code provided by Vicente Aranzana. + + Vicente Aranzana kindly requests to have CVS developer access rights. + +2003-10-10 10:00 UTC+0100 Antonio Linares + * source/rtl/round.c + ! changes on round() function, proposed by Vicente Aranzana. + Based on his tests, the changes are working ok. + +2003-10-08 14:24 UTC+0300 Alexander Kresin + * Makefile + * contrib/Makefile + * Makefiles are changed to build some contribution libraries. + * source/vm/classes.c + * hb_objSendMsg() function added ( borrowed from xHarbour ). + It makes it more easy to set/get values of object variables, + execute object methods from the C level. + +2003-10-07 12:06 UTC+0200 Chen Kedem + * doc/whatsnew.txt + * Update build 43 release date + +2003-10-04 20:18 UTC+0300 Alexander Kresin + * contrib/ole/ole2.c + * Some changes needed for Mingw. + + contrib/ole/Makefile + + Makefile added. + +2003-09-29 16:12 UTC-0800 Luis Krause Mantilla + * contrib/rdd_ads/adsfunc.c + * contrib/rdd_ads/doc/en/adsfuncs.txt + + Added 2 (ignored) & 3rd params to adsKeyNo() in order to perform + like OrdKeyNo() for other RDD's. The default remains ADS_IGNOREFILTERS + for compatibility (like adsKeyCount() does). + Updated documentation in adsfuncs.txt + +2003-09-29 22:10 UTC+0300 Alexander Kresin + *source/rtl/strcase.c + ! hb_strncpyUpperTrim() is fixed ( borrowed from xHarbour ). + * include/hbver.h + * Release info has been corrected again ... + +2003-09-29 15:20 UTC+0300 Alexander Kresin + *source/rtl/strcase.c + ! hb_strncpyUpper() is fixed ( borrowed from xHarbour ). + * make_tgz.sh + * bin/pack_src.sh + * release info changed + * include/hbver.h + * Release info has been corrected again :). + +2003-09-29 11:47 UTC+0300 Chen Kedem + * doc/whatsnew.txt + + Added information about builds 10..25, 43 based on information + found on the Harbour site and the mail list. + +2003-09-29 11:25 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + * Signature byte for ntx files is changed to be Clipper compatible. + * include/hbver.h + * Release info has been corrected + +2003-09-29 09:10 UTC+0200 Tomaz Zupan + * harbour.spec + * Release info has been changed. + +2003-09-26 22:10 UTC+0300 Alexander Kresin + * source/compiler/hbusage.c + ! Year has been changed in copyright statement ( 2003 instead of 2002 ). + * include/hbver.h + * Release info has been changed. + +2003-09-26 09:18 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! Bug fixed in ntxSeek(), reported by Przemyslaw Czerpak - + index unlocking wasn't present in some occasions. + +2003-09-22 17:07 UTC-0800 Luis Krause Mantilla + * contrib/rdd_ads/adsfunc.c + ! fixed parameter error handling in AdsSetAOF (borrowed from xHarbour) + +2003-09-18 16:33 UTC-0800 Luis Krause Mantilla + * contrib/rdd_ads/ads1.c + ! Fixed bug when passing a numeric to adsCustomizeAOF() (Nil and + array worked ok). Thanks to Brian Hays for the fix. + * include/ads.ch + ! The ROLLBACK TRANSACTION command was translating to + AdsRollbackTransaction() instead of just AdsRollback() + +2003-09-18 10:20 UTC+0100 Antonio Linares + * source/rdd/dbcmd.c + ! Fixed several places more where hb_strncpyUpper() was wrongly used + +2003-09-18 10:00 UTC+0100 Antonio Linares + * source/rdd/dbcmd.c + ! definition required for MSVC + * source/rdd/dbfcdx/dbfcdx1.c + ! some typecastings required for MSVC + +2003-09-17 21:41 UTC+0100 Antonio Linares + * source/rdd/dbcmd.c + ! fixed bug on hb_strncpyUpper() use from DbUseArea() + +2003-09-17 10:54 UTC-0800 Luis Krause Mantilla + * source/rtl/tget.prg + ! Fixed bug in unTransform() method that truncated + trailing spaces in variable when using "@R" template + Borrowed from xharbour by Andi Jahja: + * source/common/reserved.c + * utils/hbdoc/genrtf.prg + * utils/hbdoc/genng.prg + + Add option to omit reserved words by adding -DHB_RESERVED_OFF (default is ON) + + /* + This may be useful when one is working with pCode DLL where he must redefine + reserved words as dummy functions in the DLL. + */ + +2003-09-15 12:50 UTC+0300 Alexander Kresin + * source/rdd/dbf1.c + * source/rdd/dbfntx/dbfntx1.c + ! Bug fixed in hb_IncString(), reported by Przemyslaw Czerpak - + now this function respects the national sorting rules. + ! Bug fixed in hb_ntxTagKeyNo(), reported by Przemyslaw Czerpak - + index unlocking wasn't present in some occasions. + ! Bug fixed with scoping, reported by Giovi Verrua. + +2003-09-11 11:30 UTC+0200 Przemyslaw Czerpak + * harbour.spec + * small fix in auto platform detection (thanks to Tomaz Zupan) + * make_tgz.sh + * added auto platform detection + +2003-09-11 01:00 UTC+0200 Tomaz Zupan + * harbour.spec + * swiched back to gtcrs + +2003-09-11 00:47 UTC+0200 Tomaz Zupan + * harbour.spec + * Added automatic platform resolution (borrowed from courier-imap project) + * make_rpm.sh + * small fix needed to work with Mandrake Linux + +2003-09-10 23:27 UTC+0200 Przemyslaw Czerpak + * harbour.spec + * make_tgz.sh + * small fix + +2003-09-10 21:37 UTC+0200 Przemyslaw Czerpak + * harbour.spec + + new spec file. It creates four binary RPMs with shared and + static libs core harbour compiler and tools and with Ron's PP + which allow to run xBase files as scripts on *nix platform + and new tool hbcmp, hbcc, hblnk, hbmk. + For details see README.RPM + Please remember that PP has poor GPL license. It is noticed in RPM + headers. + + + hbgtmk.sh + + simple script which connect to SourceForge CVS takes sources and + build RPMs from them. + + + make_rpm.sh + + script for checking dependences and making RPMs + + + make_tgz.sh + + script for making binary package for this Linux distro which don't + support RPM + + + bin/hb-mkslib.sh + + script for building shared libs from static ones and/or object files + + + bin/pack_src.sh + + script for packing harbour sources + + * Makefile + * source/compiler/harbour.c + * source/common/hbver.c + * source/vm/cmdarg.c + * source/vm/fm.c + * source/vm/hvm.c + * changes for some new futures in hb{cmp,lnk,mk} tools + + * contrib/libct/datetime.prg + - redundant STOD removed (this function is part of RTL) + + * contrib/dot/pp.prg + * contrib/dot/pp.txt + * contrib/dot/pp_harb.ch + * contrib/dot/rp_dot.ch + * contrib/dot/rp_run.ch + * upadting for runing xBase files as scripts. + +All this changes (except Ron's PP) are my work borrowed from xHarbour. + +2003-09-10 15:00 UTC-0400 David G. Holm + * config/dos/bcc16.cf + * config/os2/icc.cf + ! Disabled the LONGLONG and UNLONGLONG definitions in hbdefs.h, which + only work for GCC and Windows, by defining HB_LONG_LONG_OFF. + * source/common/hbstr.c + * source/compiler/harbour.l + * source/rtl/val.c + ! Moved the duplicate definitions of hb_strVal to source/common/hbstr.c. + * source/rtl/symbol.prg + ! Removed static declarations from GETSYMBOLPOINTER, GETSYMBOLNAME, and + SYMBOL_EXEC in order to eliminate static vs. extern errors in os2/icc + builds. + * source/rdd/dbfcdx/dbfcdx1.c + ! Corrected two instances of (unsigned char *) typecasts on hb_fs... + functions, which use BYTE * parameters, not unsigned char * (the + distinction is very important for those builds that use C++ mode. + +2003-09-10 09:45 UTC-0300 Antonio Carlos Pantaglione + * source/vm/arrayshb.c + ! More clipper compatible on ADel(). + +2003-09-09 14:16 UTC+0300 Alexander Kresin + * source/pp/ppcore.c + ! Bug fixed in preprocessor, reported by Randy Portnoff. + +2003-09-07 13:58 UTC+0200 Tomaz Zupan + * source/rtl/gtcrs/gtcrs.c + ! fixed displaying of boxes in xterm + * source/rtl/alert.prg + ! changed BoxString parameter while displaying box to NIL. It + is needed to corectly display alert box in xterm. + +2003-08-29 07:03 UTC+0100 Antonio Linares + * source/vm/hvm.c + ! Fix implemented for -0.0 on hb_vmPushDouble() as proposed by + Alejandro de Garate , and on hb_PushDoubleConst() + (I guess this place may be a source for such bug too). + + This fix should solve the bug described by Don Lowenstein regarding -0.0 result + . + +2003-08-24 14:30 UTC+0200 Tomaz Zupan + * utils/hbdoc/genhtm.prg + * removed trailing EOL from category name, because category is also used + as file name. + +2003-08-23 13:20 UTC+0200 Tomaz Zupan + * utils/hbdoc/ffile1.prg + ! fixed end of line handling now it works on platforma other than windows + * utils/hbdoc/genhtm.prg + ! fixed getitem function (in certain situation it returned NIL instead + of logical value and prevented it to try access array beyond its bounds) + * Changed backslashes into slashes (\ -> /) + * utils/hbdoc/hbdoc.prg + * doc/genhtm.rsp + * Changed backslashes into slashes (\ -> /) + +2003-08-22 12:10 UTC+0100 Antonio Linares + + source/rtl/color53.prg + + source/rtl/mssgline.prg + ! modules borrowed from xharbour (required for recent ttopbar.prg changes) + + * makefile.bc + * makefile.nt + * makefile.vc + * source/rtl/Makefile + + added modules mssgline.prg and color53.prg + + * include/hbapicdp.h + + Added hb_cdpchrcmp() prototype + + * include/hbdefs.h + + Added support for ULONLONG + + * include/hbrddcdx.h + * source/rdd/dbfcdx/dbfcdx1.c + * source/rdd/dbfcdx/dbfcdx2.h + + Freeing pages implemented + + redistributing keys implemented + * small speed improvement + ! And many bug fixes + (changes borrowed from xharbour - developed by Przemyslaw Czerpak ) + + * source/rtl/cdpapi.c + ! sync with xharbour (changes required for DBFCDX improvements) + +2003-08-22 11:26 UTC+0100 Antonio Linares + * source/rtl/ttopbar.prg + ! some required formating + +2003-08-21 13:36 UTC+0100 Antonio Linares + * source/rtl/ttopbar.prg + + MenuModal() implementation - changes borrowed from xHarbour, + which borrowed used Class TopBarMenu from Harbour. + + With this function, David Macias reported bug of missing functions, is + answered, as the functions names should not be truncated to 10 chars, + also MAKEDIR() should be used instead of DIRMAKE(), and MemoSetSuper() + implementation is pending on RDD experts development. + +2003-08-21 12:37 UTC+0100 Antonio Linares + * source/rtl/teditor.prg + ! Modified to allow inherited classes to properly manage K_ESC + * source/rtl/memoedit.prg + ! K_ESC and CTRL-W Clipper compatible management + + MemoEdit() bugs described by David Macias, already fixed. + + The only difference there is with Clipper is that Clipper does not shows + the message "Abort Edit? (Y/N)" if the text has not been modified, but + Class HBEditor does not provides a DATA lModified by now. + +2003-08-21 11:29 UTC+0100 Antonio Linares + * contrib/samples/environ.c + ! Fixed GPF on missing dot for FileExt() use + + Bug described by David Macias, and he confirmed the fix too, with this change. + +2003-08-19 23:00 UTC+0300 Alexander Kresin + + harbour.spec + spec file to build rpm is added. + * source/debug/debugger.prg + ! Fix, provided by Lorenzo Fiorini + +2003-08-07 22:50 UTC+0300 Alexander Kresin + * source/rdd/dbcmd.c + ! Fix in LOCATE REST WHILE ... FOR ..., provided by Alexander Prostoserdov + * source/rdd/dbfntx/dbfntx1.c + * support of binary keys implemented. + +2003-08-04 14:00 UTC-0400 David G. Holm + * source/rtl/gtapi.c + ! Enforce Clipper compatibility for SCROLL by only calling hb_gt_Scroll + from hb_gtScroll if left <= right and top <= bottom. + +2003-07-30 14:30 UTC-0400 David G. Holm + * include/set.ch + ! Indicate that there are six (6) Harbour SET extensions. + +2003-07-30 08:28 UTC+0300 Chen Kedem + * doc/en/set.txt + + Added _SET_EOF text from the changelog entry written by + David G. Holm and mark it Harbour extension. + +2003-07-28 22:00 UTC-0400 David G. Holm + * include/hbset.h + * include/set.ch + * source/pp/pptable.c + * source/rtl/dbdelim.prg + * source/rtl/dbsdf.prg + * source/rtl/set.c + + New SET value named _SET_EOF. Defaults to FALSE on UN*X, but defaults + to TRUE on everything else. If set to FALSE, then CHR(26) does not get + written when using COPY TO DELIMITED, COPY TO SDF, or when closing any + of the various text files that are created using various SET values. + +2003-07-21 11:10 UTC-0300 Antonio Carlos Pantaglione + * source/rtl/transfrm.c + ! Fixed the problem with @E and negative numbers. + + local nValue := -134.24 + msginfo( Val( AllTrim( Transform( nValue, "@E 99,999.99" ) ) ) ) + msginfo( Val( AllTrim( Transform( nValue, "@E99,999.99" ) ) ) ) + + Thanks to Enrico Maria Giordano for this fix. + +2003-07-17 23:00 UTC-0300 Antonio Carlos Pantaglione + * source/rtl/transfrm.c + ! Removed some old commented lines + + * contrib/rdd_ads/adsfunc.c + ! Update transaction functions + ! Add AdsCacheRecords function + + * source/rdd/dbcmd.c + ! Modified error handling to allow retry if alias is not exist during + DBSelectArea() for Clipper compatibility. (Reported by Giovi Verrua) + * source/vm/hvm.c + ! More Clipper compatible to handle FOR-NEXT loops. + Changes by Andi Jahja, borrow from xharbour + +2003-07-17 17:43 UTC-0400 Alejandro de Garate + * doc/en/memo.txt + + Added MEMOREAD(), MEMOWRIT() documentation + * doc/es/memo.txt + + Added MEMOREAD(), MEMOWRIT() documentation + +2003-07-17 17:34 UTC-0400 Alejandro de Garate + * source/rtl/memofile.c + + Added an optional 3rd parameter to MEMOWRIT(), , to decide + at run-time if EOF char should be written. + +2003-07-16 13:00 UTC-0300 Antonio Carlos Pantaglione + * contrib/rdd_ads/ads1.c + ! Changes in adsPutValue for speed(). Tested with + ADS Local 6.2, not tested with prior versions of ADS. + +2003-07-14 13:50 UTC-0300 Antonio Carlos Pantaglione + * contrib/rdd_ads/ads1.c + * contrib/rdd_ads/adsfunc.c + ! Changes in adsGetValue and AdsKeyCount() for speed(). Tested with + ADS Local 6.2, not tested with prior versions of ADS. + +2003-07-14 14:39 UTC+0100 Antonio Linares + * source/vm/classes.c + + HB_SETCLSHANDLE() implemented + + Syntax: HB_SetClsHandle( , ) --> + + Real dirty function, though very usefull under certain circunstances: + It allows to change the class handle of an object into another class handle, + so the object behaves like a different Class of object. + Based on objects.lib SetClsHandle(). + +2003-07-14 09:10 UTC-0300 Antonio Carlos Pantaglione + * source/rtl/memoline.c + ! Fixed a bug by missed () in HB_CHAR_SOFT1 compare. + +2003-07-13 14:13 UTC-0400 Alejandro de Garate + + doc/es/gnulice.txt + + doc/es/hvm.txt + + doc/es/input.txt + + doc/es/macro.txt + + doc/es/memvar2.txt + + doc/es/misc.txt + + doc/es/nation.txt + + doc/es/objfunc.txt + + doc/es/rdd.txt + + doc/es/sayget.txt + + doc/es/subcodes.txt + + doc/es/tbrowse.txt + + doc/es/tclass.txt + + doc/es/tgetlist.txt + + doc/es/tlabel.txt + + doc/es/treport.txt + + doc/es/var.txt + + Added new doc files in spanish + +2003-07-13 14:08 UTC-0400 Alejandro de Garate + * doc/es/Makefile + + gnulice.txt + + hvm.txt + + input.txt + + macro.txt + + memvar2.txt + + misc.txt + + nation.txt + + objfunc.txt + + rdd.txt + + sayget.txt + + subcodes.txt + + tbrowse.txt + + tclass.txt + + tgetlist.txt + + tlabel.txt + + treport.txt + + var.txt + + Added references to new doc files + +2003-07-13 12:32 UTC-0400 Alejandro de Garate + * doc/es/lang.txt + ! Fixed accents, etc, minor formating. Now in sync with english version + +2003-07-13 12:24 UTC-0400 Alejandro de Garate + * doc/es/hbpplib.txt + * doc/es/howtobsd.txt + * doc/es/idle.txt + * doc/es/license.txt + * doc/es/math.txt + * doc/es/memo.txt + * doc/es/pcode.txt + * doc/es/pragma.txt + * doc/es/readme.txt + * doc/es/setmode.txt + * doc/es/simplex.txt + * doc/es/statics.txt + * doc/es/strotype.txt + * doc/es/tracing.txt + * doc/es/vm.txt + ! Fixed errors, misspelling, accents, etc, minor formating + +2003-07-13 10:52 UTC-0400 Alejandro de Garate + * doc/es/array.txt + * doc/es/binnum.txt + * doc/es/browse.txt + * doc/es/clipper.txt + * doc/es/cmdline.txt + * doc/es/codebloc.txt + * doc/es/command.txt + * doc/es/compiler.txt + * doc/es/datetime.txt + * doc/es/dbdelim.txt + * doc/es/dbsdf.txt + * doc/es/dbstrux.txt + * doc/es/dir.txt + * doc/es/dirstruc.txt + * doc/es/diskspac.txt + * doc/es/error.txt + * doc/es/eval.txt + * doc/es/garbage.txt + * doc/es/harbext.txt + * doc/es/hb_set.txt + ! Fixed errors, misspelling, accents, etc, minor formating + +2003-07-12 13:02 UTC+0100 Antonio Linares + * source/rtl/philes.c + ! FRead() bug fixed, introduced cause 1 byte length strings optimization + + Bug described by Guy Roussin: + + function main( cFile ) + local nH + local cBuf:=" " + local cBlock := "{|| Alert( 'test' ) }" + nH:=fopen(cFile,0) + while fread(nH,@cBuf,1)>0 ; end + fclose(nH) + eval( &( cBlock ) ) + return(NIL) + +2003-07-12 10:06 UTC+0100 Antonio Linares + * source/debug/debugger.prg + * source/rtl/philes.c + ! Enhancements developed by Lorenzo Fiorini. + + Lorenzo: Please supply us a description of what you have implemented. + +2003-07-10 17:43 UTC-0300 Antonio Carlos Pantaglione + * source/rtl/memoline.c + ! Fixed bug with soft returns. Clipper compatible. + +2003-07-09 07:20 UTC-0300 Antonio Carlos Pantaglione + * source/rtl/transfrm.c + ! Fix with numeric values and pictures with spaces and pictures with + severals dot. Changes by Walter Negro, borrow from xharbour. + The return values are compliant with Clipper. + eg: Transform( 1234, "9 999" ) + eg: Transform( 123.123456, "999.99.99.99" ) + PS: I comment ALL old lines with //Toninho@fwi and. If all is Ok, I delete it. + +2003-07-08 23:00 UTC-0300 Antonio Carlos Pantaglione + ! Sync with changes made in xHarbour by Walter Negro + * contrib/rdd_ads/ace.h + ! Fix warning in declaration of function + * contrib/rdd_ads/ads1.c + * contrib/rdd_ads/adsfunc.c + ! Fix error and potential error of AE_INSUFFICIENT_BUFFER in + some functions. + The len of buffer should include the NULL char. + ! Fix, now adsGoTo() test if the new position is EOF. + +2003-07-08 14:25 UTC-0300 Antonio Carlos Pantaglione + * contrib/rdd_ads/ads1.c + ! Fixed: deleted() return TRUE when is at eof(), borrow from xHarbour. + +2003-07-08 11:27 UTC+0300 Chen Kedem + * doc/en/lang.txt + + Added the following to HB_LANGSELECT() list of supported ID's: + Slovenian 437 + +2003-08-03 10:20 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! Bug fixed in ntxOrderListRebuild - sometimes GPF appared if packing/reindexing + was made after intensive replace operations. + +2003-07-07 11:12 UTC-0300 Antonio Carlos Pantaglione + * include/hbclass.ch + + Added support for PROCEDURE CLASS syntax. + +2003-07-03 15:00 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! Bug fixed in ntxZap. + +2003-07-03 11:46 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! Bug fixed, which appeared after switching between orders and following skipping. + +2003-07-03 10:54 UTC+0300 Alexander Kresin + + source/codepage/cdpsl437.c + + source/lang/msgsl437.c + + New codepage and lang modules for Slovenian 7bit 437, provided by + Mitja Podgornik + * source/codepage/cdpsl852.c + * source/codepage/cdpsliso.c + * source/codepage/cdpslwin.c + ! Some fixes, provided by Mitja Podgornik + * makefile.bc + * makefile.nt + * makefile.vc + * source/codepage/Makefile + * source/lang/Makefile + * Makefiles updated. + +2003-07-03 10:00 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! Bug fixed - there was memory leak after INDEX ON ... ADDITIVE if there + were no open indexes + * source/rdd/dbf1.c + ! Problem fixed for the cases when the field name exceeds 10 characters. + * Codepage translation added for memo fields. + * source/codepage/cdppt850.c + * source/codepage/cdpptiso.c + ! Comment delimiters bug fixed. + +2003-07-02 11:35 UTC-0300 Antonio Carlos Pantaglione + * source/compiler/harbour.slx + ! Add 'static' in definition of hb_comp_SLX_InterceptAction and + hb_comp_SLX_CustomAction. + +2003-07-02 09:25 UTC+0100 Antonio Linares + * makefile.nt + * makefile.vc + + Added gencli.c module + + * include/hbcomp.h + + Added hb_compGenILCode() prototype + + * source/compiler/gencli.c + * source/rdd/dbf1.c + + Added some MSVC required typecasts + + * source/rdd/dbfcdx/dbfcdx1.c + + Added most recent Horacio's development + +2003-06-30 10:50 UTC-0300 Antonio Carlos Pantaglione + * source/contrib/rdd_ads/ads1.c + ! Fixed problem on adsGoTo() method when using ADT files. Borrow from xHarbour. + +2003-06-30 18:33 UTC+0100 Antonio Linares + * source/compiler/gencli.c + + Added support for multidimensional arrays for Harbour.NET + ! .NET IL implementation for HB_ARRAYGEN, HB_P_FUNCTIONSHORT, HB_P_ARRAYPUSH + ! Enhanced HB_DOSHORT + + Added ObjArrayGen(), ObjArrayPush() and LEN() (Len() support just for arrays). + + Notice: I want to publically thank Microsoft tech support forums for .NET. There + are great guys there providing superb tech support. + + This code is already working ok with Harbour.NET: + + function Main() + + local a := { 123, "hello", { "nested", "array", { 5, "more" } }, .t., "another" } + + ? a[ 1 ] + ? a[ 3 ][ 2 ] + ? a[ 3 ][ 3 ][ 2 ] + ? a[ 5 ] + + ? "done!" + + return nil + + Warning: Arrays elements assignment is not implemented yet. + +2003-06-28 22:52 UTC+0100 Antonio Linares + * source/compiler/gencli.c + + Added support for logical values management + ! .NET IL implementation for HB_P_TRUE, HB_P_FALSE, HB_P_NOT + + Added ObjNot( object ) for HB_P_NOT support + +2003-06-28 14:41 UTC+0100 Antonio Linares + * source/compiler/gencli.c + + do case implemented for Harbour.NET + ! .NET IL implementation for HB_P_JUMP, HB_P_EXACTLYEQUAL + + Added ObjExactlyEqual( object, object ) for HB_P_EXACTLYEQUAL support + +2003-06-28 11:56 UTC+0100 Antonio Linares + * source/compiler/gencli.c + + for...next loops implemented for Harbour.NET + ! .NET IL implementation for HB_P_PUSHLONG, HB_P_FORTEST + + Added ObjForTest( object, object, object ) for HB_P_FORTEST support + +2003-06-28 01:10 UTC+0100 Antonio Linares + * source/compiler/gencli.c + + .NET IL implementation for HB_P_JUMPFALSENEAR, HB_P_JUMPNEAR + + Added labels to each IL generated source code line + + Added ObjLessEqual( object, object ) for "<=" operator support + ! AddObjects() renamed into ObjAdd( object, object ) for "+" operator support. + + Notice: Some "nop" has been added to match Harbour opcodes offsets. We may remove + them later on. This code is working ok: + + function Main() + + local n := 11 + + if n <= 10 + ? "less-equal 10" + else + ? n + ? "greater 10" + endif + + n = 5 + + if n <= 10 + ? n + ? "less-equal 10" + else + ? "greater " + endif + + ? "done!" + + return nil + +2003-06-27 16:07 UTC+0100 Antonio Linares + * source/compiler/gencli.c + ! .NET IL implementation for HB_P_PLUS + ! New .NET function AddObjects() for adding "object" type variables + + Notice: As Harbour.NET uses IL "object" type for storing variables, the + new implemented AddObjects() functions is used for adding variables. This + code already works ok: + + function Main() + + local n := 10, c := "Hello World" + + ? n + 20 + ? c + " from Harbour.NET" + ? "done!" + + return nil + + Warning: Date variables type have not been implemented in AddObjects() yet, and + also it is not generating an error when adding different types values. + +2003-06-27 12:13 UTC+0100 Antonio Linares + * source/compiler/gencli.c + ! .NET IL implementation for HB_P_PUSHBYTE + + Notice: This opcode is responsible for placing a byte onto the stack. + As all Harbour variables are going to be managed as object type (meanwhile + we don't implement strong typing), a box (to turn a value into an object) + process is also performed. We may check later on if this is needed for all + processes. + + This test already works: + + function Main() + + local n := 123 + + ? n + + ? 10 + + return nil + +2003-06-27 10:21 UTC+0100 Antonio Linares + * source/compiler/gencli.c + ! .NET IL implementation for HB_P_POPLOCALNEAR and HB_P_PUSHLOCALNEAR + + Notice: These opcodes are responsable for loading the values on the locals and + also for pushing the locals contents onto the virtual machine stack. + + You can already run tests like this: + + function Main() + + local c := "Hello world from Harbour.NET !" + + ? c + + return nil + + Remember the process to build a .NET app: + + Harbour.exe -gi -n hello.prg --> hello.il + ilasm.exe hello.il --> hello.exe (for .NET) + +2003-06-27 09:13 UTC+0100 Antonio Linares + * source/compiler/gencli.c + ! .NET IL implementation for HB_P_FRAME + + Notice: HB_P_FRAME is generated for declaring locals and params. On IL + only locals are declared. Params are declared on the same (function) method + declaration. Strong typing is not supported yet. + + To test it simply declare several locals, compile using /gi and check the + .IL created file. + +2003-06-25 08:32 UTC+0100 Antonio Linares + * source/compiler/gencli.c + ! object type use implementation for QOUT() + + Notice: Harbour (as Clipper) any type value vars support is implemented + through the use of IL object type. I consulted this idea with Miguel de + Icaza and he agreed. + + So all variables types are declared as object, unless strong typing is + required ( AS ... ), then we will use specific types instead of object one. + +2003-06-23 17:56 UTC+0100 Antonio Linares + * source/compiler/gencli.c + ! Some quick & dirty implementations, to provide an IL overview + + Notice: Hello.prg already works on .NET :-) + +2003-06-23 15:10 UTC+0200 Tomaz Zupan + * source/compiler/Makefile + + Added gencli.c + * source/rtl/Makefile + + Added symbol.prg + +2003-06-23 13:15 UTC+0100 Antonio Linares + * source/compiler/gencli.c + ! The IL fun begins :-) + + Notice: Of course don't even try to compile the resulting IL generated files + yet, but you can start reviewing the so-early design already :-) + +2003-06-23 10:53 UTC+0100 Antonio Linares + * makefile.bc + + gencli.c module added + + Please update other makefiles. + +2003-06-23 10:20 UTC+0100 Antonio Linares + + source/compiler/gencli.c + ! Compiler .NET .il source generation + * It is just a copy of genc.c with some minor changes, just to set a + starting point for IL generation. + + * include/hbcomp.h + * source/compiler/cmdcheck.c + * source/compiler/harbour.c + * source/compiler/hbusage.c + + Added support for IL generation + + Warning: This is not even an early prototype :-) More coming soon... + +2003-06-23 10:05 UTC+0300 Chen Kedem + * doc/en/lang.txt + + Added the following to HB_LANGSELECT() list of supported ID's: + Serbian Windows-1251 + + * source/lang/msghe862.c + * source/lang/msghewin.c + ! fix Hebrew typo + + * source/lang/msgsrwin.c + ! add missings commas + +2003-06-18 02:05 UTC+0200 Przemyslaw Czerpak + * source/codepage/Makefile + * source/codepage/cdpesdos.c + * source/codepage/cdpeswin.c + * source/codepage/cdpgedos.c + * source/codepage/cdppliso.c + * source/codepage/cdpplmaz.c + * source/codepage/cdpplwin.c + * source/codepage/cdpslwin.c + - source/codepage/cdpla850.c + + source/codepage/cdppt850.c + + source/codepage/cdpptiso.c + * makefile.bc + * makefile.nt + * makefile.vc + * corrections in code page description. + - removed cdpla850.c ("PT" codepage) + + PT850 and PTISO codepages added. + * makefiles updated - Sorry, I cannot test all of them. + +2003-06-18 00:10 UTC+0200 Przemyslaw Czerpak + * include/hbapilng.h + * include/hblang.ch + * source/lang/Makefile + * source/lang/msg_tpl.c + * source/lang/msgca.c + * source/lang/msgcs852.c + * source/lang/msgcsiso.c + * source/lang/msgcskam.c + * source/lang/msgcswin.c + * source/lang/msgde.c + * source/lang/msgdewin.c + * source/lang/msgen.c + * source/lang/msgeo.c + * source/lang/msges.c + * source/lang/msgeswin.c + * source/lang/msgeu.c + * source/lang/msgfr.c + * source/lang/msggl.c + * source/lang/msghe862.c + * source/lang/msghewin.c + * source/lang/msghr852.c + * source/lang/msghriso.c + * source/lang/msghu852.c + * source/lang/msghucwi.c + * source/lang/msghuwin.c + * source/lang/msgid.c + * source/lang/msgis850.c + * source/lang/msgit.c + * source/lang/msgko.c + * source/lang/msgpl852.c + * source/lang/msgpliso.c + * source/lang/msgplmaz.c + * source/lang/msgplwin.c + * source/lang/msgpt.c + * source/lang/msgro.c + * source/lang/msgru866.c + * source/lang/msgrukoi.c + * source/lang/msgruwin.c + * source/lang/msgsl852.c + * source/lang/msgsliso.c + * source/lang/msgslwin.c + * source/lang/msgsr852.c + * source/lang/msgsriso.c + * source/lang/msgzhb5.c + * source/lang/msgzhgb.c + + source/lang/msgsrwin.c + ! bug fixed in national msg system and new localization added + (borrowed from xHarbour) + + + tests/langmsg.prg + * simple test program for national messages + I have to ask developpers to run it and check their national messages + +2003-06-17 21:50 UTC+0300 Alexander Kresin + * source/rtl/cdpapi.c + ! Bug fixed in hb_cdpTranslate() and hb_cdpnTranslate() + * source/rdd/dbf1.c + * RDD works Ok now, if field names in dbf are in lower case ( this + may be if dbf created by other dbms ) + * source/codepage/cdprukoi.c + ! Bug fixed. + +2003-06-17 17:22 UTC+0100 Antonio Linares + * source/debug/debugger.prg + * source/debug/dbgwa.prg + ! some fixes implemented by Ian Anderson + +2003-06-17 09:08 UTC+0300 Chen Kedem + * doc/en/lang.txt + + Added the following to HB_LANGSELECT() list of supported ID's: + German ANSI, Spanish ANSI, Polish Windows-1250, Slovenian 852, + Slovenian ISO-8859-2, Slovenian Windows-1250 + +2003-06-16 21:16 UTC+0300 Alexander Kresin + * source/rtl/cdpapi.c + ! Bug fixed in hb_cdpTranslate() and hb_cdpnTranslate() + * source/lang/msg_tpl.c + * source/lang/msgca.c + * source/lang/msgcs852.c + * source/lang/msgcsiso.c + * source/lang/msgcskam.c + * source/lang/msgcswin.c + * source/lang/msgde.c + * source/lang/msgdewin.c + * source/lang/msgeo.c + * source/lang/msges.c + * source/lang/msgeswin.c + * source/lang/msgeu.c + * source/lang/msgfr.c + * source/lang/msggl.c + * source/lang/msghe862.c + * source/lang/msghewin.c + * source/lang/msghr852.c + * source/lang/msghriso.c + * source/lang/msghu852.c + * source/lang/msghucwi.c + * source/lang/msghuwin.c + * source/lang/msgid.c + * source/lang/msgis850.c + * source/lang/msgit.c + * source/lang/msgko.c + * source/lang/msgpt.c + * source/lang/msgro.c + * source/lang/msgsr852.c + * source/lang/msgsr852.c + * source/lang/msgzhb5.c + * source/lang/msgzhgb.c + ! Missing comma inserted. + + source/lang/msgsl852.c + + source/lang/msgsliso.c + + source/lang/msgslwin.c + + Slovenian language files added, provided by Mitja Podgornik + + source/codepage/cdpsl852.c + + source/codepage/cdpsliso.c + + source/codepage/cdpslwin.c + + Slovenian codepage files added, provided by Mitja Podgornik + Collating sequences are also valid for Croatian, Macedonian and Serbian (latin) language. + * source/codepage/Makefile + * source/lang/Makefile + * makefile.bc + * makefile.nt + * makefile.vc + * Makefiles are changed to compile new lang and codepage files. + +2003-06-15 14:20 UTC+0200 Przemyslaw Czerpak + * source/lang/msgen.c + * source/lang/msgpl852.c + * source/lang/msgpliso.c + * source/lang/msgplmaz.c + ! the bug reported by Alexander in msgru* fixed. + + source/lang/msgplwin.c + + added msgplwin (cp1250) + + * source/rtl/inkey.c + * removed dirty hack which degrease performance of inkey() on *nix + platforms. + +2003-06-14 21:25 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! Bug fixed, related to seek with lLast and go bottom with scope set. + * source/lang/msgru866.c + * source/lang/msgrukoi.c + * source/lang/msgruwin.c + ! Bugs fixed. + +2003-06-14 15:48 UTC+0100 Antonio Linares + * source/debug/debugger.prg + ! Some enhancements by Ian Anderson, but modified as they were implemented + on an older Harbour version source code. + ! Some improvements. + + * source/debug/dbgtwin.prg + ! some changes by Ian Anderson + + Warning: Work in progress. Thanks Ian. + +2003-06-14 15:22 UTC+0100 Antonio Linares + * source/rtl/transfrm.c + ! temporary fix waiting for users feedback + + It fixes the reported bug: + + function Main() + + local nValue := -134.24 + + ? AllTrim( Transform( nValue, "@E 99,999.99" ) ) // Harbour returns "- 134,24" + ? AllTrim( Transform( nValue, "@E99,999.99" ) ) // and Clipper "-134.24" + + return nil + + Notice that a Val() of the first wrong returned value generates zero, meanwhile + the second one returns the original nValue, as expected. + +2003-06-14 09:23 UTC+0100 Antonio Linares + * include/hbrddcdx.h + * source/rdd/dbfcdx/dbfcdx1.c + * source/rdd/dbfcdx/dbfcdx1.h + * source/rdd/dbfcdx/dbfcdx2.h + ! Recent changes and enhancements on DBFCDX from Horacio. + + Thanks Horacio! + +2003-06-09 11:26 UTC+0100 Antonio Linares + * source/rtl/tget.prg + ! fix on Method Picture() provided by Lorenzo Fiorini + +2003-06-09 00:38 UTC+0100 Antonio Linares + * source/debug/debugger.prg + + CallStack navigation support. + ! Improved variables editing. + +2003-06-06 15:53 UTC+0200 Tomaz Zupan + * source/rtl/console.c + + Added a PRG-callable functions HB_GETSTDIN and HB_GETSTDOUT, + to get stdin and stdout file handle. + +2003-06-06 10:51 UTC+0100 Antonio Linares + * makefile.bc + * makefile.vc + ! symbol module added + + Notice: Please update other make files. + +2003-06-06 09:35 UTC+0100 Antonio Linares + + source/rtl/symbol.prg + ! Harbour implementation of Class(y) Class Symbol + +2003-05-31 21:04 UTC+0100 Antonio Linares + * source/rtl/teditor.prg + ! several improvements for the debugger: + + The source code viewer does not leave a different block color when + scrolling. + + The source code is displayed from the first line (Clipper compatibility). + +2003-05-31 17:55 UTC+0100 Antonio Linares + * source/rtl/tget.prg + ! fixed behavior when pressing "." or "," on a non decimals number + + Now editing a number without decimals and pressing "." or ",", the + cursor goes to the latest GET visual pos (Clipper compatibility). + +2003-05-31 15:45 UTC+0100 Antonio Linares + * source/rtl/tget.prg + ! Some fixes for PICTURE "9" + + Now editing a character var does not allows to type "-". It allows + both "+" and "-" for numeric var. (Clipper compatibility). + +2003-05-30 12:39 UTC+0100 Antonio Linares + * contrib/rdd_ads/ads1.c + ! managed 7008 open error + + This fixes the not issued error when doing: + + USE "any" NEW SHARED ALIAS "Test" VIA "ADS" + USE "any" NEW EXCLUSIVE ALIAS "Test2" VIA "ADS" // An error must raise here + + We still need to know if there is a way to know the OS code when + ADS returns 7008 error code when opening a DBF. + +2003-05-30 09:37 UTC+0100 Antonio Linares + + * contrib/htmllib/Makefile.bc + ! some minor fixes. + + * source/compiler/harbour.l + ! hb_strVal() used instead of atof() + + This fixes the MSVC incompatibility using RTL Val() and compiled + decimal values. + + Warning: There are two more modules on Harbour that still use atof(). + We should move hb_strVal() to source/common and also make the replace + on those places. + + * source/debug/dbgtmenu.prg + ! Minor fix to allow new Classes inherit from this one. + + * source/rtl/pushbtn.prg + ! sync with xHarbour. + + + +2003-05-28 13:00 UTC-0400 David G. Holm + * contrib/rdd_ads/ads1.c + * contrib/rdd_ads/adsfunc.c + ! Minor changes to minimize MSVC++ type overrides. + ! Added MSVC++ type overrides to the ADS version functions. + +2003-05-26 18:40 UTC+0200 Przemyslaw Czerpak + * source/pp/ppcore.c + * allow to compile file with on *nix platforms. + It's dirty hack but works good for me and resolves one of the + most important problem with common CLIPPER and Harbour + (and other XBASE compatible compilers like FlagShip and CLIP) + sources - only Harbour cannot compile files with . + + * source/compiler/cmdcheck.c + ! fix which allow to use file names with '-' char in '-o' option + + * source/rtl/diskspac.c + + added support for diskspace on UNIX platforms + (first parameter is path name, if omitted "/" is checked) + +2003-05-26 15:50 UTC+0200 Przemyslaw Czerpak + * source/rtl/cdpapi.c + * small correction in s_en_codepage = { ... } + + + source/codepage/cdpplwin.c + * source/codepage/Makefile + + new Polish codepage PLWIN - CP1250 based + + * source/rtl/gt.c + + new .prg function HB_GT_VERSION() which returns GT name. + + * source/rtl/seconds.c + + new function added SECONDSCPU(n) which reports how many CPU and/or + system seconds have elapsed since the beginning of the program execution. + n == 1 utime -> user CPU time of the current process + n == 2 stime -> system CPU time behalf of the current process + n == 3 u + s -> sum of utime + stime (default) + n == 11 cutime -> sum of the user CPU time of the current + child process + n == 12 cstime -> sum of the system CPU time of the current + child process + n == 13 cu+cs -> sum of cutime + cstime + I have to ask someone similar with Windows to add support for this + function. I found 'GetProcessTimes' in WIN API which can be used for + NT based platforms but I cannot find anything for WIN 9X/ME. + +2003-05-22 23:45 UTC-0400 David G. Holm + * contrib/rdd_ads/ads1.c + * contrib/rdd_ads/adsfunc.c + * contrib/rdd_ads/rddads.h + + Added support for DBINFO(DBI_DB_VERSION), DBINFO(DBI_RDD_VERSION), + and ADSVERSION([]) (but only for nType == 0 and nType == 3 + and without date and time information for nType == 3). + +2003-05-21 20:34 UTC+0100 Antonio Linares + * source/vm/hvm.c + ! Fixed arrays comparison. Now it is Clipper compatible. + Bug reported by Randy Portnoff + +2003-05-21 19:50 UTC+0100 Antonio Linares + * source/vm/memvars.c + ! default path support for __MVSave() and __MVRestore() + implemented by Alexander Prostoserdov. + +2003-05-21 18:03 UTC+0100 Antonio Linares + * source/debug/dbgtarr.prg + * source/debug/dbgtobj.prg + ! several fixes when debugging arrays + + * source/debug/debugger.prg + ! several fixes + +2003-05-15 21:35 UTC+0300 Alexander Kresin + * tests/testrdd2.prg + * some changes, provided by Randy Portnoff + * contrib/rdd_ads/ads1.c + ! adsInfo() fixed for DBI_GETHEADERSIZE, so Header() returns now correct + value ( for dbf tables ) + +2003-05-15 12:44 UTC+0100 Antonio Linares + + source/rtl/tget.prg + ! minor fix + +2003-05-15 12:40 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! Minor fix + * source/rdd/dbf1.c + * DBI_FILEHANDLE and DBI_MEMOHANDLE added to dbInfo() + +2003-05-15 09:33 UTC+0100 Antonio Linares + + source/rtl/tget.prg + ! some fixes + ! some changes borrowed from xHarbour + + tests/testread.prg is working fine again. + +2003-05-09 23:30 UTC-0400 David G. Holm + * config/doc.cf + * config/header.cf + ! Fixes to deal with situation where installation + directories are left undefined to avoid installation. + +2003-05-09 20:30 UTC-0400 David G. Holm + * config/doc.cf + ! Removed an extra layer of "protection" that resulted in an + error message when HB_DOC_INSTALL is not defined, instead + of a simple "nothing to do" message. + +2003-05-09 20:30 UTC-0400 David G. Holm + * Makefile + + config/doc.cf + + doc/Makefile + * doc/gmake.txt + + doc/en/Makefile + + doc/es/Makefile + + Added the ability to install files from doc directory using + the new environment variable HB_DOC_INSTALL, which is left + undefined by default. All files from doc, doc/en, and doc/es + are installed if the HB_DOC_INSTALL variable is defined when + you run 'make install'. + +2003-05-09 17:20 UTC-0400 David G. Holm + * source/rtl/idle.c + + Added a PRG-callable function wrapper for hb_releaseCPU() and + named it HB_RELEASECPU. + +2003-05-09 14:40 UTC-0400 David G. Holm + * source/rdd/dbcmd.c + ! Fixed the FIELDPOS function to truncate long field names, + instead of ignoring them. + +2003-05-08 15:30 UTC-0400 David G. Holm + * source/compiler/harbour.sly + ! Fixed $3 in EmptyStatements to read $2. + +2003-05-07 14:45 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! OrdkeyCount() and OrdKeyNo() now returns physical records number and + position if there is no index opened or current order is 0 + * source/rtl/set.c + ! two warnings fixed. + +2003-05-06 15:35 UTC+0300 Alexander Kresin + * source/rtl/is.c + ! Bug fixed: ISUPPER, ISLOWER and ISALPHA with chr(0) argument + returned TRUE. + Patch provided by Przemyslaw Czerpak + +2003-05-06 12:55 UTC+0200 Przemyslaw Czerpak + * source/rtl/set.c + ! Fixed very serious bug in set(_SET_ALTFILE, "") and + set(_SET_EXTRAFILE, "") which can caused corrupting any files + open by Harbour compiled program + +2003-05-06 12:45 UTC+0300 Alexander Kresin + * contrib/rdd_ads/ads1.c + ! Bug fixed in adsOrderListClear() - the current order is set to 0 now + +2003-05-06 10:45 UTC+0300 Alexander Kresin + * include/hbapicdp.h + * source/rtl/cdpapi.c + * source/vm/itemapi.c + * source/rdd/dbfntx/dbfntx1.c + ! Some fix, regarding strings comparison via CODEPAGE API + +2003-05-01 21:19 UTC+0100 Antonio Linares + + source/codepage/cdpesdos.c + + source/codepage/cdpeswin.c + ! Added missing char + +2003-05-01 13:55 UTC+0100 Antonio Linares + + source/rdd/dbcmd.c + ! DbCreate() always returns nil. + + This fixes the bug reported by Marco Braida on sourceforge + +2003-05-01 12:10 UTC+0100 Antonio Linares + + source/codepage/cdpesdos.c + ! codepage support for Spanish MS-DOS + + + source/codepage/cdpeswin.c + ! codepage support for Spanish Windows + + + source/lang/msgeswin.c + ! language messages support for Spanish Windows + + * makefile.bc + * makefile.nt + * makefile.vc + * source/codepage/makefile + * source/lang/makefile + ! updated for cdpesdos.c, cdpeswin.c and msgeswin.c + +2003-04-28 23:00 UTC+0100 Antonio Linares + * source/rtl/tget.prg + ! numbers editing bug (side effect from previous change) fixed + + When typing a number, the second digit was overwriting the previous one. + +2003-04-28 21:00 UTC+0100 Antonio Linares + * source/debug/debugger.prg + ! aCallStack properly set when using trace mode (K_F10) + + This fixes the debugger bug reported by Guy Roussin. + +2003-04-27 15:09 UTC+0300 Chen Kedem + * doc/dirstruc.txt + + Add a line about contrib/ole + +2003-04-27 01:33 UTC+0100 Antonio Linares + * source/rtl/filesys.c + ! hb_fsOpen() minor fix for MSVC + + This fixes the DbUseArea() MSVC bug reported by Vicente. + +2003-04-24 14:35 UTC-0400 David G. Holm + * source/vm/itemapi.c + ! Added non-finite test for w32/msvc, which fixes the new problem + where all double values were displayed as if they had overflowed. + +2003-04-23 23:11 UTC+0100 Antonio Linares + * source/rtl/tget.prg + ! PICTURE "#" allows "." keystroke + + * source/rdd/dbfntx/dbfntx1.c + ! some castings for MSVC + +2003-04-19 12:00 UTC+0100 Antonio Linares + * source/rtl/tget.prg + ! Class TGet Data Pos behavior modified to make it Clipper compatible + Test sample provided on the Harbour mailing list + +2003-04-18 14:10 UTC+0300 Alexander Kresin + * source/rdd/dbf1.c + ! Bug fixed - there was unrecoverable error if file opening failed + due to access denied. + * source/rdd/dbfntx/dbfntx1.c + * Added reporting of OS error code if index opening failed + +2003-04-17 15:50 UTC+0300 Alexander Kresin + * source/pp/ppcore.c + ! Fixed some problems with a long ( few Kb ) directives. + +2003-04-16 19:15 UTC-0400 David G. Holm + * source/vm/itemapi.c + * Simplified non-finite tests for BORLANDC > 1040 and DJGPP (there is no + need to also test s_dInfinity and -s_dInfinity when using a function + that tests whether or not the parameter value is finite). + ! Added non-finite tests for os2.gcc, os2.icc, w32.mingw32, and w32.rsxnt, + which fixes the problems that they had with evaluating str(log(-1)). + +2003-04-16 22:10 UTC+0300 Alexander Kresin + * include/hbrddntx.h + * source/rdd/dbfntx/dbfntx1.c + * Added possibility to save/load and use tag name as in Clipper's DBFNTX + +2003-04-16 14:50 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + * A bug in hb_ntxTagKeyCount() fixed - reported by Jos© Luis Capel + +2003-04-15 13:10 UTC+0300 Alexander Kresin + + contrib/ole + + contrib/ole/bldtest.bat + + contrib/ole/build32.bat + + contrib/ole/hbtest.prg + + contrib/ole/ole2.c + + contrib/ole/oleauto.prg + + With a kind permission of the author, José F. Giménez , + ole library for harbour added. + Some unused stuff is removed from the original files, few bug fixes are made. + +2003-04-14 14:45 UTC-0400 David G. Holm + * source/common/hbgete.c + ! Added #ifdef to allow OS/2 GCC to use PSZ and OS/2 VAC++ to use PCSZ for EnvValue. + +2003-04-13 10:23 UTC+0200 Tomaz Zupan + * contrib/odbc/todbc.prg + ! Better way to move to first record after fetching + +2003-04-13 10:02 UTC+0300 Chen Kedem + * doc/whatsnew.txt + + Add information about builds 38..42 according to information + found on the Harbour site and the developers mailing list + +2003-04-12 23:00 UTC+0200 Tomaz Zupan + * contrib/odbc/todbc.prg + ! If recordset is cached, move to first record after fetching + recordset to cache + +2003-04-09 21:40 UTC+0300 Alexander Kresin + * include/hbdbf.h + * include/hbrddcdx.h + * include/hbrdddbf.h + * include/hbrddntx.h + * source/rdd/dbf1.c + * source/rdd/dbfcdx/dbfcdx1.c + * Byte 29 in dbf header with codepage information is added for later + implementation. Currently this allows to keep codepage byte ( before + it was cleared while header updating ). + +2003-04-09 13:40 UTC+0300 Alexander Kresin + * include/hbexprb.c + * At() function is now Clipper compatible ( At( "","abc" ) ) - + borrowed from xHarbour + * source/rdd/workarea.c + ! Fixed hb_waRelEval() - When the current order is zero, relation works + by GOTO istead of SEEK, as Clipper does - + borrowed from xHarbour + * source/rdd/dbfntx/dbfntx1.c + ! Fix in indexing - when index expression includes fields from the child + related workarea + +2003-04-08 15:40 UTC-0400 David G. Holm + * contrib/Makefile + ! Added a build path for MSVC++. + * source/common/hbffind.c + ! Added #include for the HB_OS_WIN_32 branch. + * source/common/hbgete.c + ! Changed EnvValue from PSZ to PCSZ for IBM VAC++ compatibility. + * source/compiler/harbour.y + ! Added missing semicolons using patch provided by Jos Backus . + +2003-04-04 11:20 UTC+0300 Alexander Kresin + * source/pp/ppcore.c + * Handling of '*' comment now is more Clipper compatible + * include/hbver.h + * changed version information + +2003-04-03 18:34 UTC+0200 Maurilio Longo + * source/common/hbgete.c + ! fixed warning on OS/2 GCC + +2003-04-03 19:52 UTC+0300 Alexander Kresin + * source/codepage/cdpplmaz.c + ! Minor fix, provided by Jacek Kubica + +2003-04-02 19:35 UTC+0300 Alexander Kresin + * source/rtl/langapi.c + ! Memory leak is fixed. + +2003-04-02 14:18 UTC+0300 Alexander Kresin + * include/hbapicdp.h + * source/codepage/cdp_tpl.c + * source/codepage/cdpgedos.c + * source/codepage/Cdpgewin.c + * source/codepage/cdpla850.c + * source/codepage/cdppl852.c + * source/codepage/cdppliso.c + * source/codepage/cdpplmaz.c + * source/codepage/cdpru866.c + * source/codepage/cdprukoi.c + * source/codepage/cdpruwin.c + * source/rtl/cdpapi.c + ! Few fixes in codepage subsystem + +2003-04-01 16:12 UTC+0300 Alexander Kresin + * source/rtl/transfrm.c + * Transform() now uses codepages while converting to upper case. + +2003-03-27 11:34 UTC+0100 Antonio Linares + * include/hbapi.h + * source/vm/classes.c + * hb_clsIsParent() made public + +2003-03-27 18:35 UTC+0100 Antonio Linares + * source/rdd/dbcmd.c + * contrib/rdd_ads/adsfunc.c + * Minor type casting fixes for MSVC + +2003-03-26 16:55 UTC+0300 Alexander Kresin + * source/rdd/dbcmd.c + ! Bug fixed related to COPY TO .. FIELDS ..., reported by Lorenzo Fiorini + +2003-03-26 11:30 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! Bug fixed, reported by Andrew McCumiskey + +2003-03-25 21:35 UTC+0300 Alexander Kresin + + source/codepage/cdpgewin.c + * source/codepage/Makefile + + source/lang/cdpdewin.c + * source/lang/Makefile + * makefile.bc + * makefile.nt + * makefile.bc + Added German Win codepage and lang files, contributed by + Guenther Steiner + + tests/testrdd2.prg + + Added RDD test, contributed by Randy Portnoff + +2003-03-25 16:46 UTC+0100 Martin Vogel + * contrib/libct/dattime2.prg + * bug fix in function addmonth() + +2003-03-24 15:35 UTC+0300 Alexander Kresin + * source/rdd/dbcmd.c + ! bug fixed with improper using of hb_strUpper() - reported by Lorenzo Fiorini + * source/rtl/cdpapi.c + ! fix, provided by Przemyslaw Czerpak + +2003-03-22 11:25 UTC+0100 Antonio Linares + * source/compiler/harbour.y + * fix on recent If() changes + IIf() was accepted but If() not. Now it is ok. + +2003-03-17 15:30 UTC-0500 David G. Holm + * source/rtl/filesys.c + ! Added newline at end of file. + +2003-03-16 10:33 UTC+0100 Antonio Linares + * source/compiler/harbour.y + * If() inline accepts all kind of arguments + Changes borrowed from xHarbour. + + WARNING: We don't know for sure if these changes may bring any + undesirable side effects, so please do all the tests you can. + +2003-03-16 09:50 UTC+0100 Antonio Linares + * source/rtl/filesys.c + * Proper definition for HAVE_POSIX_IO for MSVC compiler. + This fixes the CurDrive() bug reported by Vicente Aranzana. + Please notice that neither Andi and David proposed solutions + have been used. + +2003-03-05 13:35 UTC+0300 Alexander Kresin + * source/vm/hvm.c + * source/vm/itemapi.c + * source/vm/asort.c + * Reverted changes, related to short strings optimization, because they + causes problems with arrays and inmplemented 1-byte length string + optimization, borrowed from xHarbour. + +2003-02-25 22:10 UTC+0300 Alexander Kresin + * contrib/rdd_ads/adsfunc.c + + Transaction processing functions added. + * contrib/rdd_ads/ads.ch + + New commands added: + BEGIN TRANSACTION + COMMIT TRANSACTION + ROLLBACK TRANSACTION + +2003-02-18 22:05 UTC+0100 Tomaz Zupan + * include/hbdbf.h + * include/hbdbsort.h + * include/hbexprc.c + * include/hboo.ch + * source/common/hbfhnd.c + * source/compiler/genc.c + * source/compiler/harbour.c + * source/compiler/hbfix.c + * source/compiler/hbpcode.c + * source/pp/ppcomp.c + * source/rdd/hbdbsort.c + * source/rtl/at.c + * source/rtl/descend.c + * source/rtl/memoline.c + * source/rtl/philes.c + * source/rtl/philesx.c + * source/rtl/strings.c + * source/rtl/gtcrs/gtcrs.c + * source/rtl/gtcrs/kbdcrs.c + * source/vm/debug.c + * source/vm/dynsym.c + * source/vm/eval.c + * source/vm/extend.c + * source/vm/macro.c + * source/vm/memvars.c + * source/vm/runner.c + ! Added newline to the end of file, to avoid annoying warning + +2003-02-18 23:05 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! Stupid bug is fixed, which was introduced recently + +2003-02-18 09:15 UTC+0300 Alexander Kresin + * contrib/rdd_ads/adsfunc.c + * Few type casts for MSVC + +2003-02-17 13:15 UTC-0500 David G. Holm + * source/rtl/dbdelim.c + ! Bug fix for EOL handling when using large import files, + provided by the author of the dbdelim append from code, + Marco Braida + +2003-02-15 11:00 UTC+0100 Tomaz Zupan + * config/linux/global.cf + - removed PRG_USR directive, because it is no longer needed + to compile dbfsdf.prg + * source/rtl/dbsdf.prg + + Automatic EOL recognition. FindEOL() recognises LF,CR+LF and CR + as newline delimiters + +2003-02-14 22:05 UTC+0100 Tomaz Zupan + * include/hbapi.h + * include/hbcomp.h + * include/hbmacro.h + * include/hbvm.h + * include/hbvmpub.h + ! Added newline to the end of file, to avoid annoying warning + +2003-02-14 15:25 UTC+0300 Alexander Kresin + * source/common/hbffind.c + ! Fixed a problem with compiling under DJGPP + +2003-02-14 13:15 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! Fixed few bugs, including problems with scopes and GPF under Linux + +2003-02-12 11:15 UTC+0300 Alexander Kresin + * source/rdd/dbcmd.c + * source/rdd/dbf1.c + ! Bug fixed: APPEND FROM gave an error if the file was opened already + +2003-02-12 10:00 UTC+0300 Alexander Kresin + + source/codepage/cdpgedos.c + + German dos codepage, provided by Guenther Steiner + * source/codepage/Makefile + * makefile.bc + * makefile.vc + * makefile.nt + * cdpgedos.c added + +2003-02-10 23:20 UTC+1 jf Lefebvre (mafact) + * source\compiler\harbour.y + Missing external declaration 'hb_compLocalGetPos' + * include/hbapirdd.h + added function missing declaration at line 1059. 'hb_rddFieldIndex' + used in source\rdd\dbfcdx\dbfcdx1.c(1223) + * rdd/dbcmd.c changed 1 type casting BYTE * to char * + added one type casting to BYTE * + + +2003-02-10 16:00 UTC-0500 David G. Holm + * source/rtl/filesys.c + ! I missed one place where the X__WIN32__ guard needs to be used + (in the hb_fsRename function). + +2003-02-05 23:45 UTC-0500 David G. Holm + * contrib/libct/makefile.bc + ! Added a rule to compile setlast.prg + * source/rtl/filesys.c + ! Always use X__WIN32__ when testing to see if the extended + Windows file handle conversion utilities should be used. + +2003-01-30 22:10 UTC+0300 Alexander Kresin + * source/vm/asort.c + ! Some fixes, which became necessary after optimization of string operations. + +2003-01-29 22:05 UTC+0300 Alexander Kresin + * include/hberrors.h + * include/hbpcode.h + * source/compiler/genc.c + * source/compiler/harbour.sly + * source/compiler/harbour.y + * source/compiler/hbfix.c + * source/compiler/hbpcode.c + * source/vm/hvm.c + * Added new pcode HB_P_LOCALNEARADDINT for using in FOR ... NEXT cycle, + it increases the speed of execution the cycle. + Borrowed from xHarbour. + +2003-01-28 22:20 UTC+0300 Alexander Kresin + * source/rdd/dbcmd.c + ! Fixed a bug with APPEND FROM ..., COPY TO..., when there was a memo field + +2003-01-28 13:05 UTC+0300 Alexander Kresin + * source/vm/hvm.c + ! Little fix to the previous change + +2003-01-28 11:25 UTC+0300 Alexander Kresin + * include/hbapi.h + * source/rtl/philes.c + * source/vm/itemapi.c + * source/vm/hvm.c + * Optimization of string operations. Now if the size of the string is less + than sizeof(short int *) - in most systems it is 4, it is kept in the + item itself, additional memory isn't allocated for it. + This leads to performance improvement and decreasing of memory + fragmentation/usage. + +2003-01-26 16:20 UTC+0300 Alexander Kresin + * include/hbapiitm.h + * source/vm/itemapi.c + * source/vm/hvm.c + * hb_itemMove() function added, which is intended for use instead of + the + hb_itemCopy( pDest,pSource ) + hb_itemClear( pSource ) + This allows to speed up some internal vm functions. + The idea was borrowed from xHarbour. + +2003-01-26 14:50 UTC+0300 Alexander Kresin + * include/hbrddcdx.h + * source/rdd/dbfcdx/dbfcdx2.h + * source/rdd/dbfcdx/dbfcdx1.c + * all last updates, made by Horacio Roldan in xHabour + +2003-01-24 17:47 UTC+0300 Alexander Kresin + * source/vm/maindllp.c + ! Minor fix. + +2003-01-24 14:00 UTC+0300 Alexander Kresin + * source/vm/hvm.c + * hb_inkeyPoll() is removed from hb_vmDo(), the code fragment with + hb_ReadKey() is added to hb_vmExecute() - borrowed from xHarbour. + * source/vm/estack.c + * source/vm/extend.c + * include/hbapi.h + * include/hstack.h + * HB_API_MACROS and HB_STACK_MACROS are default options now - borrowed from xHarbour. + * source/rtl/version.c + ! Memory leak fixed. + +2003-01-20 00:20 UTC+0100 Martin Vogel + * contrib/libct/Makefile + * contrib/libct/Makefile.bc + * contrib/libct/Makefile.vc + * contrib/libct/readme.txt + * contrib/libct/ctflist.txt + * contrib/libct/tests/Makefile + + contrib/libct/dattim2.prg + + contrib/libct/tests/datetime.prg + + addmonth(),ctodow(),ctomonth(),daysinmonth(),daystomonth(),dmy(), + doy(),isleap(),lastdayom(),ntocdow(),ntocmonth(),quarter(),week() + Thanks to Alan Secker for providing these + functions and the test program; small enhancements, mostly making + the functions interational, docu headers etc. added by me :-) + * contrib/libct/pos1.c + * interpretation of parameter in posalpha(),poslower(),posupper() and + posrange() corrected; thanks to Guenther Steiner + for reporting this bug + + * include/hblang.ch + + added constant definitions accessing language specific string via HB_LANG_MESSAGE() + + +2002-11-01 16:20 UTC-0300 Walter Negro + * include/hbexprb.c + ! Fix assign to array_at. + This resolve FOR n[1]:=1 TO 2 + Fix borrowed from xHarbour + +2003-01-10 17:30 UTC-0500 David G. Holm + * source/rtl/filesys.c + ! The MingW32 use of _LK_UNLOCK instead of _LK_UNLCK turned out to + be a bug in a MingW32 that has since been corrected, so the fix + has been reverted. Thanks go to Phil Krylov for + pointing this out. In order to allow this to work with the buggy + version of MingW32, I've added a #define _LK_UNLCK _LK_UNLOCK if + compiling for __MINGW32__ and _LK_UNLCK is not defined. + +2003-01-10 17:00 UTC-0500 David G. Holm + * source/rdd/dbfcdx/dbfcdx1.c + ! hb_fsDelete takes a BYTE * parameter, not an unsigned char * one. + * source/rtl/filesys.c + ! MingW32 uses _LK_UNLOCK, not _LK_UNLK. + * source/vm/itemapi.c + ! Borland C 3.1 and earlier do not support _isnan or _finite. + +2003-01-04 19:40 UTC-0300 Luiz Rafael Culik + * include/filesys.c + * When X__WIN32__ is defined FHANDLE is defined as Long + * source/rtl/filesys.c + % Properly Fix the usage os Native Windows File IO API. harbour apps with native WIN IO api has the same speed as Legacy api usage + * source/rtl/console.c + ! Minor Changes required to proper work of Windows File IO Native API + * source/common/hbffind.c + ! Corrected error return Values For DJGPP compiler for hb_fsFindNext() and hb_fsFindFirst() functions + ! Corrected error return Values For WIN32 for hb_fsFindNext() and hb_fsFindFirst() functions + With This Changes to console.c and filesys.c build with X__WIN32__ defined works properly + +2002-12-31 11:45 UTC-0500 David G. Holm + * include/hbver.h + * Updated the build number and the ChangeLog information. + +2002-12-30 16:50 UTC-0300 Horacio Roldan + * source/rdd/dbfcdx/dbfcdx1.c + ! fixed scope related bug, reported by Blue Face + + added support for the EVAL clause in INDEX + +2002-12-28 09:05 UTC-0300 Horacio Roldan + * source/rdd/dbfcdx/dbfcdx1.c + * source/rdd/dbfcdx/dbfcdx2.h + ! fixed bug (search path related), + reported by Jacek Potempa + ! fixed GPF bug reported by Alex Schaft + + added support for DBOI_KEYCOUNTRAW, DBOI_KEYNORAW == DBOI_RECNO, + DBOI_KEYTYPE, DBOI_KEYSIZE, DBOI_FULLPATH + ! fixed: DBOI_BAGNAME + ! fix return value when there's no active order to: DBOI_FILEHANDLE, + DBOI_ISCOND, DBOI_ISDESC, DBOI_UNIQUE, DBOI_POSITION, DBOI_RECNO, + DBOI_KEYNORAW, DBOI_KEYCOUNT, DBOI_KEYCOUNTRAW. + This makes ordKeyNo() = recno() and ordKeyCount() = lastrec() + in such case. Reported by Hernán Diego Ceccarelli + + + added helper function hb_cdxOrdListClear + ! structural index isn't closed anymore + ! fixed ordKeyNo() and ordKeyCount() to respect filters, they also + respect the set deleted but only when there is a filter (as C53) + ! fixed ordScope(0/1, ""), reported by Jean-Christophe AVARGUES and + Blue Face + + * source/rdd/workarea.c + ! fix to fieldname, reported by Luiz Rafael Culik + +2002-12-27 16:40 UTC-0800 Brian Hays + + added doc/windll.txt as an introduction to Windows + 32-bit dll creation with Harbour. + +2002-12-22 13:06 UTC+0200 Chen Kedem + * doc/dirstruc.txt + + Add a line about source/codepade + +2002-12-22 03:46 UTC-0300 Walter Negro + * source/rtl/set.c + ! Fix, reset PRINTFILE handle when close file. + +2002-12-18 14:00 UTC-0500 David G. Holm + * source/rtl/set.c + ! In the set_string function, when then item parameter is NIL use a + zero-length string (bug fix for SET PATH TO and SET DEFAULT TO). + +2002-12-17 10:50 UTC-0800 Brian Hays + * contrib/rdd_ads/ads.ch + - Removed commands for SET PATH, DEFAULT, DELETED, EXACT, + DATEFORMAT and EPOCH since these are handled by the + Set Listener functionality now. + + added new #define ADS_REQUIRE_VERSION6 to control version 6 + ace32.lib/linker requirements + + * contrib/rdd_ads/ads1.c + * created Set Listener support for + HB_SET_DATEFORMAT + HB_SET_DEFAULT + HB_SET_DELETED + HB_SET_EPOCH + HB_SET_EXACT + HB_SET_PATH + So whenever you call the Set() function or commands, + ADS is automatically updated. + + * added these fixes by Luiz Culik: + * Created bDictionary and adsConnectHandle to allow access + to ads data dictionaries; + * store pFieldInfo.uiDec = uiDec for doubles in adsCreateFields. + + * fixed initialization of dVal in adsGetValue + (fix by Ron Christie) + + * fixed Trace in ADS_GETFUNCTABLE(%i, %p), *uiCount, pTable)); + to show the contents of uiCount instead of the pointer address. + + * contrib/rdd_ads/adsfunc.c + * to test SetListener capabilities, added or upgraded + these functions to be classic "Set/Get" functions so + they return the prior ads setting: + AdsSetDeleted + AdsSetDefault + AdsSetSearchPath + AdsSetExact + NOTE! Because the Set() function now also controls + ADS, there is no reason for normal code to ever call + these functions. If you do, you may get ADS out of sync + with Harbour's settings and create unpredictable results. + + + added these funcs by Luiz Culik: + AdsAddTable() + AdsAddUser To Group() + AdsUseDictionary() + These are all protected by ADS_REQUIRE_VERSION6, so to use them + you must define it when compiling rddads. + + The data dictionary support is a work-in-progress and may need + to be re-thought, so don't get too dependent upon current + implementation. + + * contrib/rdd_ads/doc/en/adsfuncs.txt + + added documentation for functions in adsfunc.c + * contrib/rdd_ads/doc/en/readme.txt + + added explanation for using the Set() function call + as well as the equivalent commands for SET DEFAULT TO, + DATEFORMAT, DELETE, EXACT and EPOCH. + + added explanation of INDEXING and Progress Displays using + AdsRegCallBack() (and why EVAL/EVERY cannot be supported.) + +2002-12-17 12:40 UTC-0300 Walter Negro + * source/tget.prg + ! Fix, UpdateBuffer() should not actualize the variable if the value + was not modified. + + Reported by Francisco Gamboa and Horacio Roldan + +2002-12-07 21:45 UTC-0300 Luiz Rafael Culik + * source/rtl/menuto.prg + ! Fixed Color Parameters when only One color is passed + +2002-12-02 15:30 UTC-0500 David G. Holm + * config/linux/global.cf + ! Add to PRG_USR instead of replacing it. + * source/rtl/set.c + ! When adding a new listener, set the next pointer to NULL. + +2002-12-03 22:40 UTC+0300 Alexander Kresin + * makefile.bc + * makefile.nt + * Added lines, needed for compiling of cdpla850.c + * source/codepage/cdpla850.c + * source/codepage/Makefile + ! Minor fixes + +2002-11-01 12:00 UTC-0300 Luiz Rafael Culik + * source/rtl/dbsdf.prg + ! fixed importing/exporting on linux + * contrib/mysql/tmysql.prg + ! Applyed Fixes by Wang Shuming + * config/linux/global.cf + + PRG_USR=-DHB_LINUX macro Added to compile dbsdf.prg + +2002-11-28 15:10 UTC+0300 Alexander Kresin + * source/pp/ppcore.c + ! Bug fixed, related to list match markers + +2002-11-27 13:30 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! Bug fixed, reported by Carlos Andr©s + * source/rtl/cdpapi.c + ! Bug fixed in HB_TRANSLATE() + +2002-11-26 21:20 UTC+0100 Tomaz Zupan + * contrib/odbc/browodbc.prg + ! There was a bug in skipping, that threw an error when + dataset contained 0 rows + +2002-11-25 21:45 UTC-0300 Luiz Rafael Culik + * utils/hbmake/hbmake.prg + ! removed unused Var + * source/rtl/menuto.prg + ! minor formating + +2002-11-21 12:05 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + * DBOI_ORDERCOUNT is supported now + * hb_stackPop() is added in ntxOrderCreate() + * contrib/rdd_ads/ads1.c + * adsOrderCreate() created indexes as if ADDITIVE clause is specified, even + it was absent - is fixed now. + adsOrderCreate() respects current order if WHILE clause is specified + +2002-11-20 22:00 UTC-0300 Luiz Rafael Culik + * utils/hbmake/hbmake.prg + utils/hbmake/hbmlang.c + * Some sinc from xharbour hbmake.prg hbmlang.c + +2002-11-20 21:45 UTC-0300 Luiz Rafael Culik + * source/pp/pptable.c + + COLOR parameter to @...PROMPT + * source/rtl/menuto.prg + ! Added code to use the passed Color to the Prompt.This will allow + to make Color menus and Was Far Requested since this feature is an Alaska,Flagship and Max compiler + * tests/menuto.prg + * Changes the Test to Show the ability of menu items in colors + * contrib/mysql/tmysql.prg + * On method GetRow(nRow) of TMySQLQuery fixed Handling of Date + Retrived(The date is formated on Current SET DATE FORMAT) + +2002-11-20 21:56 UTC+0300 Alexander Kresin + * source/codepage/cdppl852.c + * source/codepage/cdppliso.c + * source/codepage/cdpplmaz.c + ! Minor fix in comment delimiters + * source/rdd/dbcmd.c + ! COPY TO ... FIELDS is fixed again + +2002-11-18 22:35 UTC+0300 Alexander Kresin + * source/rdd/dbcmd.c + ! COPY TO ... FIELDS ... is fixed - fields in the result dbf are in the + same secuence as in the FIELDS clause. + +2002-11-18 14:55 UTC+0300 Alexander Kresin + * include/hbrddapi.c + * source/rdd/dbcmd.c + * source/rdd/workarea.c + * source/rdd/dbfntx/dbfntx1.c + * source/pp/pptable.c + * contrib/rdd_ads/ads1.c + * WHILE clause implemented for ADS RDD + +2002-11-15 14:30 UTC+0300 Alexander Kresin + * include/hbcdpapi.c + * source/rtl/cdpapi.c + * source/codepage/cdpru866.c + * source/codepage/cdprukoi.c + * source/codepage/cdpruwin.c + * Some fixes and enhancements + + source/codepage/cdp_tpl.c + + Template file for codepages is added + + source/codepage/cdppl852.c + + source/codepage/cdppliso.c + + source/codepage/cdpplmaz.c + + Codepages for Polish language, provided by Jacek Kubica + * source/codepage/Makefile + * makefile.bc + * makefile.nt + * makefile.vc + * Changed to compile new Polish codepages + +2002-11-13 15:50 UTC-0300 Horacio Roldan + * include/hbrddcdx.h + * source/rdd/dbfcdx/dbfcdx1.c + * source/rdd/dbfcdx/dbfcdx1.h + * source/rdd/dbfcdx/dbfcdx2.h + ! fixed some declarations to avoid warnings, + removed unnecessary introduced casts + ! fixed skip bug reported by Andrzej + ! fixed bug when empty scope used + ! fixed posible index corruption when shared. + + added functions cdxError, hb_cdxOrderListRebuild, + hb_cdxIndexReindex + Now reindex works, as well as pack and zap. + +2002-11-13 12:25 UTC+0100 Antonio Linares + * include/hbexprb.c + ! strings as bytes arrays management (assignment) + ! changes borrowed from xHarbour + + * source/vm/hvm.c + ! strings as bytes arrays management (assignment) + +2002-11-12 14:32 UTC+0100 Antonio Linares + * source/vm/hvm.c + + strings as bytes arrays management implemented + + Notice: Assignment is not implemented yet! + +2002-11-12 12:55 UTC+0100 Antonio Linares + * source/vm/hvm.c + + ":=" operator overloading support for locals and statics variables. + +2002-11-12 10:23 UTC+0100 Antonio Linares + * source/vm/classes.c + * source/vm/hvm.c + + Added support for "[]" operator overloading + +2002-11-10 19:35 UTC-0300 Luiz Rafael Culik + *source/rtl/alert.prg + ! fix initialization of cold Var + +2002-11-08 13:19 UTC+0100 Ignacio Ortiz + * source/rtl/errorapi.c + !Fixed severity to 'can retry' on Base errors (as Clipper) + * source/rtl/mlcount.c + !Fixed bug reported Brian Hays (the solution is also from Brian) + +2002-11-07 22:05 UTC-0300 Luiz Rafael Culik + *source/rtl/alert.prg + ! due an little mistake i`ve posted xharbour code, i`ve reverted back to version 1.38 and applyed the patch +2002-11-07 08:30 UTC-0300 Luiz Rafael Culik + * source/rtl/alert.prg + ! minor fix to my change from yesterday + +2002-11-06 18:38 UTC-0300 Walter Negro + * source/rtl/achoice.prg + ! Fix, if no UDF is set, pressing an alpha key it + go to first item finding this letter without respecting + upper and lowercase. + Reported by Luiz Culik. + +2002-11-06 00:00 UTC-0500 Paul Tucker + * makefile.vc + * makefile.nt + * make_vc.bat + * clean now handled by make + * corrected param handling + * use /? for help + +2002-11-05 21:41 UTC-0300 Luiz Rafael Culik + * source/rtl/alert.prg + ! Fixed problem when Text to display has more then 60 chars and the Line Breaker character (;) dont exist + (You notice this behaviour on some erros produced by xharbour rdd) + +2002-11-05 19:01 UTC-0300 Walter Negro + * source/rtl/strcase.c + ! Fix call to toupper(), tolower(), forcing unsigned char. + For the correct working with DJGPP compiler. + * source/rtl/is.c + ! Fix call to isdigit() and isalpha(), islower() and isupper(), + forcing unsigned char. + For the correct working with DJGPP compiler. + +2002-11-05 14:38 UTC-0300 Walter Negro + * contrib/libct/setlast.prg + + Init version of SETLASTKEY() + * contrib/libct/screen1.c + ! Fix variable declaration. + * contrib/libct/Makefile + + setlast.prg + * contrib/libct/makefile.bc + + setlast.prg + * contrib/libct/makefile.vc + + setlast.prg + * contrib/libct/ctflist.txt + * passed setlastkey() to Started state. + * contrib/libnf/dispc.c + ! Fix variable declaration. + * contrib/libnf/ftattr.c + ! Fix variable declaration. + +2002-11-04 15:18 UTC-0500 Paul Tucker + * makefile.vc + * no more recursive nmake calls + * makefile.nt + * corrected one batch mode call + * make_vc.bat + * if building Harbour under NT, use the alternate makefile.nt + * for faster builds. + * if you would prefer not to use batch mode, + * run make_vc /y (just like nmake) + +2002-11-03 20:28 UTC+0300 Alexander Kresin + * source/rdd/dbcmd.c + * hb_rddFieldIndex() was declared as static - is changed now, because it is + called from dbfntx1.c + +2002-11-02 19:26 UTC+0300 Alexander Kresin + * include/hbrddntx.h + * source/rdd/dbfntx/dbfntx1.c + * The algorithm of key expression evaluation is optimized. Now, if it is + the field name only, macro/codeblock evaluation doesn't used - + SELF_GETVALUE is used instead. It leads to sensible indexing speedup + in case of such simplest index keys. + +2002-11-02 11:55 UTC+0300 Alexander Kresin + * source/rdd/dbcmd.c + ! hb_rddGetCurrentWorkAreaPointer() fixed as proposed Jacek Potempa + +2002-10-31 16:40 UTC-0300 Walter Negro + * source/rtl/tget.prg + ! Fix ::DeleteEnd() method. + It didn't erase the last character. + Reported by Luiz Rafael Culik. + +2002-10-29 20:45 UTC-0500 Paul Tucker + * source/rtl/gtwin/gtwin.c + * Win9x Tone() support currently only for Borland and MSVC compilers. + * The only issue for the moment, is if the calculation of TICKS is + * incorrect for other compilers. SEE dTicks in hb_gt_Tone(). + * Someone may wish to adapt the code above hb_gt_tone() in gtwin.c + * for other compilers. + +2002-10-29 16:20 UTC-0500 Paul Tucker + * makefile.vc + * slight re-ordering and added missed codepage.lib directive. + + makefile.nt + * make_vc.bat + * if building Harbour under NT, use the alternate makefile.nt + * for faster builds. + * Changelog + Changed date of following entry from 28 to 29. + +2002-10-29 11:10 UTC-0500 Paul Tucker + * source/rtl/gtwin/gtwin.c + * modified by Robert Haley to allow Tone() + * to work correctly under Win9x. + * source/vm/maindllp.c + * remove redundant returns. Set parc to return NULL not "" + * source/rtl/transform.c + * changed nFor decl to UINT + * source/rtl/defpath.c + * removed unneeded assignment to size + * source/rdd/dbfcdx/dbfcdx1.c + * removed unneeded assignement to uiLen + +2002-10-27 21:35 UTC+0100 J-F lefebvre + * source/rdd/dbf1.c + * added missing typecasting for msvc. + +2002-10-27 10:28 UTC+0200 Chen Kedem + * doc/en/lang.txt + + Added Russian KOI-8 to HB_LANGSELECT() list of supported ID's + +2002-10-25 14:30 UTC+0300 Alexander Kresin + * source/rtl/cdpapi.c + * source/codepage/cdpru866.c + * source/codepage/cdprukoi.c + * source/codepage/cdpruwin.c + * source/vm/hvm.c + * Memory for codepage tables is allocated dynamically now - this is needed + to provide a possibility of loading codepages from external file while + run-time. + * Possibility to have the same weight for some characters ( usually accented + and appropriate unaccented ) is implemented. + +2002-10-25 11:38 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! Few fixes, related to codepages support + ! Bug fixed ( setting controlling index doesn't caused movement to the + top logical record before ) + +2002-10-24 15:00 UTC-0300 Walter Negro + * source/Makefile + ! Add codepage to compilation + +2002-10-24 20:58 UTC+0300 Alexander Kresin + * include/hbapicdp.h + ! Minor fix + +2002-10-24 16:05 UTC+0300 Alexander Kresin + + include/hbapicdp.h + + added header file for codepage system + * include/hbapirdd.h + * include/hbrddcdx.h + * include/hbrdddbf.h + * include/hbrddntx.h + + source/lang/msgrukoi.c + + added a msg file for koi8-r + * source/lang/Makefile + * msgrukoi.c added to Makefile + + source/rtl/cdpapi.c + + added codepages api source + Functions HB_SETCODEPAGE() and HB_TRANSLATE() are implemented + * source/rtl/is.c + * source/rtl/strcase.c + * IsAlpha(), IsUpper(), IsLower(), Upper(), Lower() functions modified to + use codepages + * source/rdd/dbcmd.c + * source/rdd/dbf1.c + * source/rdd/dbstrux.prg + * source/rdd/dbfntx/dbfntx1.c + * Rdd sources are modified to use codepages + dbUseArea() and dbCreate() has new optional parameter - codepage id. + * source/pp/pptable.c + * Commands USE and CREATE FROM are changed - new optional clause + 'CODEPAGE ' is added + * source/vm/itemapi.c + * hb_itemStrCmp() is modified to use codepages + * source/Makefile + * makefile.bc + * makefile.vc + * makefiles are modified + +2002-10-24 15:40 UTC+0300 Alexander Kresin + + source/codepage + + directory for codepage source files is added + + source/codepage/cdpru866.c + + source/codepage/cdprukoi.c + + source/codepage/cdpruwin.c + + source/codepage/Makefile + + Files for Russian codepages and Makefile for codepage library are added + +2002-10-22 18:30 UTC-0400 David G. Holm + * source/rtl/set.c + ! Removed comment block that incorrectly commented out + the default case in the HB_SET switch block. + ! Fixed the previously commented out code that prevented + changing the new HB_SET_DIRSEPARATOR value. + * tests/set_test.prg + + Added tests to display the Harbour-specific SET values + and a test for changing the _SET_DIRSEPARATOR value. + +2002-10-22 17:30 UTC-0400 David G. Holm + * source/rdd/dbfcmd.c + * Made FIELDNAME Clipper compatible for the case where there is + no current workarea and when the field number does not exist. + +2002-10-22 02:00 UTC-0500 Paul Tucker + * source/rdd/dbcmd.c + ! corrected copy length in rddsetdefault + +2002-10-22 18:53 UTC+0100 Antonio Linares + * source/rtl/filesys.c + ! minor fix reported by José Fco. Pérez + +2002-10-22 12:00 UTC-0500 Paul Tucker + * source/rdd/dbcmd.c + ! Fix a problem with Select() that I introduced. + +2002-10-21 05:11 UTC+0100 Antonio Linares + * source/rtl/achoice.prg + ! minor fix + +2002-10-21 23:41 UTC-0300 Walter Negro + * source/rtl/achoice.prg + ! Reduce redundant code. + ! Fix default values of nBottom and nRight out of range. + ! Add control of value of nBottom and nRight. + * source/rtl/tget.prg + ! Fix ::Changed property to conform UPDATE() behaviour with that Clipper. + + Fixed by Andi Jahja in xHarbour + +2002-10-21 12:30 UTC-0500 Paul Tucker + * source/rdd/dbfcdx/dbfcdx1.c + ! added some long needed typecasts. + ! corrected for index on/to without a tag + * source/rdd/dbfntx/dbfntx1.c + * source/rdd/dbfcdx/dbfcdx1.c + * source/common/hbffind.c + * source/common/hbfsapi.c + ! some strncpy changes. + +2002-10-21 12:00 UTC-0500 Paul Tucker + + tests/vidtest.prg by Brian Dukes + * source/rdd/dbcmd.c + * source/rdd/workarea.c + * source/rdd/dbf1.c + ! modified string copy operations for efficiency where appropriate. + +2002-10-21 10:20 UTC+0300 Alexander Kresin + * contrib/rdd_ads/adsfunc.c + ! Few fixes - checking for hb_parc() return value + +2002-10-20 22:50 UTC-0500 Paul Tucker + * source/rtl/inkey.c + ! reduce keyboard polling to <= once per tick. + ! Screen updating flies. + * source/rtl/philes.c + ! comparison to TRUE is not consistant with bool type in FREAD + +2002-10-20 16:18 UTC-0500 Paul Tucker + * source/rdd/dbfntx/dbfntx1.c + ! removed unused pLastPages + +2002-10-20 15:16 UTC-0500 Paul Tucker + * source/rdd/dbcmd.c + ! Just a few changes for efficiency... + +2002-10-20 22:40 UTC+0300 Alexander Kresin + * source/rdd/dbcmd.c + ! Yet another fix related to the hb_parc() changes + +2002-10-20 21:12 UTC+0300 Alexander Kresin + * source/rdd/dbcmd.c + ! Few fixes related to the latest hb_parc() changes + * source/rdd/dbfntx/dbfntx1.c + ! Bug fixed in indexing + +2002-10-19 16:50 UTC-0500 Paul Tucker + * include/hbdefs.h + * Added definition for UINT + * include/hbapigt.h + * source/rtl/gtapi.c + * source/rtl/saverest.c + * source/rtl/xsavescr.c + * source/rtl/gtdos/gtdos.c + * source/rtl/gtsln/gtsln.c + * source/rtl/gtos2/gtos2.c + * source/rtl/gtwin/gtwin.c + ! Properly account for the fact that hb_gt_rectsize returns an int + (ok, so we treat it as UINT, but this is better than USHORT) + * source/rtl/gtwin/gtwin.c + * New, highly optimized Windows console gt driver + written by Przemyslaw Czerpak + with some (?) fixes suggested by Peter Rees + and Marek Paliwoda + +2002-10-19 16:26 UTC-0500 Paul Tucker + * source/rtl/box.c + * source/rtl/disksphb.c + * source/rtl/errorapi + * source/rtl/fnsplit + * source/rtl/setcolor + ! Simplified some calls to hb_parc() + +2002-10-19 21:40 UTC+0100 Martin Vogel + * contrib/libct/Makefile + * contrib/libct/Makefile.bc + * contrib/libct/Makefile.vc + * contrib/libct/ctflist.txt + + contrib/libct/invertwin.prg + + INVERTWIN() function provided by Marek Horodyski + +2002-10-19 20:52 UTC+0100 Antonio Linares + * debug/debugger.prg + ! minor fix to BP (breakpoints) settings saved to file + + * debug/dbghelp.prg + ! mouse support added to debugger help + +2002-10-19 20:34 UTC+0100 Antonio Linares + * makefile.bc + + source/vm/maindllp.c added to the makefile + (don't know why this file was removed from it) + +2002-10-19 20:07 UTC+0100 Antonio Linares + * source/rtl/is.c + ! hb_parc() use made clipper compatible + +2002-10-19 16:20 UTC+0100 Antonio Linares + * source/rdd/dbcmd.c + ! some fixes on hb_parc() use from DbCreate() + + WARNING: Cause recent fix to hb_parc() to make it Clipper compatible, + hb_parc() result must be checked before using the returned value. + + REQUEST: Alexander, Horacio and Brian, as the RDDs captains, please review + all hb_parc() use from the RDDs source code, to asure hb_parc() + result is properly tested. + +2002-10-19 13:27 UTC+0100 Antonio Linares + * include/hbapi.h + * include/hbtypes.h + * source/vm/extend.c + * source/vm/maindllp.c + ! all hb_stor... functions changed to return an int value + + Notice: These changes fixes the extend API compatibility issues + with Clipper reported by gabor salai + +2002-10-19 12:53 UTC+0100 Antonio Linares + * source/vm/extend.c + ! minor fix to hb_parc() + + Notice: This change fixes the hb_parc() bug described by John Skelton + +2002-10-19 12:20 UTC+0100 Antonio Linares + * source/rtl/philes.c + ! FRead() fix for dynamic strings use with more than one holder + + Notice: This change fixes the FRead() bug described by Randy Portnoff + + +2002-10-19 11:16 UTC+0100 Antonio Linares + * include/hbtypes.h + ! minor change to avoid compiling errors if using -DHB_API_MACROS + +2002-10-17 14:40 UTC-0300 Luiz Rafael Culik + * source/rtl/tbrowse.prg + ! Fixed SetColumnMethod() that was not using all Display Area(The nWidthMax variable was substraced by 2) + +2002-10-17 15:00 UTC+0700 Andi Jahja + * source/compiler/harbour.sly + * source/compiler/harbour.y + ! Add missing third parameter on calls of hb_compGenPushSymbol() + +2002-10-16 1:50 UTC-0800 Brian Hays + * include/dbInfo.ch + ! added comments + +2002-10-14 17:10 UTC-0300 Walter Negro + * source/rtl/tget.prg + ! fixed get (value and display) involving negative with decimal + number whose value is less than 1, in some pictures. + +2002-10-14 17:40 UTC+0100 Antonio Linares + * include/hbcomp.h + * include/hbexprb.c + * include/hbmacro.h + * include/hbvmpub.h + * source/compiler/genc.c + * source/compiler/harbour.c + * source/vm/dynsym.c + * source/vm/hvm.c + * source/vm/macro.c + ! bug fixed when accesing an aliased expression from within a static + function with the same name as the alias. + ! changes borrowed from xharbour + + WARNING: All PRGs must be recompiled as defined value HB_FS_PUBLIC + has changed !!! + +2002-10-14 11:45 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! bug fixed in scopes, when the last record of current order was in the scope + ! bug fixed in error handling while index creating + + * source/rdd/dbfcdx/dbfcdx1.c + ! bug fixed in error handling while index creating ( the same as in dbfntx ) + +2002-10-14 0:10 UTC-0800 Brian Hays + * contrib/rdd_ads/rddads.h + * contrib/rdd_ads/ads1.c + * created iFileType to pArea so each workarea knows + whether it's ADT or CDX or NTX + * contrib/rdd_ads/adsfunc.c + - removed the 'far' from a char far * added in last post + + * include/dbstruct.ch + Added a note that it's also used by C code + #included it in hbapirdd.h (where I removed redundancies) + * include/ord.ch + + include/dbInfo.ch + * moved all the DBI_*, DBRI_* and DBOI_* constants to the + new dbInfo.ch, and included this in ord.ch and hbapirdd.h + * include/hbapirdd.h + * removed the redundancies, included dbinfo.ch and dbstruct.ch + + +2002-10-12 19:00 UTC-0300 Luiz Rafael Culik + * contrib/mysql/mysql.c + ! Fixed Buffer sizes on DATATOSQL() and FILETOSQLBINARY() It was leading to GPF due buffer underflow. + Many thanks to Peter Rees + +2002-10-11 21:35 UTC-0300 Horacio Roldan + * source/rdd/dbfcdx/dbfcdx1.h + * source/rdd/dbfcdx/dbfcdx2.h + * source/rdd/dbfcdx/dbfcdx1.c + ! fixed bug reported by Richard Chidiak + + added function hb_cdxMacroRun + ! fixed bug reported by Peter Rees. + * changed index creation and updating: + some spaces in keys aren't compressed now, so ADS can read + the indexes. (it couldn't with some special keys) + +2002-10-07 13:22 UTC-0300 Gustavo Junior Alves + * source/rtl/filesys.c + * Fix to compile on MSVC - Thanks to Andi Jahja + +2002-10-06 21:29 UTC-0300 Gustavo Junior Alves + * source/rtl/filesys.c + * hb_filecase on hb_fsMkDir, hb_fsChDir and hb_fsRmDir + +2002-10-05 23:00 UTC-0300 Luiz Rafael Culik + * source/rtl/tget.prg + * Fixed small problem when using Mouse to select the editing get + +2002-10-04 15:552 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! Bug fixed in key appending with few open indexes + +2002-10-04 14:42 UTC+0300 Alexander Kresin + * source/rdd/dbcmd.c + ! Bug fixed in COPY TO, APPEND FROM with aliased fields + +2002-10-04 13:58 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! Few bugs fixed, related to OrdKeyNo() and OrdKeyCount() + +2002-10-03 0:40 UTC-0800 Brian Hays + * contrib/rdd_ads/ace.h + + added (void) to AdsApplicationExit( void ); + This removes a compiler warning about missing the prototype. + Let me know if this creates a problem with any other compilers. + + * contrib/rdd_ads/adsfunc.c + + added AdsGetLastError() contrib. by Randy Portnoff (Thanks!) + + * contrib/rdd_ads/ads1.c + * Cleaned up adsPutValue and adsGetValue formatting, + * Fixed fieldname length references + * Removed errant setting of uiLen in adsGetValue since these + are set in adsOpen now. + * adsOrderInfo(DBOI_KEYVAL): fixed ntx handling of numerics + Added special decoding for keys of Negative values. + * adsCreate: fixed fielddefs buffer sizing + * adsOpen: fixed fieldname length references + set uiLen of extended types + + * adsInfo: reformatted, prepared for fleshing out the rest + of the options. + Added support for dbinfo(DBI_ISFLOCK) + +2002-10-01 08:25 UTC+0300 Chen Kedem + * doc/es/browse.txt + * doc/es/cmdline.txt + * doc/es/dbstrux.txt + ! columns in
need to be at least 3 spaces apart + +2002-09-30 16:46 UTC+0300 Chen Kedem + * doc/en/input.txt + * doc/en/lang.txt + * doc/en/menu.txt + * doc/en/objfunc.txt + ! columns in
need to be at least 3 spaces apart + +2002-09-29 12:00 UTC+0700 Andi Jahja + * source/rtl/tget.prg + ! fixed get (value and display) involving negative (with decimal) + number whose value is less than 1. + +2002-09-28 21:50 UTC-0300 Horacio Roldan + * source/compiler/hbusage.c + ! fixed a bug in the list of hb_compPrintCredits ;-) + +2002-09-28 01:55 UTC-0300 Horacio Roldan + * include/hbapirdd.h + * include/hbrdddbf.h + * include/hbrddcdx.h + * include/hbrddntx.h + * source/rdd/dbcmd.c + * source/rdd/workarea.c + * contrib/rdd_ads/ads1.c + * contrib/rdd_ads/rddads.h + + Changed fieldname max length handling, + it is now a workarea property. (set by the RDD) + (in ADS, this is just a patch) + +2002-09-28 01:50 UTC-0300 Horacio Roldan + * source/rdd/dbfcdx/dbfcdx1.h + * source/rdd/dbfcdx/dbfcdx1.c + ! changed key in-memory management. + this fixes trimmed key problems, reported by Lorenzo Fiorini. + ! fixed error reported by Gianni Santamarina. + * source/rdd/dbf1.c + ! fixed some typos + +2002-09-26 12:30 UTC-0300 Horacio Roldan + * include/hbapi.h + - removed filecase() definition from Extend API + * include/hbapifs.h + - added filecase() definition to FS API + * include/hbset.h + * source/rtl/set.c + * source/rtl/filesys.c + ! fixed GPF, fixed MSVC typecast, + changed settings from strings to numeric constants. + +2002-09-25 18:47 UTC-0300 Horacio Roldan + * source/rdd/rtl/file.c + * source/rdd/rtl/filesys.c + ! added some missing casts. + +2002-09-25 17:15 UTC-0300 Horacio Roldan + * source/rdd/rtl/file.c + * source/rdd/rtl/filesys.c + ! fixed GPF, hb_xfree must be used for hb_xgrab memory. + +2002-09-25 20:00 GMT+0100 Martin Vogel + * contrib/libct/color.prg + ! fixed initialization bug reported by Marek Horodyski + +2002-09-25 13:15 UTC-0300 Gustavo Junior Alves + * source/rtl/file.c + * source/rtl/filesys.c + ! Allow last changes to compile under MSVC + ! Change strdup to hb_strdup and rindex (BSD) to strrchr (POSIX) + +2002-09-23 11:00 UTC-0300 Gustavo Junior Alves + * include/hbapi.h + * include/hbset.h + * include/set.ch + * source/pp/pptable.c + * source/rtl/file.c + * source/rtl/filesys.c + * source/rtl/set.c + ! Implement SET FILECASE, DIRCASE and DIRSEPARATOR + * source/pp/ppcore.c + ! Fix a core dump on HB_TR_DEBUG PrevSquare + +2002-09-22 16:40 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! Bug fixed introduced in previous fix :) + +2002-09-22 12:25 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! Bug fixed in key append + +2002-09-21 12:20 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! Bug fixed, related to seeking while set deleted on is set + +2002-09-20 23:55 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! Bug fixed, related to softseek + +2002-09-20 14:50 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! Bug fixed in ntxZap() + +2002-09-20 12:32 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + * include/hbrddntx.h + * Improved algorithm of record append in shared mode - that should result + in better speed. + * Maximum number of keys in the index page is now Clipper compatible - + as I just discovered for myself, in Clipper it is already ( hm... I forgot + appropriate English word - is divided by 2 ). + +2002-09-19 00:35 UTC-0300 Horacio Roldan + * source/rdd/dbfcdx/dbfcdx2.h + * source/rdd/dbfcdx/dbfcdx1.c + + added function hb_cdxGetTagNumber + ! fixed some castings and warnings reported by + Larry Sevilla, Luiz and Andy. + ! fixed controlling order after ordCreate() + ! fixed controlling order after ordListAdd() + This fixes the controlling order after: + USE name INDEX name + SET INDEX TO name + INDEX ON key TAG tagname + * source/rdd/dbcmd.c + ! fix gpf in pack, reported by Jorge Mason. + * source/rdd/dbf1.c + + added support for DBI_FULLPATH and DBI_SHARED, + sent by Gianluca Piemonte. + +2002-09-18 16:00 UTC-0400 David G. Holm + * source/rdd/dbfcdx/dbfcdx1.c + ! Replaced non-existent _SORTSWAPPAGE used in hb_xgrab() type + override with the existing, and correct, LPSORTSWAPPAGE. + +2002-09-17 21:55 UTC-01 jf lefebvre (mafact) + * source/rdd/dbfcdx\dbfcdx1.c + ! Added needed typecasting for M$soft C + * source/vm/classes.c + ! Minor cosmetic change and syncro with xHarbour + +2002-09-13 23:30 UTC-0400 David G. Holm + * source/rtl/dbdelim.prg + ! Bug fix for fields that have an embedded delimiter. + +2002-09-13 22:20 UTC-0400 David G. Holm + * source/rtl/dbdelim.prg + ! Bug fixes for consecutive blank fields in a record and for + records that have no delimiters (either because there are + no character fields or because all of the character fields + are blank). + +2002-09-09 16:48 UTC+0300 Chen Kedem + * source/common/hbffind.c + - Remove redundant line which used FILE_ATTRIBUTE_NOT_CONTENT_INDEXED + from hb_fsAttToRaw(). The next line already use the explicit + value 0x00002000. Now Harbour complie with Borland BCB 3.0 + +2002-09-09 14:25 UTC+0100 Tomaz Zupan + * contrib/odbc/todbc.prg + + Added recordset caching. + +2002-09-07 14:38 UTC+0300 Alexander Kresin + * source/rdd/dbfntx/dbfntx1.c + ! GPF fixed, which appeared after pack operation if dbf became empty. + +2002-09-07 00:30 UTC-0300 Luiz Rafael Culik + * source/rtl/tget.prg + Added missing Caption DATA and init to "" + +2002-09-05 21:15 UTC-0300 Luiz Rafael Culik + * contrib/rdd_ads/ads1.c + ! Fixed Support for Long fields names in adscreate + ! Fixed Display for the follow type of fields when ADT format is USED + Autoinc -> 10 + Double/Curdouble 8(Official Size of field on Database)+2*HB_SET_DECIMALS value + +2002-09-05 18:46 UTC-0300 Horacio Roldan + * include/hbrddcdx.h + * source/rdd/dbfcdx/dbfcdx1.c + * source/rdd/dbfcdx/dbfcdx1.h + * source/rdd/dbfcdx/dbfcdx2.h + + added support for creating big indexes + hb_cdxSortSwapSavePage, hb_cdxSortSwapFillPage, + hb_cdxSortSwapRecurseDict, hb_cdxSortSwapSendWord + hb_cdxSortSwapBuildIndex, hb_cdxSortSwapGetNextKey; + + added hb_cdxKeyValCompare + ! fixed hb_cdxKeyGetItem for numeric keys + ! fixed hb_cdxTagExtNodeWrite + ! renamed some structs because td was confused + + * source/rdd/dbf1.c + synched with + 2002-08-31 20:38 UTC-0800 Ron Pinkas + * source/rdd/dbf1.c + ! Fixed hb_dbfLockFile() to release record locks before + attempting to lock the file. + 2002-08-31 15:24 UTC-0800 Ron Pinkas + * source/rdd/dbf1.c + ! Fixed hb_dbfLockRecord() to return success when area + alread has file lock. + +2002-09-04 17:56 UTC+0200 Maurilio Longo + * source/rtl/tbrowse.prg + ! Fixed cell padding inside ::DispCell(). Character or memo fields have to be + padded right. Number fields have to be padded left. + +2002-09-03 19:10 UTC+0200 Maurilio Longo + * source/rtl/teditor.prg + ! fixed line splitting when a character is deleted from a line and there is a + word wrapping limit. Please note that lines of text are treated differently + from the way clipper 5.x treats them, in particular when past EOL there is no + deletion from current line + * source/rtl/memoedit.prg + ! fixed cursor positiong and shaping when calling an user function + +2002-09-02 19:25 UTC-0400 David G. Holm + * ChangeLog + + Started a new ChangeLog. + * source/rtl/ChangeLog.013 + + Renamed old ChangeLog, due to file size. + * source/rtl/dbdelim.prg + ! Code fix to handle the field delimiters, provided by the + APPEND FROM code author, Marco Braida . + diff --git a/harbour/include/hbapifs.h b/harbour/include/hbapifs.h index 4fe4083db1..689f652eeb 100644 --- a/harbour/include/hbapifs.h +++ b/harbour/include/hbapifs.h @@ -202,6 +202,7 @@ extern ULONG hb_fsAttrToRaw( USHORT uiAttr ); extern USHORT hb_fsAttrEncode( const char * szAttr ); extern char * hb_fsAttrDecode( USHORT uiAttr, char * szAttr ); extern BYTE * hb_filecase ( char * ); /* Convert string to environment case */ +extern BYTE HB_EXPORT * hb_fileNameConv(char *str) ; #if defined(HB_EXTERN_C) } diff --git a/harbour/include/hbmath.h b/harbour/include/hbmath.h index e1085323c5..5800b3f932 100644 --- a/harbour/include/hbmath.h +++ b/harbour/include/hbmath.h @@ -118,6 +118,8 @@ extern int hb_matherr (HB_MATH_EXCEPTION * pexc); extern HB_MATH_HANDLERPROC hb_mathSetHandler (HB_MATH_HANDLERPROC handlerproc); extern HB_MATH_HANDLERPROC hb_mathGetHandler (void); +extern double hb_random_num( void ); + /* include defines from math.ch */ #include diff --git a/harbour/include/hbrddcdx.h b/harbour/include/hbrddcdx.h index c808f754b6..b65b1aed7c 100644 --- a/harbour/include/hbrddcdx.h +++ b/harbour/include/hbrddcdx.h @@ -53,17 +53,19 @@ #ifndef HB_RDDCDX_H_ #define HB_RDDCDX_H_ +#include "hbsetup.h" #include "hbapirdd.h" #include "hbdbferr.h" #ifndef HB_CDP_SUPPORT_OFF #include "hbapicdp.h" #endif +#define HB_EXTERNAL_RDDDBF_USE +#include "hbrdddbf.h" #if defined(HB_EXTERN_C) extern "C" { #endif - /* CDX constants and defaults */ #define CDX_INDEXEXT ".cdx" #define CDX_MAXKEY 240 @@ -72,10 +74,10 @@ extern "C" { #define CDX_INT_FREESPACE 500 #define CDX_EXT_FREESPACE 488 #define CDX_DUMMYNODE 0xFFFFFFFFL -#define CDX_LOCKOFFSET 0x7FFFFFFEL -#define CDX_LOCKSIZE 1L +//#define CDX_LOCKOFFSET 0x7FFFFFFEL +//#define CDX_LOCKSIZE 1L #define CDX_STACKSIZE 64 -#define CDX_PAGECACHESIZE 16 +#define CDX_PAGECACHESIZE 8 #define CDX_NODE_BRANCH 0 #define CDX_NODE_ROOT 1 #define CDX_NODE_LEAF 2 @@ -113,7 +115,7 @@ extern "C" { #define CURKEY_ISSET(pTag) (((pTag)->curKeyState & (CDX_CURKEY_NOTEXIST | CDX_CURKEY_UNDEF)) == 0) #define CURKEY_REC(pTag) ((((pTag)->curKeyState & CDX_CURKEY_REC) != 0) ? (pTag)->curKey->rec : 0) #define CURKEY_VAL(pTag) ((((pTag)->curKeyState & CDX_CURKEY_VAL) != 0) ? (pTag)->curKey->val : NULL) -#define CURKEY_REFRESH(pTag) +#define CURKEY_REFRESH(pTag) */ #define HB_CDXMAXKEY( x ) ((USHORT) ((x) > CDX_MAXKEY ? CDX_MAXKEY : (x))) @@ -147,7 +149,7 @@ typedef struct _CDXTAGHEADER BYTE forExpPos[ 2 ]; /* offset of filter expression */ BYTE forExpLen[ 2 ]; /* length of filter expression */ BYTE keyExpPos[ 2 ]; /* offset of key expression */ - BYTE keyExpLen[ 2 ]; /* length of key expression */ + BYTE keyExpLen[ 2 ]; /* length of key expression */ BYTE keyExpPool[ CDX_PAGELEN ]; } CDXTAGHEADER; typedef CDXTAGHEADER * LPCDXTAGHEADER; @@ -232,7 +234,7 @@ typedef struct _CDXPAGE SHORT bufKeyLen; /* and maybe temporary overwriten when adding */ SHORT iFree; /* new key to interior node record. */ BYTE * pKeyBuf; /* pointer to uncompressed leaf page key pool */ - //SHORT iKeyInBuf; + /* SHORT iKeyInBuf; */ struct _CDXPAGE * Owner; struct _CDXPAGE * Child; @@ -320,6 +322,11 @@ typedef struct _CDXINDEX LPCDXLIST freeLst; /* list of free pages in index file */ int lockWrite; /* number of write lock set */ int lockRead; /* number of read lock set */ + ULONG ulLockPos; /* readlock position for CL53 lock scheme */ +#ifdef HB_CDX_DBGCODE + BOOL RdLck; + BOOL WrLck; +#endif BOOL fChanged; /* changes written to index, need upadte ulVersion */ ULONG ulVersion; /* network version/update flag */ } CDXINDEX; @@ -391,10 +398,12 @@ typedef struct _CDXAREA BOOL fDeleted; /* TRUE if record is deleted */ BOOL fUpdateHeader; /* Update header of file */ BOOL fFLocked; /* TRUE if file is locked */ + BOOL fHeaderLocked; /* TRUE if DBF header is locked */ LPDBRELINFO lpdbPendingRel; /* Pointer to parent rel struct */ BYTE bYear; /* Last update */ BYTE bMonth; BYTE bDay; + BYTE bLockType; /* Type of locking shemes */ ULONG * pLocksPos; /* List of records locked */ ULONG ulNumLocksPos; /* Number of records locked */ #ifndef HB_CDP_SUPPORT_OFF diff --git a/harbour/include/hbrdddbf.h b/harbour/include/hbrdddbf.h index eb41f9c840..7f1984207a 100644 --- a/harbour/include/hbrdddbf.h +++ b/harbour/include/hbrdddbf.h @@ -66,6 +66,40 @@ extern "C" { #define DBF_TABLEEXT ".dbf" /* DBF lock */ #define DBF_LOCKPOS 1000000000L +/* DBF locking schemes */ +#define DBF_LOCKPOS_CLIP 1000000000L +#define DBF_LOCKPOS_CL53 1000000000L +#define DBF_LOCKPOS_VFP 0x40000000L +#define DBF_LOCKPOS_VFPX 0x7ffffffeL + +#define DBF_LOCKDIR_CLIP 1 +#define DBF_LOCKDIR_CL53 1 +#define DBF_LOCKDIR_VFP 2 /* lock forward at at record offset */ +#define DBF_LOCKDIR_VFPX -1 + +#define DBF_FLCKSIZE_CLIP 1000000000L +#define DBF_FLCKSIZE_CL53 1000000000L +#define DBF_FLCKSIZE_VFP 0x3ffffffdL +#define DBF_FLCKSIZE_VFPX 0x07ffffffL + +#define DBF_RLCKSIZE_CLIP 1L +#define DBF_RLCKSIZE_CL53 1L +#define DBF_RLCKSIZE_VFP 1L +#define DBF_RLCKSIZE_VFPX 1L + +#define IDX_LOCKPOS_CLIP 1000000000L +#define IDX_LOCKPOS_CL53 0xfffeffffL +#define IDX_LOCKPOS_VFP 0x7ffffffeL + +#define IDX_LOCKPOOL_CLIP 0L +#define IDX_LOCKPOOL_CL53 0x00010000L +#define IDX_LOCKPOOL_VFP 0L + +#ifdef OS_UNIX_COMPATIBLE +#define DBF_EXLUSIVE_LOCKPOS 0x7fffffffL +#define DBF_EXLUSIVE_LOCKSIZE 1L +#endif + @@ -134,10 +168,12 @@ typedef struct _DBFAREA BOOL fDeleted; /* TRUE if record is deleted */ BOOL fUpdateHeader; /* Update header of file */ BOOL fFLocked; /* TRUE if file is locked */ + BOOL fHeaderLocked; /* TRUE if DBF header is locked */ LPDBRELINFO lpdbPendingRel; /* Pointer to parent rel struct */ BYTE bYear; /* Last update */ BYTE bMonth; BYTE bDay; + BYTE bLockType; /* Type of locking shemes */ ULONG * pLocksPos; /* List of records locked */ ULONG ulNumLocksPos; /* Number of records locked */ PHB_CODEPAGE cdPage; /* Area's codepage pointer */ @@ -150,7 +186,7 @@ typedef DBFAREA * LPDBFAREA; #endif -#ifndef HB_EXTRANAL_RDDDBF_USE +#ifndef HB_EXTERNAL_RDDDBF_USE /* * -- DBF METHODS -- @@ -256,7 +292,13 @@ static BOOL hb_dbfExists( PHB_ITEM pItemTable, PHB_ITEM pItemIndex ); #define hb_dbfWhoCares NULL -#endif /* HB_EXTRANAL_RDDDBF_USE */ +#endif /* HB_EXTERNAL_RDDDBF_USE */ + +extern ULONG HB_EXPORT hb_dbfGetMemoBlock( DBFAREAP pArea, USHORT uiIndex ); +extern void HB_EXPORT hb_dbfPutMemoBlock( DBFAREAP pArea, USHORT uiIndex, ULONG ulBlock ); +extern ERRCODE HB_EXPORT hb_dbfGetEGcode( ERRCODE errCode ); +extern BOOL HB_EXPORT hb_dbfLockIdxFile( FHANDLE hFile, BYTE bScheme, USHORT usMode, ULONG *pPoolPos ); +extern BOOL HB_EXPORT hb_dbfLockIdxGetData( BYTE bScheme, ULONG *ulPos, ULONG *ulPool ); #if defined(HB_EXTERN_C) } diff --git a/harbour/include/hbrdddbt.h b/harbour/include/hbrdddbt.h index ab04155142..e891cda222 100644 --- a/harbour/include/hbrdddbt.h +++ b/harbour/include/hbrdddbt.h @@ -59,7 +59,7 @@ #ifndef HB_CDP_SUPPORT_OFF #include "hbapicdp.h" #endif -#define HB_EXTRANAL_RDDDBF_USE +#define HB_EXTERNAL_RDDDBF_USE #include "hbrdddbf.h" #if defined(HB_EXTERN_C) diff --git a/harbour/include/hbrddfpt.h b/harbour/include/hbrddfpt.h index 1cb499658f..383b4843f3 100644 --- a/harbour/include/hbrddfpt.h +++ b/harbour/include/hbrddfpt.h @@ -53,20 +53,20 @@ #ifndef HB_RDDFPT_H_ #define HB_RDDFPT_H_ +#include "hbsetup.h" #include "hbdbf.h" #include "hbdbferr.h" #include "hbapirdd.h" #ifndef HB_CDP_SUPPORT_OFF #include "hbapicdp.h" #endif -#define HB_EXTRANAL_RDDDBF_USE +#define HB_EXTERNAL_RDDDBF_USE #include "hbrdddbf.h" #if defined(HB_EXTERN_C) extern "C" { #endif - /* MEMO constants and defaults */ #define FPT_MEMOEXT ".fpt" #define FPT_LOCKPOS 0x00000000L @@ -115,16 +115,20 @@ extern "C" { #define FPTIT_FLEX_LONG 0x03F6 #define FPTIT_FLEX_DOUBLE 0x03F8 -#define FPTIT_FLEXAR_ARAY 0x0C -#define FPTIT_FLEXAR_NIL 0x00 -#define FPTIT_FLEXAR_TRUE 0x19 -#define FPTIT_FLEXAR_FALSE 0x1A -#define FPTIT_FLEXAR_DATE 0x0E -#define FPTIT_FLEXAR_BYTE 0x12 -#define FPTIT_FLEXAR_SHORT 0x13 -#define FPTIT_FLEXAR_LONG 0x20 -#define FPTIT_FLEXAR_DBL 0x0F -#define FPTIT_FLEXAR_STR 0x07 +#define FPTIT_FLEXAR_ARAY 0x0C +#define FPTIT_FLEXAR_NIL 0x00 +#define FPTIT_FLEXAR_TRUE 0x19 +#define FPTIT_FLEXAR_FALSE 0x1A +#define FPTIT_FLEXAR_DATE 0x0E +#define FPTIT_FLEXAR_BYTE1 0x11 +#define FPTIT_FLEXAR_BYTE 0x12 +#define FPTIT_FLEXAR_BYTE2 0x1D +#define FPTIT_FLEXAR_SHORT 0x13 +#define FPTIT_FLEXAR_SHORT2 0x1E +#define FPTIT_FLEXAR_LONG 0x20 +#define FPTIT_FLEXAR_DBL 0x0F +#define FPTIT_FLEXAR_STR 0x07 +#define FPTIT_FLEXAR_NUL 0x18 /* #define HB_IT_NIL ( ( USHORT ) 0x0000 ) @@ -311,8 +315,4 @@ static ERRCODE hb_fptWriteDBHeader( FPTAREAP pArea ); } #endif -extern ULONG hb_dbfGetMemoBlock( DBFAREAP pArea, USHORT uiIndex ); -extern void hb_dbfPutMemoBlock( DBFAREAP pArea, USHORT uiIndex, ULONG ulBlock ); -extern ERRCODE hb_dbfGetEGcode( ERRCODE errCode ); - #endif /* HB_RDDFPT */ diff --git a/harbour/include/hbrddntx.h b/harbour/include/hbrddntx.h index 42d19bcd00..2d05786ae3 100644 --- a/harbour/include/hbrddntx.h +++ b/harbour/include/hbrddntx.h @@ -283,10 +283,12 @@ typedef struct _NTXAREA BOOL fDeleted; /* TRUE if record is deleted */ BOOL fUpdateHeader; /* Update header of file */ BOOL fFLocked; /* TRUE if file is locked */ + BOOL fHeaderLocked; /* TRUE if DBF header is locked */ LPDBRELINFO lpdbPendingRel; /* Pointer to parent rel struct */ BYTE bYear; /* Last update */ BYTE bMonth; BYTE bDay; + BYTE bLockType; /* Type of locking shemes */ ULONG * pLocksPos; /* List of records locked */ ULONG ulNumLocksPos; /* Number of records locked */ PHB_CODEPAGE cdPage; /* Area's codepage pointer */ diff --git a/harbour/include/hbset.h b/harbour/include/hbset.h index ffad3f135f..d6e925ed24 100644 --- a/harbour/include/hbset.h +++ b/harbour/include/hbset.h @@ -128,7 +128,8 @@ typedef enum HB_SET_FILECASE = 102, HB_SET_DIRCASE = 103, HB_SET_DIRSEPARATOR = 104, - HB_SET_EOF = 105 + HB_SET_EOF = 105, + HB_SET_DBFLOCKSCHEME = 106 } HB_set_enum; @@ -192,12 +193,18 @@ typedef struct char HB_SET_DIRSEPARATOR; int HB_SET_VIDEOMODE; BOOL HB_SET_WRAP; + int HB_SET_DBFLOCKSCHEME; } HB_SET_STRUCT; #define HB_SET_CASE_MIXED 0 #define HB_SET_CASE_LOWER 1 #define HB_SET_CASE_UPPER 2 +#define HB_SET_DBFLOCK_DEFAULT 0 +#define HB_SET_DBFLOCK_CLIP 1 +#define HB_SET_DBFLOCK_CL53 2 +#define HB_SET_DBFLOCK_VFP 3 + extern HB_SET_STRUCT hb_set; extern void hb_setInitialize( void ); diff --git a/harbour/makefile.bc b/harbour/makefile.bc index d7ec35d75a..d0d05e9221 100644 --- a/harbour/makefile.bc +++ b/harbour/makefile.bc @@ -257,6 +257,7 @@ RTL_LIB_OBJS = \ $(OBJ_DIR)\gtapiu.obj \ $(OBJ_DIR)\gx.obj \ $(OBJ_DIR)\hardcr.obj \ + $(OBJ_DIR)\hbrandom.obj \ $(OBJ_DIR)\idle.obj \ $(OBJ_DIR)\inkey.obj \ $(OBJ_DIR)\is.obj \ @@ -1535,6 +1536,10 @@ $(OBJ_DIR)\hardcr.obj : $(RTL_DIR)\hardcr.c $(CC) $(CLIBFLAGS) -o$@ $** tlib $(RTL_LIB) $(ARFLAGS) -+$@,, +$(OBJ_DIR)\hbrandom.obj : $(RTL_DIR)\hbrandom.c + $(CC) $(CLIBFLAGS) -o$@ $** + tlib $(RTL_LIB) $(ARFLAGS) -+$@,, + $(OBJ_DIR)\idle.obj : $(RTL_DIR)\idle.c $(CC) $(CLIBFLAGS) -o$@ $** tlib $(RTL_LIB) $(ARFLAGS) -+$@,, diff --git a/harbour/makefile.nt b/harbour/makefile.nt index 1d2575b648..cfa954107e 100644 --- a/harbour/makefile.nt +++ b/harbour/makefile.nt @@ -310,6 +310,7 @@ RTL_LIB_OBJS = \ $(OBJ_DIR)\gtapiu.obj \ $(OBJ_DIR)\gx.obj \ $(OBJ_DIR)\hardcr.obj \ + $(OBJ_DIR)\hbrandom.obj \ $(OBJ_DIR)\idle.obj \ $(OBJ_DIR)\inkey.obj \ $(OBJ_DIR)\is.obj \ diff --git a/harbour/makefile.vc b/harbour/makefile.vc index 5906f0d8a9..cb24ce9666 100644 --- a/harbour/makefile.vc +++ b/harbour/makefile.vc @@ -274,6 +274,7 @@ RTL_LIB_OBJS = \ $(OBJ_DIR)\gtapiu.obj \ $(OBJ_DIR)\gx.obj \ $(OBJ_DIR)\hardcr.obj \ + $(OBJ_DIR)\hbrandom.obj \ $(OBJ_DIR)\idle.obj \ $(OBJ_DIR)\inkey.obj \ $(OBJ_DIR)\is.obj \ diff --git a/harbour/source/rdd/dbf1.c b/harbour/source/rdd/dbf1.c index 2a3c0c2175..03143bc200 100644 --- a/harbour/source/rdd/dbf1.c +++ b/harbour/source/rdd/dbf1.c @@ -60,10 +60,11 @@ #include "hbapilng.h" #include "hbset.h" #include "hbdate.h" +#include "hbmath.h" #include "hbdbsort.h" #include "error.ch" #include -# include "hbapicdp.h" +#include "hbapicdp.h" extern PHB_CODEPAGE s_cdpage; #define __PRG_SOURCE__ __FILE__ @@ -289,36 +290,44 @@ static BOOL hb_dbfWriteRecord( DBFAREAP pArea ) /* * Unlock all records. */ -static void hb_dbfUnlockAllRecords( DBFAREAP pArea ) +static ERRCODE hb_dbfUnlockAllRecords( DBFAREAP pArea ) { - ULONG ulCount; + ERRCODE uiError = SUCCESS; HB_TRACE(HB_TR_DEBUG, ("hb_dbfUnlockAllRecords(%p, %p)", pArea )); if( pArea->pLocksPos ) { + ULONG ulCount; + + uiError = SELF_GOCOLD( ( AREAP ) pArea ); for( ulCount = 0; ulCount < pArea->ulNumLocksPos; ulCount++ ) SELF_RAWLOCK( ( AREAP ) pArea, REC_UNLOCK, pArea->pLocksPos[ ulCount ] ); hb_xfree( pArea->pLocksPos ); pArea->pLocksPos = NULL; } pArea->ulNumLocksPos = 0; + return uiError; } /* * Unlock a records. */ -static void hb_dbfUnlockRecord( DBFAREAP pArea, ULONG ulRecNo ) +static ERRCODE hb_dbfUnlockRecord( DBFAREAP pArea, ULONG ulRecNo ) { + ERRCODE uiError = SUCCESS; ULONG ulCount, * pList; HB_TRACE(HB_TR_DEBUG, ("hb_dbfUnlockRecord(%p, %lu)", pArea, ulRecNo)); - if( ulRecNo <= 0 ) - ulRecNo = 1; + /* Search the locked record */ + for( ulCount = 0; ulCount < pArea->ulNumLocksPos && + pArea->pLocksPos[ ulCount ] != ulRecNo; ulCount++ ); - if( SELF_RAWLOCK( ( AREAP ) pArea, REC_UNLOCK, ulRecNo ) == SUCCESS ) + if( ulCount < pArea->ulNumLocksPos ) { + uiError = SELF_GOCOLD( ( AREAP ) pArea ); + SELF_RAWLOCK( ( AREAP ) pArea, REC_UNLOCK, ulRecNo ); if( pArea->ulNumLocksPos == 1 ) /* Delete the list */ { hb_xfree( pArea->pLocksPos ); @@ -327,23 +336,16 @@ static void hb_dbfUnlockRecord( DBFAREAP pArea, ULONG ulRecNo ) } else /* Resize the list */ { - /* Search the locked record */ - for( ulCount = 0; ulCount < pArea->ulNumLocksPos; ulCount++ ) - { - if( pArea->pLocksPos[ ulCount ] == ulRecNo ) - { - pList = pArea->pLocksPos + ulCount; - memmove( pList, pList + 1, ( pArea->ulNumLocksPos - ulCount - 1 ) * - sizeof( ULONG ) ); - pArea->pLocksPos = ( ULONG * ) hb_xrealloc( pArea->pLocksPos, - ( pArea->ulNumLocksPos - 1 ) * - sizeof( ULONG ) ); - pArea->ulNumLocksPos --; - return; - } - } + pList = pArea->pLocksPos + ulCount; + memmove( pList, pList + 1, ( pArea->ulNumLocksPos - ulCount - 1 ) * + sizeof( ULONG ) ); + pArea->pLocksPos = ( ULONG * ) hb_xrealloc( pArea->pLocksPos, + ( pArea->ulNumLocksPos - 1 ) * + sizeof( ULONG ) ); + pArea->ulNumLocksPos --; } } + return uiError; } /* @@ -364,6 +366,7 @@ static ERRCODE hb_dbfLockRecord( DBFAREAP pArea, ULONG ulRecNo, BOOL * pResult, return SUCCESS; } + /* TODO: what is this ??? */ if( ulRecNo <= 0 ) ulRecNo = 1; @@ -399,10 +402,8 @@ static ERRCODE hb_dbfLockRecord( DBFAREAP pArea, ULONG ulRecNo, BOOL * pResult, * pResult = TRUE; if( !pArea->fPositioned ) hb_dbfGoTo( pArea, pArea->ulRecNo ); - /* - else + else if ( !pArea->fRecordChanged ) pArea->fValidBuffer = FALSE; - */ } else * pResult = FALSE; @@ -424,11 +425,11 @@ static ERRCODE hb_dbfLockFile( DBFAREAP pArea, BOOL * pResult ) hb_dbfUnlockAllRecords( pArea ); SELF_RAWLOCK( ( AREAP ) pArea, FILE_LOCK, 0 ); - * pResult = pArea->fFLocked; + if( !pArea->fPositioned ) hb_dbfGoTo( pArea, pArea->ulRecNo ); - else + else if ( !pArea->fRecordChanged ) pArea->fValidBuffer = FALSE; } else @@ -440,12 +441,18 @@ static ERRCODE hb_dbfLockFile( DBFAREAP pArea, BOOL * pResult ) /* * Unlock a file. */ -static void hb_dbfUnlockFile( DBFAREAP pArea ) +static ERRCODE hb_dbfUnlockFile( DBFAREAP pArea ) { + ERRCODE uiError = SUCCESS; + HB_TRACE(HB_TR_DEBUG, ("hb_dbfUnlockFile(%p)", pArea)); if( pArea->fFLocked ) + { + uiError = SELF_GOCOLD( ( AREAP ) pArea ); SELF_RAWLOCK( ( AREAP ) pArea, FILE_UNLOCK, 0 ); + } + return uiError; } /* @@ -587,6 +594,85 @@ void hb_dbfPutMemoBlock( DBFAREAP pArea, USHORT uiIndex, ULONG ulBlock ) } } +/* + * Get information about locking schemes for additional files (MEMO, INDEX) + * This function is common for different MEMO implementation + * so I left it in DBF. + */ +BOOL HB_EXPORT hb_dbfLockIdxGetData( BYTE bScheme, ULONG *ulPos, ULONG *ulPool ) +{ + switch ( bScheme ) + { + case HB_SET_DBFLOCK_CLIP: + *ulPos = IDX_LOCKPOS_CLIP; + *ulPool = IDX_LOCKPOOL_CLIP; + break; + + case HB_SET_DBFLOCK_CL53: + *ulPos = IDX_LOCKPOS_CL53; + *ulPool = IDX_LOCKPOOL_CL53; + break; + + case HB_SET_DBFLOCK_VFP: + *ulPos = IDX_LOCKPOS_VFP; + *ulPool = IDX_LOCKPOOL_VFP; + break; + + default: + return FALSE; + } + return TRUE; +} + +/* + * Set lock using current locking schemes in additional files (MEMO, INDEX) + * This function is common for different MEMO implementation + * so I left it in DBF. + */ +BOOL HB_EXPORT hb_dbfLockIdxFile( FHANDLE hFile, BYTE bScheme, USHORT usMode, ULONG *pPoolPos ) +{ + ULONG ulPos, ulPool, ulSize = 1; + BOOL fRet = FALSE, fWait; + + if ( !hb_dbfLockIdxGetData( bScheme, &ulPos, &ulPool ) ) + return fRet; + + do + { + switch ( usMode & FL_MASK ) + { + case FL_LOCK: + if ( ulPool ) + { + if ( ( usMode & FLX_SHARED ) != 0 ) + *pPoolPos = (ULONG) ( hb_random_num() * ulPool ) + 1; + else + { + *pPoolPos = 0; + ulSize = ulPool + 1; + } + } + break; + + case FL_UNLOCK: + if ( ulPool ) + { + if ( ! *pPoolPos ) + ulSize = ulPool + 1; + } + break; + + default: + return FALSE; + } + fRet = hb_fsLock( hFile, ulPos + *pPoolPos, ulSize, usMode ); + fWait = ( !fRet && ( usMode & FLX_WAIT ) != 0 && ( usMode & FL_MASK ) == FL_LOCK ); + /* TODO: call special error handler (LOCKHANDLER) hiere if fWait */ + + } while ( fWait ); + return fRet; +} + /* * -- DBF METHODS -- */ @@ -821,9 +907,6 @@ static ERRCODE hb_dbfAppend( DBFAREAP pArea, BOOL bUnLockAll ) HB_TRACE(HB_TR_DEBUG, ("hb_dbfAppend(%p, %d)", pArea, (int) bUnLockAll)); - if( SELF_GOCOLD( ( AREAP ) pArea ) == FAILURE ) - return FAILURE; - if( pArea->fReadonly ) { pError = hb_errNew(); @@ -835,6 +918,9 @@ static ERRCODE hb_dbfAppend( DBFAREAP pArea, BOOL bUnLockAll ) return FAILURE; } + if( SELF_GOCOLD( ( AREAP ) pArea ) == FAILURE ) + return FAILURE; + /* Reset parent rel struct */ pArea->lpdbPendingRel = NULL; @@ -1079,17 +1165,15 @@ static ERRCODE hb_dbfGoCold( DBFAREAP pArea ) pArea->fRecordChanged = FALSE; - if( !pArea->fAppend ) + if( pArea->fAppend ) + { pArea->fUpdateHeader = TRUE; - else pArea->fAppend = FALSE; + } /* Update header */ - if( pArea->fShared ) + if( pArea->fShared && pArea->fUpdateHeader ) SELF_WRITEDBHEADER( ( AREAP ) pArea ); - /* hb_dbfWriteDBHeader( pArea ); */ - - pArea->fAppend = FALSE; } return SUCCESS; } @@ -1448,9 +1532,42 @@ static ERRCODE hb_dbfCreate( DBFAREAP pArea, LPDBOPENINFO pCreateInfo ) HB_TRACE(HB_TR_DEBUG, ("hb_dbfCreate(%p, %p)", pArea, pCreateInfo)); + pError = NULL; + /* Try create */ + do + { + pArea->hDataFile = hb_spCreate( pCreateInfo->abName, FC_NORMAL ); + if( pArea->hDataFile == FS_ERROR ) + { + if( !pError ) + { + pError = hb_errNew(); + hb_errPutGenCode( pError, EG_CREATE ); + hb_errPutSubCode( pError, EDBF_CREATE_DBF ); + hb_errPutDescription( pError, hb_langDGetErrorDesc( EG_CREATE ) ); + hb_errPutFileName( pError, ( char * ) pCreateInfo->abName ); + hb_errPutFlags( pError, EF_CANRETRY ); + } + bRetry = ( SELF_ERROR( ( AREAP ) pArea, pError ) == E_RETRY ); + } + else + bRetry = FALSE; + } while( bRetry ); + + if( pError ) + { + hb_errRelease( pError ); + } + + if( pArea->hDataFile == FS_ERROR ) + { + return FAILURE; + } + pArea->szDataFileName = (char *) hb_xgrab( strlen( (char * ) pCreateInfo->abName)+1 ); strcpy( pArea->szDataFileName, ( char * ) pCreateInfo->abName ); uiSize = pArea->uiFieldCount * sizeof( DBFFIELD ); + pBuffer = ( DBFFIELD * ) hb_xgrab( uiSize ); pArea->uiRecordLen = 1; bHasMemo = FALSE; @@ -1504,36 +1621,6 @@ static ERRCODE hb_dbfCreate( DBFAREAP pArea, LPDBOPENINFO pCreateInfo ) pBuffer[ uiCount ] = dbField; } - pError = NULL; - /* Try create */ - do - { - pArea->hDataFile = hb_spCreate( pCreateInfo->abName, FC_NORMAL ); - if( pArea->hDataFile == FS_ERROR ) - { - if( !pError ) - { - pError = hb_errNew(); - hb_errPutGenCode( pError, EG_CREATE ); - hb_errPutSubCode( pError, EDBF_CREATE_DBF ); - hb_errPutDescription( pError, hb_langDGetErrorDesc( EG_CREATE ) ); - hb_errPutFileName( pError, ( char * ) pCreateInfo->abName ); - hb_errPutFlags( pError, EF_CANRETRY ); - } - bRetry = ( SELF_ERROR( ( AREAP ) pArea, pError ) == E_RETRY ); - } - else - bRetry = FALSE; - } while( bRetry ); - if( pError ) - hb_errRelease( pError ); - - if( pArea->hDataFile == FS_ERROR ) - { - hb_xfree( pBuffer ); - return FAILURE; - } - pArea->fShared = pCreateInfo->fShared; pArea->ulRecCount = 0; pArea->uiHeaderLen = sizeof( DBFHEADER ) + uiSize + 2; @@ -1575,7 +1662,7 @@ static ERRCODE hb_dbfCreate( DBFAREAP pArea, LPDBOPENINFO pCreateInfo ) hb_xfree( pFileName ); pFileExt = hb_itemPutC( NULL, "" ); SELF_INFO( ( AREAP ) pArea, DBI_MEMOEXT, pFileExt ); - strncat( pArea->szMemoFileName, hb_itemGetCPtr( pFileExt ), + strncat( pArea->szMemoFileName, pFileExt->item.asString.value, _POSIX_PATH_MAX - strlen( pArea->szMemoFileName ) ); hb_itemRelease( pFileExt ); tmp = pCreateInfo->abName; @@ -1678,7 +1765,7 @@ static ERRCODE hb_dbfNewArea( DBFAREAP pArea ) static ERRCODE hb_dbfOpen( DBFAREAP pArea, LPDBOPENINFO pOpenInfo ) { USHORT uiFlags, uiFields, uiSize, uiCount; - BOOL bRetry, bError; + BOOL bRetry, bError, bLock; PHB_ITEM pError, pFileExt; PHB_FNAME pFileName; char * szFileName; @@ -1688,17 +1775,21 @@ static ERRCODE hb_dbfOpen( DBFAREAP pArea, LPDBOPENINFO pOpenInfo ) HB_TRACE(HB_TR_DEBUG, ("hb_dbfOpen(%p, %p)", pArea, pOpenInfo)); - pArea->szDataFileName = (char *) hb_xgrab( strlen( (char * ) pOpenInfo->abName)+1 ); - strcpy( pArea->szDataFileName, ( char * ) pOpenInfo->abName ); pArea->atomAlias = hb_dynsymGet( ( char * ) pOpenInfo->atomAlias ); if( ( ( PHB_DYNS ) pArea->atomAlias )->hArea ) { hb_errRT_DBCMD( EG_DUPALIAS, EDBCMD_DUPALIAS, NULL, ( char * ) pOpenInfo->atomAlias ); - hb_xfree( pArea->szDataFileName ); return FAILURE; } + if ( !pArea->bLockType ) + { + if ( hb_set.HB_SET_DBFLOCKSCHEME ) + pArea->bLockType = hb_set.HB_SET_DBFLOCKSCHEME; + else + pArea->bLockType = HB_SET_DBFLOCK_CLIP; + } ( ( PHB_DYNS ) pArea->atomAlias )->hArea = pOpenInfo->uiArea; if( pOpenInfo->cdpId ) { @@ -1724,7 +1815,20 @@ static ERRCODE hb_dbfOpen( DBFAREAP pArea, LPDBOPENINFO pOpenInfo ) /* Try open */ do { + bLock = FALSE; pArea->hDataFile = hb_spOpen( pOpenInfo->abName, uiFlags ); +#ifdef DBF_EXLUSIVE_LOCKPOS + if( pArea->hDataFile != FS_ERROR ) + { + if ( !hb_fsLock( pArea->hDataFile, DBF_EXLUSIVE_LOCKPOS, DBF_EXLUSIVE_LOCKSIZE, + FL_LOCK | ( pArea->fShared ? FLX_SHARED : FLX_EXCLUSIVE ) ) ) + { + hb_fsClose( pArea->hDataFile ); + pArea->hDataFile = FS_ERROR; + bLock = TRUE; + } + } +#endif if( pArea->hDataFile == FS_ERROR ) { if( !pError ) @@ -1738,7 +1842,7 @@ static ERRCODE hb_dbfOpen( DBFAREAP pArea, LPDBOPENINFO pOpenInfo ) * Temporary fix for neterr() support and Clipper compatibility, * should be revised with a better solution. */ - if ( hb_fsError() == EACCES ) + if ( hb_fsError() == EACCES || bLock ) hb_errPutOsCode( pError, 32 ); else hb_errPutOsCode( pError, hb_fsError() ); @@ -1763,6 +1867,10 @@ static ERRCODE hb_dbfOpen( DBFAREAP pArea, LPDBOPENINFO pOpenInfo ) return FAILURE; } + /* Allocate only after succesfully open file */ + pArea->szDataFileName = (char *) hb_xgrab( strlen( (char * ) pOpenInfo->abName)+1 ); + strcpy( pArea->szDataFileName, ( char * ) pOpenInfo->abName ); + /* Read file header and exit if error */ if( SELF_READDBHEADER( ( AREAP ) pArea ) == FAILURE ) { @@ -1919,6 +2027,9 @@ static ERRCODE hb_dbfOpen( DBFAREAP pArea, LPDBOPENINFO pOpenInfo ) pArea->pRecord = ( BYTE * ) hb_xgrab( pArea->uiRecordLen ); pArea->fValidBuffer = FALSE; + /* Update the number of record for corrupted headers */ + pArea->ulRecCount = hb_dbfCalcRecCount( pArea ); + /* Position cursor at the first record */ return SELF_GOTOP( ( AREAP ) pArea ); } @@ -2046,6 +2157,9 @@ static ERRCODE hb_dbfSort( DBFAREAP pArea, LPDBSORTINFO pSortInfo ) HB_TRACE(HB_TR_DEBUG, ("hb_dbfSort(%p, %p)", pArea, pSortInfo)); + if( SELF_GOCOLD( ( AREAP ) pArea ) == FAILURE ) + return FAILURE; + if( !hb_dbQSortInit( &dbQuickSort, pSortInfo, pArea->uiRecordLen ) ) return FAILURE; @@ -2312,45 +2426,140 @@ static ERRCODE hb_dbfSetFilter( DBFAREAP pArea, LPDBFILTERINFO pFilterInfo ) */ static ERRCODE hb_dbfRawLock( DBFAREAP pArea, USHORT uiAction, ULONG ulRecNo ) { + ERRCODE uiErr = SUCCESS; + ULONG ulPos, ulFlSize, ulRlSize; + SHORT iDir; + BOOL fLck; + HB_TRACE(HB_TR_DEBUG, ("hb_dbfRawLock(%p, %hu, %lu)", pArea, uiAction, ulRecNo)); - switch( uiAction ) + if( pArea->fShared ) { - case FILE_LOCK: - if( pArea->fShared && !pArea->fFLocked ) - pArea->fFLocked = hb_fsLock( pArea->hDataFile, DBF_LOCKPOS + 1, DBF_LOCKPOS, FL_LOCK ); - break; + switch( pArea->bLockType ) + { + case HB_SET_DBFLOCK_CLIP: + ulPos = DBF_LOCKPOS_CLIP; + iDir = DBF_LOCKDIR_CLIP; + ulFlSize = DBF_FLCKSIZE_CLIP; + ulRlSize = DBF_RLCKSIZE_CLIP; + break; - case FILE_UNLOCK: - if( pArea->fShared && pArea->fFLocked ) - pArea->fFLocked = !hb_fsLock( pArea->hDataFile, DBF_LOCKPOS + 1, DBF_LOCKPOS, FL_UNLOCK ); - break; + case HB_SET_DBFLOCK_CL53: + ulPos = DBF_LOCKPOS_CL53; + iDir = DBF_LOCKDIR_CL53; + ulFlSize = DBF_FLCKSIZE_CL53; + ulRlSize = DBF_RLCKSIZE_CL53; + break; - case APPEND_LOCK: - case REC_LOCK: - if( pArea->fShared && !pArea->fFLocked ) - if( !hb_fsLock( pArea->hDataFile, DBF_LOCKPOS + ulRecNo, 1, FL_LOCK ) ) - return FAILURE; - break; + case HB_SET_DBFLOCK_VFP: + if ( pArea->fHasTags ) + { + ulPos = DBF_LOCKPOS_VFPX; + iDir = DBF_LOCKDIR_VFPX; + ulFlSize = DBF_FLCKSIZE_VFPX; + ulRlSize = DBF_RLCKSIZE_VFPX; + } + else + { + ulPos = DBF_LOCKPOS_VFP; + iDir = DBF_LOCKDIR_VFP; + ulFlSize = DBF_FLCKSIZE_VFP; + ulRlSize = DBF_RLCKSIZE_VFP; + } + break; - case APPEND_UNLOCK: - case REC_UNLOCK: - if( pArea->fShared && !pArea->fFLocked ) - if( !hb_fsLock( pArea->hDataFile, DBF_LOCKPOS + ulRecNo, 1, FL_UNLOCK ) ) - return FAILURE; - break; - case HEADER_LOCK: - if( pArea->fShared && !pArea->fFLocked ) - if( !hb_fsLock( pArea->hDataFile, DBF_LOCKPOS, 1, FL_LOCK ) ) - return FAILURE; - break; - case HEADER_UNLOCK: - if( pArea->fShared && !pArea->fFLocked ) - if( !hb_fsLock( pArea->hDataFile, DBF_LOCKPOS, 1, FL_UNLOCK ) ) - return FAILURE; - break; + default: + return FAILURE; + } + + switch( uiAction ) + { + case FILE_LOCK: + if( !pArea->fFLocked ) + { + if ( iDir < 0 ) + fLck = hb_fsLock( pArea->hDataFile, ulPos - ulFlSize, ulFlSize, FL_LOCK ); + else + fLck = hb_fsLock( pArea->hDataFile, ulPos + 1, ulFlSize, FL_LOCK ); + + if( !fLck ) + uiErr = FAILURE; + else + pArea->fFLocked = TRUE; + } + break; + + case FILE_UNLOCK: + if( pArea->fFLocked ) + { + if ( iDir < 0 ) + fLck = hb_fsLock( pArea->hDataFile, ulPos - ulFlSize, ulFlSize, FL_UNLOCK ); + else + fLck = hb_fsLock( pArea->hDataFile, ulPos + 1, ulFlSize, FL_UNLOCK ); + + if( !fLck ) + uiErr = FAILURE; + pArea->fFLocked = FALSE; + } + break; + + case REC_LOCK: + if( !pArea->fFLocked ) + { + if ( iDir < 0 ) + fLck = hb_fsLock( pArea->hDataFile, ulPos - ulRecNo, ulRlSize, FL_LOCK ); + else if ( iDir == 2 ) + fLck = hb_fsLock( pArea->hDataFile, ulPos + ( ulRecNo - 1 ) * pArea->uiRecordLen + pArea->uiHeaderLen, ulRlSize, FL_LOCK ); + else + fLck = hb_fsLock( pArea->hDataFile, ulPos + ulRecNo, ulRlSize, FL_LOCK ); + + if( !fLck ) + uiErr = FAILURE; + } + break; + + case REC_UNLOCK: + if( !pArea->fFLocked ) + { + if ( iDir < 0 ) + fLck = hb_fsLock( pArea->hDataFile, ulPos - ulRecNo, ulRlSize, FL_UNLOCK ); + else if ( iDir == 2 ) + fLck = hb_fsLock( pArea->hDataFile, ulPos + ( ulRecNo - 1 ) * pArea->uiRecordLen + pArea->uiHeaderLen, ulRlSize, FL_UNLOCK ); + else + fLck = hb_fsLock( pArea->hDataFile, ulPos + ulRecNo, ulRlSize, FL_UNLOCK ); + if( !fLck ) + uiErr = FAILURE; + } + break; + + case APPEND_LOCK: + case HEADER_LOCK: + if( !pArea->fHeaderLocked ) + { + do + { + fLck = hb_fsLock( pArea->hDataFile, ulPos, 1, FL_LOCK | FLX_WAIT ); + /* TODO: call special error handler (LOCKHANDLER) hiere if !fLck */ + } while ( !fLck ); + if( !fLck ) + uiErr = FAILURE; + else + pArea->fHeaderLocked = TRUE; + } + break; + + case APPEND_UNLOCK: + case HEADER_UNLOCK: + if( pArea->fHeaderLocked ) + { + if( !hb_fsLock( pArea->hDataFile, ulPos, 1, FL_UNLOCK ) ) + uiErr = FAILURE; + pArea->fHeaderLocked = FALSE; + } + break; + } } - return SUCCESS; + return uiErr; } /* @@ -2400,13 +2609,13 @@ static ERRCODE hb_dbfUnLock( DBFAREAP pArea, ULONG ulRecNo ) { if( pArea->ulNumLocksPos > 0 ) { - uiError = SELF_GOCOLD( ( AREAP ) pArea ); + SELF_GOCOLD( ( AREAP ) pArea ); /* Unlock all records? */ if( ulRecNo == 0 ) - hb_dbfUnlockAllRecords( pArea ); + uiError = hb_dbfUnlockAllRecords( pArea ); else if( hb_dbfIsLocked( pArea, ulRecNo ) ) - hb_dbfUnlockRecord( pArea, ulRecNo ); + uiError = hb_dbfUnlockRecord( pArea, ulRecNo ); } if( pArea->fFLocked ) { @@ -2475,7 +2684,11 @@ static ERRCODE hb_dbfReadDBHeader( DBFAREAP pArea ) { hb_fsSeek( pArea->hDataFile, 0, FS_SET ); if( hb_fsRead( pArea->hDataFile, ( BYTE * ) &dbHeader, sizeof( DBFHEADER ) ) != sizeof( DBFHEADER ) || - ( dbHeader.bVersion != 0x03 && dbHeader.bVersion != 0x83 && dbHeader.bVersion != 0xF5 ) ) + ( dbHeader.bVersion != 0x03 && // dBase III + dbHeader.bVersion != 0x30 && // VisualFoxPro 6.0 + dbHeader.bVersion != 0x83 && // dBase III w/memo + dbHeader.bVersion != 0xF5 // FoxPro??? w/memo + ) ) { bError = TRUE; if( !pError ) @@ -2517,8 +2730,9 @@ static ERRCODE hb_dbfReadDBHeader( DBFAREAP pArea ) */ static ERRCODE hb_dbfWriteDBHeader( DBFAREAP pArea ) { + BOOL fLck = FALSE; DBFHEADER dbfHeader; - long lYear, lMonth, lDay; + LONG lYear, lMonth, lDay; HB_TRACE(HB_TR_DEBUG, ("hb_dbfWriteDBHeader(%p)", pArea)); @@ -2534,7 +2748,12 @@ static ERRCODE hb_dbfWriteDBHeader( DBFAREAP pArea ) /* Update record count */ if( pArea->fShared ) { - SELF_RAWLOCK( ( AREAP ) pArea, HEADER_LOCK, 0 ); + if( !pArea->fHeaderLocked ) + { + if( SELF_RAWLOCK( ( AREAP ) pArea, HEADER_LOCK, 0 ) == FAILURE ) + return FAILURE; + fLck = TRUE; + } pArea->ulRecCount = hb_dbfCalcRecCount( pArea ); } @@ -2544,7 +2763,7 @@ static ERRCODE hb_dbfWriteDBHeader( DBFAREAP pArea ) hb_fsSeek( pArea->hDataFile, 0, FS_SET ); hb_fsWrite( pArea->hDataFile, ( BYTE * ) &dbfHeader, sizeof( DBFHEADER ) ); pArea->fUpdateHeader = FALSE; - if( pArea->fShared ) + if( fLck ) SELF_RAWLOCK( ( AREAP ) pArea, HEADER_UNLOCK, 0 ); return SUCCESS; } diff --git a/harbour/source/rdd/dbfcdx/dbfcdx1.c b/harbour/source/rdd/dbfcdx/dbfcdx1.c index 2a07316135..c811c3026f 100644 --- a/harbour/source/rdd/dbfcdx/dbfcdx1.c +++ b/harbour/source/rdd/dbfcdx/dbfcdx1.c @@ -53,10 +53,14 @@ * */ -#define HB_CDX_DBGCODE_OFF + +#define HB_CDX_DBGCODE +//#define HB_CDX_DBGCODE_EXT + //#define HB_CDX_DSPDBG_INFO //#define HB_CDP_SUPPORT_OFF //#define HB_CDX_DBGTIME +//#define HB_CDX_DBGUPDT #include "hbapi.h" #include "hbinit.h" @@ -307,7 +311,7 @@ HB_INIT_SYMBOLS_BEGIN( dbfcdx1__InitSymbols ) { "DBFCDX_GETFUNCTABLE", HB_FS_PUBLIC, HB_FUNCNAME( DBFCDX_GETFUNCTABLE ), NULL } HB_INIT_SYMBOLS_END( dbfcdx1__InitSymbols ) -#if defined(HB_STATIC_STARTUP) +#if defined(HB_PRAGMA_STARTUP) #pragma startup dbfcdx1__InitSymbols #elif defined(_MSC_VER) #if _MSC_VER >= 1010 @@ -318,8 +322,6 @@ HB_INIT_SYMBOLS_END( dbfcdx1__InitSymbols ) #endif static HB_$INITSYM hb_vm_auto_dbfcdx1__InitSymbols = dbfcdx1__InitSymbols; #pragma data_seg() -#elif ! defined(__GNUC__) - #pragma startup dbfcdx1__InitSymbols #endif #ifdef HB_CDX_DSPDBG_INFO @@ -345,7 +347,7 @@ static void hb_cdxDspTags( LPCDXINDEX pIndex ) #ifdef HB_CDX_DBGTIME #include -typedef long long CDXDBGTIME; +typedef LONGLONG CDXDBGTIME; static CDXDBGTIME cdxTimeIntBld = 0; static CDXDBGTIME cdxTimeExtBld = 0; @@ -361,7 +363,12 @@ static CDXDBGTIME hb_cdxGetTime() return ( (CDXDBGTIME) tv.tv_sec * 1000000 + (CDXDBGTIME) tv.tv_usec ); } #endif - +#ifdef HB_CDX_DBGUPDT +static ULONG cdxWriteNO = 0; +static ULONG cdxReadNO = 0; +static SHORT cdxStackSize = 0; +static SHORT cdxTmpStackSize = 0; +#endif /* * internal DBFCDX function @@ -385,7 +392,7 @@ static ERRCODE hb_cdxErrorRT( CDXAREAP pArea, USHORT uiGenCode, USHORT uiSubCode if ( uiFlags ) hb_errPutFlags( pError, uiFlags ); iRet = SELF_ERROR( ( AREAP ) pArea, pError ); - hb_errRelease( pError ); + hb_itemRelease( pError ); return iRet; } @@ -398,7 +405,8 @@ static void hb_cdxMakeSortTab( CDXAREAP pArea ) if ( pArea->cdPage && pArea->cdPage->lSort && !pArea->bCdxSortTab ) { int i, j, l; - BYTE * pbSort, b; + BYTE * pbSort; + BYTE b; pArea->bCdxSortTab = ( BYTE * ) hb_xgrab( 256 ); pbSort = ( BYTE * ) hb_xgrab( 256 ); @@ -500,7 +508,7 @@ static LPCDXKEY hb_cdxKeyPut( LPCDXKEY pKey, BYTE * pbVal, USHORT uiLen, ULONG u } if ( pbVal && uiLen ) { - pKey->len = uiLen; + pKey->len = (BYTE) uiLen; if ( !pKey->val ) pKey->val = ( BYTE * ) hb_xgrab( uiLen + 1 ); memcpy( pKey->val, pbVal, uiLen ); @@ -531,7 +539,7 @@ static LPCDXKEY hb_cdxKeyPutC( LPCDXKEY pKey, char * szText, USHORT uiRealLen, U uiLen = (USHORT) ( szText ? strlen( szText ) : 0 ); if ( uiLen > uiRealLen ) uiLen = uiRealLen; - pKey->len = uiRealLen; + pKey->len = ( BYTE ) uiRealLen; pKey->val = ( BYTE * ) hb_xgrab( uiRealLen + 1 ); if ( uiLen ) memcpy( pKey->val, szText, uiLen ); @@ -621,7 +629,7 @@ static LPCDXKEY hb_cdxKeyPutItem( LPCDXKEY pKey, PHB_ITEM pItem, ULONG ulRec, LP len = 8; break; case HB_IT_DATE: - d = (double) hb_itemGetDL( pItem ); + d = (double) pItem->item.asDate.value; HB_DBL2ORD( &d, ptr ); len = 8; break; @@ -631,7 +639,7 @@ static LPCDXKEY hb_cdxKeyPutItem( LPCDXKEY pKey, PHB_ITEM pItem, ULONG ulRec, LP break; default: ptr = NULL; -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE /* TODO: RTerror */ printf( "hb_cdxKeyPutItem( invalid item type: %i )", hb_itemType( pItem ) ); #endif @@ -672,7 +680,7 @@ static PHB_ITEM hb_cdxKeyGetItem( LPCDXKEY pKey, PHB_ITEM pItem, USHORT uiType ) break; default: pItem = hb_itemNew( pItem ); -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE printf( "hb_cdxKeyGetItem() ??? (%x)\n", uiType ); #endif } @@ -851,7 +859,7 @@ static void hb_cdxTagClearScope( LPCDXTAG pTag, USHORT nScope ) } } -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT /* * check internal integrity of page pool */ @@ -945,9 +953,12 @@ static ULONG hb_cdxIndexGetAvailPage( LPCDXINDEX pIndex, BOOL bHeader ) else { if ( hb_fsSeek( hFile, ulPos, FS_SET ) != ulPos || - hb_fsRead( hFile, (BYTE *) &byBuf, 4 ) != 4 ) + hb_fsRead( hFile, (BYTE *) byBuf, 4 ) != 4 ) hb_errInternal( EDBF_READ, "Read index page failed.", "", "" ); pIndex->freePage = HB_GET_LE_ULONG( byBuf ); +#ifdef HB_CDX_DBGUPDT + cdxReadNO++; +#endif } } else @@ -1033,6 +1044,9 @@ static void hb_cdxIndexFlushAvailPage( LPCDXINDEX pIndex ) ulPos = pLst->ulAddr; pLst->fStat = FALSE; pLst = pLst->pNext; +#ifdef HB_CDX_DBGUPDT + cdxWriteNO++; +#endif } } @@ -1066,6 +1080,9 @@ static void hb_cdxIndexPageWrite( LPCDXINDEX pIndex, ULONG ulPos, BYTE * pBuffer hb_fsWrite( pIndex->hFile, pBuffer, uiSize ) != uiSize ) hb_errInternal( EDBF_WRITE, "Write in index page failed.", "", "" ); pIndex->fChanged = TRUE; +#ifdef HB_CDX_DBGUPDT + cdxWriteNO++; +#endif } /* @@ -1080,6 +1097,9 @@ static void hb_cdxIndexPageRead( LPCDXINDEX pIndex, ULONG ulPos, BYTE * pBuffer, if ( hb_fsSeek( pIndex->hFile, ulPos, FS_SET ) != ulPos || hb_fsRead( pIndex->hFile, pBuffer, uiSize ) != uiSize ) hb_errInternal( EDBF_READ, "Read index page failed.", "", "" ); +#ifdef HB_CDX_DBGUPDT + cdxReadNO++; +#endif } /* @@ -1098,9 +1118,14 @@ static void hb_cdxIndexCheckVersion( LPCDXINDEX pIndex ) else hb_errInternal( 2155, "hb_cdxIndexCheckVersion: Read error on index heading page.", "", "" ); } +#ifdef HB_CDX_DBGUPDT + cdxReadNO++; +#endif ulFree = HB_GET_LE_ULONG( &byBuf[0] ); ulVer = HB_GET_BE_ULONG( &byBuf[4] ); - if ( ulVer != pIndex->ulVersion || ulFree != pIndex->freePage ) + if ( !pIndex->fShared ) + pIndex->ulVersion = pIndex->freePage; + else if ( ulVer != pIndex->ulVersion || ulFree != pIndex->freePage ) { pIndex->nextAvail = CDX_DUMMYNODE; pIndex->ulVersion = ulVer; @@ -1123,11 +1148,17 @@ static BOOL hb_cdxIndexLockRead( LPCDXINDEX pIndex ) pIndex->lockRead++; return TRUE; } +#ifdef HB_CDX_DBGCODE if ( pIndex->lockRead != 0 ) hb_errInternal( 9105, "hb_cdxIndexLockRead: bad count of locks.", "", "" ); - while (! (ret = hb_fsLock ( pIndex->hFile, CDX_LOCKOFFSET, CDX_LOCKSIZE, - FL_LOCK | FLX_SHARED | FLX_WAIT ) ) ); + if ( pIndex->WrLck || pIndex->RdLck ) + hb_errInternal( 9107, "hb_cdxIndexLockRead: lock failure (*)", "", "" ); + pIndex->RdLck = TRUE; +#endif + + ret = hb_dbfLockIdxFile( pIndex->hFile, pIndex->pArea->bLockType, + FL_LOCK | FLX_SHARED | FLX_WAIT, &pIndex->ulLockPos ); if ( !ret ) /* TODO: change into RT error dbfcdx/1038 */ hb_errInternal( 9107, "hb_cdxIndexLockRead: lock failure.", "", "" ); @@ -1148,7 +1179,7 @@ static BOOL hb_cdxIndexLockWrite( LPCDXINDEX pIndex ) if ( pIndex->lockRead ) hb_errInternal( 9105, "hb_cdxIndexLockRead: writeLock after readLock.", "", "" ); - if ( pIndex->lockWrite > 0 || !pIndex->fShared ) + if ( pIndex->lockWrite > 0 ) { pIndex->lockWrite++; return TRUE; @@ -1156,15 +1187,27 @@ static BOOL hb_cdxIndexLockWrite( LPCDXINDEX pIndex ) if ( pIndex->lockWrite != 0 ) hb_errInternal( 9105, "hb_cdxIndexLockWrite: bad count of locks.", "", "" ); - while (! (ret = hb_fsLock ( pIndex->hFile, CDX_LOCKOFFSET, CDX_LOCKSIZE, - FL_LOCK | FLX_EXCLUSIVE | FLX_WAIT ) ) ); + if ( !pIndex->fShared ) + ret = TRUE; + else + { +#ifdef HB_CDX_DBGCODE + if ( pIndex->WrLck || pIndex->RdLck ) + hb_errInternal( 9107, "hb_cdxIndexLockWrite: lock failure (*)", "", "" ); + pIndex->WrLck = TRUE; +#endif + ret = hb_dbfLockIdxFile( pIndex->hFile, pIndex->pArea->bLockType, + FL_LOCK | FLX_EXCLUSIVE | FLX_WAIT, &pIndex->ulLockPos ); + } if ( !ret ) /* TODO: change into RT error dbfcdx/1038 */ hb_errInternal( 9107, "hb_cdxIndexLockWrite: lock failure.", "", "" ); + if ( ret ) { pIndex->lockWrite++; - hb_cdxIndexCheckVersion( pIndex ); + if ( pIndex->fShared || pIndex->nextAvail == CDX_DUMMYNODE ) + hb_cdxIndexCheckVersion( pIndex ); } return ret; } @@ -1183,7 +1226,7 @@ static BOOL hb_cdxIndexUnLockRead( LPCDXINDEX pIndex ) { return TRUE; } -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxIndexCheckBuffers( pIndex ); #endif @@ -1191,7 +1234,12 @@ static BOOL hb_cdxIndexUnLockRead( LPCDXINDEX pIndex ) if ( pIndex->fShared ) { - if ( !hb_fsLock ( pIndex->hFile, CDX_LOCKOFFSET, CDX_LOCKSIZE, FL_UNLOCK ) ) +#ifdef HB_CDX_DBGCODE + if ( pIndex->WrLck || ! pIndex->RdLck ) + hb_errInternal( 9108, "hb_cdxIndexUnLockRead: unlock error (*)", "", "" ); + pIndex->RdLck = FALSE; +#endif + if ( !hb_dbfLockIdxFile( pIndex->hFile, pIndex->pArea->bLockType, FL_UNLOCK, &pIndex->ulLockPos ) ) { hb_errInternal( 9108, "hb_cdxIndexUnLockRead: unlock error.", "", "" ); } @@ -1238,13 +1286,32 @@ static BOOL hb_cdxIndexUnLockWrite( LPCDXINDEX pIndex ) } pIndex->fChanged = FALSE; } - if ( !hb_fsLock ( pIndex->hFile, CDX_LOCKOFFSET, CDX_LOCKSIZE, FL_UNLOCK ) ) +#ifdef HB_CDX_DBGCODE + if ( ! pIndex->WrLck || pIndex->RdLck ) + hb_errInternal( 9108, "hb_cdxIndexUnLockWrite: unlock error (*)", "", "" ); + pIndex->WrLck = FALSE; +#endif + if ( !hb_dbfLockIdxFile( pIndex->hFile, pIndex->pArea->bLockType, FL_UNLOCK, &pIndex->ulLockPos ) ) { hb_errInternal( 9108, "hb_cdxIndexUnLockWrite: unlock error.", "", "" ); } } else { + if ( pIndex->ulVersion != pIndex->freePage ) + { + BYTE byBuf[4]; + HB_PUT_LE_ULONG( &byBuf[0], pIndex->freePage ); + if ( hb_fsSeek( pIndex->hFile, 0x04, FS_SET ) != 0x04 || + hb_fsWrite( pIndex->hFile, byBuf, 4) != 4 ) + { + hb_errInternal( EDBF_WRITE, "Write in index page failed (ver.ex)", "", "" ); + } + pIndex->ulVersion = pIndex->freePage; +#ifdef HB_CDX_DBGUPDT + cdxWriteNO++; +#endif + } pIndex->fChanged = FALSE; } return TRUE; @@ -1257,7 +1324,7 @@ static void hb_cdxIndexDiscardBuffers( LPCDXINDEX pIndex ) { LPCDXTAG pTag; -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxIndexCheckBuffers( pIndex ); #endif @@ -1330,7 +1397,7 @@ static void hb_cdxIndexPoolFree( LPCDXINDEX pIndex, int nPagesLeft ) */ static BYTE * hb_cdxPageGetKeyVal( LPCDXPAGE pPage, SHORT iKey ) { -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE if ( iKey < 0 || iKey >= pPage->iKeys ) hb_cdxErrInternal( "hb_cdxPageGetKeyVal: wrong iKey index." ); #endif @@ -1363,6 +1430,13 @@ static BYTE * hb_cdxPageGetKeyVal( LPCDXPAGE pPage, SHORT iKey ) memcpy( &pPage->bufKeyVal[ iDup ], &pPage->node.extNode.keyPool[ pPage->bufKeyPos ], iTmp ); } +#ifdef HB_CDX_DBGCODE + else if ( iTmp < 0 ) + { + printf("\r\npPage->Page=%lx, iLen=%d, iDup=%d, iTrl=%d", pPage->Page, iLen, iDup, iTrl); fflush(stdout); + hb_cdxErrInternal( "hb_cdxPageGetKeyVal: index corrupted." ); + } +#endif if ( iTrl > 0 && ( iTmp = pPage->bufKeyLen - iLen + iTrl ) > 0 ) memset( &pPage->bufKeyVal[ iLen - iTrl ], bTrail, iTmp ); pPage->bufKeyLen = iLen - iTrl; @@ -1379,7 +1453,7 @@ static BYTE * hb_cdxPageGetKeyVal( LPCDXPAGE pPage, SHORT iKey ) */ static ULONG hb_cdxPageGetKeyRec( LPCDXPAGE pPage, SHORT iKey ) { -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE if ( iKey < 0 || iKey >= pPage->iKeys ) hb_cdxErrInternal( "hb_cdxPageGetKeyRec: wrong iKey index." ); #endif @@ -1397,7 +1471,7 @@ static ULONG hb_cdxPageGetKeyRec( LPCDXPAGE pPage, SHORT iKey ) */ static ULONG hb_cdxPageGetKeyPage( LPCDXPAGE pPage, SHORT iKey ) { -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE if ( iKey < 0 || iKey >= pPage->iKeys ) hb_cdxErrInternal( "hb_cdxPageGetKeyPage: wrong iKey index." ); if ( pPage->PageType & CDX_NODE_LEAF ) @@ -1420,7 +1494,7 @@ static LPCDXKEY hb_cdxPageGetKey( LPCDXPAGE pPage, SHORT iKey, LPCDXKEY pKey ) } #endif -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT /* * check if keys are sorted in proper order */ @@ -1450,7 +1524,7 @@ static void hb_cdxPageCheckKeys( LPCDXPAGE pPage ) i, pPage->iKeys, K, ulRecPrev, ulRec );fflush(stdout); printf( "\r\npbValPrev=[%s] pbVal=[%s], [%d], pPage->pKeyBuf=%p, pPage->iCurKey=%d", pbValPrev, pbVal, memcmp( pbValPrev, pbVal, iLen ), - pPage->pKeyBuf, pPage->iCurKey );fflush(stdout); + pPage->pKeyBuf, pPage->iCurKey );fflush(stdout); hb_cdxErrInternal( "hb_cdxPageCheckKeys: index corrupted." ); } } @@ -1526,48 +1600,67 @@ static void hb_cdxPageCheckDupTrl( LPCDXPAGE pPage, BYTE * pKeyBuf, SHORT iKeys */ static void hb_cdxPageLeafEncode( LPCDXPAGE pPage, BYTE * pKeyBuf, SHORT iKeys ) { - SHORT iKey, iPos, iTrl, iDup, iTmp, iNum = pPage->TagParent->uiLen; - SHORT iLen = iNum + 6, iRecPos, iWrPos; - ULONG ulRec; + int iKey, iTrl, iDup, iReq, iTmp, iNum, iLen, iShift; + BYTE *pKeyPos, *pRecPos, *pSrc; + ULONG RNMask; -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE if ( ( pPage->PageType & CDX_NODE_LEAF ) == 0 ) { printf("\r\npPage->Page=%lx. left=%lx, right=%lx", pPage->Page, pPage->Left, pPage->Right); fflush(stdout); hb_cdxErrInternal( "hb_cdxPageLeafEncode: page is not a leaf." ); } +#endif +#ifdef HB_CDX_DBGCODE_EXT if ( ! pKeyBuf ) hb_cdxErrInternal( "hb_cdxPageLeafEncode: page has no buffer." ); + hb_cdxPageCheckDupTrl( pPage, pKeyBuf, iKeys ); #endif - iWrPos = CDX_EXT_FREESPACE; - for ( iKey = 0; iKey < iKeys; iKey++ ) + iNum = pPage->TagParent->uiLen; + iLen = iNum + 6; + iReq = pPage->ReqByte; + RNMask = ~pPage->RNMask; + iShift = 16 - pPage->TCBits; + pKeyPos = &pPage->node.extNode.keyPool[ CDX_EXT_FREESPACE ]; + pRecPos = &pPage->node.extNode.keyPool[ 0 ]; + pSrc = &pKeyBuf[ 0 ]; + for ( iKey = 0; iKey < iKeys; iKey++, pSrc += iLen, pRecPos += iReq ) { - iPos = iKey * iLen; - ulRec = HB_GET_LE_ULONG( &pKeyBuf[ iPos + iNum ] ); - iDup = pKeyBuf[ iPos + iNum + 4 ]; - iTrl = pKeyBuf[ iPos + iNum + 5 ]; - iRecPos = iKey * pPage->ReqByte; - HB_PUT_LE_USHORT( &pPage->node.extNode.keyPool[ iRecPos + pPage->ReqByte - 2 ], - ( iTrl << ( 16 - pPage->TCBits ) ) | - ( iDup << ( 16 - pPage->TCBits - pPage->DCBits ) ) ); - HB_PUT_LE_ULONG( &pPage->node.extNode.keyPool[ iRecPos ], - ( HB_GET_LE_ULONG( &pPage->node.extNode.keyPool[ iRecPos ] ) & ~pPage->RNMask ) | ulRec ); - if ( ( iTmp = iNum - iTrl - iDup ) > 0 ) + iDup = pSrc[ iNum + 4 ]; + iTrl = pSrc[ iNum + 5 ]; + iTmp = iNum - iTrl - iDup; + HB_PUT_LE_USHORT( &pRecPos[ iReq - 2 ], + ( iTrl << iShift ) | ( iDup << ( iShift - pPage->DCBits ) ) ); + HB_PUT_LE_ULONG( pRecPos, ( HB_GET_LE_ULONG( pRecPos ) & RNMask ) | + HB_GET_LE_ULONG( &pSrc[ iNum ] ) ); + if ( iTmp > 0 ) { - iWrPos -= iTmp; - memcpy( &pPage->node.extNode.keyPool[ iWrPos ], - &pKeyBuf[ iPos + iDup ], iTmp ); + pKeyPos -= iTmp; + memcpy( pKeyPos, &pSrc[ iDup ], iTmp ); } + /* '#ifdef' commented because it's a workaround for bug in -O3 + * optimization in GCC 3.3.2 in DJGPP (I haven't tested this GCC + * version in Linux so far, GCC 3.2 seems to work OK in this code + * but I've found other places which gives bad code when optimization + * is enabled + */ +/* #ifdef HB_CDX_DBGCODE */ + else if ( iTmp < 0 ) + { + printf("\r\n[%s][%s]", pSrc - iLen, pSrc); + printf("\r\npPage->Page=0x%lx, iKey=%d, iNum=%d, iDup=%d, iTrl=%d", pPage->Page, iKey, iNum, iDup, iTrl); fflush(stdout); + hb_cdxErrInternal( "hb_cdxPageLeafEncode: index corrupted." ); + } +/* #endif */ } - iRecPos = iKeys * pPage->ReqByte; - if ( iRecPos < iWrPos ) - memset( &pPage->node.extNode.keyPool[ iRecPos ], 0, iWrPos - iRecPos ); -#ifndef HB_CDX_DBGCODE_OFF - if ( iWrPos - iRecPos != pPage->iFree ) + if ( pRecPos < pKeyPos ) + memset( pRecPos, 0, pKeyPos - pRecPos ); +#ifdef HB_CDX_DBGCODE + if ( pKeyPos - pRecPos != pPage->iFree ) { - printf("\r\nPage=%ld, calc=%d,iFree=%d, req=%d, keys=%d, wrpos=%d\r\n", - pPage->Page,iWrPos - iRecPos, pPage->iFree, pPage->ReqByte, iKeys, iWrPos); + printf("\r\nPage=0x%lx, calc=%d, iFree=%d, req=%d, keys=%d, keyLen=%d\r\n", + pPage->Page, pKeyPos - pRecPos, pPage->iFree, pPage->ReqByte, iKeys, iNum ); fflush(stdout); hb_cdxErrInternal( "hb_cdxPageLeafEncode: FreeSpace calculated wrong!." ); } @@ -1577,7 +1670,13 @@ static void hb_cdxPageLeafEncode( LPCDXPAGE pPage, BYTE * pKeyBuf, SHORT iKeys ) pPage->iKeys = iKeys; pPage->fChanged = TRUE; pPage->bufKeyNum = 0; -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT_EXT + { + BYTE * pKeyBf = pPage->pKeyBuf; + pPage->pKeyBuf = NULL; + hb_cdxPageCheckKeys( pPage ); + pPage->pKeyBuf = pKeyBf; + } hb_cdxPageCheckKeys( pPage ); hb_cdxPageCheckDupTrl( pPage, pKeyBuf, pPage->iKeys ); #endif @@ -1588,11 +1687,10 @@ static void hb_cdxPageLeafEncode( LPCDXPAGE pPage, BYTE * pKeyBuf, SHORT iKeys ) */ static void hb_cdxPageLeafDecode( LPCDXPAGE pPage, BYTE * pKeyBuf ) { - SHORT iKey, iTmp, iLen = pPage->TagParent->uiLen, iBits; - BYTE bDup, bTrl, bReq, *pDst, *pSrc, *pRec, - bTrail = ( pPage->TagParent->uiType == 'C' ) ? ' ' : '\0'; + int iKey, iTmp, iBits, iDup, iTrl, iNew, iReq, iLen = pPage->TagParent->uiLen; + BYTE *pDst, *pSrc, *pRec, bTrail = ( pPage->TagParent->uiType == 'C' ) ? ' ' : '\0'; -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE if ( ( pPage->PageType & CDX_NODE_LEAF ) == 0 ) { printf("\r\npPage->Page=%lx", pPage->Page); fflush(stdout); @@ -1603,34 +1701,42 @@ static void hb_cdxPageLeafDecode( LPCDXPAGE pPage, BYTE * pKeyBuf ) pDst = pKeyBuf; pSrc = &pPage->node.extNode.keyPool[ CDX_EXT_FREESPACE ]; pRec = pPage->node.extNode.keyPool; - bReq = pPage->ReqByte; - for ( iKey = 0; iKey < pPage->iKeys; iKey++, pRec += bReq ) + iReq = pPage->ReqByte; + for ( iKey = 0; iKey < pPage->iKeys; iKey++, pRec += iReq ) { - iTmp = HB_GET_LE_USHORT( &pRec[ bReq - 2 ] ) >> iBits; - bDup = ( iKey == 0 ) ? 0 : ( iTmp & pPage->DCMask ); - bTrl = ( iTmp >> pPage->DCBits ) & pPage->TCMask; - if ( bDup != 0 ) + iTmp = HB_GET_LE_USHORT( &pRec[ iReq - 2 ] ) >> iBits; + iDup = ( iKey == 0 ) ? 0 : ( iTmp & pPage->DCMask ); + iTrl = ( iTmp >> pPage->DCBits ) & pPage->TCMask; + iNew = iLen - iDup - iTrl; + if ( iDup > 0 ) { - memcpy( pDst, pDst - iLen - 6, bDup ); - pDst += bDup; + memcpy( pDst, pDst - iLen - 6, iDup ); + pDst += iDup; } - if ( ( iTmp = iLen - bDup - bTrl ) > 0 ) + if ( iNew > 0 ) { - pSrc -= iTmp; - memcpy( pDst, pSrc, iTmp ); - pDst += iTmp; + pSrc -= iNew; + memcpy( pDst, pSrc, iNew ); + pDst += iNew; } - if ( bTrl != 0 ) +#ifdef HB_CDX_DBGCODE + else if ( iNew < 0 ) { - memset( pDst, bTrail, bTrl ); - pDst += bTrl; + printf("\r\npPage->Page=%lx, iLen=%d, iDup=%d, iTrl=%d", pPage->Page, iLen, iDup, iTrl); fflush(stdout); + hb_cdxErrInternal( "hb_cdxPageLeafDecode: index corrupted." ); + } +#endif + if ( iTrl > 0 ) + { + memset( pDst, bTrail, iTrl ); + pDst += iTrl; } HB_PUT_LE_ULONG( pDst, HB_GET_LE_ULONG( pRec ) & pPage->RNMask ); pDst += 4; - *(pDst++) = bDup; - *(pDst++) = bTrl; + *(pDst++) = ( BYTE ) iDup; + *(pDst++) = ( BYTE ) iTrl; } -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT { BOOL fChg = pPage->fChanged; hb_cdxPageLeafEncode( pPage, pKeyBuf, pPage->iKeys ); @@ -1649,7 +1755,7 @@ static void hb_cdxPageLeafInitSpace( LPCDXPAGE pPage ) for ( bBits = 0; iLen; bBits++, iLen >>= 1 ); pPage->ReqByte = 3; - pPage->RNBits = 24 - bBits * 2; + pPage->RNBits = 24 - ( bBits << 1 ); pPage->DCBits = pPage->TCBits = bBits; pPage->DCMask = pPage->TCMask = (BYTE) HB_CDXBITMASK( bBits ); pPage->RNMask = HB_CDXBITMASK( pPage->RNBits ); @@ -1671,7 +1777,7 @@ static void hb_cdxPageCalcLeafSpace( LPCDXPAGE pPage, BYTE * pKeyBuf, SHORT iKey pPage->iKeys = 0; RNMask = pPage->RNMask; ReqByte = pPage->ReqByte; -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxPageCheckDupTrl( pPage, pKeyBuf, iKeys ); #endif for ( iKey = 0; iKey < iKeys; iKey++ ) @@ -1721,7 +1827,7 @@ static int hb_cdxPageLeafDelKey( LPCDXPAGE pPage ) SHORT iKey = pPage->iCurKey, iLen = pPage->TagParent->uiLen + 6, iSpc; int iRet = 0; -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE if ( ( pPage->PageType & CDX_NODE_LEAF ) == 0 ) hb_cdxErrInternal( "hb_cdxPageLeafDelKey: page is not a leaf." ); if ( iKey < 0 || iKey >= pPage->iKeys ) @@ -1751,13 +1857,22 @@ static int hb_cdxPageLeafDelKey( LPCDXPAGE pPage ) SHORT iPrev = ( iKey - 1 ) * iLen, iNext = ( iKey + 1 ) * iLen, iNum = pPage->TagParent->uiLen; iNum -= /* pPage->pKeyBuf[ iNext + iNum + 5 ]; */ - HB_MAX( pPage->pKeyBuf[ iNext + iNum + 5 ], - pPage->pKeyBuf[ iPrev + iNum + 5 ] ); - while ( iDup < iNum && pPage->pKeyBuf[ iPrev + iDup ] == - pPage->pKeyBuf[ iNext + iDup ] ) - ++iDup; + HB_MAX( pPage->pKeyBuf[ iNext + iLen - 1 ], + pPage->pKeyBuf[ iPrev + iLen - 1 ] ); + iDup = HB_MIN( pPage->pKeyBuf[ iPos ], + pPage->pKeyBuf[ iNext - 2] ); + if ( iDup > iNum ) + { + iDup = iNum; + } + else + { + while ( iDup < iNum && pPage->pKeyBuf[ iPrev + iDup ] == + pPage->pKeyBuf[ iNext + iDup ] ) + ++iDup; + } } - iSpc += pPage->pKeyBuf[ iPos ] = iDup; + iSpc += ( pPage->pKeyBuf[ iPos ] = ( BYTE ) iDup ); } pPage->iFree += iSpc; if ( --pPage->iKeys > iKey ) @@ -1767,7 +1882,7 @@ static int hb_cdxPageLeafDelKey( LPCDXPAGE pPage ) ( pPage->iKeys - iKey ) * iLen ); } pPage->fBufChanged = pPage->fChanged = TRUE; -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxPageCheckKeys( pPage ); hb_cdxPageCheckDupTrl( pPage, pPage->pKeyBuf, pPage->iKeys ); #endif @@ -1796,7 +1911,7 @@ static int hb_cdxPageLeafAddKey( LPCDXPAGE pPage, LPCDXKEY pKey ) pPage->Page, pPage->iCurKey, pPage->iKeys, pKey->rec); fflush(stdout); #endif -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE if ( ( pPage->PageType & CDX_NODE_LEAF ) == 0 ) hb_cdxErrInternal( "hb_cdxPageLeafAddKey: page is not a leaf." ); if ( pPage->iCurKey < 0 || pPage->iCurKey > pPage->iKeys ) @@ -1813,26 +1928,20 @@ static int hb_cdxPageLeafAddKey( LPCDXPAGE pPage, LPCDXKEY pKey ) pPage->pKeyBuf = (BYTE*) hb_xrealloc( pPage->pKeyBuf, ( pPage->iKeys + 1 ) * iLen ); } -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxPageCheckKeys( pPage ); hb_cdxPageCheckDupTrl( pPage, pPage->pKeyBuf, pPage->iKeys ); #endif -#if 0 - /* TODO: use this code if memmove forward doesn't work correctly */ - for ( iKey = pPage->iKeys, iPos = iKey * iLen; iKey > pPage->iCurKey; - iKey--, iPos -= iLen ) - { - memcpy( &pPage->pKeyBuf[ iPos ], &pPage->pKeyBuf[ iPos - iLen ], iLen ); - } -#else + + iTrl = iDup = 0; iKey = pPage->iCurKey; iPos = iKey * iLen; if ( iKey < pPage->iKeys ) { + iDup = pPage->pKeyBuf[ iPos + iNum + 4 ]; memmove( &pPage->pKeyBuf[ iPos + iLen ], &pPage->pKeyBuf[ iPos ], iLen * ( pPage->iKeys - iKey ) ); } -#endif if ( pKey->len >= iNum ) memcpy( &pPage->pKeyBuf[ iPos ], pKey->val, iNum ); else @@ -1841,15 +1950,21 @@ static int hb_cdxPageLeafAddKey( LPCDXPAGE pPage, LPCDXKEY pKey ) memset( &pPage->pKeyBuf[ iPos + pKey->len ], bTrail, iNum - pKey->len ); } HB_PUT_LE_ULONG( &pPage->pKeyBuf[ iPos + iNum ], pKey->rec ); - iTrl = iDup = 0; while ( iTrl < iNum && pPage->pKeyBuf[ iPos + iNum - iTrl - 1 ] == bTrail ) ++iTrl; if ( iKey > 0 ) { iMax = iNum - HB_MAX( iTrl, pPage->pKeyBuf[ iPos - 1 ] ); - while ( iDup < iMax && pPage->pKeyBuf[ iPos + iDup ] == - pPage->pKeyBuf[ iPos + iDup - iLen ] ) - ++iDup; + if ( iDup > iMax ) + { + iDup = iMax; + } + else + { + while ( iDup < iMax && pPage->pKeyBuf[ iPos + iDup ] == + pPage->pKeyBuf[ iPos + iDup - iLen ] ) + ++iDup; + } } pPage->pKeyBuf[ iPos + iNum + 4 ] = (BYTE) iDup; pPage->pKeyBuf[ iPos + iNum + 5 ] = (BYTE) iTrl; @@ -1862,7 +1977,7 @@ static int hb_cdxPageLeafAddKey( LPCDXPAGE pPage, LPCDXKEY pKey ) while ( iDup < iMax && pPage->pKeyBuf[ iPos + iDup ] == pPage->pKeyBuf[ iPos + iDup + iLen ] ) ++iDup; - iSpc -= pPage->pKeyBuf[ iPos + iLen + iLen - 2 ] = iDup; + iSpc -= ( pPage->pKeyBuf[ iPos + iLen + iLen - 2 ] = ( BYTE ) iDup ); } pPage->iKeys++; while ( pKey->rec > pPage->RNMask ) @@ -1874,7 +1989,7 @@ static int hb_cdxPageLeafAddKey( LPCDXPAGE pPage, LPCDXKEY pKey ) } pPage->iFree -= iSpc; pPage->fBufChanged = pPage->fChanged = TRUE; -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxPageCheckKeys( pPage ); hb_cdxPageCheckDupTrl( pPage, pPage->pKeyBuf, pPage->iKeys ); #endif @@ -1882,8 +1997,8 @@ static int hb_cdxPageLeafAddKey( LPCDXPAGE pPage, LPCDXKEY pKey ) iRet |= NODE_NEWLASTKEY; if ( pPage->iFree < 0 ) iRet |= NODE_SPLIT; - /* if ( pPage->iFree >= CDX_EXT_FREESPACE / 2 ) */ - if ( pPage->iFree >= pPage->ReqByte ) + if ( pPage->iFree >= pPage->ReqByte && + pPage->Left != CDX_DUMMYNODE && pPage->Right != CDX_DUMMYNODE ) iRet |= NODE_BALANCE; return iRet; } @@ -1901,7 +2016,7 @@ static void hb_cdxPageIntSetKey( LPCDXPAGE pPage, SHORT iKey, BOOL fIns, BYTE * fIns ? "ins" : "set", pPage->Page, iKey, pPage->iKeys, ulPag); fflush(stdout); #endif -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE if ( ( pPage->PageType & CDX_NODE_LEAF ) != 0 ) hb_cdxErrInternal( "hb_cdxPageIntSetKey: page is a leaf!" ); if ( iKey < 0 || iKey >= pPage->iKeys + ( fIns ? 1 : 0 ) ) @@ -1911,30 +2026,21 @@ static void hb_cdxPageIntSetKey( LPCDXPAGE pPage, SHORT iKey, BOOL fIns, BYTE * #endif if ( fIns ) { -#if 0 - /* TODO: use this code if memmove forward doesn't work correctly */ - SHORT i, l, n; - for ( i = pPage->iKeys, l = iLen + 8, n = i * l; i > iKey; i--, n -= l ) - { - memcpy( &pPage->node.intNode.keyPool[ n ], - &pPage->node.intNode.keyPool[ n - l ], l ); - } -#else if ( iKey < pPage->iKeys ) { memmove( &pPage->node.intNode.keyPool[ iPos + iLen + 8 ], &pPage->node.intNode.keyPool[ iPos ], ( iLen + 8 ) * ( pPage->iKeys - iKey ) ); } -#endif pPage->iKeys++; } if ( pbVal ) memcpy( &pPage->node.intNode.keyPool[ iPos ], pbVal, iLen ); - else + else if ( fIns ) memset( &pPage->node.intNode.keyPool[ iPos ], ( pPage->TagParent->uiType == 'C' ) ? ' ' : '\0', iLen ); - HB_PUT_BE_ULONG( &pPage->node.intNode.keyPool[ iPos + iLen ], ulRec ); + if ( ulRec ) + HB_PUT_BE_ULONG( &pPage->node.intNode.keyPool[ iPos + iLen ], ulRec ); HB_PUT_BE_ULONG( &pPage->node.intNode.keyPool[ iPos + iLen + 4 ], ulPag ); pPage->fChanged = TRUE; } @@ -1952,7 +2058,7 @@ static void hb_cdxPageIntDelKey( LPCDXPAGE pPage, SHORT iKey ) HB_GET_BE_ULONG( &pPage->node.intNode.keyPool[ (iKey+1) * iLen - 4 ] ) ); fflush(stdout); #endif -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE if ( ( pPage->PageType & CDX_NODE_LEAF ) != 0 ) hb_cdxErrInternal( "hb_cdxPageIntDelKey: page is a leaf!" ); if ( iKey < 0 || iKey >= pPage->iKeys ) @@ -1982,7 +2088,7 @@ static void hb_cdxPageLoad( LPCDXPAGE pPage ) pPage->fBufChanged = FALSE; } hb_cdxIndexPageRead( pPage->TagParent->pIndex, pPage->Page, (BYTE *) &pPage->node, sizeof( CDXNODE ) ); - pPage->PageType = HB_GET_LE_USHORT( pPage->node.intNode.attr ); + pPage->PageType = ( BYTE ) HB_GET_LE_USHORT( pPage->node.intNode.attr ); pPage->Left = HB_GET_LE_ULONG( pPage->node.intNode.leftPtr ); pPage->Right = HB_GET_LE_ULONG( pPage->node.intNode.rightPtr ); pPage->iKeys = HB_GET_LE_USHORT( pPage->node.intNode.nKeys ); @@ -2009,7 +2115,7 @@ static void hb_cdxPageLoad( LPCDXPAGE pPage ) } #endif } -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxPageCheckKeys( pPage ); #endif } @@ -2019,11 +2125,9 @@ static void hb_cdxPageLoad( LPCDXPAGE pPage ) */ static void hb_cdxPageStore( LPCDXPAGE pPage ) { -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE if ( pPage->Page == 0 || pPage->Page == CDX_DUMMYNODE ) hb_cdxErrInternal( "hb_cdxPageStore: Page number wrong!." ); -#endif -#ifndef HB_CDX_DBGCODE_OFF if ( pPage->PageType & CDX_NODE_LEAF ) { if ( pPage->iFree < 0 ) @@ -2054,7 +2158,8 @@ static void hb_cdxPageStore( LPCDXPAGE pPage ) hb_cdxPageLeafEncode( pPage, pPage->pKeyBuf, pPage->iKeys ); pPage->fBufChanged = FALSE; } -#if 0 +//#if 0 +#ifdef HB_CDX_DBGCODE_EXT if ( pPage->pKeyBuf ) { hb_xfree( pPage->pKeyBuf ); @@ -2063,7 +2168,7 @@ static void hb_cdxPageStore( LPCDXPAGE pPage ) #endif } hb_cdxIndexPageWrite( pPage->TagParent->pIndex, pPage->Page, (BYTE *) &pPage->node, sizeof( CDXNODE ) ); -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxPageCheckKeys( pPage ); #endif pPage->fChanged = FALSE; @@ -2077,7 +2182,7 @@ static LPCDXPAGE hb_cdxPageNew( LPCDXTAG pTag, LPCDXPAGE pOwnerPage, ULONG ulPag { LPCDXPAGE pPage = NULL; -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxTagPoolCheck( pTag ); #endif if ( ulPage && ulPage != CDX_DUMMYNODE && pTag->pagePool ) @@ -2130,7 +2235,7 @@ static LPCDXPAGE hb_cdxPageNew( LPCDXTAG pTag, LPCDXPAGE pOwnerPage, ULONG ulPag pPage->Owner = pOwnerPage; pPage->iCurKey = -1; pPage->bUsed = 1; -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxTagPoolCheck( pTag ); #endif return pPage; @@ -2141,7 +2246,7 @@ static LPCDXPAGE hb_cdxPageNew( LPCDXTAG pTag, LPCDXPAGE pOwnerPage, ULONG ulPag */ static void hb_cdxPageFree( LPCDXPAGE pPage, BOOL fReal ) { -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT LPCDXTAG pTag = pPage->TagParent; hb_cdxTagPoolCheck( pTag ); #endif @@ -2162,7 +2267,7 @@ static void hb_cdxPageFree( LPCDXPAGE pPage, BOOL fReal ) if ( pPage->fChanged ) hb_cdxPageStore( pPage ); -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxTagPoolCheck( pTag ); #endif if ( pPage->pPoolPrev ) @@ -2181,7 +2286,7 @@ static void hb_cdxPageFree( LPCDXPAGE pPage, BOOL fReal ) pPage->pPoolNext->pPoolPrev = NULL; } } -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxTagPoolCheck( pTag ); #endif } @@ -2199,7 +2304,7 @@ static void hb_cdxPageFree( LPCDXPAGE pPage, BOOL fReal ) hb_xfree( pPage->pKeyBuf ); hb_xfree( pPage ); } -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxTagPoolCheck( pTag ); #endif } @@ -2211,7 +2316,7 @@ static void hb_cdxPageGetChild( LPCDXPAGE pPage ) { ULONG ulPage; -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE if ( ( pPage->PageType & CDX_NODE_LEAF ) != 0 ) hb_cdxErrInternal( "hb_cdxPageGetChild: index corrupted." ); #endif @@ -2225,22 +2330,27 @@ static void hb_cdxPageGetChild( LPCDXPAGE pPage ) pPage->Child = NULL; } } +#ifdef HB_CDX_DSPDBG_INFO + printf("GetChild: Parent=%lx, Child=%lx\r\n", pPage->Page, ulPage); fflush(stdout); +#endif if ( pPage->Child == NULL ) pPage->Child = hb_cdxPageNew( pPage->TagParent, pPage, ulPage ); } -static int hb_cdxPageKeyLeafBalance( LPCDXPAGE pPage, SHORT iChildRet ) +static int hb_cdxPageKeyLeafBalance( LPCDXPAGE pPage, int iChildRet ) { LPCDXPAGE childs[ CDX_BALANCE_LEAFPAGES + 2 ], lpTmpPage; + SHORT iChKeys[ CDX_BALANCE_LEAFPAGES + 2 ], + iChFree[ CDX_BALANCE_LEAFPAGES + 2 ]; SHORT iFirstKey, iBlncKeys = CDX_BALANCE_LEAFPAGES; SHORT iLen = pPage->TagParent->uiLen + 6, - iKeys = 0, iFree = 0, iSkip = 0, iMaxReq = 0; + iKeys = 0, iFree = 0, iSkip = 0, iBufSize = 0; BYTE * pKeyPool = NULL, * pPtr; BOOL fIns; ULONG ulPage; int iRet = 0, i; -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxPageCheckKeys( pPage ); #endif @@ -2250,11 +2360,14 @@ static int hb_cdxPageKeyLeafBalance( LPCDXPAGE pPage, SHORT iChildRet ) { iFirstKey = 0; --iBlncKeys; + if ( pPage->Left != CDX_DUMMYNODE ) + iRet |= NODE_BALANCE; } if ( iBlncKeys > pPage->iKeys - iFirstKey ) { iBlncKeys = pPage->iKeys - iFirstKey; - iRet |= NODE_BALANCE; + if ( pPage->Right != CDX_DUMMYNODE ) + iRet |= NODE_BALANCE; } #ifdef HB_CDX_DSPDBG_INFO @@ -2278,7 +2391,7 @@ static int hb_cdxPageKeyLeafBalance( LPCDXPAGE pPage, SHORT iChildRet ) { childs[i] = hb_cdxPageNew( pPage->TagParent, pPage, ulPage ); } -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE if ( i > 0 && ( childs[i]->Page != childs[i-1]->Right || childs[i]->Left != childs[i-1]->Page ) ) { @@ -2289,14 +2402,16 @@ static int hb_cdxPageKeyLeafBalance( LPCDXPAGE pPage, SHORT iChildRet ) hb_cdxErrInternal( "hb_cdxPageKeyLeafBalance: index corrupted." ); } #endif + iChKeys[i] = childs[i]->iKeys; + iChFree[i] = childs[i]->iFree; if ( childs[i]->iFree >= childs[i]->ReqByte ) /* TODO: increase limit for last page */ iFree += childs[i]->iFree; else if ( childs[i]->iFree >= 0 ) { if ( i == iSkip ) ++iSkip; -#if 0 - else if ( i + 1 == iBlncKeys ) +#if 1 + else if ( i + 1 == iBlncKeys && ( iChildRet & NODE_SPLIT ) == 0 ) { iBlncKeys--; hb_cdxPageFree( childs[i], FALSE ); @@ -2308,7 +2423,7 @@ static int hb_cdxPageKeyLeafBalance( LPCDXPAGE pPage, SHORT iChildRet ) #ifdef HB_CDX_DSPDBG_INFO printf(", childs[%d]->Page=%lx(%d/%d)", i, childs[i]->Page, childs[i]->iKeys, childs[i]->iFree); - printf("(%d/%d/%d:%d,%lx)", i, iSkip, iBlncKeys, iKeys,childs[i]->Right); + printf("(%d/%d/%d:%d,%lx)", i, iSkip, iBlncKeys, iKeys, childs[i]->Right); fflush(stdout); #endif } @@ -2334,7 +2449,8 @@ static int hb_cdxPageKeyLeafBalance( LPCDXPAGE pPage, SHORT iChildRet ) #endif if ( iKeys > 0 ) { - pPtr = pKeyPool = (BYTE *) hb_xgrab( iKeys * iLen ); + iBufSize = iKeys; + pPtr = pKeyPool = (BYTE *) hb_xgrab( iBufSize * iLen ); for ( i = iSkip; i < iBlncKeys && iKeys > 0; i++ ) { if ( childs[i]->iKeys > 0 ) @@ -2365,8 +2481,6 @@ static int hb_cdxPageKeyLeafBalance( LPCDXPAGE pPage, SHORT iChildRet ) } } pPtr += childs[i]->iKeys * iLen; - if ( childs[i]->ReqByte > iMaxReq ) - iMaxReq = childs[i]->ReqByte; #ifdef HB_CDX_DSPDBG_INFO printf(", childs[%d]->iKeys=%d", i, childs[i]->iKeys); fflush(stdout); @@ -2375,7 +2489,7 @@ static int hb_cdxPageKeyLeafBalance( LPCDXPAGE pPage, SHORT iChildRet ) } } -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxPageCheckDupTrl( pPage, pKeyPool, iKeys ); #endif pPtr = pKeyPool; @@ -2393,7 +2507,7 @@ static int hb_cdxPageKeyLeafBalance( LPCDXPAGE pPage, SHORT iChildRet ) if ( !fIns && lpTmpPage != NULL ) { #if 1 - SHORT j, iSize = 0; + SHORT j, iSize = 0, iMaxReq; ULONG ulMaxRec = 0, ul; BYTE * pbKey, bMax; @@ -2431,35 +2545,45 @@ static int hb_cdxPageKeyLeafBalance( LPCDXPAGE pPage, SHORT iChildRet ) #endif else { - BYTE * pTmp = (BYTE *) hb_xgrab( ( iKeys + lpTmpPage->iKeys ) * iLen ); /* TODO: iBufSize to avoid new allocation if old buffer is large enough */ #ifdef HB_CDX_DSPDBG_INFO printf("\r\ninserting #keys=%d/%d (%d) parent=%lx, child=%lx, rec=%ld", iKeys, lpTmpPage->iKeys, i, pPage->Page, lpTmpPage->Page, HB_GET_LE_ULONG( pPtr + iLen - 6 )); fflush(stdout); #endif - memcpy( pTmp, pPtr, iKeys * iLen ); - hb_xfree( pKeyPool ); - pPtr = pKeyPool = pTmp; - pTmp = &pTmp[ iKeys * iLen ]; + if ( iBufSize >= iKeys + lpTmpPage->iKeys ) + { + memmove( pKeyPool, pPtr, iKeys * iLen ); + } + else + { + BYTE * pTmp; + iBufSize = iKeys + lpTmpPage->iKeys; + pTmp = (BYTE *) hb_xgrab( iBufSize * iLen ); + memcpy( pTmp, pPtr, iKeys * iLen ); + hb_xfree( pKeyPool ); + pKeyPool = pTmp; + } if ( lpTmpPage->iKeys > 0 ) { BYTE bDup = 0, bMax; + pPtr = &pKeyPool[ iKeys * iLen ]; if ( lpTmpPage->pKeyBuf ) - memcpy( pTmp, lpTmpPage->pKeyBuf, lpTmpPage->iKeys * iLen ); + memcpy( pPtr, lpTmpPage->pKeyBuf, lpTmpPage->iKeys * iLen ); else - hb_cdxPageLeafDecode( lpTmpPage, pTmp ); - bMax = iLen - 6 - HB_MAX( pTmp[ iLen - 1 ], pTmp[ -1 ] ); - while ( bDup < bMax && pTmp[ bDup ] == pTmp[ bDup - iLen ] ) + hb_cdxPageLeafDecode( lpTmpPage, pPtr ); + bMax = iLen - 6 - HB_MAX( pPtr[ iLen - 1 ], pPtr[ -1 ] ); + while ( bDup < bMax && pPtr[ bDup ] == pPtr[ bDup - iLen ] ) ++bDup; - pTmp[ iLen - 2 ] = bDup; + pPtr[ iLen - 2 ] = bDup; iKeys += lpTmpPage->iKeys; } + pPtr = pKeyPool; childs[i] = lpTmpPage; if ( iFirstKey + i >= pPage->iKeys ) iRet |= NODE_NEWLASTKEY; -#if 1 -#ifndef HB_CDX_DBGCODE_OFF +#if 0 +#ifdef HB_CDX_DBGCODE_EXT childs[i]->iKeys = 0; if ( childs[i]->pKeyBuf ) { @@ -2477,7 +2601,6 @@ static int hb_cdxPageKeyLeafBalance( LPCDXPAGE pPage, SHORT iChildRet ) } #endif #endif - } } else @@ -2514,57 +2637,87 @@ static int hb_cdxPageKeyLeafBalance( LPCDXPAGE pPage, SHORT iChildRet ) childs[i]->fBufChanged = FALSE; } hb_cdxPageCalcLeafSpace( childs[i], pPtr, iKeys ); - hb_cdxPageLeafEncode( childs[i], pPtr, childs[i]->iKeys ); + if ( i == iSkip && i < iBlncKeys && !childs[i]->fChanged && + childs[i]->iKeys == iChKeys[i] && + childs[i]->iFree == iChFree[i] ) + { +#ifdef HB_CDX_DSPDBG_INFO + printf("\r\niskip++\r\n");fflush(stdout); +#endif + iSkip++; + } + else + { + hb_cdxPageLeafEncode( childs[i], pPtr, childs[i]->iKeys ); + } pPtr += childs[i]->iKeys * iLen; iKeys -= childs[i]->iKeys; /* update parent key */ if ( i < iBlncKeys ) - { - hb_cdxPageIntSetKey( pPage, iFirstKey + i,fIns, + hb_cdxPageIntSetKey( pPage, iFirstKey + i, fIns, pPtr - iLen, HB_GET_LE_ULONG( pPtr - 6 ), childs[i]->Page ); - } + else + iBlncKeys++; #ifdef HB_CDX_DSPDBG_INFO printf(" (%d/%d)", childs[i]->iKeys,childs[i]->iFree); fflush(stdout); #endif -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxPageCheckKeys( childs[i] ); #endif - hb_cdxPageFree( childs[i], FALSE ); i++; } if ( i < iBlncKeys ) { - ULONG Left, Right; - /* Update siblings links */ - Right = childs[iBlncKeys-1]->Right; - if ( i > 0 ) +#if 1 + if ( childs[iBlncKeys-1]->Right != CDX_DUMMYNODE && + ( i > 1 || ( i == 1 && childs[0]->Left == CDX_DUMMYNODE ) ) ) { - Left = childs[i-1]->Page; - childs[i-1]->Right = Right; - childs[i-1]->fChanged = TRUE; + ULONG Page; + Page = childs[iBlncKeys-1]->Page; + childs[iBlncKeys-1]->Page = childs[i-1]->Page; + childs[i-1]->Page = Page; + hb_cdxPageIntSetKey( pPage, iFirstKey + i - 1, FALSE, NULL, 0, Page ); + childs[i-1]->Right = childs[iBlncKeys-1]->Right; + childs[i-1]->fChanged = TRUE; + if ( i > 1 ) + { + childs[i-2]->Right = Page; + childs[i-2]->fChanged = TRUE; + } } else +#endif { - Left = childs[0]->Left; - if ( Left != CDX_DUMMYNODE ) + ULONG Left, Right; + Right = childs[iBlncKeys-1]->Right; + if ( i > 0 ) { - lpTmpPage = hb_cdxPageNew( pPage->TagParent, pPage, Left ); - lpTmpPage->Right = Right; + Left = childs[i-1]->Page; + childs[i-1]->Right = Right; + childs[i-1]->fChanged = TRUE; + } + else + { + Left = childs[0]->Left; + if ( Left != CDX_DUMMYNODE ) + { + lpTmpPage = hb_cdxPageNew( pPage->TagParent, pPage, Left ); + lpTmpPage->Right = Right; + lpTmpPage->fChanged = TRUE; + hb_cdxPageFree( lpTmpPage, FALSE ); + } + } + if ( Right != CDX_DUMMYNODE ) + { + lpTmpPage = hb_cdxPageNew( pPage->TagParent, pPage, Right ); + lpTmpPage->Left = Left; lpTmpPage->fChanged = TRUE; hb_cdxPageFree( lpTmpPage, FALSE ); } } - if ( Right != CDX_DUMMYNODE ) - { - lpTmpPage = hb_cdxPageNew( pPage->TagParent, pPage, Right ); - lpTmpPage->Left = Left; - lpTmpPage->fChanged = TRUE; - hb_cdxPageFree( lpTmpPage, FALSE ); - } - /* Unlink empty pages from parent */ while ( i < iBlncKeys ) { @@ -2590,13 +2743,13 @@ static int hb_cdxPageKeyLeafBalance( LPCDXPAGE pPage, SHORT iChildRet ) } iRet |= NODE_BALANCE; } - for ( i = 0; i < iSkip; i++ ) + for ( i = 0; i < iBlncKeys; i++ ) hb_cdxPageFree( childs[i], FALSE ); if ( pKeyPool ) hb_xfree( pKeyPool ); pPage->fChanged = TRUE; -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxPageCheckKeys( pPage ); #endif if ( pPage->iKeys > pPage->TagParent->MaxKeys ) @@ -2604,7 +2757,7 @@ static int hb_cdxPageKeyLeafBalance( LPCDXPAGE pPage, SHORT iChildRet ) return iRet; } -static int hb_cdxPageKeyIntBalance( LPCDXPAGE pPage, SHORT iChildRet ) +static int hb_cdxPageKeyIntBalance( LPCDXPAGE pPage, int iChildRet ) { LPCDXPAGE childs[ CDX_BALANCE_INTPAGES + 2 ], lpTmpPage; SHORT iFirstKey, iBlncKeys = CDX_BALANCE_INTPAGES; @@ -2621,7 +2774,7 @@ static int hb_cdxPageKeyIntBalance( LPCDXPAGE pPage, SHORT iChildRet ) if ( pPage->Child && pPage->Child->Child ) hb_cdxPageFree( pPage->Child->Child, FALSE ); -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxPageCheckKeys( pPage ); #endif @@ -2657,7 +2810,7 @@ static int hb_cdxPageKeyIntBalance( LPCDXPAGE pPage, SHORT iChildRet ) { childs[i] = hb_cdxPageNew( pPage->TagParent, pPage, ulPage ); } -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE if ( i > 0 && ( childs[i]->Page != childs[i-1]->Right || childs[i]->Left != childs[i-1]->Page ) ) { @@ -2679,33 +2832,63 @@ static int hb_cdxPageKeyIntBalance( LPCDXPAGE pPage, SHORT iChildRet ) fflush(stdout); #endif } + iNeedKeys = ( iKeys + pPage->TagParent->MaxKeys - 1 ) + / pPage->TagParent->MaxKeys; +#if 1 + if ( iNeedKeys == 1 && iBlncKeys > 1 && childs[0]->Left != CDX_DUMMYNODE && + childs[iBlncKeys-1]->Right != CDX_DUMMYNODE && + iKeys >= CDX_BALANCE_INTPAGES << 1 && + iKeys > pPage->TagParent->MaxKeys * 3 >> 1 ) + { + iNeedKeys = 2; + } +#endif +#if 1 + iDiv = HB_MAX( iMax - iMin - ( pPage->TagParent->MaxKeys >> 1 ) + 1, + iBlncKeys - iNeedKeys ); +#else iDiv = iMax - iMin; +#endif if ( iDiv >= 2 || fForce ) { - iNeedKeys = ( iKeys + pPage->TagParent->MaxKeys - 1 ) - / pPage->TagParent->MaxKeys; - iMin = iKeys / iNeedKeys; - iMax = ( iKeys + iNeedKeys - 1 ) / iNeedKeys; - if ( iMin < 1 ) - iMin = 1; - if ( iMax > pPage->TagParent->MaxKeys ) - iMax = pPage->TagParent->MaxKeys; - for ( i = iBlncKeys - 1; i >= 0 && - childs[i]->iKeys >= iMin && childs[i]->iKeys <= iMax; i-- ) +#if 1 + if ( iBlncKeys == 1 && iKeys > pPage->TagParent->MaxKeys && + childs[0]->Right != CDX_DUMMYNODE ) { - iKeys -= childs[i]->iKeys; - hb_cdxPageFree( childs[i], FALSE ); - iBlncKeys--; + lpTmpPage = hb_cdxPageNew( pPage->TagParent, pPage, childs[0]->Right ); + iKeys += lpTmpPage->iKeys; + childs[iBlncKeys++] = lpTmpPage; + if ( iFirstKey + iBlncKeys > pPage->iKeys ) + iRet |= NODE_NEWLASTKEY; + iNeedKeys = ( iKeys + pPage->TagParent->MaxKeys - 1 ) + / pPage->TagParent->MaxKeys; } - while ( iBlncKeys > 0 && childs[0]->iKeys >= iMin && childs[0]->iKeys <= iMax ) + else +#endif { - iKeys -= childs[0]->iKeys; - hb_cdxPageFree( childs[0], FALSE ); - iBlncKeys--; - iFirstKey++; - for ( i = 0; i < iBlncKeys; i++ ) + iMax = ( iKeys + iNeedKeys - 1 ) / iNeedKeys; + iMin = HB_MAX( iKeys / iNeedKeys, 1 ); + for ( i = iBlncKeys - 1; i > 1 && + childs[i]->iKeys >= iMin && childs[i]->iKeys <= iMax; i-- ) { - childs[i] = childs[i+1]; + iKeys -= childs[i]->iKeys; + hb_cdxPageFree( childs[i], FALSE ); + iBlncKeys--; + iMax = ( iKeys + iNeedKeys - 1 ) / iNeedKeys; + iMin = HB_MAX( iKeys / iNeedKeys, 1 ); + } + while ( iBlncKeys > 2 && childs[0]->iKeys >= iMin && childs[0]->iKeys <= iMax ) + { + iKeys -= childs[0]->iKeys; + hb_cdxPageFree( childs[0], FALSE ); + iBlncKeys--; + iFirstKey++; + for ( i = 0; i < iBlncKeys; i++ ) + { + childs[i] = childs[i+1]; + } + iMax = ( iKeys + iNeedKeys - 1 ) / iNeedKeys; + iMin = HB_MAX( iKeys / iNeedKeys, 1 ); } } } @@ -2716,8 +2899,6 @@ static int hb_cdxPageKeyIntBalance( LPCDXPAGE pPage, SHORT iChildRet ) return iRet; } - iNeedKeys = ( iKeys + pPage->TagParent->MaxKeys - 1 ) - / pPage->TagParent->MaxKeys; if ( iKeys > 0 ) { pPtr = pKeyPool = (BYTE*) hb_xgrab( iKeys * iLen ); @@ -2733,21 +2914,30 @@ static int hb_cdxPageKeyIntBalance( LPCDXPAGE pPage, SHORT iChildRet ) if ( iNeedKeys > iBlncKeys ) { - childs[iBlncKeys] = hb_cdxPageNew( pPage->TagParent, pPage, 0 ); - childs[iBlncKeys]->PageType = CDX_NODE_BRANCH; - childs[iBlncKeys]->iKeys = 0; - childs[iBlncKeys]->fChanged = TRUE; + if ( iBlncKeys < 2 ) + i = iBlncKeys; + else + { + i = iBlncKeys - 1; + childs[iBlncKeys] = childs[i]; + } + childs[ i ] = hb_cdxPageNew( pPage->TagParent, pPage, 0 ); + childs[ i ]->PageType = CDX_NODE_BRANCH; + childs[ i ]->iKeys = 0; + childs[ i ]->fChanged = TRUE; /* Add new parent key */ - hb_cdxPageIntSetKey( pPage, iFirstKey + iBlncKeys, TRUE, + hb_cdxPageIntSetKey( pPage, iFirstKey + i, TRUE, NULL, 0, childs[iBlncKeys]->Page ); /* Update siblings links */ - childs[iBlncKeys ]->Left = childs[iBlncKeys-1]->Page; - childs[iBlncKeys ]->Right = childs[iBlncKeys-1]->Right; - childs[iBlncKeys-1]->Right = childs[iBlncKeys ]->Page; - if ( childs[iBlncKeys]->Right != CDX_DUMMYNODE ) + childs[ i ]->Left = childs[i-1]->Page; + childs[ i ]->Right = childs[i-1]->Right; + childs[i-1]->Right = childs[ i ]->Page; + if ( i < iBlncKeys ) + childs[i+1]->Left = childs[i]->Page; + else if ( childs[i]->Right != CDX_DUMMYNODE ) { lpTmpPage = hb_cdxPageNew( pPage->TagParent, pPage, childs[iBlncKeys]->Right ); - lpTmpPage->Left = childs[iBlncKeys]->Page; + lpTmpPage->Left = childs[i]->Page; lpTmpPage->fChanged = TRUE; hb_cdxPageFree( lpTmpPage, FALSE ); } @@ -2763,30 +2953,48 @@ static int hb_cdxPageKeyIntBalance( LPCDXPAGE pPage, SHORT iChildRet ) ULONG Left, Right; /* Update siblings links */ - Right = childs[iBlncKeys-1]->Right; - if ( iNeedKeys > 0 ) + if ( iNeedKeys > 1 ) { - Left = childs[iNeedKeys-1]->Page; - childs[iNeedKeys-1]->Right = Right; + childs[iNeedKeys-2]->Right = childs[iBlncKeys-1]->Page; + childs[iBlncKeys-1]->Left = childs[iNeedKeys-2]->Page; + lpTmpPage = childs[iBlncKeys-1]; + childs[iBlncKeys-1] = childs[iNeedKeys-1]; + childs[iNeedKeys-1] = lpTmpPage; + } + else if ( iNeedKeys > 0 && childs[0]->Left == CDX_DUMMYNODE ) + { + lpTmpPage = childs[iBlncKeys-1]; + childs[iBlncKeys-1] = childs[0]; + childs[0] = lpTmpPage; + childs[0]->Left = CDX_DUMMYNODE; } else { - Left = childs[0]->Left; - if ( Left != CDX_DUMMYNODE ) + Right = childs[iBlncKeys-1]->Right; + if ( iNeedKeys > 0 ) { - lpTmpPage = hb_cdxPageNew( pPage->TagParent, pPage, Left ); - lpTmpPage->Right = Right; + Left = childs[iNeedKeys-1]->Page; + childs[iNeedKeys-1]->Right = Right; + } + else + { + Left = childs[0]->Left; + if ( Left != CDX_DUMMYNODE ) + { + lpTmpPage = hb_cdxPageNew( pPage->TagParent, pPage, Left ); + lpTmpPage->Right = Right; + lpTmpPage->fChanged = TRUE; + hb_cdxPageFree( lpTmpPage, FALSE ); + } + } + if ( Right != CDX_DUMMYNODE ) + { + lpTmpPage = hb_cdxPageNew( pPage->TagParent, pPage, Right ); + lpTmpPage->Left = Left; lpTmpPage->fChanged = TRUE; hb_cdxPageFree( lpTmpPage, FALSE ); } } - if ( Right != CDX_DUMMYNODE ) - { - lpTmpPage = hb_cdxPageNew( pPage->TagParent, pPage, Right ); - lpTmpPage->Left = Left; - lpTmpPage->fChanged = TRUE; - hb_cdxPageFree( lpTmpPage, FALSE ); - } /* Unlink empty pages from parent */ for ( i = iBlncKeys - 1; i >= iNeedKeys; i-- ) { @@ -2817,7 +3025,7 @@ static int hb_cdxPageKeyIntBalance( LPCDXPAGE pPage, SHORT iChildRet ) for ( i = 0; i < iBlncKeys; i++ ) { iNodeKeys = ( iKeys + iBlncKeys - i - 1 ) / ( iBlncKeys - i ); -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE if ( iNodeKeys > pPage->TagParent->MaxKeys ) hb_cdxErrInternal( "hb_cdxPageKeyIntBalance: iNodeKeys calculated wrong!." ); #endif @@ -2828,13 +3036,16 @@ static int hb_cdxPageKeyIntBalance( LPCDXPAGE pPage, SHORT iChildRet ) pPtr += iNodeKeys * iLen; iKeys -= iNodeKeys; /* update parent key */ - hb_cdxPageIntSetKey( pPage, iFirstKey + i, FALSE, - pPtr - iLen, HB_GET_BE_ULONG( pPtr - 8 ), - childs[i]->Page ); + if ( iFirstKey + i < pPage->iKeys ) + { + hb_cdxPageIntSetKey( pPage, iFirstKey + i, FALSE, + pPtr - iLen, HB_GET_BE_ULONG( pPtr - 8 ), + childs[i]->Page ); + } #ifdef HB_CDX_DSPDBG_INFO printf(" (%d)", childs[i]->iKeys); #endif -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxPageCheckKeys( childs[i] ); #endif hb_cdxPageFree( childs[i], FALSE ); @@ -2842,7 +3053,7 @@ static int hb_cdxPageKeyIntBalance( LPCDXPAGE pPage, SHORT iChildRet ) hb_xfree( pKeyPool ); } pPage->fChanged = TRUE; -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxPageCheckKeys( pPage ); #endif if ( pPage->iKeys > pPage->TagParent->MaxKeys ) @@ -2874,7 +3085,7 @@ static int hb_cdxPageBalance( LPCDXPAGE pPage, int iChildRet ) hb_cdxPageGetKeyVal( pPage->Child, pPage->Child->iKeys-1 ), hb_cdxPageGetKeyRec( pPage->Child, pPage->Child->iKeys-1 ), pPage->Child->Page ); -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxPageCheckKeys( pPage ); #endif pPage->fChanged = TRUE; @@ -2890,7 +3101,10 @@ static int hb_cdxPageBalance( LPCDXPAGE pPage, int iChildRet ) if ( !pPage->Owner ) { if ( pPage->iKeys == 0 ) + { pPage->PageType |= CDX_NODE_LEAF; + hb_cdxPageLeafInitSpace( pPage ); + } else if ( iRet & NODE_SPLIT ) iRet = hb_cdxPageRootSplit( pPage ); } @@ -2914,6 +3128,7 @@ static int hb_cdxPageRootSplit( LPCDXPAGE pPage ) ulPage = pNewRoot->Page; pNewRoot->Page = pPage->Page; pPage->Page = ulPage; + pPage->Owner = pNewRoot; pPage->PageType &= ~CDX_NODE_ROOT; pNewRoot->PageType = CDX_NODE_ROOT | CDX_NODE_BRANCH; @@ -2924,7 +3139,7 @@ static int hb_cdxPageRootSplit( LPCDXPAGE pPage ) hb_cdxPageGetKeyVal( pPage, pPage->iKeys-1 ), hb_cdxPageGetKeyRec( pPage, pPage->iKeys-1 ), pPage->Page ); -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxPageCheckKeys( pNewRoot ); hb_cdxTagPoolCheck( pPage->TagParent ); #endif @@ -2957,6 +3172,9 @@ static int hb_cdxPageKeyInsert( LPCDXPAGE pPage, LPCDXKEY pKey ) iChildRet = hb_cdxPageLeafAddKey( pPage, pKey ); else /* interior node */ iChildRet = hb_cdxPageKeyInsert( pPage->Child, pKey ); +#ifdef HB_CDX_DBGUPDT + cdxTmpStackSize++; +#endif return hb_cdxPageBalance( pPage, iChildRet ); } @@ -3090,10 +3308,12 @@ static void hb_cdxTagLoad( LPCDXTAG pTag ) case HB_IT_STRING: pTag->uiType = 'C'; /* TODO: is this safe? */ - pTag->uiLen = HB_CDXMAXKEY( ( hb_stackItemFromTop( -1 ) )->item.asString.length ); + /* pTag->uiLen = HB_CDXMAXKEY( ( hb_stackItemFromTop( -1 ) )->item.asString.length ); */ break; } hb_stackPop(); /* pop macro evaluated value */ + if ( pTag->uiType == 'C' ) + hb_cdxMakeSortTab( pTag->pIndex->pArea ); pTag->nField = hb_rddFieldIndex( ( AREAP ) pTag->pIndex->pArea, pTag->KeyExpr ); @@ -3235,7 +3455,7 @@ static void hb_cdxTagPoolFree( LPCDXTAG pTag, int nPagesLeft ) { LPCDXPAGE pPage, pPageNext; -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxTagPoolCheck( pTag ); #endif pPage = pTag->pagePool; @@ -3253,7 +3473,7 @@ static void hb_cdxTagPoolFree( LPCDXTAG pTag, int nPagesLeft ) } pPage = pPageNext; } -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxTagPoolCheck( pTag ); #endif } @@ -3274,7 +3494,7 @@ static void hb_cdxTagPoolFlush( LPCDXTAG pTag ) } pPage = pPage->pPoolNext; } -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT hb_cdxTagPoolCheck( pTag ); #endif } @@ -3296,22 +3516,10 @@ static void hb_cdxSetCurKey( LPCDXPAGE pPage ) /* * seek given Key in the Page or in its children */ -static int hb_cdxPageSeekKey( LPCDXPAGE pPage, LPCDXKEY pKey, BOOL fExact ) +static int hb_cdxPageSeekKey( LPCDXPAGE pPage, LPCDXKEY pKey, ULONG ulKeyRec, BOOL fExact ) { - int l, r, n = -1, k = 1; + int l, r, n, k; BOOL fLeaf = ( pPage->PageType & CDX_NODE_LEAF ) != 0; - ULONG ulKeyRec = pKey->rec; - - if ( pPage->TagParent->UsrUnique ) - { - if ( pPage->TagParent->UsrAscend ) - { - if ( ulKeyRec == CDX_MAX_REC_NUM ) - ulKeyRec = CDX_IGNORE_REC_NUM; - } - else if ( ulKeyRec == CDX_IGNORE_REC_NUM ) - ulKeyRec = CDX_MAX_REC_NUM; - } if ( fLeaf && !pPage->pKeyBuf && pPage->iKeys > 0 ) { @@ -3321,6 +3529,8 @@ static int hb_cdxPageSeekKey( LPCDXPAGE pPage, LPCDXKEY pKey, BOOL fExact ) pPage->pKeyBuf = pKeyBuf; } + k = ( ulKeyRec == CDX_MAX_REC_NUM ) ? -1 : 1; + n = -1; l = 0; r = pPage->iKeys - 1; while ( l < r ) @@ -3328,7 +3538,7 @@ static int hb_cdxPageSeekKey( LPCDXPAGE pPage, LPCDXKEY pKey, BOOL fExact ) n = (l + r ) >> 1; k = hb_cdxValCompare( pPage->TagParent, pKey->val, pKey->len, hb_cdxPageGetKeyVal( pPage, n ), - pPage->TagParent->uiLen, fExact ); + (BYTE) pPage->TagParent->uiLen, fExact ); if ( k == 0 ) { if ( ulKeyRec == CDX_MAX_REC_NUM ) @@ -3354,7 +3564,7 @@ static int hb_cdxPageSeekKey( LPCDXPAGE pPage, LPCDXKEY pKey, BOOL fExact ) if ( !fLeaf ) { hb_cdxPageGetChild( pPage ); -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE if ( memcmp( hb_cdxPageGetKeyVal( pPage, pPage->iCurKey ), hb_cdxPageGetKeyVal( pPage->Child, pPage->Child->iKeys-1 ), pPage->TagParent->uiLen ) != 0 || @@ -3367,13 +3577,13 @@ static int hb_cdxPageSeekKey( LPCDXPAGE pPage, LPCDXKEY pKey, BOOL fExact ) hb_cdxErrInternal("hb_cdxPageSeekKey: wrong parent key."); } #endif - k = hb_cdxPageSeekKey( pPage->Child, pKey, fExact ); + k = hb_cdxPageSeekKey( pPage->Child, pKey, ulKeyRec, fExact ); } else if ( l != n || ulKeyRec == CDX_MAX_REC_NUM ) { k = hb_cdxValCompare( pPage->TagParent, pKey->val, pKey->len, hb_cdxPageGetKeyVal( pPage, pPage->iCurKey ), - pPage->TagParent->uiLen, fExact ); + (BYTE) pPage->TagParent->uiLen, fExact ); if ( k == 0 && ulKeyRec != CDX_MAX_REC_NUM && ulKeyRec != CDX_IGNORE_REC_NUM ) { @@ -3392,12 +3602,12 @@ static int hb_cdxPageSeekKey( LPCDXPAGE pPage, LPCDXKEY pKey, BOOL fExact ) if ( !fLeaf ) { hb_cdxPageGetChild( pPage ); - k = hb_cdxPageSeekKey( pPage->Child, pKey, fExact ); + k = hb_cdxPageSeekKey( pPage->Child, pKey, ulKeyRec, fExact ); } else k = hb_cdxValCompare( pPage->TagParent, pKey->val, pKey->len, hb_cdxPageGetKeyVal( pPage, pPage->iCurKey ), - pPage->TagParent->uiLen, fExact ); + (BYTE) pPage->TagParent->uiLen, fExact ); } } else if ( k > 0 && fLeaf ) @@ -3688,14 +3898,26 @@ static void hb_cdxTagKeyRead( LPCDXTAG pTag, BYTE bTypRead ) static ULONG hb_cdxTagKeyFind( LPCDXTAG pTag, LPCDXKEY pKey ) { int K; + ULONG ulKeyRec = pKey->rec; + + if ( pTag->UsrUnique ) + { + if ( pTag->UsrAscend ) + { + if ( ulKeyRec == CDX_MAX_REC_NUM ) + ulKeyRec = CDX_IGNORE_REC_NUM; + } + else if ( ulKeyRec == CDX_IGNORE_REC_NUM ) + ulKeyRec = CDX_MAX_REC_NUM; + } pTag->CurKey->rec = 0; pTag->fRePos = FALSE; hb_cdxTagOpen( pTag ); pTag->TagBOF = pTag->TagEOF = FALSE; - K = hb_cdxPageSeekKey( pTag->RootPage, pKey, FALSE ); - if ( pKey->rec == CDX_MAX_REC_NUM && K != 0 ) + K = hb_cdxPageSeekKey( pTag->RootPage, pKey, ulKeyRec, FALSE ); + if ( ulKeyRec == CDX_MAX_REC_NUM ) K = - K; if ( K > 0 ) @@ -3717,19 +3939,19 @@ static void hb_cdxTagKeyAdd( LPCDXTAG pTag, LPCDXKEY pKey ) BOOL fFound; hb_cdxTagOpen( pTag ); - if ( pTag->UniqueKey ) - { - ULONG ulRec = pKey->rec; - pKey->rec = CDX_IGNORE_REC_NUM; - fFound = ( hb_cdxPageSeekKey( pTag->RootPage, pKey, TRUE ) == 0 ); - pKey->rec = ulRec; - } - else - fFound = ( hb_cdxPageSeekKey( pTag->RootPage, pKey, TRUE ) == 0 ); - + fFound = ( hb_cdxPageSeekKey( pTag->RootPage, pKey, + pTag->UniqueKey ? CDX_IGNORE_REC_NUM : pKey->rec, + TRUE ) == 0 ); if ( ! fFound ) { +#ifdef HB_CDX_DBGUPDT + cdxTmpStackSize = 0; +#endif hb_cdxPageKeyInsert( pTag->RootPage, pKey ); +#ifdef HB_CDX_DBGUPDT + if ( cdxTmpStackSize > cdxStackSize ) + cdxStackSize = cdxTmpStackSize; +#endif /* TODO: !!! remove when page leaf balance can save CurKey */ hb_cdxTagKeyFind( pTag, pKey ); } @@ -3800,6 +4022,28 @@ static void hb_cdxTagIndexTagNew( LPCDXTAG pTag, hb_cdxTagDoIndex( pTag ); } +/* + * free page and all child pages + */ +static void hb_cdxIndexFreePages( LPCDXPAGE pPage ) +{ + if ( ( pPage->PageType & CDX_NODE_LEAF ) == 0 ) + { + LPCDXPAGE pChildPage; + SHORT iKey; + + for ( iKey = 0; iKey < pPage->iKeys; iKey++ ) + { + pChildPage = hb_cdxPageNew( pPage->TagParent, NULL, + hb_cdxPageGetKeyPage( pPage, iKey ) ); + if ( pChildPage ) + hb_cdxIndexFreePages( pChildPage ); + } + } + pPage->PageType = CDX_NODE_UNUSED; + hb_cdxPageFree( pPage, FALSE ); +} + /* * remove Tag from Bag */ @@ -3817,7 +4061,18 @@ static void hb_cdxIndexDelTag( LPCDXINDEX pIndex, char * szTagName ) if ( hb_cdxTagKeyFind( pIndex->pCompound, pKey ) > 0 ) { hb_cdxPageKeyDelete( pIndex->pCompound->RootPage ); - /* TODO: !!! free header and all pages used by order */ + if ( pTag != pIndex->TagList || pTag->pNext != NULL ) + { + LPCDXPAGE pPage; + + hb_cdxTagOpen( pTag ); + pPage = pTag->RootPage; + hb_cdxTagClose( pTag ); + if ( pPage ) + hb_cdxIndexFreePages( pPage ); + pTag->TagChanged = FALSE; + hb_cdxIndexPutAvailPage( pIndex, pTag->TagBlock, TRUE ); + } } *pTagPtr = pTag->pNext; hb_cdxTagFree( pTag ); @@ -3837,7 +4092,9 @@ static LPCDXTAG hb_cdxIndexAddTag( LPCDXINDEX pIndex, char * szTagName, LPCDXTAG pTag, *pTagPtr; LPCDXKEY pKey; - /* Delete previous tag first to free the place for new one */ + /* Delete previous tag first to free the place for new one + * its redundant Tag should be already deleted + */ hb_cdxIndexDelTag( pIndex, szTagName ); /* Create new tag an add to tag list */ @@ -3945,6 +4202,10 @@ static void hb_cdxIndexFree( LPCDXINDEX pIndex ) if ( pIndex->fShared && ( pIndex->lockWrite || pIndex->lockRead ) ) hb_errInternal( 9104, "hb_cdxIndexFree: index file still locked.", "", "" ); +#ifdef HB_CDX_DBGCODE + if ( pIndex->WrLck || pIndex->RdLck ) + hb_errInternal( 9104, "hb_cdxIndexFree: index file still locked (*)", "", "" ); +#endif if ( pIndex->szFileName != NULL ) hb_xfree( pIndex->szFileName ); @@ -4038,13 +4299,14 @@ static LPCDXINDEX hb_cdxFindBag( CDXAREAP pArea, char * szBagName ) pFileName = hb_fsFNameSplit( szBagName ); szBaseName = hb_strdup( pFileName->szName ); - hb_strUpper( szBaseName, strlen(szBaseName)); + hb_strUpper( szBaseName, strlen(szBaseName) ); pIndex = pArea->lpIndexes; - while ( pIndex ) { + while ( pIndex ) + { hb_xfree( pFileName ); pFileName = hb_fsFNameSplit( pIndex->szFileName ); - hb_strUpper( pFileName->szName, strlen(pFileName->szName)); + hb_strUpper( pFileName->szName, strlen(pFileName->szName) ); if ( !hb_stricmp( pFileName->szName, szBaseName ) ) break; pIndex = pIndex->pNext; @@ -4125,8 +4387,8 @@ static USHORT hb_cdxFindTag( CDXAREAP pArea, PHB_ITEM pItem ) LPCDXINDEX pIndex; char szName[ CDX_MAXTAGNAMELEN + 1 ]; - hb_strncpyUpperTrim( szName, hb_itemGetCPtr( pItem ), - HB_MIN(hb_itemGetCLen( pItem ), CDX_MAXTAGNAMELEN) ); + hb_strncpyUpperTrim( szName, pItem->item.asString.value, + HB_MIN( pItem->item.asString.length, CDX_MAXTAGNAMELEN) ); pIndex = pArea->lpIndexes; pTag = NULL; uiTag = 0; @@ -4165,33 +4427,6 @@ static LPCDXTAG hb_cdxGetActiveTag( CDXAREAP pArea ) return pTag; } -/* - * go to Eof and update BOF and EOF flags. - */ -static ERRCODE hb_cdxGoEof( CDXAREAP pArea ) -{ - ERRCODE retvalue; - LPCDXTAG pTag; - - HB_TRACE(HB_TR_DEBUG, ("cdxGoEof(%p)", pArea)); - - pTag = hb_cdxGetActiveTag( pArea ); - retvalue = SELF_GOTO( ( AREAP ) pArea, 0 ); - if ( pArea->ulRecCount ) - { - pArea->fBof = FALSE; - if ( pTag ) - pTag->TagBOF = FALSE; - } - if ( pTag ) - { - pTag->TagEOF = TRUE; - pTag->fRePos = FALSE; - pTag->CurKey->rec = 0; - } - return retvalue; -} - /* * refresh CurKey value and set proper path from RootPage to LeafPage * fUniq is used for forward skipunique @@ -4203,6 +4438,7 @@ static BOOL hb_cdxCurKeyRefresh( CDXAREAP pArea, LPCDXTAG pTag, BOOL fUniq ) pTag->TagEOF = TRUE; pTag->fRePos = FALSE; pTag->CurKey->rec = 0; + return FALSE; } else if ( pTag->fRePos || pTag->CurKey->rec != pArea->ulRecNo ) { @@ -4218,18 +4454,19 @@ static BOOL hb_cdxCurKeyRefresh( CDXAREAP pArea, LPCDXTAG pTag, BOOL fUniq ) } hb_cdxKeyFree( pKey ); } + return ( pTag->CurKey->rec != 0 && pTag->CurKey->rec == pArea->ulRecNo ); } - return ( pTag->CurKey->rec != 0 && pTag->CurKey->rec == pArea->ulRecNo ); + return TRUE; } /* - * return number of keys in order + * skit to next unique key */ static ERRCODE hb_cdxSkipUnique( CDXAREAP pArea, LPCDXTAG pTag, BOOL fForward ) { ERRCODE retval; - HB_TRACE(HB_TR_DEBUG, ("hb_cdxSkipUnique(%p, %p, %d)", pArea, pTag, (int) fForward)); + HB_TRACE(HB_TR_DEBUG, ("hb_cdxSkipUnique(%p, %p, %i)", pArea, pTag, (int) fForward)); if ( FAST_GOCOLD( ( AREAP ) pArea ) == FAILURE ) return FAILURE; @@ -4264,10 +4501,8 @@ static ERRCODE hb_cdxSkipUnique( CDXAREAP pArea, LPCDXTAG pTag, BOOL fForward ) pTag->TagEOF = TRUE; } } - if ( pArea->fEof || pTag->TagEOF ) - retval = hb_cdxGoEof( pArea ); - else - retval = SELF_GOTO( ( AREAP ) pArea, pTag->CurKey->rec ); + retval = SELF_GOTO( ( AREAP ) pArea, ( pArea->fEof || pTag->TagEOF ) + ? 0 : pTag->CurKey->rec ); } else { @@ -4300,14 +4535,20 @@ static ERRCODE hb_cdxSkipUnique( CDXAREAP pArea, LPCDXTAG pTag, BOOL fForward ) } } hb_cdxIndexUnLockRead( pTag->pIndex ); + + /* Update Bof and Eof flags */ + if( fForward ) + pArea->fBof = FALSE; + else + pArea->fEof = FALSE; + return retval; } - /* * return number of keys in order */ -static long hb_cdxDBOIKeyCount( CDXAREAP pArea, LPCDXTAG pTag, BOOL fFilters ) +static LONG hb_cdxDBOIKeyCount( CDXAREAP pArea, LPCDXTAG pTag, BOOL fFilters ) { ULONG lKeyCount = 0; @@ -4400,7 +4641,7 @@ static long hb_cdxDBOIKeyCount( CDXAREAP pArea, LPCDXTAG pTag, BOOL fFilters ) /* * return logical key position in order */ -static long hb_cdxDBOIKeyNo( CDXAREAP pArea, LPCDXTAG pTag, BOOL fFilters ) +static LONG hb_cdxDBOIKeyNo( CDXAREAP pArea, LPCDXTAG pTag, BOOL fFilters ) { ULONG lKeyNo = 0; @@ -4524,7 +4765,7 @@ static ERRCODE hb_cdxDBOIKeyGoto( CDXAREAP pArea, LPCDXTAG pTag, ULONG ulKeyNo, fFilters = 0; if ( ulKeyNo == 0 ) - retval = hb_cdxGoEof( pArea ); + retval = SELF_GOTO( ( AREAP ) pArea, 0 ); else if ( fFilters ) { USHORT uiTag = pArea->uiTag; @@ -4558,7 +4799,7 @@ static ERRCODE hb_cdxDBOIKeyGoto( CDXAREAP pArea, LPCDXTAG pTag, ULONG ulKeyNo, pOwnerPage = pPage; pPage = pPage->Child; } - while ( (USHORT) pPage->iKeys < ulKeyNo && pOwnerPage && + while ( (ULONG) pPage->iKeys < ulKeyNo && pOwnerPage && ( ulNextPg = pTag->UsrAscend ? pPage->Right : pPage->Left ) != CDX_DUMMYNODE ) { @@ -4567,19 +4808,16 @@ static ERRCODE hb_cdxDBOIKeyGoto( CDXAREAP pArea, LPCDXTAG pTag, ULONG ulKeyNo, hb_cdxPageFree( pPage, FALSE ); pPage = pOwnerPage->Child; } - if ( (USHORT) pPage->iKeys >= ulKeyNo ) + if ( (ULONG) pPage->iKeys >= ulKeyNo ) { - pPage->iCurKey = pTag->UsrAscend ? ulKeyNo - 1 : pPage->iKeys - ulKeyNo; + pPage->iCurKey = pTag->UsrAscend ? ( SHORT ) ulKeyNo - 1 : pPage->iKeys - ( SHORT ) ulKeyNo; hb_cdxSetCurKey( pPage ); } else pTag->CurKey->rec = 0; } hb_cdxIndexUnLockRead( pTag->pIndex ); - if ( pTag->CurKey->rec == 0 ) - retval = hb_cdxGoEof( pArea ); - else - retval = SELF_GOTO( ( AREAP ) pArea, pTag->CurKey->rec ); + retval = SELF_GOTO( ( AREAP ) pArea, pTag->CurKey->rec ); } else { @@ -4620,6 +4858,10 @@ static ERRCODE hb_cdxGoBottom( CDXAREAP pArea ) hb_cdxTagKeyRead( pTag, BTTM_RECORD ); if ( pTag->CurKey->rec != 0 && ! hb_cdxTopScope( pTag ) ) pTag->CurKey->rec = 0; + + pArea->fTop = FALSE; + pArea->fBottom = TRUE; + retval = SELF_GOTO( ( AREAP ) pArea, pTag->CurKey->rec ); if ( retval != FAILURE && !pArea->fEof ) retval = SELF_SKIPFILTER( ( AREAP ) pArea, -1 ); @@ -4652,6 +4894,10 @@ static ERRCODE hb_cdxGoTop( CDXAREAP pArea ) hb_cdxTagKeyRead( pTag, TOP_RECORD ); if ( pTag->CurKey->rec != 0 && ! hb_cdxBottomScope( pTag ) ) pTag->CurKey->rec = 0; + + pArea->fTop = TRUE; + pArea->fBottom = FALSE; + retval = SELF_GOTO( ( AREAP ) pArea, pTag->CurKey->rec ); if ( retval != FAILURE && !pArea->fEof ) retval = SELF_SKIPFILTER( ( AREAP ) pArea, 1 ); @@ -4683,6 +4929,8 @@ static ERRCODE hb_cdxSeek( CDXAREAP pArea, BOOL fSoftSeek, PHB_ITEM pKeyItm, BOO BOOL fEOF = FALSE; ULONG ulRec; + pArea->fTop = pArea->fBottom = FALSE; + if ( !pTag->UsrAscend ) fFindLast = !fFindLast; @@ -4733,8 +4981,9 @@ static ERRCODE hb_cdxSeek( CDXAREAP pArea, BOOL fSoftSeek, PHB_ITEM pKeyItm, BOO ( fEOF || ! hb_cdxTopScope( pTag ) || ! hb_cdxBottomScope( pTag ) ) ) { - retval = hb_cdxGoEof( pArea ); + retval = SELF_GOTO( ( AREAP ) pArea, 0 ); } + pArea->fBof = FALSE; hb_cdxKeyFree( pKey ); return retval; } @@ -4791,10 +5040,8 @@ static ERRCODE hb_cdxSkipRaw( CDXAREAP pArea, LONG lToSkip ) } } } - if ( pArea->fEof || pTag->TagEOF ) - retval = hb_cdxGoEof( pArea ); - else - retval = SELF_GOTO( ( AREAP ) pArea, pTag->CurKey->rec ); + retval = SELF_GOTO( ( AREAP ) pArea, ( pArea->fEof || pTag->TagEOF ) + ? 0 : pTag->CurKey->rec ); } else /* if ( lToSkip < 0 ) */ { @@ -4910,7 +5157,7 @@ static ERRCODE hb_cdxGoCold( CDXAREAP pArea ) if ( hb_cdxValCompare( pTag, pKey->val, pKey->len, pTag->HotKey->val, pTag->HotKey->len, TRUE ) == 0 ) { - fAdd = !pTag->HotFor; + fAdd = fAdd && !pTag->HotFor; fDel = FALSE; } else if ( !pTag->HotFor ) @@ -4929,7 +5176,7 @@ static ERRCODE hb_cdxGoCold( CDXAREAP pArea ) { if ( !fLck ) { - hb_cdxIndexLockWrite( pTag->pIndex ); + hb_cdxIndexLockWrite( pTag->pIndex ); fLck = TRUE; } if ( fDel ) @@ -5058,6 +5305,11 @@ static ERRCODE hb_cdxClose( CDXAREAP pArea ) fflush(stdout); cdxTimeIntBld = cdxTimeExtBld = 0; #endif +#ifdef HB_CDX_DBGUPDT + printf( "\r\n#reads=%ld, #writes=%ld, stacksize=%d\r\n", cdxReadNO, cdxWriteNO, cdxStackSize ); + fflush(stdout); + cdxReadNO = cdxWriteNO = 0; +#endif return SUPER_CLOSE( ( AREAP ) pArea ); } @@ -5074,6 +5326,13 @@ static ERRCODE hb_cdxOpen( CDXAREAP pArea, LPDBOPENINFO pOpenInfo ) { HB_TRACE(HB_TR_DEBUG, ("hb_cdxOpen(%p, %p)", pArea, pOpenInfo)); + if ( !pArea->bLockType ) + { + if ( hb_set.HB_SET_DBFLOCKSCHEME ) + pArea->bLockType = hb_set.HB_SET_DBFLOCKSCHEME; + else + pArea->bLockType = HB_SET_DBFLOCK_VFP; + } if ( SUPER_OPEN( ( AREAP ) pArea, pOpenInfo ) == FAILURE ) { return FAILURE; @@ -5214,8 +5473,8 @@ static ERRCODE hb_cdxOrderListAdd( CDXAREAP pArea, LPDBORDERINFO pOrderInfo ) return FAILURE; szFileName = ( char * ) hb_xgrab( _POSIX_PATH_MAX + 3 ); - strcpy( szFileName, hb_itemGetCPtr( pOrderInfo->atomBagName ) ); - szFileName = ( char * ) hb_filecase( szFileName ) ; + strcpy( szFileName, pOrderInfo->atomBagName->item.asString.value ); + szFileName = ( char * ) hb_fileNameConv( szFileName ) ; if ( strlen( szFileName ) == 0 ) { @@ -5440,7 +5699,6 @@ static ERRCODE hb_cdxOrderCreate( CDXAREAP pArea, LPDBORDERCREATEINFO pOrderInfo { ULONG ulRecNo; BOOL fNewFile, fOpenedIndex; - FHANDLE hFile; PHB_ITEM pKeyExp, pForExp, pResult; HB_MACRO_PTR pExpMacro, pForMacro; char * szFileName, * szCpndTagName, * szTagName; @@ -5634,9 +5892,11 @@ static ERRCODE hb_cdxOrderCreate( CDXAREAP pArea, LPDBORDERCREATEINFO pOrderInfo pIndex = hb_cdxFindBag( pArea, szFileName ); fOpenedIndex = ( pIndex != NULL ); + fNewFile = FALSE; if ( !fOpenedIndex ) { + FHANDLE hFile; fNewFile = ! hb_spFile( ( BYTE * ) szFileName, szSpFile ); if ( fNewFile ) { @@ -5676,46 +5936,44 @@ static ERRCODE hb_cdxOrderCreate( CDXAREAP pArea, LPDBORDERCREATEINFO pOrderInfo /* TODO: check if index file is not corrupted */ /* cut corrupted files */ fNewFile = ( hb_fsSeek( hFile, 0, FS_END ) <= sizeof( CDXTAGHEADER ) ); - hb_fsSeek( hFile, 0, FS_SET ); - if ( fNewFile ) - hb_fsWrite( hFile, NULL, 0 ); } - - hb_cdxIndexLockWrite( pIndex ); - if ( fNewFile ) - { - hb_cdxIndexDropAvailPage( pIndex ); - pIndex->nextAvail = pIndex->freePage = 0; - pIndex->pCompound = hb_cdxTagNew( pIndex, szCpndTagName, CDX_DUMMYNODE ); - pIndex->pCompound->OptFlags = CDX_TYPE_COMPACT | CDX_TYPE_COMPOUND | CDX_TYPE_STRUCTURE; - hb_cdxTagIndexTagNew( pIndex->pCompound, NULL, NULL, 'C', 10, NULL, NULL, - TRUE, FALSE, FALSE ); - } - else - { + if ( !fNewFile ) hb_cdxIndexLoad( pIndex, szCpndTagName ); - /* Delete new tag if exist */ - hb_cdxIndexDelTag( pIndex, szTagName ); - } - - /* Update DBF header */ - if ( !pArea->fHasTags ) - { - pFileName = hb_fsFNameSplit( pArea->szDataFileName ); - hb_strncpyUpper( szFileName, pFileName->szName, CDX_MAXTAGNAMELEN ); - hb_xfree( pFileName ); - if ( strcmp( szFileName, szCpndTagName ) == 0 ) - { - pArea->fHasTags = TRUE; - SELF_WRITEDBHEADER( ( AREAP ) pArea ); - } - } } - else /* if ( fOpenedIndex ) */ + + hb_cdxIndexLockWrite( pIndex ); + if ( !fNewFile ) { - hb_cdxIndexLockWrite( pIndex ); /* Delete new tag if exist */ hb_cdxIndexDelTag( pIndex, szTagName ); + fNewFile = ( pIndex->TagList == NULL ); + } + + if ( fNewFile ) + { + hb_fsSeek( pIndex->hFile, 0, FS_SET ); + hb_fsWrite( pIndex->hFile, NULL, 0 ); + hb_cdxIndexDropAvailPage( pIndex ); + if ( pIndex->pCompound != NULL ) + hb_cdxTagFree( pIndex->pCompound ); + pIndex->nextAvail = pIndex->freePage = 0; + pIndex->pCompound = hb_cdxTagNew( pIndex, szCpndTagName, CDX_DUMMYNODE ); + pIndex->pCompound->OptFlags = CDX_TYPE_COMPACT | CDX_TYPE_COMPOUND | CDX_TYPE_STRUCTURE; + hb_cdxTagIndexTagNew( pIndex->pCompound, NULL, NULL, 'C', 10, NULL, NULL, + TRUE, FALSE, FALSE ); + } + + /* Update DBF header */ + if ( !pArea->fHasTags ) + { + pFileName = hb_fsFNameSplit( pArea->szDataFileName ); + hb_strncpyUpper( szFileName, pFileName->szName, CDX_MAXTAGNAMELEN ); + hb_xfree( pFileName ); + if ( strcmp( szFileName, szCpndTagName ) == 0 ) + { + pArea->fHasTags = TRUE; + SELF_WRITEDBHEADER( ( AREAP ) pArea ); + } } hb_xfree( szFileName ); @@ -5735,6 +5993,7 @@ static ERRCODE hb_cdxOrderCreate( CDXAREAP pArea, LPDBORDERCREATEINFO pOrderInfo { hb_cdxOrdListClear( pArea, FALSE, pIndex ); } + hb_cdxIndexUnLockWrite( pIndex ); if ( !fOpenedIndex ) { if ( pArea->lpIndexes == NULL ) @@ -5748,7 +6007,6 @@ static ERRCODE hb_cdxOrderCreate( CDXAREAP pArea, LPDBORDERCREATEINFO pOrderInfo } } - hb_cdxIndexUnLockWrite( pIndex ); pArea->uiTag = hb_cdxGetTagNumber( pArea, pTag ); /* Clear pArea->lpdbOrdCondInfo */ @@ -5844,6 +6102,7 @@ static ERRCODE hb_cdxOrderInfo( CDXAREAP pArea, USHORT uiIndex, LPDBORDERINFO pO case DBOI_ORDERCOUNT: case DBOI_BAGEXT: case DBOI_LOCKOFFSET: + case DBOI_HPLOCKING: break; default: if ( pOrderInfo->itmOrder ) @@ -5926,9 +6185,18 @@ static ERRCODE hb_cdxOrderInfo( CDXAREAP pArea, USHORT uiIndex, LPDBORDERINFO pO pOrderInfo->itmResult = hb_itemPutC( pOrderInfo->itmResult, CDX_INDEXEXT ); break; + case DBOI_HPLOCKING: case DBOI_LOCKOFFSET: - pOrderInfo->itmResult = hb_itemPutNL( pOrderInfo->itmResult, CDX_LOCKSIZE ); - break; + { + ULONG ulPos, ulPool; + + hb_dbfLockIdxGetData( pArea->bLockType, &ulPos, &ulPool ); + if ( uiIndex == DBOI_LOCKOFFSET ) + pOrderInfo->itmResult = hb_itemPutNL( pOrderInfo->itmResult, ulPos ); + else + pOrderInfo->itmResult = hb_itemPutL( pOrderInfo->itmResult, ulPool > 0 ); + break; + } case DBOI_ORDERCOUNT: uiTag = 0; @@ -6373,7 +6641,9 @@ static SHORT hb_cdxSortKeyFindDup( LPCDXKEYINFO pKey1, LPCDXKEYINFO pKey2 ) int iLimit = (pKey1->length > pKey2->length) ? pKey2->length : pKey1->length; while ( usDup < iLimit && ( (BYTE) pKey1->Value[ usDup ] ) == ( (BYTE) pKey2->Value[ usDup ] ) ) + { usDup++; + } } return usDup; } @@ -6434,8 +6704,9 @@ static int hb_cdxSortKeyCompare( LPCDXKEYINFO pKey1, LPCDXKEYINFO pKey2 ) return 0; } -static int hb_cdxSortKeyValCompare( LPCDXTAG pTag, BYTE * pKeyVal1, BYTE keyLen1, - BYTE * pKeyVal2, BYTE keyLen2 ) +static int hb_cdxSortKeyValCompare( LPCDXTAG pTag, + BYTE * pKeyVal1, BYTE keyLen1, + BYTE * pKeyVal2, BYTE keyLen2 ) { CDXKEYINFO pKey1, pKey2; pKey1.Value = pKeyVal1; @@ -6452,104 +6723,6 @@ static int hb_cdxSortKeyValCompare( LPCDXTAG pTag, BYTE * pKeyVal1, BYTE keyLen1 } -static LPSORTINFO hb_cdxSortNew( LPCDXTAG pTag, BOOL bUnique ) -{ - BYTE * P; - LPSORTINFO pSort; - - pSort = ( LPSORTINFO ) hb_xgrab( sizeof( SORTINFO ) ); - memset( pSort, 0, sizeof( SORTINFO ) ); - pSort->SortChunk = SORT_CHUNK_LIMIT; - pSort->NodeLimit = pSort->SortChunk / sizeof( SORTDATA ); - pSort->NodeMask = pSort->NodeShift = pSort->NodeCur = 1; - pSort->ChunkLimit = 0x8000; - while( pSort->NodeMask < pSort->NodeLimit - 1 ) - { - pSort->NodeMask = ( pSort->NodeMask << 1 ) + 1; - pSort->ChunkLimit >>= 1; - pSort->NodeShift++; - } - pSort->ChunkSize = pSort->ChunkLimit; - pSort->ChunkList = ( long * ) hb_xgrab( pSort->ChunkSize * sizeof( LONG ) ); - memset( pSort->ChunkList, 0, pSort->ChunkSize * sizeof( LONG ) ); - P = ( BYTE * ) hb_xgrab( pSort->SortChunk * sizeof( BYTE ) ); - memset( P, 0, pSort->SortChunk * sizeof( BYTE ) ); - pSort->ChunkList[ 0 ] = ( LONG ) P; - hb_cdxSortLinkNew( pSort, &pSort->RootLink ); - pSort->Unique = bUnique; - pSort->Ascend = TRUE; - pSort->CurTag = pTag; - pSort->KeyTot = pTag->pIndex->pArea->ulRecCount; - pSort->KeyWork = hb_cdxSortKeyNew(); - pSort->LastKey = hb_cdxSortKeyNew(); - return pSort; -} - -static void hb_cdxSortFree( LPSORTINFO pSort ) -{ - USHORT usCount; - LONG pa; - - pSort->Closing = TRUE; - for( usCount = 0; usCount <= 30; usCount++ ) - { - if( pSort->NodeList[ usCount ] != NULL ) - { - pa = pSort->NodeList[ usCount ]->Rght_Ptr; - pSort->NodeList[ usCount ]->Rght_Ptr = -1; - if( pSort->NodeList[ usCount ]->Entry_Ct > 0 ) - { - if( pSort->NodeList[ usCount + 1 ] == NULL ) - { - pSort->CurTag->RootBlock = pa; - pSort->NodeList[ usCount ]->Node_Atr++; - } - hb_cdxIndexPageWrite( pSort->CurTag->pIndex, pa, (BYTE *) pSort->NodeList[ usCount ], - sizeof( CDXDATA ) ); - if( pSort->NodeList[ usCount + 1 ] != NULL ) - hb_cdxSortAddToNode( pSort, ( USHORT ) ( usCount + 1 ), pa, - pSort->LastTag, pSort->KeyWork ); - } - hb_xfree( ( LPCDXDATA ) pSort->NodeList[ usCount ] ); - } - } - - if( pSort->ChunkList != NULL ) - { - for( usCount = 0; usCount < pSort->ChunkLimit; usCount++ ) - { - if( pSort->ChunkList[ usCount ] != 0 ) - hb_xfree( ( BYTE * ) pSort->ChunkList[ usCount ] ); - } - hb_xfree( pSort->ChunkList ); - } - hb_cdxSortKeyFree( pSort->KeyWork ); - hb_cdxSortKeyFree( pSort->LastKey ); - - if ( pSort->hTempFile ) - { - // hb_fsCommit( pSort->hTempFile ); - hb_fsClose( pSort->hTempFile ); - pSort->hTempFile = FS_ERROR; - } - if ( pSort->szTempFileName ) - { - hb_fsDelete( (BYTE *) ( pSort->szTempFileName ) ); - hb_xfree( pSort->szTempFileName ); - pSort->szTempFileName = NULL; - } - - hb_xfree( pSort ); -} - -static void hb_cdxSortLinkNew( LPSORTINFO pSort, LONG * NewLink ) -{ - if( pSort->NodeCur >= pSort->NodeLimit ) - hb_cdxSortGetNewChunk( pSort ); - * NewLink = ( pSort->ChunkCur << pSort->NodeShift ) + pSort->NodeCur; - pSort->NodeCur++; -} - static void hb_cdxSortSwapSendWord( LPSORTINFO pSort, BYTE * Value ) { LONG Tag; @@ -6770,7 +6943,7 @@ static BOOL hb_cdxSortSwapGetNextKey( LPSORTINFO pSort, LONG * pKeyRec, BYTE * p pPage->nBytesLeft += pPage->nBufLeft; hb_fsSeek( pSort->hTempFile, pPage->nFileOffset + pPage->pageLen - pPage->nBytesLeft, SEEK_SET ); pPage->nBufLeft = (USHORT) ( ( pPage->nBytesLeft < sizeof(pPage->page) ) ? pPage->nBytesLeft : sizeof(pPage->page) ); - if ( hb_fsRead( pSort->hTempFile, (BYTE *) &(pPage->page), pPage->nBufLeft ) != pPage->nBufLeft ) + if ( hb_fsRead( pSort->hTempFile, (BYTE *) (pPage->page), pPage->nBufLeft ) != pPage->nBufLeft ) hb_errInternal( HB_EI_ERRUNRECOV, "hb_cdxTagDoIndex: Read error reading temporary index file", "hb_cdxTagDoIndex", NULL ); pPage->nBytesLeft -= pPage->nBufLeft; pPage->nCurPos = 0; @@ -6808,7 +6981,7 @@ static int hb_cdxSortSwapBuildIndex( LPSORTINFO pSort ) pPage = pSort->pSwapPage + nPage; pPage->nFileOffset = hb_fsSeek( pSort->hTempFile, 0, SEEK_CUR ); pPage->nBufLeft = 2 * sizeof(char) + sizeof(USHORT) + 2 * sizeof(ULONG); - if ( hb_fsRead( pSort->hTempFile, (BYTE *) &(pPage->page), pPage->nBufLeft ) != pPage->nBufLeft ) + if ( hb_fsRead( pSort->hTempFile, (BYTE *) (pPage->page), pPage->nBufLeft ) != pPage->nBufLeft ) hb_errInternal( HB_EI_ERRUNRECOV, "hb_cdxTagDoIndex: Read error reading temporary index file", "hb_cdxTagDoIndex", NULL ); ptr = pPage->page; memcpy( pPage->mark, ptr, 2 ); @@ -6827,7 +7000,7 @@ static int hb_cdxSortSwapBuildIndex( LPSORTINFO pSort ) pPage->keysLeft = pPage->keyCount; pPage->nBufLeft = (USHORT) ( ( pPage->nBytesLeft < sizeof(pPage->page) ) ? pPage->nBytesLeft : sizeof(pPage->page) ); - if ( hb_fsRead( pSort->hTempFile, (BYTE *) &(pPage->page), pPage->nBufLeft ) != pPage->nBufLeft ) + if ( hb_fsRead( pSort->hTempFile, (BYTE *) (pPage->page), pPage->nBufLeft ) != pPage->nBufLeft ) hb_errInternal( HB_EI_ERRUNRECOV, "hb_cdxTagDoIndex: Read error reading tempmrary index file", "hb_cdxTagDoIndex", NULL ); pPage->nBytesLeft -= pPage->nBufLeft; pPage->nCurPos = 0; @@ -6891,6 +7064,105 @@ static int hb_cdxSortSwapBuildIndex( LPSORTINFO pSort ) pSort->pSwapPage = NULL; return 0; } + +static LPSORTINFO hb_cdxSortNew( LPCDXTAG pTag, BOOL bUnique ) +{ + BYTE * P; + LPSORTINFO pSort; + + pSort = ( LPSORTINFO ) hb_xgrab( sizeof( SORTINFO ) ); + memset( pSort, 0, sizeof( SORTINFO ) ); + pSort->SortChunk = SORT_CHUNK_LIMIT; + pSort->NodeLimit = pSort->SortChunk / sizeof( SORTDATA ); + pSort->NodeMask = pSort->NodeShift = pSort->NodeCur = 1; + pSort->ChunkLimit = 0x8000; + while( pSort->NodeMask < pSort->NodeLimit - 1 ) + { + pSort->NodeMask = ( pSort->NodeMask << 1 ) + 1; + pSort->ChunkLimit >>= 1; + pSort->NodeShift++; + } + pSort->ChunkSize = pSort->ChunkLimit; + pSort->ChunkList = ( LONG * ) hb_xgrab( pSort->ChunkSize * sizeof( LONG ) ); + memset( pSort->ChunkList, 0, pSort->ChunkSize * sizeof( LONG ) ); + P = ( BYTE * ) hb_xgrab( pSort->SortChunk * sizeof( BYTE ) ); + memset( P, 0, pSort->SortChunk * sizeof( BYTE ) ); + pSort->ChunkList[ 0 ] = ( LONG ) P; + hb_cdxSortLinkNew( pSort, &pSort->RootLink ); + pSort->Unique = bUnique; + pSort->Ascend = TRUE; + pSort->CurTag = pTag; + pSort->KeyTot = pTag->pIndex->pArea->ulRecCount; + pSort->KeyWork = hb_cdxSortKeyNew(); + pSort->LastKey = hb_cdxSortKeyNew(); + return pSort; +} + +static void hb_cdxSortFree( LPSORTINFO pSort ) +{ + USHORT usCount; + LONG pa; + + pSort->Closing = TRUE; + for( usCount = 0; usCount <= 30; usCount++ ) + { + if( pSort->NodeList[ usCount ] != NULL ) + { + pa = pSort->NodeList[ usCount ]->Rght_Ptr; + pSort->NodeList[ usCount ]->Rght_Ptr = -1; + if( pSort->NodeList[ usCount ]->Entry_Ct > 0 ) + { + if( pSort->NodeList[ usCount + 1 ] == NULL ) + { + pSort->CurTag->RootBlock = pa; + pSort->NodeList[ usCount ]->Node_Atr++; + } + hb_cdxIndexPageWrite( pSort->CurTag->pIndex, pa, (BYTE *) pSort->NodeList[ usCount ], + sizeof( CDXDATA ) ); + if( pSort->NodeList[ usCount + 1 ] != NULL ) + hb_cdxSortAddToNode( pSort, ( USHORT ) ( usCount + 1 ), pa, + pSort->LastTag, pSort->KeyWork ); + } + hb_xfree( ( LPCDXDATA ) pSort->NodeList[ usCount ] ); + } + } + + if( pSort->ChunkList != NULL ) + { + for( usCount = 0; usCount < pSort->ChunkLimit; usCount++ ) + { + if( pSort->ChunkList[ usCount ] != 0 ) + hb_xfree( ( BYTE * ) pSort->ChunkList[ usCount ] ); + } + hb_xfree( pSort->ChunkList ); + } + hb_cdxSortKeyFree( pSort->KeyWork ); + hb_cdxSortKeyFree( pSort->LastKey ); + + if ( pSort->hTempFile ) + { + // hb_fsCommit( pSort->hTempFile ); + hb_fsClose( pSort->hTempFile ); + pSort->hTempFile = FS_ERROR; + } + if ( pSort->szTempFileName ) + { + hb_fsDelete( (BYTE *) ( pSort->szTempFileName ) ); + hb_xfree( pSort->szTempFileName ); + pSort->szTempFileName = NULL; + } + + hb_xfree( pSort ); +} + +static void hb_cdxSortLinkNew( LPSORTINFO pSort, LONG * NewLink ) +{ + if( pSort->NodeCur >= pSort->NodeLimit ) + hb_cdxSortGetNewChunk( pSort ); + * NewLink = ( pSort->ChunkCur << pSort->NodeShift ) + pSort->NodeCur; + pSort->NodeCur++; +} + static void hb_cdxSortGetNewChunk( LPSORTINFO pSort ) { BYTE * P; @@ -6938,22 +7210,8 @@ static void hb_cdxSortInsertWord( LPSORTINFO pSort, LONG Tag, char * Value, memcpy( pSort->WPch+1, Value, uiLen ); pSort->WPch[0] = (BYTE) uiLen; - if( pSort->WPch[0] > 0 ) - { - if( pSort->WPch[0] > pSort->KeySize ) - pSort->KeySize = pSort->WPch[0]; - /* pSort->WPch[0]--; lose last byte! */ - /* - Patch for empty fields (> 1) - */ -/* - while( pSort->WPch[0] > 1 && pSort->WPch[ pSort->WPch[0] ] == - ( pSort->CurTag->uiType == 'C' ? ' ' : 0 ) ) - { - pSort->WPch[0]--; - } -*/ - } + if( pSort->WPch[0] > pSort->KeySize ) + pSort->KeySize = pSort->WPch[0]; pSort->LevelPtr = pSort->RootLink; pSort->PriorPtr = 0; pSort->WCur = 0; @@ -7324,7 +7582,7 @@ static void hb_cdxSortAddExternal( LPSORTINFO pSort, USHORT Lvl, LONG Tag, LONG ct = ( USHORT ) ( pSort->CurTag->uiLen - Value->length ); cd = hb_cdxSortKeyFindDup( Value, pSort->LastKey ); -#ifndef HB_CDX_DBGCODE_OFF +#ifdef HB_CDX_DBGCODE_EXT #ifndef HB_CDP_SUPPORT_OFF if( hb_cdxSortKeyCompare( Value, pSort->LastKey, pSort->CurTag->pIndex->pArea->cdPage ) < 0 ) #else @@ -7467,15 +7725,20 @@ static void hb_cdxTagDoIndex( LPCDXTAG pTag ) pSaveFilter = pArea->dbfi.itmCobExpr; pArea->dbfi.itmCobExpr = NULL; - bDirectRead = TRUE; - if ( pArea->lpdbOrdCondInfo && !pArea->lpdbOrdCondInfo->fAll ) - bDirectRead = FALSE; - if ( pArea->lpdbRelations ) - bDirectRead = FALSE; + pSort = hb_cdxSortNew( pTag, pTag->UniqueKey ); + pItem = hb_itemNew( NULL ); + ulRecCount = pArea->ulRecCount; + pForItem = pTag->pForItem; + bForOk = TRUE; + pEvalItem = ( pArea->lpdbOrdCondInfo ? pArea->lpdbOrdCondInfo->itmCobEval : NULL); + pWhileItem = ( pArea->lpdbOrdCondInfo ? pArea->lpdbOrdCondInfo->itmCobWhile : NULL); bEnd = FALSE; + bDirectRead = !hb_set.HB_SET_STRICTREAD && !pArea->lpdbRelations && + ( !pArea->lpdbOrdCondInfo || pArea->lpdbOrdCondInfo->fAll ); if ( !bDirectRead ) { - if ( !pArea->lpdbOrdCondInfo || pArea->lpdbOrdCondInfo->fAll || pArea->lpdbOrdCondInfo->fUseCurrent ) { + if ( !pArea->lpdbOrdCondInfo || pArea->lpdbOrdCondInfo->fAll || pArea->lpdbOrdCondInfo->fUseCurrent ) + { SELF_GOTOP( ( AREAP ) pArea ); } else @@ -7491,24 +7754,14 @@ static void hb_cdxTagDoIndex( LPCDXTAG pTag ) } } } - pSort = hb_cdxSortNew( pTag, pTag->UniqueKey ); - pItem = hb_itemNew( NULL ); - ulRecCount = pArea->ulRecCount; - pForItem = pTag->pForItem; - bForOk = TRUE; - pEvalItem = ( pArea->lpdbOrdCondInfo ? pArea->lpdbOrdCondInfo->itmCobEval : NULL); - pWhileItem = ( pArea->lpdbOrdCondInfo ? pArea->lpdbOrdCondInfo->itmCobWhile : NULL); for ( ulRecNo = 1; ulRecNo <= ulRecCount; ulRecNo++ ) { if ( bDirectRead ) { hb_fsSeek( pArea->hDataFile, - pArea->uiHeaderLen + - ( ulRecNo - 1 ) * pArea->uiRecordLen, - FS_SET ); - hb_fsRead( pArea->hDataFile, - pArea->pRecord, - pArea->uiRecordLen ); + pArea->uiHeaderLen + ( ulRecNo - 1 ) * pArea->uiRecordLen, + FS_SET ); + hb_fsRead( pArea->hDataFile, pArea->pRecord, pArea->uiRecordLen ); pArea->ulRecNo = ulRecNo; pArea->fDeleted = ( pArea->pRecord[ 0 ] == '*' ); } @@ -7546,7 +7799,7 @@ static void hb_cdxTagDoIndex( LPCDXTAG pTag ) switch( hb_itemType( pItem ) ) { case HB_IT_STRING: - hb_cdxSortInsertWord( pSort, (long) pArea->ulRecNo, + hb_cdxSortInsertWord( pSort, ( LONG ) pArea->ulRecNo, pItem->item.asString.value, HB_CDXMAXKEY( pItem->item.asString.length ) ); break; @@ -7563,7 +7816,7 @@ static void hb_cdxTagDoIndex( LPCDXTAG pTag ) break; case HB_IT_DATE: - d = (double) hb_itemGetDL( pItem ); + d = (double) pItem->item.asDate.value; HB_DBL2ORD( &d, &cTemp[0] ); hb_cdxSortInsertWord( pSort, pArea->ulRecNo, (char *) cTemp, 8 ); break; @@ -7613,6 +7866,7 @@ static void hb_cdxTagDoIndex( LPCDXTAG pTag ) hb_cdxTagEmptyIndex( pTag ); hb_cdxSortFree( pSort ); hb_itemRelease( pItem ); + hb_set.HB_SET_DELETED = bSaveDeleted; pArea->dbfi.itmCobExpr = pSaveFilter; pTag->TagChanged = TRUE; diff --git a/harbour/source/rdd/dbfcdx/dbfcdx1.h b/harbour/source/rdd/dbfcdx/dbfcdx1.h index 175a2b4a8b..784810db37 100644 --- a/harbour/source/rdd/dbfcdx/dbfcdx1.h +++ b/harbour/source/rdd/dbfcdx/dbfcdx1.h @@ -77,6 +77,8 @@ #if (__BORLANDC__ > 1040) /* Use this only above Borland C++ 3.1 */ #pragma option -a1 /* byte alignment */ +#elif defined(_MSC_VER) + #pragma pack(push, 1) #elif defined(__GNUC__) #pragma pack(1) #elif defined(__WATCOMC__) @@ -135,7 +137,6 @@ typedef struct _SORTSWAPPAGE } SORTSWAPPAGE; typedef SORTSWAPPAGE * LPSORTSWAPPAGE; - typedef struct _SORTSWAPITEM { ULONG recno; @@ -146,6 +147,8 @@ typedef SORTSWAPITEM * LPSORTSWAPITEM; #if (__BORLANDC__ > 1040) /* Use this only above Borland C++ 3.1 */ #pragma option -a /* default alignment */ +#elif defined(_MSC_VER) + #pragma pack(pop) #elif defined(__GNUC__) #pragma pack() #elif defined(__WATCOMC__) diff --git a/harbour/source/rdd/dbffpt/dbffpt1.c b/harbour/source/rdd/dbffpt/dbffpt1.c index 7906d4fb11..c43dddaad2 100644 --- a/harbour/source/rdd/dbffpt/dbffpt1.c +++ b/harbour/source/rdd/dbffpt/dbffpt1.c @@ -272,11 +272,15 @@ HB_INIT_SYMBOLS_END( dbffpt1__InitSymbols ) */ static BOOL hb_fptFileLockEx( FPTAREAP pArea ) { - BOOL bRet; + BOOL fRet; - while ( ! ( bRet = hb_fsLock( pArea->hMemoFile, FPT_LOCKPOS, FPT_LOCKSIZE, - FL_LOCK | FLX_EXCLUSIVE | FLX_WAIT ) ) ); - return bRet; + do + { + fRet = hb_fsLock( pArea->hMemoFile, FPT_LOCKPOS, FPT_LOCKSIZE, + FL_LOCK | FLX_EXCLUSIVE | FLX_WAIT ); + } while ( !fRet ); + + return fRet; } /* @@ -284,11 +288,15 @@ static BOOL hb_fptFileLockEx( FPTAREAP pArea ) */ static BOOL hb_fptFileLockSh( FPTAREAP pArea ) { - BOOL bRet; + BOOL fRet; - while ( ! ( bRet = hb_fsLock( pArea->hMemoFile, FPT_LOCKPOS, FPT_LOCKSIZE, - FL_LOCK | FLX_SHARED | FLX_WAIT ) ) ); - return bRet; + do + { + fRet = hb_fsLock( pArea->hMemoFile, FPT_LOCKPOS, FPT_LOCKSIZE, + FL_LOCK | FLX_SHARED | FLX_WAIT ); + } while ( !fRet ); + + return fRet; } /* @@ -399,7 +407,7 @@ static void hb_fptPackGCitems( LPMEMOGCTABLE pGCtable ) free block list table */ for( i = 0; i < pGCtable->usItems; i++ ) { - if ( pGCtable->pGCitems[i].ulOffset != 0 && + if ( pGCtable->pGCitems[i].ulOffset != 0 && pGCtable->pGCitems[i].ulSize != 0 ) { ulEnd = pGCtable->pGCitems[i].ulOffset + pGCtable->pGCitems[i].ulSize; @@ -430,7 +438,7 @@ static void hb_fptPackGCitems( LPMEMOGCTABLE pGCtable ) /* remove empty items */ for( i = j = 0; i < pGCtable->usItems; i++ ) { - if ( pGCtable->pGCitems[i].ulOffset != 0 && + if ( pGCtable->pGCitems[i].ulOffset != 0 && pGCtable->pGCitems[i].ulSize != 0 ) { if ( i > j ) @@ -451,8 +459,11 @@ static ERRCODE hb_fptWriteGCitems( FPTAREAP pArea, LPMEMOGCTABLE pGCtable, USHOR { FPTBLOCK fptBlock; ERRCODE errCode = SUCCESS; - int i, iStart, iStop; + int i /* ,iStart, iStop */ ; + HB_SYMBOL_UNUSED( usItem ) ; + +/* if ( usItem == 0 ) { iStart = 0; @@ -463,14 +474,16 @@ static ERRCODE hb_fptWriteGCitems( FPTAREAP pArea, LPMEMOGCTABLE pGCtable, USHOR iStart = usItem; iStop = usItem + 1; } +*/ + for( i = 0; i < pGCtable->usItems; i++ ) { if ( pGCtable->pGCitems[i].fChanged ) { - HB_PUT_BE_ULONG( &fptBlock.type, FPTIT_FLEX_UNUSED ); - HB_PUT_BE_ULONG( &fptBlock.size, pArea->uiMemoBlockSize * + HB_PUT_BE_ULONG( fptBlock.type, FPTIT_FLEX_UNUSED ); + HB_PUT_BE_ULONG( fptBlock.size, pArea->uiMemoBlockSize * pGCtable->pGCitems[i].ulSize - sizeof( FPTBLOCK ) ); - hb_fsSeek( pArea->hMemoFile, pGCtable->pGCitems[i].ulOffset * + hb_fsSeek( pArea->hMemoFile, pGCtable->pGCitems[i].ulOffset * pArea->uiMemoBlockSize, FS_SET ); if ( hb_fsWrite( pArea->hMemoFile, ( BYTE * ) &fptBlock, sizeof( FPTBLOCK ) ) != sizeof( FPTBLOCK ) ) @@ -500,7 +513,7 @@ static ERRCODE hb_fptGCfreeBlock( FPTAREAP pArea, LPMEMOGCTABLE pGCtable, if( hb_fsRead( pArea->hMemoFile, ( BYTE * ) &fptBlock, sizeof( FPTBLOCK ) ) == sizeof( FPTBLOCK ) ) { - ulByteSize = HB_GET_BE_ULONG( &fptBlock.size ) + sizeof( FPTBLOCK ); + ulByteSize = HB_GET_BE_ULONG( fptBlock.size ) + sizeof( FPTBLOCK ); } } else @@ -514,7 +527,7 @@ static ERRCODE hb_fptGCfreeBlock( FPTAREAP pArea, LPMEMOGCTABLE pGCtable, { return EDBF_CORRUPT; } - + if ( ulOffset + ulSize == pGCtable->ulNextBlock ) { pGCtable->ulNextBlock -= ulSize; @@ -545,7 +558,7 @@ static ERRCODE hb_fptGCfreeBlock( FPTAREAP pArea, LPMEMOGCTABLE pGCtable, } if ( !fChanged ) { - if ( pGCtable->usItems < pGCtable->usMaxItem ) + if ( pGCtable->usItems <= pGCtable->usMaxItem ) { if ( pGCtable->pGCitems == NULL ) { @@ -558,7 +571,7 @@ static ERRCODE hb_fptGCfreeBlock( FPTAREAP pArea, LPMEMOGCTABLE pGCtable, } else if ( pGCtable->pGCitems[ 1 ].ulSize < ulSize ) { - if ( pGCtable->ulNextBlock == pGCtable->pGCitems[ 1 ].ulOffset + + if ( pGCtable->ulNextBlock == pGCtable->pGCitems[ 1 ].ulOffset + pGCtable->pGCitems[ 1 ].ulSize ) { pGCtable->ulNextBlock -= pGCtable->pGCitems[ 1 ].ulSize; @@ -667,14 +680,14 @@ static ERRCODE hb_fptReadGCdata( FPTAREAP pArea, LPMEMOGCTABLE pGCtable ) hb_fsSeek( pArea->hMemoFile, 0, FS_SET ); if ( hb_fsRead( pArea->hMemoFile, ( BYTE * ) &pGCtable->fptHeader, sizeof( FPTHEADER ) ) >= 512 ) { - pGCtable->ulNextBlock = HB_GET_BE_ULONG( &pGCtable->fptHeader.nextBlock ); + pGCtable->ulNextBlock = HB_GET_BE_ULONG( pGCtable->fptHeader.nextBlock ); - if ( pArea->bMemoType == MEMO_FPT_SIX || + if ( pArea->bMemoType == MEMO_FPT_SIX || pArea->bMemoType == MEMO_FPT_SIXHB ) { pGCtable->bType = MEMO_FPT_SIX; pGCtable->usMaxItem = MAX_SIXFREEBLOCKS; - pGCtable->usItems = HB_GET_LE_USHORT( &pGCtable->fptHeader.nGCitems ); + pGCtable->usItems = HB_GET_LE_USHORT( pGCtable->fptHeader.nGCitems ); if ( pGCtable->usItems > pGCtable->usMaxItem ) { return EDBF_CORRUPT; @@ -689,7 +702,7 @@ static ERRCODE hb_fptReadGCdata( FPTAREAP pArea, LPMEMOGCTABLE pGCtable ) pGCtable->pGCitems[i].fChanged = FALSE; } } - else if ( pArea->bMemoType == MEMO_FPT_FLEX || + else if ( pArea->bMemoType == MEMO_FPT_FLEX || pArea->bMemoType == MEMO_FPT_HB || pArea->bMemoType == MEMO_FPT_CLIP ) { @@ -698,22 +711,22 @@ static ERRCODE hb_fptReadGCdata( FPTAREAP pArea, LPMEMOGCTABLE pGCtable ) pGCtable->bType = MEMO_FPT_FLEX; pGCtable->usMaxItem = MAX_FLEXFREEBLOCKS; - pGCtable->ulRevPage = HB_GET_LE_ULONG( &pGCtable->fptHeader.flexRev ); - pGCtable->ulDirPage = HB_GET_LE_ULONG( &pGCtable->fptHeader.flexDir ); - pGCtable->ulCounter = HB_GET_LE_ULONG( &pGCtable->fptHeader.counter ); + pGCtable->ulRevPage = HB_GET_LE_ULONG( pGCtable->fptHeader.flexRev ); + pGCtable->ulDirPage = HB_GET_LE_ULONG( pGCtable->fptHeader.flexDir ); + pGCtable->ulCounter = HB_GET_LE_ULONG( pGCtable->fptHeader.counter ); if ( pGCtable->ulDirPage ) { hb_fsSeek( pArea->hMemoFile, pGCtable->ulDirPage, FS_SET ); if ( hb_fsRead( pArea->hMemoFile, ( BYTE * ) &fptBlock, sizeof( FPTBLOCK ) ) != sizeof( FPTBLOCK ) || - HB_GET_BE_ULONG( &fptBlock.type ) != FPTIT_FLEX_GC ) + HB_GET_BE_ULONG( fptBlock.type ) != FPTIT_FLEX_GC ) { return EDBF_CORRUPT; } - pGCtable->ulSize = HB_GET_BE_ULONG( &fptBlock.size ); + pGCtable->ulSize = HB_GET_BE_ULONG( fptBlock.size ); bPageBuf = ( BYTE * ) hb_xgrab( pGCtable->ulSize ); - if ( hb_fsRead( pArea->hMemoFile, bPageBuf, ( USHORT ) pGCtable->ulSize ) != - pGCtable->ulSize ) + if ( hb_fsRead( pArea->hMemoFile, bPageBuf, ( USHORT ) pGCtable->ulSize ) != + ( USHORT ) pGCtable->ulSize ) { hb_xfree( bPageBuf ); return EDBF_CORRUPT; @@ -721,7 +734,7 @@ static ERRCODE hb_fptReadGCdata( FPTAREAP pArea, LPMEMOGCTABLE pGCtable ) pGCtable->usMaxItem = (USHORT ) ( ( pGCtable->ulSize - 2 ) >> 3 ); pGCtable->usItems = ( HB_GET_LE_USHORT( bPageBuf ) - 3 ) >> 2; - pGCtable->pGCitems = ( LPMEMOGCITEM ) hb_xgrab( sizeof( MEMOGCITEM ) * + pGCtable->pGCitems = ( LPMEMOGCITEM ) hb_xgrab( sizeof( MEMOGCITEM ) * ( HB_MIN( pGCtable->usItems, pGCtable->usMaxItem ) + 1 ) ); for( i = 0; i < pGCtable->usItems; i++ ) @@ -759,7 +772,7 @@ static ERRCODE hb_fptWriteGCdata( FPTAREAP pArea, LPMEMOGCTABLE pGCtable ) { if ( pGCtable->bType == MEMO_FPT_SIX ) { - HB_PUT_LE_USHORT( &pGCtable->fptHeader.nGCitems, pGCtable->usItems ); + HB_PUT_LE_USHORT( pGCtable->fptHeader.nGCitems, pGCtable->usItems ); memset( pGCtable->fptHeader.reserved2, 0, sizeof( pGCtable->fptHeader.reserved2 ) ); j = ( pGCtable->usItems > pGCtable->usMaxItem ) ? pGCtable->usItems - pGCtable->usMaxItem : 0; @@ -814,8 +827,8 @@ static ERRCODE hb_fptWriteGCdata( FPTAREAP pArea, LPMEMOGCTABLE pGCtable ) FPTBLOCK fptBlock; BYTE *bPageBuf; - HB_PUT_BE_ULONG( &fptBlock.type, FPTIT_FLEX_GC ); - HB_PUT_BE_ULONG( &fptBlock.size, pGCtable->ulSize ); + HB_PUT_BE_ULONG( fptBlock.type, FPTIT_FLEX_GC ); + HB_PUT_BE_ULONG( fptBlock.size, pGCtable->ulSize ); bPageBuf = ( BYTE * ) hb_xgrab( pGCtable->ulSize ); memset( bPageBuf, 0xAD, pGCtable->ulSize ); HB_PUT_LE_USHORT( bPageBuf, ( (USHORT) pGCtable->usItems << 2 ) + 3 ); @@ -832,7 +845,7 @@ static ERRCODE hb_fptWriteGCdata( FPTAREAP pArea, LPMEMOGCTABLE pGCtable ) if ( hb_fsWrite( pArea->hMemoFile, ( BYTE * ) &fptBlock, sizeof( FPTBLOCK ) ) != sizeof( FPTBLOCK ) || hb_fsWrite( pArea->hMemoFile, bPageBuf, - ( USHORT ) pGCtable->ulSize ) != pGCtable->ulSize ) + ( USHORT ) pGCtable->ulSize ) != ( USHORT ) pGCtable->ulSize ) { errCode = EDBF_WRITE; } @@ -849,16 +862,16 @@ static ERRCODE hb_fptWriteGCdata( FPTAREAP pArea, LPMEMOGCTABLE pGCtable ) if ( hb_fsWrite( pArea->hMemoFile, ( BYTE * ) &fptBlock, sizeof( FPTBLOCK ) ) != sizeof( FPTBLOCK ) || hb_fsWrite( pArea->hMemoFile, bPageBuf, - ( USHORT )pGCtable->ulSize ) != pGCtable->ulSize ) + ( USHORT )pGCtable->ulSize ) != ( USHORT ) pGCtable->ulSize ) { errCode = EDBF_WRITE; } } hb_xfree( bPageBuf ); } - HB_PUT_LE_ULONG( &pGCtable->fptHeader.flexRev, pGCtable->ulRevPage ); - HB_PUT_LE_ULONG( &pGCtable->fptHeader.flexDir, pGCtable->ulDirPage ); - HB_PUT_LE_ULONG( &pGCtable->fptHeader.counter, pGCtable->ulCounter ); + HB_PUT_LE_ULONG( pGCtable->fptHeader.flexRev, pGCtable->ulRevPage ); + HB_PUT_LE_ULONG( pGCtable->fptHeader.flexDir, pGCtable->ulDirPage ); + HB_PUT_LE_ULONG( pGCtable->fptHeader.counter, pGCtable->ulCounter ); } if ( pGCtable->bChanged > 1 && errCode == SUCCESS ) @@ -867,9 +880,9 @@ static ERRCODE hb_fptWriteGCdata( FPTAREAP pArea, LPMEMOGCTABLE pGCtable ) } if ( errCode == SUCCESS ) { - HB_PUT_BE_ULONG( &pGCtable->fptHeader.nextBlock, pGCtable->ulNextBlock ); + HB_PUT_BE_ULONG( pGCtable->fptHeader.nextBlock, pGCtable->ulNextBlock ); hb_fsSeek( pArea->hMemoFile, 0, FS_SET ); - if ( hb_fsWrite( pArea->hMemoFile, ( BYTE * ) &pGCtable->fptHeader, ( USHORT )ulHdrSize ) != ulHdrSize ) + if ( hb_fsWrite( pArea->hMemoFile, ( BYTE * ) &pGCtable->fptHeader, ( USHORT )ulHdrSize ) != ( USHORT ) ulHdrSize ) { errCode = EDBF_WRITE; } @@ -906,7 +919,7 @@ static ULONG hb_fptGetMemoLen( FPTAREAP pArea, USHORT uiIndex ) sizeof( FPTBLOCK ) ) != sizeof( FPTBLOCK ) ) return 0; - return HB_GET_BE_ULONG( &fptBlock.size ); + return HB_GET_BE_ULONG( fptBlock.size ); } /* @@ -1047,6 +1060,7 @@ static ERRCODE hb_fptReadFlexItem( FPTAREAP pArea, BYTE ** pbMemoBuf, BYTE * bBu errCode = EDBF_CORRUPT; } break; + case FPTIT_FLEXAR_BYTE1: case FPTIT_FLEXAR_BYTE: if ( bBufEnd - (*pbMemoBuf) >= 2 ) { @@ -1058,6 +1072,17 @@ static ERRCODE hb_fptReadFlexItem( FPTAREAP pArea, BYTE ** pbMemoBuf, BYTE * bBu errCode = EDBF_CORRUPT; } break; + case FPTIT_FLEXAR_BYTE2: + if ( bBufEnd - (*pbMemoBuf) >= 3 ) + { + hb_itemPutNI( pItem, ( BYTE ) **pbMemoBuf ); + *pbMemoBuf += 3; + } + else + { + errCode = EDBF_CORRUPT; + } + break; case FPTIT_FLEXAR_SHORT: if ( bBufEnd - (*pbMemoBuf) >= 3 ) { @@ -1069,6 +1094,17 @@ static ERRCODE hb_fptReadFlexItem( FPTAREAP pArea, BYTE ** pbMemoBuf, BYTE * bBu errCode = EDBF_CORRUPT; } break; + case FPTIT_FLEXAR_SHORT2: + if ( bBufEnd - (*pbMemoBuf) >= 4 ) + { + hb_itemPutNI( pItem, (SHORT) HB_GET_LE_USHORT( *pbMemoBuf ) ); + *pbMemoBuf += 4; + } + else + { + errCode = EDBF_CORRUPT; + } + break; case FPTIT_FLEXAR_LONG: if ( bBufEnd - (*pbMemoBuf) >= 6 ) { @@ -1092,6 +1128,10 @@ static ERRCODE hb_fptReadFlexItem( FPTAREAP pArea, BYTE ** pbMemoBuf, BYTE * bBu errCode = EDBF_CORRUPT; } break; + case FPTIT_FLEXAR_NUL: + hb_itemPutCL( pItem, NULL, 0); + break; + case FPTIT_FLEXAR_STR: if ( bBufEnd - (*pbMemoBuf) >= 2 ) { @@ -1115,7 +1155,7 @@ static ERRCODE hb_fptReadFlexItem( FPTAREAP pArea, BYTE ** pbMemoBuf, BYTE * bBu errCode = EDBF_CORRUPT; } break; - + case FPTIT_FLEXAR_ARAY: if ( bBufEnd - (*pbMemoBuf) >= 2 ) { @@ -1179,10 +1219,10 @@ static ERRCODE hb_fptGetMemo( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) } else { - ulSize = HB_GET_BE_ULONG( &fptBlock.size ); + ulSize = HB_GET_BE_ULONG( fptBlock.size ); } - ulType = HB_GET_BE_ULONG( &fptBlock.type ); + ulType = HB_GET_BE_ULONG( fptBlock.type ); pBuffer = ( BYTE * ) hb_xgrab( HB_MAX( ulSize + 1, 8 ) ); memset( pBuffer, '\0', 8); if ( hb_fsReadLarge( pArea->hMemoFile, pBuffer, ulSize ) != ulSize ) @@ -1264,7 +1304,7 @@ static ERRCODE hb_fptGetMemo( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) */ static ULONG hb_fptCountSixItemLength( FPTAREAP pArea, PHB_ITEM pItem ) { - ULONG ulLen, i, ulSize = 0; + ULONG ulLen, i, ulSize; USHORT usType; usType = hb_itemType( pItem ); @@ -1492,7 +1532,7 @@ static void hb_fptStoreFlexItem( FPTAREAP pArea, PHB_ITEM pItem, BYTE ** bBufPtr *bBufPtr += 8; break; case HB_IT_LOGICAL: - *(*bBufPtr)++ = pItem->item.asLogical.value ? + *(*bBufPtr)++ = pItem->item.asLogical.value ? FPTIT_FLEXAR_TRUE : FPTIT_FLEXAR_FALSE; break; case HB_IT_NIL: @@ -1550,9 +1590,9 @@ static ERRCODE hb_fptWriteMemo( FPTAREAP pArea, ULONG ulBlock, BYTE *bBufPtr, hb_fptDestroyGCdata( &fptGCtable ); return errCode; } - - HB_PUT_BE_ULONG( &fptBlock.type, ulType ); - HB_PUT_BE_ULONG( &fptBlock.size, ulLen ); + + HB_PUT_BE_ULONG( fptBlock.type, ulType ); + HB_PUT_BE_ULONG( fptBlock.size, ulLen ); hb_fsSeek( pArea->hMemoFile, *ulStoredBlock * pArea->uiMemoBlockSize, FS_SET ); hb_fsWrite( pArea->hMemoFile, ( BYTE * ) &fptBlock, sizeof( FPTBLOCK ) ); @@ -1572,7 +1612,7 @@ static ERRCODE hb_fptWriteMemo( FPTAREAP pArea, ULONG ulBlock, BYTE *bBufPtr, { ULONG ulBlocks = ( ulLen + sizeof( FPTBLOCK ) + pArea->uiMemoBlockSize - 1 ) / pArea->uiMemoBlockSize; - hb_fsSeek( pArea->hMemoFile, ( *ulStoredBlock + ulBlocks ) * + hb_fsSeek( pArea->hMemoFile, ( *ulStoredBlock + ulBlocks ) * pArea->uiMemoBlockSize - 1, FS_SET ); hb_fsWrite( pArea->hMemoFile, ( BYTE * ) "\xAF", 1 ); } @@ -1597,7 +1637,8 @@ static ERRCODE hb_fptWriteMemo( FPTAREAP pArea, ULONG ulBlock, BYTE *bBufPtr, static ERRCODE hb_fptPutMemo( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) { ULONG ulLen, ulBlock, ulType; - BYTE itmBuffer[FLEX_ITEM_BUFSIZE], *bBufPtr = NULL, *bBufAlloc = NULL; + BYTE itmBuffer[FLEX_ITEM_BUFSIZE]; + BYTE *bBufPtr = NULL, *bBufAlloc = NULL; ERRCODE errCode; HB_TRACE(HB_TR_DEBUG, ("hb_fptPutMemo(%p, %hu, %p)", pArea, uiIndex, pItem)); @@ -1630,7 +1671,7 @@ static ERRCODE hb_fptPutMemo( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) bBufPtr = bBufAlloc; } } - else if ( pArea->bMemoType == MEMO_FPT_FLEX || + else if ( pArea->bMemoType == MEMO_FPT_FLEX || pArea->bMemoType == MEMO_FPT_HB ) { ulType = hb_itemType( pItem ); @@ -1814,7 +1855,7 @@ static ERRCODE hb_fptSysName( FPTAREAP pArea, BYTE * pBuffer ) static ERRCODE hb_fptGetValue( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) { BOOL bDeleted; - ERRCODE uiError = SUCCESS; + ERRCODE uiError; HB_TRACE(HB_TR_DEBUG, ("hb_fptGetValue(%p, %hu, %p)", pArea, uiIndex, pItem)); @@ -1843,7 +1884,7 @@ static ERRCODE hb_fptGetValue( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) hb_errPutSubCode( pError, uiError ); hb_errPutFlags( pError, EF_CANDEFAULT ); SELF_ERROR( ( AREAP ) pArea, pError ); - hb_errRelease( pError ); + hb_itemRelease( pError ); return FAILURE; } return SUCCESS; @@ -1859,7 +1900,7 @@ static ERRCODE hb_fptGetValue( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) static ERRCODE hb_fptPutValue( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) { BOOL bDeleted; - ERRCODE uiError = SUCCESS; + ERRCODE uiError; HB_TRACE(HB_TR_DEBUG, ("hb_fptPutValue(%p, %hu, %p)", pArea, uiIndex, pItem)); @@ -1900,7 +1941,7 @@ static ERRCODE hb_fptPutValue( FPTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) hb_errPutSubCode( pError, uiError ); hb_errPutFlags( pError, EF_CANDEFAULT ); SELF_ERROR( ( AREAP ) pArea, pError ); - hb_errRelease( pError ); + hb_itemRelease( pError ); return FAILURE; } return SUCCESS; @@ -1948,7 +1989,7 @@ static ERRCODE hb_fptCreateMemFile( FPTAREAP pArea, LPDBOPENINFO pCreateInfo ) bRetry = FALSE; } while( bRetry ); if( pError ) - hb_errRelease( pError ); + hb_itemRelease( pError ); if( pArea->hMemoFile == FS_ERROR ) return FAILURE; @@ -1957,16 +1998,16 @@ static ERRCODE hb_fptCreateMemFile( FPTAREAP pArea, LPDBOPENINFO pCreateInfo ) hb_fsSeek( pArea->hMemoFile, 0, FS_SET ); memset( &fptHeader, 0, sizeof( FPTHEADER ) ); - pArea->uiMemoBlockSize = ( hb_set.HB_SET_MBLOCKSIZE > 0 && - hb_set.HB_SET_MBLOCKSIZE < 0xFFFF ) ? + pArea->uiMemoBlockSize = ( hb_set.HB_SET_MBLOCKSIZE > 0 && + hb_set.HB_SET_MBLOCKSIZE < 0xFFFF ) ? hb_set.HB_SET_MBLOCKSIZE : FPT_DEFBLOCKSIZE; pArea->bMemoType = MEMO_FPT_HB; //pArea->bMemoType = MEMO_FPT_SIX; ulNextBlock = ( sizeof( FPTHEADER ) + pArea->uiMemoBlockSize - 1 ) / pArea->uiMemoBlockSize; - HB_PUT_BE_ULONG( &fptHeader.nextBlock, ulNextBlock ); - HB_PUT_BE_USHORT( &fptHeader.blockSize, pArea->uiMemoBlockSize ); - if ( pArea->bMemoType == MEMO_FPT_SIX || + HB_PUT_BE_ULONG( fptHeader.nextBlock, ulNextBlock ); + HB_PUT_BE_USHORT( fptHeader.blockSize, pArea->uiMemoBlockSize ); + if ( pArea->bMemoType == MEMO_FPT_SIX || pArea->bMemoType == MEMO_FPT_SIXHB ) { strcpy( ( char *) fptHeader.signature1, "SIxMemo" ); @@ -1978,7 +2019,7 @@ static ERRCODE hb_fptCreateMemFile( FPTAREAP pArea, LPDBOPENINFO pCreateInfo ) strcpy( ( char *) fptHeader.signature2, "FlexFile3\003" ); ulSize = sizeof( FPTHEADER ); } - if( hb_fsWrite( pArea->hMemoFile, ( BYTE * ) &fptHeader, ( USHORT) ulSize ) != ulSize ) + if( hb_fsWrite( pArea->hMemoFile, ( BYTE * ) &fptHeader, ( USHORT) ulSize ) != ( USHORT ) ulSize ) return FAILURE; memset( &fptHeader, 0, sizeof( FPTHEADER ) ); @@ -1986,7 +2027,7 @@ static ERRCODE hb_fptCreateMemFile( FPTAREAP pArea, LPDBOPENINFO pCreateInfo ) while ( ulLen > 0 ) { ulSize = HB_MIN( ulLen, sizeof( FPTHEADER ) ); - if( hb_fsWrite( pArea->hMemoFile, ( BYTE * ) &fptHeader, ( USHORT ) ulSize ) != ulSize ) + if( hb_fsWrite( pArea->hMemoFile, ( BYTE * ) &fptHeader, ( USHORT ) ulSize ) != ( USHORT ) ulSize ) return FAILURE; ulLen -= ulSize; } @@ -2037,7 +2078,7 @@ static ERRCODE hb_fptOpenMemFile( FPTAREAP pArea, LPDBOPENINFO pOpenInfo ) } while( bRetry ); if( pError ) - hb_errRelease( pError ); + hb_itemRelease( pError ); if( pArea->hMemoFile == FS_ERROR ) return FAILURE; @@ -2047,12 +2088,16 @@ static ERRCODE hb_fptOpenMemFile( FPTAREAP pArea, LPDBOPENINFO pOpenInfo ) hb_fsSeek( pArea->hMemoFile, 0, FS_SET ); if ( hb_fsRead( pArea->hMemoFile, ( BYTE * ) &fptHeader, sizeof( FPTHEADER ) ) >= 512 ) { - pArea->uiMemoBlockSize = HB_GET_BE_USHORT( &fptHeader.blockSize ); - + pArea->uiMemoBlockSize = HB_GET_BE_USHORT( fptHeader.blockSize ); + pArea->bMemoType = 0; /* Check for compatibility with Harbour memo headers */ if ( memcmp( fptHeader.signature1, "Harbour", 7 ) == 0 ) { - pArea->bMemoType = MEMO_FPT_HB; + /* hack for detecting old harbour FPT files without FLEX support */ + if ( HB_GET_BE_ULONG( fptHeader.signature2 ) == FPTIT_TEXT ) + pArea->bMemoType = MEMO_FPT_SIXHB; + else + pArea->bMemoType = MEMO_FPT_HB; } /* Check for compatibility with SIX memo headers */ else if ( memcmp( fptHeader.signature1, "SIxMemo", 7 ) == 0 ) @@ -2065,12 +2110,12 @@ static ERRCODE hb_fptOpenMemFile( FPTAREAP pArea, LPDBOPENINFO pOpenInfo ) pArea->bMemoType = MEMO_FPT_CLIP; } /* Check for compatibility with Clipper 5.3/FlexFile3 malformed memo headers */ - if ( pArea->bMemoType != MEMO_FPT_SIX && + if ( pArea->bMemoType != MEMO_FPT_SIX && memcmp( fptHeader.signature2, "FlexFile3\003", 10) == 0 ) { pArea->bMemoType = MEMO_FPT_FLEX; - if ( pArea->uiMemoBlockSize == 0) - pArea->uiMemoBlockSize = HB_GET_LE_USHORT( &fptHeader.flexSize ); + if ( pArea->uiMemoBlockSize == 0 ) + pArea->uiMemoBlockSize = HB_GET_LE_USHORT( fptHeader.flexSize ); } } @@ -2082,7 +2127,7 @@ static ERRCODE hb_fptOpenMemFile( FPTAREAP pArea, LPDBOPENINFO pOpenInfo ) hb_errPutDescription( pError, hb_langDGetErrorDesc( EG_CORRUPTION ) ); hb_errPutFileName( pError, (char *) pOpenInfo->abName ); SELF_ERROR( ( AREAP ) pArea, pError ); - hb_errRelease( pError ); + hb_itemRelease( pError ); return FAILURE; } @@ -2097,7 +2142,7 @@ static ERRCODE hb_fptOpenMemFile( FPTAREAP pArea, LPDBOPENINFO pOpenInfo ) */ static ERRCODE hb_fptReadDBHeader( FPTAREAP pArea ) { - HB_TRACE(HB_TR_DEBUG, ("hb_fptReadHeader(%p)", pArea)); + HB_TRACE(HB_TR_DEBUG, ("hb_fptReadDBHeader(%p)", pArea)); if( SUPER_READDBHEADER( ( AREAP ) pArea ) == FAILURE ) return FAILURE; diff --git a/harbour/source/rdd/dbfntx/dbfntx1.c b/harbour/source/rdd/dbfntx/dbfntx1.c index ec5c05a46e..283d944715 100644 --- a/harbour/source/rdd/dbfntx/dbfntx1.c +++ b/harbour/source/rdd/dbfntx/dbfntx1.c @@ -267,20 +267,20 @@ static void commonError( NTXAREAP pArea, USHORT uiGenCode, USHORT uiSubCode, cha static void hb_IncString( NTXAREAP pArea, char* s, int slen ) { char *ptr; - unsigned int nsymb; + UINT nsymb; for( ptr=s+slen-1;ptr>=s;ptr-- ) { - nsymb = (unsigned int) *ptr; + nsymb = (UINT) *ptr; if( nsymb < 255 ) { - unsigned int n1, i; - if( pArea->cdPage->lSort && ( n1 = (unsigned int)pArea->cdPage->s_chars[ nsymb ] ) != 0 ) + UINT n1, i; + if( pArea->cdPage->lSort && ( n1 = (UINT)pArea->cdPage->s_chars[ nsymb ] ) != 0 ) { n1 ++; for( i=0; i<255; i++ ) { - if( n1 == (unsigned int)pArea->cdPage->s_chars[ i ] ) + if( n1 == (UINT)pArea->cdPage->s_chars[ i ] ) { *ptr = (char) i; break; @@ -2437,7 +2437,7 @@ static ERRCODE hb_ntxIndexCreate( LPNTXINDEX pIndex ) USHORT uiCurLen; char szBuffer[ HB_MAX_DOUBLE_LENGTH + 1 ]; char * pszTempName = NULL; - NTXAREAP pArea; + NTXAREAP pArea = pIndex->Owner; LPTAGINFO pTag; HB_MACRO_PTR pMacro; PHB_ITEM pItem; @@ -2449,8 +2449,7 @@ static ERRCODE hb_ntxIndexCreate( LPNTXINDEX pIndex ) BOOL fValidBuffer; PHB_CODEPAGE cdpTmp = s_cdpage; - ulRecCount = pIndex->Owner->ulRecCount; - pArea = pIndex->Owner; + ulRecCount = pArea->ulRecCount; pTag = pIndex->CompoundTag; pItem = hb_itemNew( NULL ); s_cdpage = pArea->cdPage; diff --git a/harbour/source/rtl/Makefile b/harbour/source/rtl/Makefile index 4f54af4418..ebbf2d863b 100644 --- a/harbour/source/rtl/Makefile +++ b/harbour/source/rtl/Makefile @@ -44,6 +44,7 @@ C_SOURCES=\ gtapiu.c \ gx.c \ hardcr.c \ + hbrandom.c \ idle.c \ inkey.c \ is.c \ diff --git a/harbour/source/rtl/filesys.c b/harbour/source/rtl/filesys.c index 09a10ffebe..165c3bb9be 100644 --- a/harbour/source/rtl/filesys.c +++ b/harbour/source/rtl/filesys.c @@ -2005,3 +2005,48 @@ static HANDLE DostoWinHandle( FHANDLE fHandle) } #endif + +BYTE HB_EXPORT * hb_fileNameConv(char *str) { + // Convert file and dir case. The allowed SET options are: + // LOWER - Convert all caracters of file to lower + // UPPER - Convert all caracters of file to upper + // MIXED - Leave as is + + // The allowed environment options are: + // FILECASE - define the case of file + // DIRCASE - define the case of path + // DIRSEPARATOR - define separator of path (Ex. "/") + + size_t a; + char *filename; + char *dirname=str; + size_t dirlen; + char * szFileTrim =str; + ULONG ulPos; + + // Look for filename (Last "\" or DIRSEPARATOR) + if( hb_set.HB_SET_DIRSEPARATOR != '\\' ) { + for(a=0;a + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ + +#include +#include +#include + +#ifndef HB_OS_WIN_32 +#include +#endif + +/* Globally available data, no need to MT it */ +volatile static int s_bInit = 0; + +/* +* HB_RANDOM +* +* HB_RANDOM() --> returns a real value n so that 0 <= n < 1 +* HB_RANDOM( x ) --> returns a real number n so that 0 <= n < x +* HB_RANDOM( x, y) --> Returns a real number n so that x <= n < y +*/ +HB_FUNC( HB_RANDOM ) +{ + double dRnd; + double dX, dY; + + dRnd = hb_random_num(); + + if( ! ISNUM( 1 ) ) + { + hb_retnd( dRnd ); + } + else if( ! ISNUM(2) ) + { + hb_retnd( dRnd * hb_parnd(1) ); + } + else + { + dX = hb_parnd( 2 ); + dY = hb_parnd( 1 ); + + if ( dX > dY ) + { + double dZ = dY; + dY = dX; + dX = dZ; + } + + hb_retnd( dRnd * (dY - dX ) + dX ); + } +} + +HB_FUNC( HB_RANDOMSEED ) +{ + if( ! ISNUM( 1 ) ) + { + srand( (unsigned)time( NULL ) ); + } + else + { + srand( hb_parni(1) ); + } + + s_bInit = 1; +} + +/* Returns a double value between 0 and 1 */ +double hb_random_num() +{ + double d1, d2; + + if( s_bInit == 0 ) + { + srand( (unsigned)time( NULL ) ); + s_bInit = 1; + } + + d1 = (double) rand(); + d2 = (double) RAND_MAX; + #ifdef HB_OS_WIN_32 + /* It seems that on win32 platform there some weirdness about EPSILON value so + that a float division using an epsilon smaller than 1e-10 may be rounded. + Must dig if it's a borland lib bug or a windows problem. + */ + d2 += 0.001; + #else + d2 += DBL_EPSILON; + #endif + + return d1 / d2; +} + diff --git a/harbour/source/rtl/set.c b/harbour/source/rtl/set.c index 7955e6be05..44ef80b773 100644 --- a/harbour/source/rtl/set.c +++ b/harbour/source/rtl/set.c @@ -869,6 +869,20 @@ HB_FUNC( SET ) hb_retc( hb_dirsep_string ); if( args > 1 ) hb_set.HB_SET_DIRSEPARATOR = set_char( pArg2, hb_set.HB_SET_DIRSEPARATOR ); break; + case HB_SET_DBFLOCKSCHEME: + hb_retni( hb_set.HB_SET_DBFLOCKSCHEME ); + if( args > 1 ) + { + if( set_number( pArg2, hb_set.HB_SET_DBFLOCKSCHEME ) < 0 ) + { + hb_errRT_BASE( EG_ARG, 2020, NULL, "SET", 2, hb_paramError( 1 ), hb_paramError( 2 ) ); + } + else + { + hb_set.HB_SET_DBFLOCKSCHEME = set_number( pArg2, hb_set.HB_SET_DBFLOCKSCHEME ); + } + } + break; default : /* Return NIL if called with invalid SET specifier */ break; @@ -959,6 +973,7 @@ void hb_setInitialize( void ) hb_set.HB_SET_DIRSEPARATOR = '\\'; hb_set.HB_SET_VIDEOMODE = 0; hb_set.HB_SET_WRAP = FALSE; + hb_set.HB_SET_DBFLOCKSCHEME = 0; sp_sl_first = sp_sl_last = NULL; s_next_listener = 1;