* harbour/contrib/hbmxml/hbmxml.c
! redesigned to use mxml_node reference counters - it should fix
all problems with memory leak and accessing freed memory which
where in our wrapper.
! fixed few typos and possible GPF I've found
! modified mxmlDelete() wrapper to respect reference counter
It means that it cannot call mxmlDelete() MXML function directly.
- removed mxmlRelease() and mxmlRetain() PRG wrappers
* harbour/contrib/hbmxml/3rd/minixml/mxml_fil.c
! fixed double mxml_node releasing
* harbour/contrib/hbmxml/3rd/minixml/mxml_nod.c
! fixed mxmlDelete() to respect reference counters
; TODO: There are still two problems but inside MXML library.
1. memory leak in testmxml rem_err.xml
The leak is inside MXML function and have to be fixed by author
(I do not want to change this code too deeply). Here is valgrind
report:
(88 direct, 1 indirect) bytes in 1 blocks are definitely lost
at 0x4C234E7: calloc ()
by 0x40ABF9: mxml_new (mxml_nod.c:758)
by 0x40AE39: mxmlNewText (mxml_nod.c:547)
by 0x407421: mxml_load_data (mxml_fil.c:1585)
by 0x404E50: HB_FUN_MXMLLOADFILE (hbmxml.c:794)
by 0x50A9FF6: hb_vmProc (hvm.c:5795)
by 0x5086104: hb_vmExecute (hvm.c:1655)
by 0x50A9FF6: hb_vmProc (hvm.c:5795)
by 0x50ADC12: main (mainstd.c:96)
2. Index functions in MXML library does not update reference counters.
It means that it's possible to create index then remove nodes and
access such nodes extracting their addresses from the index.
It's the only one place I know when user can make sth wrong with
memory using just modified HBMXML wrapper and it cannot be fixed
without modifications in MXML library.
Please test it.
* harbour/contrib/hbnetio/netiomt.prg
+ added 8-th parameter <sSrvFunc> to NETIO_MTSERVER().
It allows to set own server function which can be used for
statistic or connection INIT/EXIT code. By default it's
@netio_server() is used.
User functions may look like:
function custom_netio_server( pConnectionSocket )
register_connection( pConnectionSocket )
begin sequence
netio_server( pConnectionSocket )
finally
unregister_connection( pConnectionSocket )
end sequence
return nil
* harbour/contrib/hbnetio/netiosrv.c
+ added new server function
NETIO_SRVSOCKET( <pConnectionSocket> ) -> <pHbSocket>
<pHbSocket> can be used with Harbour socket functions (hb_socket*())
Please remember that <pHbSocket> handle can be used only for statistics
and must not be used for any send/receive operations.
* harbour/contrib/hbnetio/readme.txt
* updated
* harbour/contrib/hbwin/tests/olesrv1.prg
* modified to return HVM error object as OLE object to the client
on RTE
* harbour/include/hbexprb.c
! allow to use variable in parenthesis as lvalue when -kc switch
is used - Clipper compatibility
* harbour/contrib/hbfoxpro/misc.prg
+ __FOX_ARRAY( <dims,...> ) which returns array initialized
with .F. values - it can be used to initialize arrays declared
using FP syntax
* harbour/contrib/hbfoxpro/hbfoxpro.ch
+ added some new PP rules for FP array declarations
+ added DISPLAY FIELDS ... command
* harbour/contrib/hbmxml/hbmxml.c
! fixed hb_strdup() wrongly used instead of strdup()
Thanks to Petr for the information.
* modified MXMLSAVESTRING() to follow recent Viktor modifications in
MXMLSAVEALLOCSTRING() and not strip trailing EOL
* contrib/hbmxml/hbmxml.c
% In MXMLSAVEALLOCSTRING() strdup()-ed buffer passed directly
to hb_retclen_buffer() replaced with plain hb_retclen() call.
hb_retclen_buffer() is to be used only if there is already
an allocated buffer to pass as is.
! MXMLSAVEALLOCSTRING() modified to not remove EOLs from
buffers received from minixml lib. Reason two-fold: 1. hbmxml
libs job is to be as transparent as possible, so it should not
tamper with the contents 2. Do not make any assumptions about
the size of EOL, which was 1, but now it can be 2 on certain
platforms.
; Please review and test. There is no test code for this
call, so I only did build tests.
* contrib/hbfoxpro/hbfoxpro.hbp
+ contrib/hbfoxpro/misc.prg
+ Added very humble attempt to emulate SYS(). I'm no FoxPro user
and don't have any facility to make tests against real FoxPro.
Please fix and extend as you deem necessary.
* bin/hb3rdpat.hbs
+ Changed tool detection to only require what's really to be
used in a certain session.
+ Added detection to more tools.
; Thanks Tamas for the patch session.
! allow to assign to variable in parenthesis in compiler when -kc switch
is used (Clipper compatibility), i.e.:
(var) := 1
Please remember that Clipper does not accept such syntax in
macrocompiler and Harbour replicates this behavior when -kc
compile time switch is used.
* contrib/hbmxml/tests/testmxml.prg
! Reverted 2011-01-17 00:05 UTC+0200 Petr Chornyj.
It's wrong solution, it makes the output non-portable.
; TOFIX: Change LF to CRLF in libmxml for a proper fix.
* contrib/hbmxml/hbmxml.c
! Fixed warning reported by bcc55 in mxmlNewCustom()
* contrib/hbmxml/tests/testmxml.prg
* Changed whitespace_cb() to respect official mxml test result
f.e. hb_eol() -> e"\n"
* harbour/contrib/hbmxml/hbmxml.c
% optimized user callback calls
* declare all helper functions as static - all public functions
except HB_FUNC() ones should be declared in .h files
If it's not necessary the please do not declare functions as public.
It's much easier to update the code when developers know that it's
use only locally and not accessed from some other or user code.
* contrib/hbmxml/hbmxml.c
+ Added experimental hb_mxmlGetAttrsCount(), hb_mxmlGetAttrs(),
hb_mxmlGetAttrsArray()
; WARNING: can be changed or even removed after final 2.7 miniXML release
* bin/hb3rdpat.hbs
+ Added error message when URL is missing.
; TOFIX: I could not test it because of this error:
'E: Can not find xz'
I indeed don't have it, but this tool is not needed
for this diffing session, so IMO it should be left
out when checking for prerequisites.
Tamas, can you take a look?
* harbour/contrib/hbmxml/hbmxml.c
! fixed using released strings
! added missing callback item clearing
! release previous callback items in MXMLSETERRORCALLBACK() and
MXMLSETCUSTOMHANDLERS() - it fixes memory leak in repeated calls
and allows to free all items used by codeblock callbacks before
application/thread exit.
; small note about TSD functions:
hb_stackGetTSD() always returns non NULL pointer, on first call
it allocates and initialize new structure. It's not necessary to
check if return value is not NULL.
hb_stackTestTSD() return NULL if TSD structure is not allocated
yet by current thread, otherwise it returns this structure.
Newly allocated TSD structures are cleared so it's not necessary
to clear their members inside init functions. In such case init
functions can be ignored (set to NULL in HB_TSD_NEW().
I know that on some platforms NULL can be represented as non
0 value anyhow current Harbour code is not ready to work with
such platforms and needs a lot of modifications to adopt it
to such condition. I do not expect that anyone will try to
make such port in the future.
; QUESTION: why custom_save_cb() uses hb_parc() instead of
hb_parstr_utf8()?
; QUESTION2: what TODO in MXMLDELETE() means?
* harbour/include/hbapi.h
* harbour/include/hbwmain.c
* harbour/src/vm/cmdarg.c
* moved declaration of hb_winmainArgInit() to header file
* harbour/contrib/hbmxml/3rd/minixml/mxml_fil.c
* harbour/contrib/hbmxml/3rd/minixml/mxml.h
! fixed to compile with WinCE builds
; I cannot regenerate .diff file because
../../../../bin/hb3rdpat.hbs -rediff
generates RT error:
Error BASE/1123 Argument error: HB_ATOKENS
Called from HB_ATOKENS(0)
Called from URL_GETFILENAME(810)
Called from FETCHANDEXTRACT(673)
Called from MAIN(412)
Sorry, probably I'm missing sth what was already discussed
but I was not able to follow all post on the list in last
weeks so I would like to ask Viktor or Tamas for the help.
* include/hbwmain.c
* src/vm/cmdarg.c
! Fixed missing declaration for hb_winmainArgInit()
! Fixed missing HB_EXTERN_* from around hb_winmainArgInit() declaration.
; Patches from Andi. Thank you.
* Added HB_EXPORT to the declaration in hbwmain.c.
* harbour/include/hbcomp.h
* do not inherit in macrocompiler -z compile time switch when -kc is
also used
* harbour/src/common/expropt2.c
* disable logical expression optimization (reduction) in macrocompiler
when -kc compile time switch is used.
* harbour/config/beos/gcc.mk
* harbour/config/qnx/gcc.mk
* harbour/config/bsd/gcc.mk
* harbour/config/wce/mingwarm.mk
* harbour/config/vxworks/gcc.mk
* harbour/config/hpux/gcc.mk
* harbour/config/darwin/gcc.mk
* harbour/config/dos/djgpp.mk
* harbour/config/win/mingw.mk
* harbour/config/linux/gcc.mk
* harbour/config/cygwin/gcc.mk
* harbour/config/symbian/gcc.mk
* harbour/config/os2/gcc.mk
* harbour/config/sunos/gcc.mk
* harbour/utils/hbmk2/hbmk2.prg
* enable some important warnings in GCC builds using -W<name>... instead
of -Wall and -Wno-<name>... for warning level set to low.
It should help in backward compatibility with some older GCC versions.
* harbour/config/beos/gcc.mk
* harbour/config/qnx/gcc.mk
* harbour/config/bsd/gcc.mk
* harbour/config/wce/mingwarm.mk
* harbour/config/vxworks/gcc.mk
* harbour/config/hpux/gcc.mk
* harbour/config/darwin/gcc.mk
* harbour/config/dos/djgpp.mk
* harbour/config/win/mingw.mk
* harbour/config/linux/gcc.mk
* harbour/config/cygwin/gcc.mk
* harbour/config/symbian/gcc.mk
* harbour/config/os2/gcc.mk
* harbour/config/sunos/gcc.mk
* use -Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized
-Wno-switch -Wno-strict-overflow -Wno-main
instead of -W when warnings are not enabled with GCC based compilers.
Using only -W only is rather useless because this switch enables
warnings which can be usually ignored in 3-rd party code.
This modification should help in locating bugs introduced by us
to 3-rd party code, i.e. due to wrong header files used on some
platforms (we do not use autoconf assuming some default settings
what can be wrong in some cases). It should also not hide some
important/critical bugs in 3-rd party code.
This modification pacifies some common warnings which can be
ignored usually but it also enables some more important ones.
If it's necessary then we can tune it a little bit more and disable
some other warnings too.
It's possible that on some platforms using very old GCC versions
some of -W* switches are not supported - please make tests and
inform us about problems.
* harbour/utils/hbmk2/hbmk2.prg
* use -Wall -Wno-unused -Wno-pointer-sign -Wno-uninitialized
-Wno-switch -Wno-strict-overflow -Wno-main
instead of -W when warning level is set to low with GCC based
compilers
* contrib/hbexpat/tests/test.prg
* contrib/hbexpat/tests/tohash.prg
* Tweaked to find example xml file out of the box.
* contrib/hbexpat/hbexpat.c
* contrib/hbcurl/hbcurl.c
* contrib/hbssl/ssl.c
* contrib/hbssl/pem.c
% Using hb_vmPush*() functions instead of less efficient
hb_evalBlock*().
Calls requiring UTF8 conversion were not optimized.
* contrib/hbzebra/coredraw.c
! Fixed to use HB_DEFAULT_DECIMALS instead of hard coded 2.
* contrib/hbmxml/hbmxml.c
! Fixed to use hb_itemPutC() instead of hb_itemPutCConst().
(use the latter for 'static const' strings only)
* harbour/src/rtl/stuff.c
* minor modification which should pacify warnings in some compilers
* harbour/src/rtl/gtgui/gtgui.c
* removed unnecessary assignment to pacify BCC warning
* harbour/contrib/hbxdiff/hbxdiff.c
! fixed file handle to pointer casting - on some platforms/C compilers
old code could cause compile time warnings or even errors
* contrib/hbmxml/hbmxml.c
+ Enabled function pointer support with new PHB_ITEM based
callback system.
! MXMLSETERRORCALLBACK() fixed to reset error handler to NULL
if wrong (or no) parameter is passed.
! Replaced hb_vmProc() with hb_vmSend().
! Fixed some missed locations still using dynsyms directly.
* contrib/hbmxml/tests/custom.prg
* contrib/hbmxml/tests/testmxml.prg
* contrib/hbmxml/tests/reminder.prg
* Switched back to use function pointers.
* contrib/hbsqlit3/hbsqlit3.c
* contrib/hbxdiff/hbxdiff.c
* Renamed variables to reflect recent changes.
* contrib/hbsqlit3/hbsqlit3.c
+ Enabled function pointers. It's even easier I thought since
the block calling method also supports function pointers
automatically.
* contrib/hbxdiff/hbxdiff.c
% Deleted separate (original) function symbol support, and
enabled it on the codeblock branch. Now it supports both
without redundant code.
* contrib/hbxdiff/tests/test3.prg
+ Added back function pointer example.
* contrib/hbmxml/hbmxml.c
+ First round to switch to supporting codeblocks and storing
callback information in PHB_ITEM instead of PHB_DYNS. For some
reason I couldn't figure, reminder.prg fails after this modification.
Please verify.
+ Added TOFIX to severe buffer handling problem in all MXMLSAVE*()
functions. Buffer is returned from save_cb() callback after
it's freed.
* contrib/hbmxml/tests/custom.prg
* contrib/hbmxml/tests/testmxml.prg
* contrib/hbmxml/tests/reminder.prg
* Changed to use codeblock callbacks.
(later some examples might be readded for function pointers,
it's simple s&r)
* Some formatting. Deleted line spaces @ EOL.
; NOTE: f.e. testmxml.prg fails instantly. It failed the same
way before this commit.
* contrib/hbmxml/tests/reminder.prg
* contrib/hbmxml/tests/test.prg
! Fixed warnings and errors preventing these
tests from building.
* contrib/hbexpat/hbexpat.c
* contrib/hbcurl/hbcurl.c
* contrib/hbssl/ssl.c
* contrib/hbssl/pem.c
+ Added support also for function pointers where codeblocks
were accepted. Please test it.
NOTE: It was easy change because PHB_ITEM was already
used to store the callback value and official Eval API
was used to call the callbacks.
* contrib/hbssl/tests/pem.prg
+ Added example for function pointer callback.
* contrib/hbssl/pem.c
% Minor optimization.
* contrib/hbsqlit3/hbsqlit3.c
+ Switched to use codeblocks for callbacks (instead of function
pointers).
; I'd like to kindly ask those who understand the topic to review
GC unlock/mark mechanism. I also didn't make any tests, because
they are missing from tests dir.
* contrib/hbxdiff/hbxdiff.c
! Another typo in prev.
* contrib/hbxdiff/hbxdiff.c
+ Added support for codeblocks as callbacks.
; I'm not sure if we should keep symbol callbacks, looks
like inferior alternative and codeblocks are the preferred
choice in 98% (well all except this, and recently added
hbsqlit3 extension and hbmxml) of Harbour wrappers addons.
* contrib/hbxdiff/tests/test.prg
* contrib/hbxdiff/tests/test2.prg
* contrib/hbxdiff/tests/test3.prg
* Changed to use codeblock in callback example.
* Formatting.