From 1abdfef7ec3a510fe83bda5f12184bc86ed0d453 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 29 May 2009 10:19:15 +0000 Subject: [PATCH] 2009-05-29 12:18 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * utils/hbmk2/hbmk2.prg + Added -echo= command line parameter. Similar to echo= in .hbc files. ! Fixed filename expansion behaviour on empty strings. * Tweaked a little the filter parser to recognize keywords using similar rules to Harbour compiler. ! Fixed filter parser not to RTE on malformed filters. - examples/hbapollo/Makefile + examples/hbapollo/hbapollo.hbm - examples/hboleold/Makefile + examples/hboleold/hboleold.hbm - examples/hbsqlit2/Makefile + examples/hbsqlit2/hbsqlit2.hbm - examples/hbgf/hbgfwin/Makefile + examples/hbgf/hbgfwin/hbgfwin.hbm - examples/hbgf/hbgfos2/Makefile + examples/hbgf/hbgfos2/hbgfos2.hbm - examples/hbgf/hbgfgtk/Makefile + examples/hbgf/hbgfgtk/hbgfgtk.hbm - examples/hbwhat/Makefile + examples/hbwhat/hbwhat.hbm * Replaced GNU Make files with hbmk2 make files. These should now work outside the source tree. Please test them, they are also good examples for .hbm files. - examples/pe/Makefile - examples/pp/Makefile - examples/hbdoc/Makefile - examples/guestbk/Makefile - examples/misc/Makefile - examples/dbu/Makefile - examples/hscript/Makefile - examples/rl/Makefile - examples/Makefile - examples/hbgf/Makefile - Deleted unnecessary make files belonging to GNU Make system. (these wouldn't work outside the source tree, f.e in a binary distro which includes these examples in source form) - examples/rdddbt - Deleted this example as it doesn't build anymore. * examples/hbsuper/hbsuper.hbm ! Added SVN header. * source/rtl/Makefile * source/rtl/errint.c + source/rtl/errintlo.c * Split hb_errInternal() and hb_errInternalRaw() for easier user override. --- harbour/ChangeLog | 52 ++ harbour/examples/Makefile | 17 - harbour/examples/dbu/Makefile | 36 - harbour/examples/guestbk/Makefile | 30 - harbour/examples/hbapollo/Makefile | 42 -- harbour/examples/hbapollo/hbapollo.hbm | 12 + harbour/examples/hbdoc/Makefile | 39 - harbour/examples/hbgf/Makefile | 23 - harbour/examples/hbgf/hbgfgtk/Makefile | 45 -- harbour/examples/hbgf/hbgfgtk/hbgfgtk.hbm | 28 + harbour/examples/hbgf/hbgfos2/Makefile | 26 - harbour/examples/hbgf/hbgfos2/hbgfos2.hbm | 20 + harbour/examples/hbgf/hbgfwin/Makefile | 26 - harbour/examples/hbgf/hbgfwin/hbgfwin.hbm | 20 + harbour/examples/hboleold/Makefile | 28 - harbour/examples/hboleold/hboleold.hbm | 14 + harbour/examples/hbsqlit2/Makefile | 26 - harbour/examples/hbsqlit2/hbsqlit2.hbm | 14 + harbour/examples/hbsuper/hbsuper.hbm | 6 +- harbour/examples/hbwhat/Makefile | 100 --- harbour/examples/hbwhat/hbwhat.hbm | 70 ++ harbour/examples/hscript/Makefile | 28 - harbour/examples/misc/Makefile | 52 -- harbour/examples/pe/Makefile | 31 - harbour/examples/pp/Makefile | 18 - harbour/examples/rdddbt/Makefile | 12 - harbour/examples/rdddbt/dbfdbt1.c | 858 ---------------------- harbour/examples/rdddbt/hbrdddbt.h | 193 ----- harbour/examples/rl/Makefile | 30 - harbour/source/rtl/Makefile | 1 + harbour/source/rtl/errint.c | 84 --- harbour/source/rtl/errintlo.c | 141 ++++ harbour/utils/hbmk2/hbmk2.prg | 41 +- 33 files changed, 406 insertions(+), 1757 deletions(-) delete mode 100644 harbour/examples/Makefile delete mode 100644 harbour/examples/dbu/Makefile delete mode 100644 harbour/examples/guestbk/Makefile delete mode 100644 harbour/examples/hbapollo/Makefile create mode 100644 harbour/examples/hbapollo/hbapollo.hbm delete mode 100644 harbour/examples/hbdoc/Makefile delete mode 100644 harbour/examples/hbgf/Makefile delete mode 100644 harbour/examples/hbgf/hbgfgtk/Makefile create mode 100644 harbour/examples/hbgf/hbgfgtk/hbgfgtk.hbm delete mode 100644 harbour/examples/hbgf/hbgfos2/Makefile create mode 100644 harbour/examples/hbgf/hbgfos2/hbgfos2.hbm delete mode 100644 harbour/examples/hbgf/hbgfwin/Makefile create mode 100644 harbour/examples/hbgf/hbgfwin/hbgfwin.hbm delete mode 100644 harbour/examples/hboleold/Makefile create mode 100644 harbour/examples/hboleold/hboleold.hbm delete mode 100644 harbour/examples/hbsqlit2/Makefile create mode 100644 harbour/examples/hbsqlit2/hbsqlit2.hbm delete mode 100644 harbour/examples/hbwhat/Makefile create mode 100644 harbour/examples/hbwhat/hbwhat.hbm delete mode 100644 harbour/examples/hscript/Makefile delete mode 100644 harbour/examples/misc/Makefile delete mode 100644 harbour/examples/pe/Makefile delete mode 100644 harbour/examples/pp/Makefile delete mode 100644 harbour/examples/rdddbt/Makefile delete mode 100644 harbour/examples/rdddbt/dbfdbt1.c delete mode 100644 harbour/examples/rdddbt/hbrdddbt.h delete mode 100644 harbour/examples/rl/Makefile create mode 100644 harbour/source/rtl/errintlo.c diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 9f86ae51f4..906d0e346b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,58 @@ past entries belonging to these authors: Viktor Szakats. */ +2009-05-29 12:18 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * utils/hbmk2/hbmk2.prg + + Added -echo= command line parameter. Similar to echo= in .hbc files. + ! Fixed filename expansion behaviour on empty strings. + * Tweaked a little the filter parser to recognize keywords using + similar rules to Harbour compiler. + ! Fixed filter parser not to RTE on malformed filters. + + - examples/hbapollo/Makefile + + examples/hbapollo/hbapollo.hbm + - examples/hboleold/Makefile + + examples/hboleold/hboleold.hbm + - examples/hbsqlit2/Makefile + + examples/hbsqlit2/hbsqlit2.hbm + - examples/hbgf/hbgfwin/Makefile + + examples/hbgf/hbgfwin/hbgfwin.hbm + - examples/hbgf/hbgfos2/Makefile + + examples/hbgf/hbgfos2/hbgfos2.hbm + - examples/hbgf/hbgfgtk/Makefile + + examples/hbgf/hbgfgtk/hbgfgtk.hbm + - examples/hbwhat/Makefile + + examples/hbwhat/hbwhat.hbm + * Replaced GNU Make files with hbmk2 make files. These should + now work outside the source tree. Please test them, they are + also good examples for .hbm files. + + - examples/pe/Makefile + - examples/pp/Makefile + - examples/hbdoc/Makefile + - examples/guestbk/Makefile + - examples/misc/Makefile + - examples/dbu/Makefile + - examples/hscript/Makefile + - examples/rl/Makefile + - examples/Makefile + - examples/hbgf/Makefile + - Deleted unnecessary make files belonging to GNU Make system. + (these wouldn't work outside the source tree, f.e in a binary + distro which includes these examples in source form) + + - examples/rdddbt + - Deleted this example as it doesn't build anymore. + + * examples/hbsuper/hbsuper.hbm + ! Added SVN header. + + * source/rtl/Makefile + * source/rtl/errint.c + + source/rtl/errintlo.c + * Split hb_errInternal() and hb_errInternalRaw() for + easier user override. + 2009-05-29 11:04 UTC+0200 Viktor Szakats (harbour.01 syenar hu) - contrib/examples + examples diff --git a/harbour/examples/Makefile b/harbour/examples/Makefile deleted file mode 100644 index dc5b9131f5..0000000000 --- a/harbour/examples/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# -# $Id$ -# - -ROOT = ../ - -DIRS=\ - guestbk \ - hbgf \ - hbsqlit2 \ - hscript \ - misc \ - pe \ - pp \ - rdddbt \ - -include $(ROOT)config/dir.cf diff --git a/harbour/examples/dbu/Makefile b/harbour/examples/dbu/Makefile deleted file mode 100644 index 8abe533e0d..0000000000 --- a/harbour/examples/dbu/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -# -# $Id$ -# - -ROOT = ../../ - -PRG_SOURCES=\ - DBU.PRG \ - DBUCOPY.PRG \ - DBUEDIT.PRG \ - DBUHELP.PRG \ - DBUINDX.PRG \ - DBUNET.PRG \ - DBUSTRU.PRG \ - DBUUTIL.PRG \ - DBUVIEW.PRG \ - -PRG_MAIN=DBU.PRG - -LIBS=\ - hbdebug \ - hbvm \ - hbrtl \ - hblang \ - hbrdd \ - hbrtl \ - hbvm \ - hbmacro \ - hbpp \ - rddntx \ - rddcdx \ - rddfpt \ - hbsix \ - hbcommon \ - -include $(TOP)$(ROOT)config/bin.cf diff --git a/harbour/examples/guestbk/Makefile b/harbour/examples/guestbk/Makefile deleted file mode 100644 index 96998638ed..0000000000 --- a/harbour/examples/guestbk/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# -# $Id$ -# - -ROOT = ../../ - -PRG_SOURCES=\ - guestbk.prg \ - inifiles.prg \ - testcgi.prg \ - -PRG_MAIN=guestbk.prg - -LIBS=\ - hbdebug \ - hbvm \ - hbrtl \ - hblang \ - hbrdd \ - hbrtl \ - hbvm \ - hbmacro \ - hbpp \ - rddntx \ - rddcdx \ - rddfpt \ - hbsix \ - hbcommon \ - -include $(TOP)$(ROOT)config/bin.cf diff --git a/harbour/examples/hbapollo/Makefile b/harbour/examples/hbapollo/Makefile deleted file mode 100644 index 55090288a1..0000000000 --- a/harbour/examples/hbapollo/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -# -# $Id$ -# - -ROOT = ../../ - -LIBNAME=hbapollo - -ifneq ($(HB_ARCHITECTURE),dos) -ifneq ($(HB_COMPILER),mingw64) - -HB_INC_APOLLO_OK += $(foreach d, $(HB_INC_APOLLO), $(if $(wildcard $(d)/Sde61.h),$(d),)) - -ifneq ($(strip $(HB_INC_APOLLO_OK)),) - -HB_USER_CFLAGS += $(foreach d, $(HB_INC_APOLLO_OK), -I$(d)) - -C_SOURCES=\ - apollo.c \ - -PRG_SOURCES=\ - apollo1.prg \ - -PRG_HEADERS=\ - apollo.ch \ - -include $(TOP)$(ROOT)config/header.cf -INSTALL_RULE_HEADERS := $(INSTALL_RULE) -include $(TOP)$(ROOT)config/lib.cf - -install:: - $(INSTALL_RULE_HEADERS) - -else -include $(TOP)$(ROOT)config/none.cf -endif -else -include $(TOP)$(ROOT)config/none.cf -endif -else -include $(TOP)$(ROOT)config/none.cf -endif diff --git a/harbour/examples/hbapollo/hbapollo.hbm b/harbour/examples/hbapollo/hbapollo.hbm new file mode 100644 index 0000000000..790cb0d453 --- /dev/null +++ b/harbour/examples/hbapollo/hbapollo.hbm @@ -0,0 +1,12 @@ +# +# $Id$ +# + +-hblib +-ohbapollo +-inc +-q0 -w3 -es2 -l +-i${HB_INC_APOLLO} + +apollo.c +apollo1.prg diff --git a/harbour/examples/hbdoc/Makefile b/harbour/examples/hbdoc/Makefile deleted file mode 100644 index 78ea2e670e..0000000000 --- a/harbour/examples/hbdoc/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -# -# $Id$ -# - -ifeq ($(HB_MAIN),) -HB_MAIN = std -endif - -ROOT = ../../ - -PRG_SOURCES=\ - hbdoc.prg \ - genos2.prg \ - gentrf.prg \ - genng.prg \ - genhtm.prg \ - genchm.prg \ - genrtf.prg \ - genhpc.prg \ - genasc.prg \ - genpdf1.prg \ - ft_funcs.prg \ - -C_SOURCES=\ - hbdfrdln.c \ - -PRG_MAIN=hbdoc.prg - -LIBS=\ - hbdebug \ - hbvm \ - hbrtl \ - hbnulrdd \ - hbrtl \ - hbvm \ - hbmacro \ - hbcommon \ - -include $(TOP)$(ROOT)config/bin.cf diff --git a/harbour/examples/hbgf/Makefile b/harbour/examples/hbgf/Makefile deleted file mode 100644 index 45fe1687f0..0000000000 --- a/harbour/examples/hbgf/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -# -# $Id$ -# - -ROOT = ../../ - -ifeq ($(HB_ARCHITECTURE),win) -DIRS = hbgfwin -endif - -ifeq ($(HB_ARCHITECTURE),linux) -DIRS = hbgfgtk -endif - -ifeq ($(HB_ARCHITECTURE),os2) -DIRS = hbgfos2 -endif - -ifneq ($(DIRS),) -include $(ROOT)config/dir.cf -else -include $(TOP)$(ROOT)config/none.cf -endif diff --git a/harbour/examples/hbgf/hbgfgtk/Makefile b/harbour/examples/hbgf/hbgfgtk/Makefile deleted file mode 100644 index 9f2a95850c..0000000000 --- a/harbour/examples/hbgf/hbgfgtk/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -# -# $Id$ -# - -ROOT = ../../../ - -LIBNAME=hbgfgtk - -ifeq ($(HB_ARCHITECTURE),linux) - -ifeq ($(HB_INC_GTK),) -ifeq ($(HB_XBUILD),) -HB_INC_GTK = /usr/include /usr/include/glib-2.0/ -endif -endif -HB_INC_GTK_OK += $(foreach d, $(HB_INC_GTK), $(if $(wildcard $(d)/glib.h),$(d),)) - -endif - -ifneq ($(strip $(HB_INC_GTK_OK)),) - -HB_USER_CFLAGS += $(foreach d, $(HB_INC_GTK_OK), -I$(d)) -HB_USER_CFLAGS += `pkg-config --cflags gtk+-2.0` - -C_SOURCES=\ - creawin.c \ - general.c \ - creamenu.c \ - creabutt.c \ - dispatch.c \ - msginfo.c \ - mainlgtk.c \ - -PRG_SOURCES=\ - form.prg \ - menu.prg \ - button.prg \ - menuitem.prg \ - winctrl.prg \ - -include $(TOP)$(ROOT)config/lib.cf - -else -include $(TOP)$(ROOT)config/none.cf -endif diff --git a/harbour/examples/hbgf/hbgfgtk/hbgfgtk.hbm b/harbour/examples/hbgf/hbgfgtk/hbgfgtk.hbm new file mode 100644 index 0000000000..bd2e2a6748 --- /dev/null +++ b/harbour/examples/hbgf/hbgfgtk/hbgfgtk.hbm @@ -0,0 +1,28 @@ +# +# $Id$ +# + +-hblib +-ohbgfgtk +-inc +-q0 -w3 -es2 -l +-i${HB_INC_GTK} + +-inctrypath={linux}/usr/include +-inctrypath={linux}/usr/include/glib-2.0 + +-cflag=`pkg-config --cflags gtk+-2.0` + +creawin.c +general.c +creamenu.c +creabutt.c +dispatch.c +msginfo.c +mainlgtk.c + +form.prg +menu.prg +button.prg +menuitem.prg +winctrl.prg diff --git a/harbour/examples/hbgf/hbgfos2/Makefile b/harbour/examples/hbgf/hbgfos2/Makefile deleted file mode 100644 index dbcd7c61fe..0000000000 --- a/harbour/examples/hbgf/hbgfos2/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -# -# $Id$ -# - -ROOT = ../../../ - -LIBNAME=hbgfos2 - -ifeq ($(HB_ARCHITECTURE),os2) - -C_SOURCES=\ - os2pm.c \ - -PRG_SOURCES=\ - tform.prg \ - tmenu.prg \ - tmenuit.prg \ - winctrl.prg \ - button.prg \ - edit.prg \ - -include $(TOP)$(ROOT)config/lib.cf - -else -include $(TOP)$(ROOT)config/none.cf -endif diff --git a/harbour/examples/hbgf/hbgfos2/hbgfos2.hbm b/harbour/examples/hbgf/hbgfos2/hbgfos2.hbm new file mode 100644 index 0000000000..079ce57a2f --- /dev/null +++ b/harbour/examples/hbgf/hbgfos2/hbgfos2.hbm @@ -0,0 +1,20 @@ +# +# $Id$ +# + +-hblib +-ohbgfos2 +-inc +-q0 -w3 -es2 -l + +"-echo={!os2}This library builds on os2 only." +-stop{!os2} + +os2pm.c + +tform.prg +tmenu.prg +tmenuit.prg +winctrl.prg +button.prg +edit.prg diff --git a/harbour/examples/hbgf/hbgfwin/Makefile b/harbour/examples/hbgf/hbgfwin/Makefile deleted file mode 100644 index 523eed1264..0000000000 --- a/harbour/examples/hbgf/hbgfwin/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -# -# $Id$ -# - -ROOT = ../../../ - -LIBNAME=hbgfwin - -ifeq ($(HB_ARCHITECTURE),win) - -C_SOURCES=\ - winapi.c \ - -PRG_SOURCES=\ - button.prg \ - edit.prg \ - form.prg \ - menu.prg \ - menuitem.prg \ - winctrl.prg \ - -include $(TOP)$(ROOT)config/lib.cf - -else -include $(TOP)$(ROOT)config/none.cf -endif diff --git a/harbour/examples/hbgf/hbgfwin/hbgfwin.hbm b/harbour/examples/hbgf/hbgfwin/hbgfwin.hbm new file mode 100644 index 0000000000..d744c8239d --- /dev/null +++ b/harbour/examples/hbgf/hbgfwin/hbgfwin.hbm @@ -0,0 +1,20 @@ +# +# $Id$ +# + +-hblib +-ohbgfwin +-inc +-q0 -w3 -es2 -l + +"-echo={!winall}This library builds on win/wce only." +-stop{!winall} + +winapi.c + +button.prg +edit.prg +form.prg +menu.prg +menuitem.prg +winctrl.prg diff --git a/harbour/examples/hboleold/Makefile b/harbour/examples/hboleold/Makefile deleted file mode 100644 index d37bd79a9a..0000000000 --- a/harbour/examples/hboleold/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -# -# $Id$ -# - -ROOT = ../../ - -LIBNAME=hboleold - -ifeq ($(HB_WITH_HBWIN),) -ifeq ($(HB_ARCHITECTURE),win) -HB_WITH_HBWIN=yes -endif -ifeq ($(HB_ARCHITECTURE),wce) -HB_WITH_HBWIN=yes -endif -endif - -ifeq ($(HB_WITH_HBWIN),yes) - -C_SOURCES = \ - win_ole.c \ - -PRG_SOURCES = \ - win_tole.prg \ - -else -include $(TOP)$(ROOT)config/none.cf -endif diff --git a/harbour/examples/hboleold/hboleold.hbm b/harbour/examples/hboleold/hboleold.hbm new file mode 100644 index 0000000000..7162ec3efd --- /dev/null +++ b/harbour/examples/hboleold/hboleold.hbm @@ -0,0 +1,14 @@ +# +# $Id$ +# + +-hblib +-ohboleold +-inc +-q0 -w3 -es2 -l + +"-echo={!winall}This library builds on win/wce only." +-stop{!winall} + +win_ole.c +win_tole.prg diff --git a/harbour/examples/hbsqlit2/Makefile b/harbour/examples/hbsqlit2/Makefile deleted file mode 100644 index fd62de37c9..0000000000 --- a/harbour/examples/hbsqlit2/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -# -# $Id$ -# - -ROOT = ../../ - -LIBNAME=hbsqlit2 - -ifneq ($(HB_ARCHITECTURE),dos) - -C_SOURCES =\ - hbsqlit2.c \ - -PRG_HEADERS=\ - hbsqlit2.ch - -include $(TOP)$(ROOT)config/header.cf -INSTALL_RULE_HEADERS := $(INSTALL_RULE) -include $(TOP)$(ROOT)config/lib.cf - -install:: - $(INSTALL_RULE_HEADERS) - -else -include $(TOP)$(ROOT)config/none.cf -endif diff --git a/harbour/examples/hbsqlit2/hbsqlit2.hbm b/harbour/examples/hbsqlit2/hbsqlit2.hbm new file mode 100644 index 0000000000..d80faf1f81 --- /dev/null +++ b/harbour/examples/hbsqlit2/hbsqlit2.hbm @@ -0,0 +1,14 @@ +# +# $Id$ +# + +-hblib +-ohbsqlit2 +-inc +-q0 -w3 -es2 -l +-i${HB_INC_SQLITE2} + +"-echo={dos}This library doesn't build on DOS." +-stop{dos} + +hbsqlit2.c diff --git a/harbour/examples/hbsuper/hbsuper.hbm b/harbour/examples/hbsuper/hbsuper.hbm index eeefaaa932..bae08633d7 100644 --- a/harbour/examples/hbsuper/hbsuper.hbm +++ b/harbour/examples/hbsuper/hbsuper.hbm @@ -1,7 +1,11 @@ +# +# $Id$ +# + -hblib -ohbsuper -inc --q0 -w1 -es2 -gc0 -l +-q0 -w1 -es2 -l hbsuper.prg diff --git a/harbour/examples/hbwhat/Makefile b/harbour/examples/hbwhat/Makefile deleted file mode 100644 index 0131fddc49..0000000000 --- a/harbour/examples/hbwhat/Makefile +++ /dev/null @@ -1,100 +0,0 @@ -# -# $Id$ -# - -ROOT = ../../ - -LIBNAME=hbwhat - -ifeq ($(HB_ARCHITECTURE),win) -ifneq ($(HB_COMPILER),dmc) - -C_SOURCES = \ - wincorec.c \ - whtbmp.c \ - whtbrsh.c \ - whtcdlg.c \ - whtclpb.c \ - whtcomm.c \ - whtcret.c \ - whtdate.c \ - whtdc.c \ - whtdir.c \ - whtdlg.c \ - whtdraw.c \ - whtfont.c \ - whtgdi.c \ - whthead.c \ - whticon.c \ - whtilst.c \ - whtinet.c \ - whtini.c \ - whtkbrd.c \ - whtlv.c \ - whtmain.c \ - whtmapi.c \ - whtmem.c \ - whtmenu.c \ - whtmeta.c \ - whtmisc.c \ - whtmmcap.c \ - whtmous.c \ - whtmsg.c \ - whtpen.c \ - whtprn.c \ - whtrect.c \ - whtreg.c \ - whtrgn.c \ - whtscrlb.c \ - whtseria.c \ - whtshell.c \ - whtsock.c \ - whtsys.c \ - whttab.c \ - whttbar.c \ - whttext.c \ - whttree.c \ - whtview.c \ - whtwnd.c \ - -PRG_SOURCES= \ - whatutil.prg \ - wincdlg.prg \ - wincomm.prg \ - wincore.prg \ - windebug.prg \ - winerror.prg \ - winini.prg \ - winrbar.prg \ - wintabs.prg \ - wintbar.prg \ - -PRG_HEADERS= \ - commctrl.ch \ - commdlg.ch \ - debug.ch \ - hbwhat.ch \ - import.ch \ - sqltypes.ch \ - wingdi.ch \ - wininet.ch \ - winstruc.ch \ - winuser.ch \ - -# This lib needs xhb headers to compile, and this is -# the hack to help Harbour find them. -HB_USER_PRGFLAGS += -I../../../../xhb - -include $(TOP)$(ROOT)config/header.cf -INSTALL_RULE_HEADERS := $(INSTALL_RULE) -include $(TOP)$(ROOT)config/lib.cf - -install:: - $(INSTALL_RULE_HEADERS) - -else -include $(TOP)$(ROOT)config/none.cf -endif -else -include $(TOP)$(ROOT)config/none.cf -endif diff --git a/harbour/examples/hbwhat/hbwhat.hbm b/harbour/examples/hbwhat/hbwhat.hbm new file mode 100644 index 0000000000..554112bf2a --- /dev/null +++ b/harbour/examples/hbwhat/hbwhat.hbm @@ -0,0 +1,70 @@ +# +# $Id$ +# + +-hblib +-ohbwhat +-inc +-q0 -w3 -es2 -l +-i../../contrib/xhb + +"-echo={!win}This library builds on win only." +-stop{!win} + +wincorec.c +whtbmp.c +whtbrsh.c +whtcdlg.c +whtclpb.c +whtcomm.c +whtcret.c +whtdate.c +whtdc.c +whtdir.c +whtdlg.c +whtdraw.c +whtfont.c +whtgdi.c +whthead.c +whticon.c +whtilst.c +whtinet.c +whtini.c +whtkbrd.c +whtlv.c +whtmain.c +whtmapi.c +whtmem.c +whtmenu.c +whtmeta.c +whtmisc.c +whtmmcap.c +whtmous.c +whtmsg.c +whtpen.c +whtprn.c +whtrect.c +whtreg.c +whtrgn.c +whtscrlb.c +whtseria.c +whtshell.c +whtsock.c +whtsys.c +whttab.c +whttbar.c +whttext.c +whttree.c +whtview.c +whtwnd.c + +whatutil.prg +wincdlg.prg +wincomm.prg +wincore.prg +windebug.prg +winerror.prg +winini.prg +winrbar.prg +wintabs.prg +wintbar.prg diff --git a/harbour/examples/hscript/Makefile b/harbour/examples/hscript/Makefile deleted file mode 100644 index 98b19efd90..0000000000 --- a/harbour/examples/hscript/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -# -# $Id$ -# - -ROOT = ../../ - -PRG_SOURCES=\ - hscript.prg \ - -PRG_MAIN=hscript.prg - -LIBS=\ - hbdebug \ - hbvm \ - hbrtl \ - hblang \ - hbrdd \ - hbrtl \ - hbvm \ - hbmacro \ - hbpp \ - rddntx \ - rddcdx \ - rddfpt \ - hbsix \ - hbcommon \ - -include $(TOP)$(ROOT)config/bin.cf diff --git a/harbour/examples/misc/Makefile b/harbour/examples/misc/Makefile deleted file mode 100644 index 4311952ba3..0000000000 --- a/harbour/examples/misc/Makefile +++ /dev/null @@ -1,52 +0,0 @@ -# -# $Id$ -# - -ROOT = ../../ - -LIBS=\ - hbdebug \ - hbvm \ - hbrtl \ - hblang \ - hbrdd \ - hbrtl \ - hbvm \ - hbmacro \ - hbpp \ - rddntx \ - rddcdx \ - rddfpt \ - hbsix \ - hbcommon \ - -ifeq ($(PM),) - PM := $(pm) -endif -ifeq ($(PM),) # PM not defined = build all files -PRG_SOURCES=\ - guess.prg \ - mankala.prg \ - -PRG_HEADERS=\ - -C_SOURCES=\ - -C_HEADERS=\ - -include $(TOP)$(ROOT)config/test.cf - -else #PM defined = build specified file - -ifneq ($(findstring .prg,$(PM)),) - PRG_MAIN := $(PM) -else - ifneq ($(findstring .PRG,$(PM)),) - PRG_MAIN := $(PM) - else - PRG_MAIN := $(PM).prg - endif -endif -include $(TOP)$(ROOT)config/bin.cf - -endif diff --git a/harbour/examples/pe/Makefile b/harbour/examples/pe/Makefile deleted file mode 100644 index 4f803a54f2..0000000000 --- a/harbour/examples/pe/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -# -# $Id$ -# - -ROOT = ../../ - -PRG_SOURCES=\ - editorhi.prg \ - -C_SOURCES=\ - editorlo.c \ - -PRG_MAIN=pe.prg - -LIBS=\ - hbdebug \ - hbvm \ - hbrtl \ - hblang \ - hbrdd \ - hbrtl \ - hbvm \ - hbmacro \ - hbpp \ - rddntx \ - rddcdx \ - rddfpt \ - hbsix \ - hbcommon \ - -include $(TOP)$(ROOT)config/bin.cf diff --git a/harbour/examples/pp/Makefile b/harbour/examples/pp/Makefile deleted file mode 100644 index 82dfc9bcd5..0000000000 --- a/harbour/examples/pp/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -# -# $Id$ -# - -ROOT = ../../ - -C_SOURCES=\ - hbppcore.c \ - hbppcomp.c \ - hbpptbl.c \ - hbpragma.c \ - -C_MAIN=pp.c - -LIBS=\ - hbcommon \ - -include $(TOP)$(ROOT)config/bin.cf diff --git a/harbour/examples/rdddbt/Makefile b/harbour/examples/rdddbt/Makefile deleted file mode 100644 index 68d5309176..0000000000 --- a/harbour/examples/rdddbt/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# - -ROOT = ../../ - -C_SOURCES=\ - dbfdbt1.c \ - -LIBNAME=rdddbt - -include $(TOP)$(ROOT)config/lib.cf diff --git a/harbour/examples/rdddbt/dbfdbt1.c b/harbour/examples/rdddbt/dbfdbt1.c deleted file mode 100644 index f94fb1aab6..0000000000 --- a/harbour/examples/rdddbt/dbfdbt1.c +++ /dev/null @@ -1,858 +0,0 @@ -/* - * $Id$ - */ - -/* - * xHarbour Project source code: - * DBFDBT RDD - * - * Copyright 2003 Przemyslaw Czerpak - * www - http://www.xharbour.org - * Most of code taken from dbf1.c - * Copyright 1999 Bruno Cantero - * www - http://www.harbour-project.org - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). - * - * As a special exception, the Harbour Project gives permission for - * additional uses of the text contained in its release of Harbour. - * - * The exception is that, if you link the Harbour libraries with other - * files to produce an executable, this does not by itself cause the - * resulting executable to be covered by the GNU General Public License. - * Your use of that executable is in no way restricted on account of - * linking the Harbour library code into it. - * - * This exception does not however invalidate any other reasons why - * the executable file might be covered by the GNU General Public License. - * - * This exception applies only to the code released by the Harbour - * Project under the name Harbour. If you copy code from other - * Harbour Project or Free Software Foundation releases into a copy of - * Harbour, as the General Public License permits, the exception does - * not apply to the code that you add in this way. To avoid misleading - * anyone as to the status of such modified files, you must delete - * this exception notice from them. - * - * If you write modifications of your own for Harbour, it is your choice - * whether to permit this exception to apply to your modifications. - * If you do not wish that, delete this exception notice. - * - */ - -#include "hbapi.h" -#include "hbapiitm.h" -#include "hbinit.h" -#include "hbapierr.h" -#include "hbapilng.h" -#include "hbset.h" -#include "hbvm.h" -#include "hbdate.h" -#include "hbrdddbt.h" -#include "rddsys.ch" - -#ifndef HB_CDP_SUPPORT_OFF -# include "hbapicdp.h" -#endif - -static RDDFUNCS dbtSuper; -static const RDDFUNCS dbtTable = -{ - - /* Movement and positioning methods */ - - ( DBENTRYP_BP ) hb_dbtBof, - ( DBENTRYP_BP ) hb_dbtEof, - ( DBENTRYP_BP ) hb_dbtFound, - ( DBENTRYP_V ) hb_dbtGoBottom, - ( DBENTRYP_UL ) hb_dbtGoTo, - ( DBENTRYP_I ) hb_dbtGoToId, - ( DBENTRYP_V ) hb_dbtGoTop, - ( DBENTRYP_BIB ) hb_dbtSeek, - ( DBENTRYP_L ) hb_dbtSkip, - ( DBENTRYP_L ) hb_dbtSkipFilter, - ( DBENTRYP_L ) hb_dbtSkipRaw, - - - /* Data management */ - - ( DBENTRYP_VF ) hb_dbtAddField, - ( DBENTRYP_B ) hb_dbtAppend, - ( DBENTRYP_I ) hb_dbtCreateFields, - ( DBENTRYP_V ) hb_dbtDeleteRec, - ( DBENTRYP_BP ) hb_dbtDeleted, - ( DBENTRYP_SP ) hb_dbtFieldCount, - ( DBENTRYP_VF ) hb_dbtFieldDisplay, - ( DBENTRYP_SSI ) hb_dbtFieldInfo, - ( DBENTRYP_SVP ) hb_dbtFieldName, - ( DBENTRYP_V ) hb_dbtFlush, - ( DBENTRYP_PP ) hb_dbtGetRec, - ( DBENTRYP_SI ) hb_dbtGetValue, - ( DBENTRYP_SVL ) hb_dbtGetVarLen, - ( DBENTRYP_V ) hb_dbtGoCold, - ( DBENTRYP_V ) hb_dbtGoHot, - ( DBENTRYP_P ) hb_dbtPutRec, - ( DBENTRYP_SI ) hb_dbtPutValue, - ( DBENTRYP_V ) hb_dbtRecall, - ( DBENTRYP_ULP ) hb_dbtRecCount, - ( DBENTRYP_ISI ) hb_dbtRecInfo, - ( DBENTRYP_ULP ) hb_dbtRecNo, - ( DBENTRYP_I ) hb_dbtRecId, - ( DBENTRYP_S ) hb_dbtSetFieldExtent, - - - /* WorkArea/Database management */ - - ( DBENTRYP_P ) hb_dbtAlias, - ( DBENTRYP_V ) hb_dbtClose, - ( DBENTRYP_VP ) hb_dbtCreate, - ( DBENTRYP_SI ) hb_dbtInfo, - ( DBENTRYP_V ) hb_dbtNewArea, - ( DBENTRYP_VP ) hb_dbtOpen, - ( DBENTRYP_V ) hb_dbtRelease, - ( DBENTRYP_SP ) hb_dbtStructSize, - ( DBENTRYP_P ) hb_dbtSysName, - ( DBENTRYP_VEI ) hb_dbtEval, - ( DBENTRYP_V ) hb_dbtPack, - ( DBENTRYP_LSP ) hb_dbtPackRec, - ( DBENTRYP_VS ) hb_dbtSort, - ( DBENTRYP_VT ) hb_dbtTrans, - ( DBENTRYP_VT ) hb_dbtTransRec, - ( DBENTRYP_V ) hb_dbtZap, - - - /* Relational Methods */ - - ( DBENTRYP_VR ) hb_dbtChildEnd, - ( DBENTRYP_VR ) hb_dbtChildStart, - ( DBENTRYP_VR ) hb_dbtChildSync, - ( DBENTRYP_V ) hb_dbtSyncChildren, - ( DBENTRYP_V ) hb_dbtClearRel, - ( DBENTRYP_V ) hb_dbtForceRel, - ( DBENTRYP_SVP ) hb_dbtRelArea, - ( DBENTRYP_VR ) hb_dbtRelEval, - ( DBENTRYP_SI ) hb_dbtRelText, - ( DBENTRYP_VR ) hb_dbtSetRel, - - - /* Order Management */ - - ( DBENTRYP_OI ) hb_dbtOrderListAdd, - ( DBENTRYP_V ) hb_dbtOrderListClear, - ( DBENTRYP_OI ) hb_dbtOrderListDelete, - ( DBENTRYP_OI ) hb_dbtOrderListFocus, - ( DBENTRYP_V ) hb_dbtOrderListRebuild, - ( DBENTRYP_VOI ) hb_dbtOrderCondition, - ( DBENTRYP_VOC ) hb_dbtOrderCreate, - ( DBENTRYP_OI ) hb_dbtOrderDestroy, - ( DBENTRYP_OII ) hb_dbtOrderInfo, - - - /* Filters and Scope Settings */ - - ( DBENTRYP_V ) hb_dbtClearFilter, - ( DBENTRYP_V ) hb_dbtClearLocate, - ( DBENTRYP_V ) hb_dbtClearScope, - ( DBENTRYP_VPLP ) hb_dbtCountScope, - ( DBENTRYP_I ) hb_dbtFilterText, - ( DBENTRYP_SI ) hb_dbtScopeInfo, - ( DBENTRYP_VFI ) hb_dbtSetFilter, - ( DBENTRYP_VLO ) hb_dbtSetLocate, - ( DBENTRYP_VOS ) hb_dbtSetScope, - ( DBENTRYP_VPL ) hb_dbtSkipScope, - ( DBENTRYP_B ) hb_dbtLocate, - - - /* Miscellaneous */ - - ( DBENTRYP_P ) hb_dbtCompile, - ( DBENTRYP_I ) hb_dbtError, - ( DBENTRYP_I ) hb_dbtEvalBlock, - - - /* Network operations */ - - ( DBENTRYP_VSP ) hb_dbtRawLock, - ( DBENTRYP_VL ) hb_dbtLock, - ( DBENTRYP_I ) hb_dbtUnLock, - - - /* Memofile functions */ - - ( DBENTRYP_V ) hb_dbtCloseMemFile, - ( DBENTRYP_VP ) hb_dbtCreateMemFile, - ( DBENTRYP_SVPB ) hb_dbtGetValueFile, - ( DBENTRYP_VP ) hb_dbtOpenMemFile, - ( DBENTRYP_SVPB ) hb_dbtPutValueFile, - - - /* Database file header handling */ - - ( DBENTRYP_V ) hb_dbtReadDBHeader, - ( DBENTRYP_V ) hb_dbtWriteDBHeader, - - - /* non WorkArea functions */ - ( DBENTRYP_R ) hb_dbtInit, - ( DBENTRYP_R ) hb_dbtExit, - ( DBENTRYP_RVV ) hb_dbtDrop, - ( DBENTRYP_RVV ) hb_dbtExists, - ( DBENTRYP_RSLV ) hb_dbtRddInfo, - - /* Special and reserved methods */ - - ( DBENTRYP_SVP ) hb_dbtWhoCares -}; - - -/* - * Exclusive lock memo file. - */ -static BOOL hb_dbtFileLockEx( DBTAREAP pArea ) -{ - BOOL fRet; - - if ( !pArea->fShared ) - { - fRet = TRUE; - } - else - { - do - { - fRet = hb_fsLock( pArea->hMemoFile, DBT_LOCKPOS, DBT_LOCKSIZE, - FL_LOCK | FLX_EXCLUSIVE | FLX_WAIT ); - } while ( !fRet ); - } - return fRet; -} - -/* - * Shared lock memo file. - */ -static BOOL hb_dbtFileLockSh( DBTAREAP pArea ) -{ - BOOL fRet; - - if ( !pArea->fShared ) - { - fRet = TRUE; - } - else - { - do - { - fRet = hb_fsLock( pArea->hMemoFile, DBT_LOCKPOS, DBT_LOCKSIZE, - FL_LOCK | FLX_SHARED | FLX_WAIT ); - } while ( !fRet ); - } - return fRet; -} - -/* - * Unlock memo file. - */ -static BOOL hb_dbtFileUnLock( DBTAREAP pArea ) -{ - return !pArea->fShared || hb_fsLock( pArea->hMemoFile, DBT_LOCKPOS, DBT_LOCKSIZE, FL_UNLOCK ); -} - -/* - * Return the size of memo. - */ -static ULONG hb_dbtGetMemoLen( DBTAREAP pArea, USHORT uiIndex ) -{ - ULONG ulBlock; - BYTE pBlock[ DBT_BLOCKSIZE ]; - USHORT uiLen; - - HB_TRACE(HB_TR_DEBUG, ("hb_dbtGetMemoLen(%p, %hu)", pArea, uiIndex)); - - ulBlock = hb_dbfGetMemoBlock( ( DBFAREAP ) pArea, uiIndex ); - if( ulBlock == 0 ) - return 0; - hb_fsSeekLarge( pArea->hMemoFile, ( HB_FOFFSET ) ulBlock * DBT_BLOCKSIZE, FS_SET ); - ulBlock = 0; - do - { - uiIndex = 0; - uiLen = hb_fsRead( pArea->hMemoFile, pBlock, DBT_BLOCKSIZE ); - if ( uiLen == ( USHORT ) FS_ERROR ) - break; - while( uiIndex < uiLen && pBlock[ uiIndex ] != 0x1A ) - uiIndex++; - ulBlock += uiIndex; - } while( uiIndex == DBT_BLOCKSIZE ); - return ulBlock; -} - -/* - * Read memo data. - */ -static void hb_dbtGetMemo( DBTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) -{ - ULONG ulSize, ulBlock; - BYTE * pBuffer; - - HB_TRACE(HB_TR_DEBUG, ("hb_dbtGetMemo(%p, %hu, %p)", pArea, uiIndex, pItem)); - - ulSize = hb_dbtGetMemoLen( pArea, uiIndex ); - - pBuffer = ( BYTE * ) hb_xgrab( ulSize + 1 ); - if( ulSize > 0 ) - { - ulBlock = hb_dbfGetMemoBlock( ( DBFAREAP ) pArea, uiIndex ); - hb_fsSeekLarge( pArea->hMemoFile, ( HB_FOFFSET ) ulBlock * DBT_BLOCKSIZE, FS_SET ); - hb_fsReadLarge( pArea->hMemoFile, pBuffer, ulSize ); -#ifndef HB_CDP_SUPPORT_OFF - hb_cdpnTranslate( ( char * ) pBuffer, pArea->cdPage, hb_vmCDP(), ulSize ); -#endif - } - else - *pBuffer = '\0'; - - hb_itemPutCLPtr( pItem, ( char * ) pBuffer, ulSize ); - hb_itemSetCMemo( pItem ); -} - -/* - * Write memo data. - */ -static void hb_dbtWriteMemo( DBTAREAP pArea, ULONG ulBlock, PHB_ITEM pItem, ULONG ulLen, - ULONG * ulStoredBlock ) -{ - BYTE pAddr[4]; - BOOL bNewBlock; - - HB_TRACE(HB_TR_DEBUG, ("hb_dbtWriteMemo(%p, %lu, %p, %lu, %p)", pArea, ulBlock, pItem, - ulLen, ulStoredBlock)); - - bNewBlock = !( ulBlock && ulLen < DBT_BLOCKSIZE - 1 ); - if( bNewBlock ) - { - /* Get next block from header */ - hb_fsSeek( pArea->hMemoFile, 0, FS_SET ); - hb_fsRead( pArea->hMemoFile, pAddr, 4 ); - ulBlock = HB_GET_LE_UINT32( pAddr ); - } - * ulStoredBlock = ulBlock; - - hb_fsSeekLarge( pArea->hMemoFile, ( HB_FOFFSET ) ulBlock * DBT_BLOCKSIZE, FS_SET ); -#ifndef HB_CDP_SUPPORT_OFF - if( hb_vmCDP() != pArea->cdPage ) - { - BYTE * pBuff = ( BYTE * ) hb_xalloc( ulLen + 1 ); - - if( pBuff ) - { - memcpy( pBuff, hb_itemGetCPtr( pItem ), ulLen ); - pBuff[ ulLen ] = 0x1A; - hb_cdpnTranslate( ( char * ) pBuff, hb_vmCDP(), pArea->cdPage, ulLen ); - hb_fsWriteLarge( pArea->hMemoFile, pBuff, ulLen + 1 ); - hb_xfree( pBuff ); - } - else - { - BYTE pBlock[ DBT_BLOCKSIZE ], *pSrc = ( BYTE * ) hb_itemGetCPtr( pItem ); - ULONG ulWritten = 0, ulRest; - - do - { - ulRest = HB_MIN( ulLen - ulWritten, DBT_BLOCKSIZE ); - memcpy( pBlock, pSrc + ulWritten, ulRest ); - memset( pBlock + ulRest, 0x1A, DBT_BLOCKSIZE - ulRest ); - hb_cdpnTranslate( ( char * ) pBlock, hb_vmCDP(), pArea->cdPage, ulRest ); - hb_fsWrite( pArea->hMemoFile, pBlock, DBT_BLOCKSIZE ); - ulWritten += DBT_BLOCKSIZE; - } - while ( ulWritten <= ulLen ); - } - } - else -#endif - { - BYTE pBlock[ DBT_BLOCKSIZE ]; - memset( pBlock, 0x1A, DBT_BLOCKSIZE ); - hb_fsWriteLarge( pArea->hMemoFile, ( BYTE * ) hb_itemGetCPtr( pItem ), ulLen ); - hb_fsWrite( pArea->hMemoFile, pBlock, ( DBT_BLOCKSIZE - ( USHORT ) ( ulLen % DBT_BLOCKSIZE ) ) ); - } - pArea->fMemoFlush = TRUE; - - if( bNewBlock ) - { - ulBlock += ( ulLen / DBT_BLOCKSIZE ) + 1; - HB_PUT_LE_UINT32( pAddr, ulBlock ); - hb_fsSeek( pArea->hMemoFile, 0, FS_SET ); - hb_fsWrite( pArea->hMemoFile, pAddr, 4 ); - pArea->fMemoFlush = TRUE; - } -} - -/* - * Assign a value to the specified memo field. - */ -static BOOL hb_dbtPutMemo( DBTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) -{ - ULONG ulLen, ulBlock; - - HB_TRACE(HB_TR_DEBUG, ("hb_dbtPutMemo(%p, %hu, %p)", pArea, uiIndex, pItem)); - - ulLen = hb_itemGetCLen( pItem ); - if( ulLen > 0 ) - { - ulBlock = hb_dbfGetMemoBlock( ( DBFAREAP ) pArea, uiIndex ); - hb_dbtWriteMemo( pArea, ulBlock, pItem, ulLen, &ulBlock ); - } - else - ulBlock = 0; - hb_dbfPutMemoBlock( ( DBFAREAP ) pArea, uiIndex, ulBlock ); - return TRUE; -} - - -/* DBT METHODS */ - -/* - * Obtain the length of a field value. - * ( DBENTRYP_SVL ) hb_dbtGetVarLen - */ -static HB_ERRCODE hb_dbtGetVarLen( DBTAREAP pArea, USHORT uiIndex, ULONG * pLength ) -{ - BOOL bDeleted; - - HB_TRACE(HB_TR_DEBUG, ("hb_dbtGetVarLen(%p, %hu, %p)", pArea, uiIndex, pLength)); - - if( pArea->fHasMemo && pArea->hMemoFile != FS_ERROR ) - { - /* Force read record */ - if( SELF_DELETED( ( AREAP ) pArea, &bDeleted ) == HB_FAILURE ) - return HB_FAILURE; - - if( pArea->lpFields[ uiIndex - 1 ].uiType == HB_FT_MEMO ) - { - if( hb_dbtFileLockSh( pArea ) ) - { - * pLength = hb_dbtGetMemoLen( pArea, uiIndex - 1 ); - hb_dbtFileUnLock( pArea ); - } - else - { - * pLength = 0; - } - return HB_SUCCESS; - } - } - - return SUPER_GETVARLEN( ( AREAP ) pArea, uiIndex, pLength ); -} - -/* - * Retrieve information about the current driver. - * ( DBENTRYP_SI ) hb_dbtInfo - */ -static HB_ERRCODE hb_dbtInfo( DBTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) -{ - HB_TRACE(HB_TR_DEBUG, ("hb_dbtInfo(%p, %hu, %p)", pArea, uiIndex, pItem)); - - switch( uiIndex ) - { - case DBI_MEMOEXT: - if( pArea->fHasMemo && pArea->hMemoFile != FS_ERROR ) - { - PHB_FNAME pFileName; - - pFileName = hb_fsFNameSplit( ( char * ) pArea->szMemoFileName ); - hb_itemPutC( pItem, pFileName->szExtension ); - hb_xfree( pFileName ); - } - else - { - hb_itemClear( pItem ); - return SELF_RDDINFO( SELF_RDDNODE( pArea ), RDDI_MEMOEXT, 0, pItem ); - } - break; - - case DBI_MEMOBLOCKSIZE: - if( pArea->fHasMemo && pArea->hMemoFile != FS_ERROR ) - hb_itemPutNI( pItem, pArea->uiMemoBlockSize ); - else - hb_itemPutNI( pItem, DBT_BLOCKSIZE ); - break; - - case DBI_MEMOTYPE: - if( pArea->fHasMemo && pArea->hMemoFile != FS_ERROR ) - hb_itemPutNI( pItem, pArea->bMemoType ); - else - hb_itemPutNI( pItem, DB_MEMO_DBT ); - break; - - /* case DBI_RDD_VERSION */ - - default: - return SUPER_INFO( ( AREAP ) pArea, uiIndex, pItem ); - } - - return HB_SUCCESS; -} - -/* - * Retrieve the size of the WorkArea structure. - * ( DBENTRYP_SP ) hb_dbtStructSize - */ -static HB_ERRCODE hb_dbtStructSize( DBTAREAP pArea, USHORT * uiSize ) -{ - HB_TRACE(HB_TR_DEBUG, ("hb_dbtStrucSize(%p, %p)", pArea, uiSize)); - HB_SYMBOL_UNUSED( pArea ); - - * uiSize = sizeof( DBTAREA ); - return HB_SUCCESS; -} - -/* - * Obtain the current value of a field. - * ( DBENTRYP_SI ) hb_dbtGetValue - */ -static HB_ERRCODE hb_dbtGetValue( DBTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) -{ - BOOL bDeleted; - - HB_TRACE(HB_TR_DEBUG, ("hb_dbtGetValue(%p, %hu, %p)", pArea, uiIndex, pItem)); - - if( pArea->fHasMemo && pArea->hMemoFile != FS_ERROR && - pArea->lpFields[ uiIndex - 1 ].uiType == HB_FT_MEMO ) - { - /* Force read record */ - if( SELF_DELETED( ( AREAP ) pArea, &bDeleted ) == HB_FAILURE ) - return HB_FAILURE; - - if( hb_dbtFileLockSh( pArea ) ) - { - hb_dbtGetMemo( pArea, uiIndex - 1, pItem ); - hb_dbtFileUnLock( pArea ); - } - else - { - PHB_ITEM pError = hb_errNew(); - - hb_errPutGenCode( pError, EG_LOCK ); - hb_errPutDescription( pError, hb_langDGetErrorDesc( EG_LOCK ) ); - hb_errPutSubCode( pError, EDBF_LOCK ); - hb_errPutFlags( pError, EF_CANDEFAULT ); - SELF_ERROR( ( AREAP ) pArea, pError ); - hb_itemRelease( pError ); - return HB_FAILURE; - } - return HB_SUCCESS; - } - else - return SUPER_GETVALUE( ( AREAP ) pArea, uiIndex, pItem ); -} - -/* - * Assign a value to a field. - * ( DBENTRYP_SI ) hb_dbtPutValue - */ -static HB_ERRCODE hb_dbtPutValue( DBTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ) -{ - BOOL bDeleted; - PHB_ITEM pError; - HB_ERRCODE uiError, uiErrorG; - - HB_TRACE(HB_TR_DEBUG, ("hb_dbtPutValue(%p, %hu, %p)", pArea, uiIndex, pItem)); - - if( pArea->fHasMemo && pArea->hMemoFile != FS_ERROR && - pArea->lpFields[ uiIndex - 1 ].uiType == HB_FT_MEMO ) - { - if( HB_IS_MEMO( pItem ) || HB_IS_STRING( pItem ) ) - { - /* Force read record */ - if( SELF_DELETED( ( AREAP ) pArea, &bDeleted ) == HB_FAILURE ) - return HB_FAILURE; - - if( !pArea->fPositioned ) - return HB_SUCCESS; - - /* Buffer is hot? */ - if( !pArea->fRecordChanged && SELF_GOHOT( ( AREAP ) pArea ) == HB_FAILURE ) - return HB_FAILURE; - - if( hb_dbtFileLockEx( pArea ) ) - { - uiError = hb_dbtPutMemo( pArea, uiIndex -1, pItem ) ? HB_SUCCESS : EDBF_DATAWIDTH; - hb_dbtFileUnLock( pArea ); - } - else - { - uiError = EDBF_LOCK; - } - /* Update deleted flag */ - pArea->pRecord[ 0 ] = (BYTE) (pArea->fDeleted ? '*' : ' '); - } - else - uiError = EDBF_DATATYPE; - - if( uiError != HB_SUCCESS ) - { - uiErrorG = uiError == EDBF_DATAWIDTH ? EG_DATAWIDTH : - ( uiError == EDBF_LOCK ? EG_LOCK : EG_DATATYPE ); - pError = hb_errNew(); - hb_errPutGenCode( pError, uiErrorG ); - hb_errPutDescription( pError, hb_langDGetErrorDesc( uiErrorG ) ); - hb_errPutSubCode( pError, uiError ); - hb_errPutFlags( pError, EF_CANDEFAULT ); - SELF_ERROR( ( AREAP ) pArea, pError ); - hb_itemRelease( pError ); - return HB_FAILURE; - } - return HB_SUCCESS; - } - return SUPER_PUTVALUE( ( AREAP ) pArea, uiIndex, pItem); -} - - -/* ( DBENTRYP_V ) hb_dbtCloseMemFile : NULL */ - -/* - * Create a memo file in the WorkArea. - * ( DBENTRYP_VP ) hb_dbtCreateMemFile - */ -static HB_ERRCODE hb_dbtCreateMemFile( DBTAREAP pArea, LPDBOPENINFO pCreateInfo ) -{ - BYTE pBlock[ DBT_BLOCKSIZE ]; - BOOL bRetry; - PHB_ITEM pError; - - HB_TRACE(HB_TR_DEBUG, ("hb_dbtCreateMemFile(%p, %p)", pArea, pCreateInfo)); - - pArea->uiMemoBlockSize = DBT_BLOCKSIZE; - - if( pCreateInfo ) - { - pError = NULL; - /* Try create */ - do - { - pArea->hMemoFile = hb_fsExtOpen( pCreateInfo->abName, NULL, - FO_READWRITE | FO_EXCLUSIVE | FXO_TRUNCATE | - FXO_DEFAULTS | FXO_SHARELOCK, - NULL, pError ); - if( pArea->hMemoFile == 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_itemRelease( pError ); - - if( pArea->hMemoFile == FS_ERROR ) - return HB_FAILURE; - } - else /* For zap file */ - hb_fsSeek( pArea->hMemoFile, 0, FS_SET ); - - memset( pBlock, 0, DBT_BLOCKSIZE ); - * ( ( LONG * ) pBlock ) = 1; - if( hb_fsWrite( pArea->hMemoFile, pBlock, DBT_BLOCKSIZE ) != DBT_BLOCKSIZE ) - return HB_FAILURE; - hb_fsWrite( pArea->hMemoFile, NULL, 0 ); - pArea->fMemoFlush = TRUE; - - return HB_SUCCESS; -} - - -/* ( DBENTRYP_SVPB ) hb_dbtGetValueFile : NULL */ - -/* - * Open a memo file in the specified WorkArea. - * ( DBENTRYP_VP ) hb_dbtOpenMemFile - */ -static HB_ERRCODE hb_dbtOpenMemFile( DBTAREAP pArea, LPDBOPENINFO pOpenInfo ) -{ - USHORT uiFlags; - BOOL bRetry; - PHB_ITEM pError = NULL; - - HB_TRACE(HB_TR_DEBUG, ("hb_dbtOpenMemFile(%p, %p)", pArea, pOpenInfo)); - - uiFlags = (pOpenInfo->fReadonly ? FO_READ : FO_READWRITE) | - (pOpenInfo->fShared ? FO_DENYNONE : FO_EXCLUSIVE); - - /* Try open */ - do - { - pArea->hMemoFile = hb_fsExtOpen( pOpenInfo->abName, NULL, uiFlags | - FXO_DEFAULTS | FXO_SHARELOCK, - NULL, pError ); - if( pArea->hMemoFile == FS_ERROR ) - { - if( !pError ) - { - pError = hb_errNew(); - hb_errPutGenCode( pError, EG_OPEN ); - hb_errPutSubCode( pError, EDBF_OPEN_DBF ); - hb_errPutDescription( pError, hb_langDGetErrorDesc( EG_OPEN ) ); - hb_errPutFileName( pError, ( char * ) pOpenInfo->abName ); - hb_errPutFlags( pError, EF_CANRETRY | EF_CANDEFAULT ); - } - bRetry = ( SELF_ERROR( ( AREAP ) pArea, pError ) == E_RETRY ); - } - else - bRetry = FALSE; - } while( bRetry ); - - if( pError ) - { - hb_itemRelease( pError ); - } - pArea->uiMemoBlockSize = DBT_BLOCKSIZE; - - return ( pArea->hMemoFile == FS_ERROR ? HB_FAILURE : HB_SUCCESS ); -} - -/* ( DBENTRYP_SVPB ) hb_dbtPutValueFile : NULL */ - -/* - * Retrieve (set) information about RDD - * ( DBENTRYP_RSLV ) hb_dbtFieldInfo - */ -static HB_ERRCODE hb_dbtRddInfo( LPRDDNODE pRDD, USHORT uiIndex, ULONG ulConnect, PHB_ITEM pItem ) -{ - HB_TRACE(HB_TR_DEBUG, ("hb_dbtRddInfo(%p, %hu, %lu, %p)", pRDD, uiIndex, ulConnect, pItem)); - - switch( uiIndex ) - { - case RDDI_MEMOEXT: - { - LPDBFDATA pData = ( LPDBFDATA ) pRDD->lpvCargo; - char *szNew = hb_itemGetCPtr( pItem ); - - if( szNew[0] == '.' && szNew[1] ) - szNew = hb_strdup( szNew ); - else - szNew = NULL; - - hb_itemPutC( pItem, pData->szMemoExt[ 0 ] ? pData->szMemoExt : DBT_MEMOEXT ); - if( szNew ) - { - hb_strncpy( pData->szMemoExt, szNew, HB_MAX_FILE_EXT ); - hb_xfree( szNew ); - } - break; - } - case RDDI_MEMOBLOCKSIZE: - hb_itemPutNI( pItem, DBT_BLOCKSIZE ); - break; - - case RDDI_MEMOTYPE: - hb_itemPutNI( pItem, DB_MEMO_DBT ); - break; - - case RDDI_MEMOGCTYPE: - hb_itemPutNI( pItem, 0 ); - break; - - case RDDI_MEMOREADLOCK: - case RDDI_MEMOREUSE: - hb_itemPutL( pItem, FALSE ); - break; - - default: - return SUPER_RDDINFO( pRDD, uiIndex, ulConnect, pItem ); - } - - return HB_SUCCESS; -} - - -HB_FUNC( DBFDBT ) {;} - -HB_FUNC( DBFDBT_GETFUNCTABLE ) -{ - RDDFUNCS * pTable; - USHORT * uiCount; - - uiCount = ( USHORT * ) hb_parptr( 1 ); - pTable = ( RDDFUNCS * ) hb_parptr( 2 ); - - HB_TRACE(HB_TR_DEBUG, ("DBFDBT_GETFUNCTABLE(%p, %p)", uiCount, pTable)); - - if( pTable ) - { - if ( uiCount ) - * uiCount = RDDFUNCSCOUNT; - hb_retni( hb_rddInherit( pTable, &dbtTable, &dbtSuper, "DBF" ) ); - } - else - hb_retni( HB_FAILURE ); -} - - -#define __PRG_SOURCE__ __FILE__ - -#ifdef HB_PCODE_VER -# undef HB_PRG_PCODE_VER -# define HB_PRG_PCODE_VER HB_PCODE_VER -#endif - -HB_FUNC_EXTERN( _DBF ); - -static void hb_dbfdbtRddInit( void * cargo ) -{ - HB_SYMBOL_UNUSED( cargo ); - - if( hb_rddRegister( "DBF", RDT_FULL ) > 1 || - hb_rddRegister( "DBFDBT", RDT_FULL ) > 1 ) - { - hb_errInternal( HB_EI_RDDINVALID, NULL, NULL, NULL ); - - /* not executed, only to force DBF RDD linking */ - HB_FUNC_EXEC( _DBF ); - } -} - -HB_INIT_SYMBOLS_BEGIN( dbfdbt1__InitSymbols ) -{ "DBFDBT", {HB_FS_PUBLIC|HB_FS_LOCAL}, {HB_FUNCNAME( DBFDBT )}, NULL }, -{ "DBFDBT_GETFUNCTABLE", {HB_FS_PUBLIC|HB_FS_LOCAL}, {HB_FUNCNAME( DBFDBT_GETFUNCTABLE )}, NULL } -HB_INIT_SYMBOLS_END( dbfdbt1__InitSymbols ) - -HB_CALL_ON_STARTUP_BEGIN( _hb_dbfdbt_rdd_init_ ) - hb_vmAtInit( hb_dbfdbtRddInit, NULL ); -HB_CALL_ON_STARTUP_END( _hb_dbfdbt_rdd_init_ ) - -#if defined( HB_PRAGMA_STARTUP ) - #pragma startup dbfdbt1__InitSymbols - #pragma startup _hb_dbfdbt_rdd_init_ -#elif defined( HB_MSC_STARTUP ) - #if defined( HB_OS_WIN_64 ) - #pragma section( HB_MSC_START_SEGMENT, long, read ) - #endif - #pragma data_seg( HB_MSC_START_SEGMENT ) - static HB_$INITSYM hb_vm_auto_dbfdbt1__InitSymbols = dbfdbt1__InitSymbols; - static HB_$INITSYM hb_vm_auto_dbfdbt_rdd_init = _hb_dbfdbt_rdd_init_; - #pragma data_seg() -#endif diff --git a/harbour/examples/rdddbt/hbrdddbt.h b/harbour/examples/rdddbt/hbrdddbt.h deleted file mode 100644 index bb86eaee59..0000000000 --- a/harbour/examples/rdddbt/hbrdddbt.h +++ /dev/null @@ -1,193 +0,0 @@ -/* - * $Id$ - */ - -/* - * xHarbour Project source code: - * DBFDBT RDD - * - * Copyright 2003 Przemyslaw Czerpak - * www - http://www.xharbour.org - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this software; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). - * - * As a special exception, the Harbour Project gives permission for - * additional uses of the text contained in its release of Harbour. - * - * The exception is that, if you link the Harbour libraries with other - * files to produce an executable, this does not by itself cause the - * resulting executable to be covered by the GNU General Public License. - * Your use of that executable is in no way restricted on account of - * linking the Harbour library code into it. - * - * This exception does not however invalidate any other reasons why - * the executable file might be covered by the GNU General Public License. - * - * This exception applies only to the code released by the Harbour - * Project under the name Harbour. If you copy code from other - * Harbour Project or Free Software Foundation releases into a copy of - * Harbour, as the General Public License permits, the exception does - * not apply to the code that you add in this way. To avoid misleading - * anyone as to the status of such modified files, you must delete - * this exception notice from them. - * - * If you write modifications of your own for Harbour, it is your choice - * whether to permit this exception to apply to your modifications. - * If you do not wish that, delete this exception notice. - * - */ - -#ifndef HB_RDDDBT_H_ -#define HB_RDDDBT_H_ - -#include "hbdbf.h" -#include "hbdbferr.h" -#include "hbapirdd.h" -#define HB_EXTERNAL_RDDDBF_USE -#include "hbrdddbf.h" - -HB_EXTERN_BEGIN - -/* MEMO constants and defaults */ -#define DBT_MEMOEXT ".dbt" -#define DBT_BLOCKSIZE 512 -#define DBT_LOCKPOS 0x00000000L -#define DBT_LOCKSIZE 0x00000001L - -/* - * DBFDBT WORKAREA - * ------------ - * The Workarea Structure of DBFDBT RDD - * - */ - -/* we don't have to change DBFAREA to create DBTAREA */ -typedef DBFAREA DBTAREA; -typedef DBTAREA * LPDBTAREA; -#ifndef DBTAREAP -#define DBTAREAP LPDBTAREA -#endif - - -/* - * -- DBFDBT METHODS -- - */ - -#define SUPERTABLE ( &dbtSuper ) - -#define hb_dbtBof NULL -#define hb_dbtEof NULL -#define hb_dbtFound NULL -#define hb_dbtGoBottom NULL -#define hb_dbtGoTo NULL -#define hb_dbtGoToId NULL -#define hb_dbtGoTop NULL -#define hb_dbtSeek NULL -#define hb_dbtSkip NULL -#define hb_dbtSkipFilter NULL -#define hb_dbtSkipRaw NULL -#define hb_dbtAddField NULL -#define hb_dbtAppend NULL -#define hb_dbtCreateFields NULL -#define hb_dbtDeleteRec NULL -#define hb_dbtDeleted NULL -#define hb_dbtFieldCount NULL -#define hb_dbtFieldDisplay NULL -#define hb_dbtFieldInfo NULL -#define hb_dbtFieldName NULL -#define hb_dbtFlush NULL -#define hb_dbtGetRec NULL -static HB_ERRCODE hb_dbtGetValue( DBTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ); -static HB_ERRCODE hb_dbtGetVarLen( DBTAREAP pArea, USHORT uiIndex, ULONG * pLength ); -#define hb_dbtGoCold NULL -#define hb_dbtGoHot NULL -#define hb_dbtPutRec NULL -static HB_ERRCODE hb_dbtPutValue( DBTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ); -#define hb_dbtRecall NULL -#define hb_dbtRecCount NULL -#define hb_dbtRecInfo NULL -#define hb_dbtRecNo NULL -#define hb_dbtRecId NULL -#define hb_dbtSetFieldExtent NULL -#define hb_dbtAlias NULL -#define hb_dbtClose NULL -#define hb_dbtCreate NULL -static HB_ERRCODE hb_dbtInfo( DBTAREAP pArea, USHORT uiIndex, PHB_ITEM pItem ); -#define hb_dbtNewArea NULL -#define hb_dbtOpen NULL -#define hb_dbtRelease NULL -static HB_ERRCODE hb_dbtStructSize( DBTAREAP pArea, USHORT * uiSize ); -#define hb_dbtSysName NULL -#define hb_dbtEval NULL -#define hb_dbtPack NULL -#define hb_dbtPackRec NULL -#define hb_dbtSort NULL -#define hb_dbtTrans NULL -#define hb_dbtTransRec NULL -#define hb_dbtZap NULL -#define hb_dbtChildEnd NULL -#define hb_dbtChildStart NULL -#define hb_dbtChildSync NULL -#define hb_dbtSyncChildren NULL -#define hb_dbtClearRel NULL -#define hb_dbtForceRel NULL -#define hb_dbtRelArea NULL -#define hb_dbtRelEval NULL -#define hb_dbtRelText NULL -#define hb_dbtSetRel NULL -#define hb_dbtOrderListAdd NULL -#define hb_dbtOrderListClear NULL -#define hb_dbtOrderListDelete NULL -#define hb_dbtOrderListFocus NULL -#define hb_dbtOrderListRebuild NULL -#define hb_dbtOrderCondition NULL -#define hb_dbtOrderCreate NULL -#define hb_dbtOrderDestroy NULL -#define hb_dbtOrderInfo NULL -#define hb_dbtClearFilter NULL -#define hb_dbtClearLocate NULL -#define hb_dbtClearScope NULL -#define hb_dbtCountScope NULL -#define hb_dbtFilterText NULL -#define hb_dbtScopeInfo NULL -#define hb_dbtSetFilter NULL -#define hb_dbtSetLocate NULL -#define hb_dbtSetScope NULL -#define hb_dbtSkipScope NULL -#define hb_dbtLocate NULL -#define hb_dbtCompile NULL -#define hb_dbtError NULL -#define hb_dbtEvalBlock NULL -#define hb_dbtRawLock NULL -#define hb_dbtLock NULL -#define hb_dbtUnLock NULL -#define hb_dbtCloseMemFile NULL -static HB_ERRCODE hb_dbtCreateMemFile( DBTAREAP pArea, LPDBOPENINFO pCreateInfo ); -#define hb_dbtGetValueFile NULL -static HB_ERRCODE hb_dbtOpenMemFile( DBTAREAP pArea, LPDBOPENINFO pOpenInfo ); -#define hb_dbtPutValueFile NULL -#define hb_dbtReadDBHeader NULL -#define hb_dbtWriteDBHeader NULL -#define hb_dbtInit NULL -#define hb_dbtExit NULL -#define hb_dbtDrop NULL -#define hb_dbtExists NULL -static HB_ERRCODE hb_dbtRddInfo( LPRDDNODE pRDD, USHORT uiIndex, ULONG ulConnect, PHB_ITEM pItem ); -#define hb_dbtWhoCares NULL - -HB_EXTERN_END - -#endif /* HB_RDDDBT */ diff --git a/harbour/examples/rl/Makefile b/harbour/examples/rl/Makefile deleted file mode 100644 index a38cce057b..0000000000 --- a/harbour/examples/rl/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# -# $Id$ -# - -ROOT = ../../ - -PRG_SOURCES=\ - RLBACK.PRG \ - RLDIALG.PRG \ - RLFRONT.PRG \ - -PRG_MAIN=RLFRONT.PRG - -LIBS=\ - hbdebug \ - hbvm \ - hbrtl \ - hblang \ - hbrdd \ - hbrtl \ - hbvm \ - hbmacro \ - hbpp \ - rddntx \ - rddcdx \ - rddfpt \ - hbsix \ - hbcommon \ - -include $(TOP)$(ROOT)config/bin.cf diff --git a/harbour/source/rtl/Makefile b/harbour/source/rtl/Makefile index aadea8bfa5..712aa8abfb 100644 --- a/harbour/source/rtl/Makefile +++ b/harbour/source/rtl/Makefile @@ -38,6 +38,7 @@ C_SOURCES=\ errapi.c \ errapiu.c \ errint.c \ + errintlo.c \ file.c \ filebuf.c \ filehb.c \ diff --git a/harbour/source/rtl/errint.c b/harbour/source/rtl/errint.c index cfaf1907bf..87417c492a 100644 --- a/harbour/source/rtl/errint.c +++ b/harbour/source/rtl/errint.c @@ -52,94 +52,10 @@ #include "hbapi.h" #include "hbapierr.h" -#include "hbapilng.h" -#include "hbdate.h" -#include "hbset.h" /* NOTE: Use as minimal calls from here, as possible. Don't allocate memory from this function. [vszakats] */ -void hb_errInternalRaw( ULONG ulIntCode, const char * szText, const char * szPar1, const char * szPar2 ) -{ - char buffer[ 8192 ]; - char file[ HB_PATH_MAX ]; - const char * szFile; - USHORT uiLine; - int iLevel; - FILE * hLog; - - BOOL fLang; - - HB_TRACE(HB_TR_DEBUG, ("hb_errInternal(%lu, %s, %s, %s)", ulIntCode, szText, szPar1, szPar2)); - - if( szPar1 == NULL ) - szPar1 = ""; - - if( szPar2 == NULL ) - szPar2 = ""; - - fLang = ( hb_langID() != NULL ); - - szFile = hb_setGetCPtr( HB_SET_HBOUTLOG ); - if( !szFile ) - szFile = "hb_out.log"; - - hLog = hb_fopen( szFile, "a+" ); - if( hLog ) - { - char szTime[ 9 ]; - int iYear, iMonth, iDay; - - hb_dateToday( &iYear, &iMonth, &iDay ); - hb_dateTimeStr( szTime ); - - fprintf( hLog, HB_I_("Application Internal Error - %s\n"), hb_cmdargARGVN( 0 ) ); - fprintf( hLog, HB_I_("Terminated at: %04d.%02d.%02d %s\n"), iYear, iMonth, iDay, szTime ); - if( *hb_setGetCPtr( HB_SET_HBOUTLOGINFO ) ) - fprintf( hLog, HB_I_("Info: %s\n"), hb_setGetCPtr( HB_SET_HBOUTLOGINFO ) ); - } - - hb_conOutErr( hb_conNewLine(), 0 ); - if( fLang ) - hb_snprintf( buffer, sizeof( buffer ), ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_ERRINTR ), ulIntCode ); - else - hb_snprintf( buffer, sizeof( buffer ), "Unrecoverable error %lu: ", ulIntCode ); - - hb_conOutErr( buffer, 0 ); - if( hLog ) - fprintf( hLog, "%s", buffer ); - - if( szText ) - hb_snprintf( buffer, sizeof( buffer ), szText, szPar1, szPar2 ); - else if( fLang ) - hb_snprintf( buffer, sizeof( buffer ), ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_ERRINTR + ulIntCode - 9000 ), szPar1, szPar2 ); - else - buffer[ 0 ] = '\0'; - - hb_conOutErr( buffer, 0 ); - hb_conOutErr( hb_conNewLine(), 0 ); - if( hLog ) - fprintf( hLog, "%s\n", buffer ); - - iLevel = 0; - while( hb_procinfo( iLevel++, buffer, &uiLine, file ) ) - { - char msg[ HB_SYMBOL_NAME_LEN + HB_SYMBOL_NAME_LEN + 32 ]; - - hb_snprintf( msg, sizeof( msg ), HB_I_("Called from %s(%hu)%s%s\n"), buffer, uiLine, *file ? HB_I_(" in ") : "", file ); - - hb_conOutErr( msg, 0 ); - if( hLog ) - fprintf( hLog, "%s", msg ); - } - - if( hLog ) - { - fprintf( hLog, "------------------------------------------------------------------------\n"); - fclose( hLog ); - } -} - void hb_errInternal( ULONG ulIntCode, const char * szText, const char * szPar1, const char * szPar2 ) { hb_errInternalRaw( ulIntCode, szText, szPar1, szPar2 ); diff --git a/harbour/source/rtl/errintlo.c b/harbour/source/rtl/errintlo.c new file mode 100644 index 0000000000..c8e1e0895b --- /dev/null +++ b/harbour/source/rtl/errintlo.c @@ -0,0 +1,141 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * The Error API (internal error) + * + * Copyright 1999-2004 Viktor Szakats + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ + +#include "hbapi.h" +#include "hbapierr.h" +#include "hbapilng.h" +#include "hbdate.h" +#include "hbset.h" + +/* NOTE: Use as minimal calls from here, as possible. + Don't allocate memory from this function. [vszakats] */ + +void hb_errInternalRaw( ULONG ulIntCode, const char * szText, const char * szPar1, const char * szPar2 ) +{ + char buffer[ 8192 ]; + char file[ HB_PATH_MAX ]; + const char * szFile; + USHORT uiLine; + int iLevel; + FILE * hLog; + + BOOL fLang; + + HB_TRACE(HB_TR_DEBUG, ("hb_errInternal(%lu, %s, %s, %s)", ulIntCode, szText, szPar1, szPar2)); + + if( szPar1 == NULL ) + szPar1 = ""; + + if( szPar2 == NULL ) + szPar2 = ""; + + fLang = ( hb_langID() != NULL ); + + szFile = hb_setGetCPtr( HB_SET_HBOUTLOG ); + if( !szFile ) + szFile = "hb_out.log"; + + hLog = hb_fopen( szFile, "a+" ); + if( hLog ) + { + char szTime[ 9 ]; + int iYear, iMonth, iDay; + + hb_dateToday( &iYear, &iMonth, &iDay ); + hb_dateTimeStr( szTime ); + + fprintf( hLog, HB_I_("Application Internal Error - %s\n"), hb_cmdargARGVN( 0 ) ); + fprintf( hLog, HB_I_("Terminated at: %04d.%02d.%02d %s\n"), iYear, iMonth, iDay, szTime ); + if( *hb_setGetCPtr( HB_SET_HBOUTLOGINFO ) ) + fprintf( hLog, HB_I_("Info: %s\n"), hb_setGetCPtr( HB_SET_HBOUTLOGINFO ) ); + } + + hb_conOutErr( hb_conNewLine(), 0 ); + if( fLang ) + hb_snprintf( buffer, sizeof( buffer ), ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_ERRINTR ), ulIntCode ); + else + hb_snprintf( buffer, sizeof( buffer ), "Unrecoverable error %lu: ", ulIntCode ); + + hb_conOutErr( buffer, 0 ); + if( hLog ) + fprintf( hLog, "%s", buffer ); + + if( szText ) + hb_snprintf( buffer, sizeof( buffer ), szText, szPar1, szPar2 ); + else if( fLang ) + hb_snprintf( buffer, sizeof( buffer ), ( char * ) hb_langDGetItem( HB_LANG_ITEM_BASE_ERRINTR + ulIntCode - 9000 ), szPar1, szPar2 ); + else + buffer[ 0 ] = '\0'; + + hb_conOutErr( buffer, 0 ); + hb_conOutErr( hb_conNewLine(), 0 ); + if( hLog ) + fprintf( hLog, "%s\n", buffer ); + + iLevel = 0; + while( hb_procinfo( iLevel++, buffer, &uiLine, file ) ) + { + char msg[ HB_SYMBOL_NAME_LEN + HB_SYMBOL_NAME_LEN + 32 ]; + + hb_snprintf( msg, sizeof( msg ), HB_I_("Called from %s(%hu)%s%s\n"), buffer, uiLine, *file ? HB_I_(" in ") : "", file ); + + hb_conOutErr( msg, 0 ); + if( hLog ) + fprintf( hLog, "%s", msg ); + } + + if( hLog ) + { + fprintf( hLog, "------------------------------------------------------------------------\n"); + fclose( hLog ); + } +} diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 9f8aa377c3..eae52973ce 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -166,6 +166,10 @@ REQUEST hbmk_KEYW #define OutStd( x ) low_OutStd( hbmk[ _HBMK_lUTF8 ], x ) #define OutErr( x ) low_OutErr( hbmk[ _HBMK_lUTF8 ], x ) +#define HB_ISALPHA( c ) ( Upper( c ) >= "A" .AND. Upper( c ) <= "Z" ) +#define HB_ISFIRSTIDCHAR( c ) ( HB_ISALPHA( c ) .OR. ( c ) == '_' ) +#define HB_ISNEXTIDCHAR( c ) ( HB_ISFIRSTIDCHAR(c) .OR. IsDigit( c ) ) + /* This requires Set( _SET_EXACT, .F. ) */ #define LEFTEQUAL( l, r ) ( l = r ) @@ -1460,6 +1464,13 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) hbmk[ _HBMK_lRUN ] := .F. ENDIF + CASE Left( cParamL, Len( "-echo=" ) ) == "-echo=" + + cParam := MacroProc( hbmk, ArchCompFilter( hbmk, SubStr( cParam, Len( "-echo=" ) + 1 ) ), FN_DirGet( aParam[ _PAR_cFileName ] ) ) + IF ! Empty( cParam ) + OutStd( hb_StrFormat( I_( "%1$s" ), cParam ) + hb_osNewLine() ) + ENDIF + CASE Left( cParamL, Len( "-prgflag=" ) ) == "-prgflag=" cParam := MacroProc( hbmk, ArchCompFilter( hbmk, SubStr( cParam, Len( "-prgflag=" ) + 1 ) ), FN_DirGet( aParam[ _PAR_cFileName ] ) ) @@ -4439,6 +4450,10 @@ STATIC FUNCTION FN_Expand( cFileName, lCommandLine ) LOCAL aFile LOCAL aDir + IF Empty( cFileName ) + RETURN {} + ENDIF + #if defined( __PLATFORM__UNIX ) /* Disable expansion if this came from the command line */ IF lCommandLine @@ -4863,8 +4878,9 @@ STATIC FUNCTION ArchCompFilter( hbmk, cItem ) cFilterHarb := "" cValue := "" FOR nPos := 1 TO Len( cFilterSrc ) - IF IsDigit( SubStr( cFilterSrc, nPos, 1 ) ) .OR. ; - IsAlpha( SubStr( cFilterSrc, nPos, 1 ) ) + IF iif( Empty( cValue ),; + HB_ISFIRSTIDCHAR( SubStr( cFilterSrc, nPos, 1 ) ),; + HB_ISNEXTIDCHAR( SubStr( cFilterSrc, nPos, 1 ) ) ) cValue += SubStr( cFilterSrc, nPos, 1 ) ELSE IF ! Empty( cValue ) @@ -4883,13 +4899,17 @@ STATIC FUNCTION ArchCompFilter( hbmk, cItem ) cFilterHarb := StrTran( cFilterHarb, "|", ".OR." ) /* Evaluate filter */ - bFilter := &( "{| hbmk |" + cFilterHarb + "}" ) - IF ISBLOCK( bFilter ) - IF ISLOGICAL( xResult := Eval( bFilter, hbmk ) ) .AND. xResult - RETURN cItem + + BEGIN SEQUENCE WITH {| oError | Break( oError ) } + bFilter := &( "{| hbmk |" + cFilterHarb + "}" ) + IF ! ISBLOCK( bFilter ) .OR. ! ISLOGICAL( xResult := Eval( bFilter, hbmk ) ) .OR. ! xResult + cItem := "" ENDIF - ENDIF - RETURN "" + RECOVER + cItem := "" + END SEQUENCE + + RETURN cItem ENDIF ENDIF @@ -4944,10 +4964,6 @@ STATIC FUNCTION MacroProc( hbmk, cString, cDirParent ) STATIC FUNCTION TimeElapsed( nStartSec, nEndSec ) RETURN Round( ( nEndSec - iif( nEndSec < nStartSec, nStartSec - 86399, nStartSec ) ), 1 ) -#define HB_ISALPHA( c ) ( Upper( c ) >= "A" .AND. Upper( c ) <= "Z" ) -#define HB_ISFIRSTIDCHAR( c ) ( HB_ISALPHA( c ) .OR. ( c ) == '_' ) -#define HB_ISNEXTIDCHAR( c ) ( HB_ISFIRSTIDCHAR(c) .OR. IsDigit( c ) ) - STATIC FUNCTION IsValidHarbourID( cName ) LOCAL tmp IF HB_ISFIRSTIDCHAR( Left( cName, 1 ) ) @@ -5840,6 +5856,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lLong ) { "-instpath=" , I_( "copy target to . if is a directory, it should end with path separator. can be specified multiple times" ) },; { "-nohbc" , I_( "do not process .hbc files in current directory" ) },; { "-stop" , I_( "stop without doing anything" ) },; + { "-echo=" , I_( "echo text on screen" ) },; NIL,; { "-bldf[-]" , I_( "inherit all/no (default) flags from Harbour build" ) },; { "-bldf=[p][c][l]" , I_( "inherit .prg/.c/linker flags (or none) from Harbour build" ) },;