20000411-00:24 GMT+1 Victor Szakats <info@szelvesz.hu>

This commit is contained in:
Viktor Szakats
2000-04-10 22:33:43 +00:00
parent 03dafc3a74
commit 47a17d7ece
35 changed files with 939 additions and 877 deletions

View File

@@ -1,3 +1,87 @@
20000411-00:24 GMT+1 Victor Szakats <info@szelvesz.hu>
; Please retest Harbour on every possible platform.
* make_gnu.*
* bin/bld.*
* Added RSX32 and RSXNT
* makefile.bc
+ $(ARFLAGS) added.
+ /P32 added for BCC32, to avoid overflowing libs when compiling with
debug info.
+ config/dos/rsx32.cf
* include/hbsetup.h
* source/common/hbver.c
* source/rtl/gtdos/gtdos.c
* source/rtl/gtdos/mousedos.c
+ Added support for the RSXNT compiler under DOS 32 bit.
Harbour executable don't run yet.
+ DISKSPACE() for DOS now uses INT_86 instead of the less-portable
library call.
! GTDOS and MOUSEDOS use the standard INT86, so they should work on
more platforms now, easier to extend and much more clear.
+ config/w32/rsxnt.cf
* include/hbsetup.h
* source/common/hbver.c
* source/rtl/diskspac.c
* source/rtl/gtwin/gtwin.c
+ Added support for the RSXNT compiler under Windows NT.
* source/common/hbver.c
* source/rtl/is.c
* source/rtl/transfrm.c
* source/pp/ppcore.c
* source/vm/fm.c
! Fixed warnings for GCC -O2 and the new RSX compiler.
! Fixed warning for turned off HB_FM_STATISTICS
* source/vm/extend.c
* include/hbapi.h
+ hb_retd() function added. Thanks to Jose Lalin.
* include/hbdefs.h
* source/common/hbver.c
* source/rtl/isprint.c
* source/rtl/inkey.c
* source/rtl/dateshb.c
* source/rtl/gtdos/gtdos.c
* source/vm/mainwin.c
* source/vm/maindll.c
% Cleaned up the multiplatform code. (mainly for DOS (INT_86)).
+ Added common HB_DOS_INT86 macro to the central header, local
declarations removed.
% Removed the branches where the word registers were accessed via "w".
"x" is supported by __BORLANDC__, __DJGPP__, _MSC_VER, __RSX32__,
__WATCOM__, __TURBOC__ (9.5). Who's missing ?
* source/common/hbver.c
+ Shows DJGPP package version.
* source/rtl/filesys.c
+ TOFIX added for hb_fsFile()
* config/dos/global.cf
! Got rid of the \ to / conversion for rsx32, watcom and djgpp
* config/dos/djgpp.cf
! Modified to avoid long command lines when linking.
I finally found a way to build DJGPP under W2K, using the MAKE.EXE
supplied with RSXNT.
* config/os2/gcc.cf
* include/hbsetup.h
- The -DHARBOUR_GCC_OS2 detection made automatic.
* source/rtl/version.c
* tests/version.prg
* utils/hbtest/hbtest.prg
* VERSION() no longer has the parameter extension to make things
more straight. One can use HB_COMPILER() to retrieve this info.
! WARNING ! Please update the docs.
20000410-09:00 Luiz Rafael Culik <culik@sl.conex.net
*Doc/en/set.txt
+doc for: SET PRINTER,SET FIXED,SET DECIMALS

View File

@@ -49,20 +49,22 @@ rem if "%HB_GT_LIB%" == "" set HB_GT_LIB=
pause
echo HB_COMPILER:
echo - When HB_ARCHITECTURE=dos
echo - bcc16 (Borland C++ 3.x, 16-bit DOS)
echo - djgpp (GCC (DJGPP), 32-bit Windows)
echo - watcom
echo - bcc16 (Borland C++ 3.x, DOS 16-bit)
echo - djgpp (Delorie GNU C, DOS 32-bit)
echo - rxs32 (EMX/RSXNT/DOS GNU C, DOS 32-bit)
echo - watcom (Watcom C++ 9.x, 10.x, 11.x, DOS 32-bit)
echo - When HB_ARCHITECTURE=w32
echo - bcc32 (Borland C++ 4.x,5.x, 32-bit Windows)
echo - gcc (GCC (Cygnus), 32-bit Windows)
echo - mingw32 (GCC (Cygnus/MingW32), Windows 32 bit)
echo - icc
echo - msvc (Microsoft Visual C++, Windows 32 bit)
echo - bcc32 (Borland C++ 4.x, 5.x, Windows 32-bit)
echo - gcc (Cygnus/Cygwin GNU C, Windows 32-bit)
echo - mingw32 (Cygnus/Mingw32 GNU C, Windows 32-bit)
echo - rxsnt (EMX/RSXNT/Win32 GNU C, Windows 32-bit)
echo - icc (IBM Visual Age C++, Windows 32-bit)
echo - msvc (Microsoft Visual C++, Windows 32-bit)
echo - When HB_ARCHITECTURE=linux
echo - gcc
echo - gcc (GNU C, 32-bit)
echo - When HB_ARCHITECTURE=os2
echo - gcc (GCC (EMX), 32-bit OS/2)
echo - icc (ICC (IBM Visual Age C++ 3.0), 32-bit OS/2)
echo - gcc (EMX GNU C, OS/2 32-bit)
echo - icc (IBM Visual Age C++ 3.0, OS/2 32-bit)
echo.
pause
echo HB_GT_LIB:
@@ -107,6 +109,7 @@ rem if "%HB_GT_LIB%" == "" set HB_GT_LIB=
if "%HB_COMPILER%" == "bcc16" bcc -O2 -mh -I..\include -L..\lib %1.c tools.lib debug.lib vm.lib rtl.lib %HB_GT_LIB%.lib rdd.lib macro.lib pp.lib dbfntx.lib dbfcdx.lib common.lib
if "%HB_COMPILER%" == "djgpp" gcc %1.c -o%1.exe -I..\include -L..\lib -ltools -ldebug -lvm -lrtl -l%HB_GT_LIB% -lrdd -lrtl -lvm -lmacro -lpp -ldbfnt -ldbfcd -lcommo
if "%HB_COMPILER%" == "rsx32" gcc %1.c -Zrsx32 -I..\include -L..\lib -ltools -ldebug -lvm -lrtl -l%HB_GT_LIB% -lrdd -lrtl -lvm -lmacro -lpp -ldbfntx -ldbfcdx -lcommon
goto END
:A_W32
@@ -118,6 +121,7 @@ rem if "%HB_GT_LIB%" == "" set HB_GT_LIB=
if "%HB_COMPILER%" == "bcc32" bcc32 -O2 -I..\include -L..\lib %1.c tools.lib debug.lib vm.lib rtl.lib %HB_GT_LIB%.lib rdd.lib macro.lib pp.lib dbfntx.lib dbfcdx.lib common.lib
if "%HB_COMPILER%" == "gcc" gcc %1.c -o%1.exe -I..\include -L..\lib -ltools -ldebug -lvm -lrtl -l%HB_GT_LIB% -lrdd -lrtl -lvm -lmacro -lpp -ldbfntx -ldbfcdx -lcommon
if "%HB_COMPILER%" == "mingw32" gcc %1.c -o%1.exe -mno-cygwin -I..\include -L..\lib -ltools -ldebug -lvm -lrtl -l%HB_GT_LIB% -lrdd -lrtl -lvm -lmacro -lpp -ldbfntx -ldbfcdx -lcommon
if "%HB_COMPILER%" == "rsxnt" gcc %1.c -Zwin32 -I..\include -L..\lib -ltools -ldebug -lvm -lrtl -l%HB_GT_LIB% -lrdd -lrtl -lvm -lmacro -lpp -ldbfntx -ldbfcdx -lcommon
if "%HB_COMPILER%" == "msvc" cl -Fd..\bin\harbour -w -Zi -TP -GZ -GA -I..\include %1.c /link /subsystem:CONSOLE ..\lib\tools.lib ..\lib\debug.lib ..\lib\vm.lib ..\lib\rtl.lib ..\lib\%HB_GT_LIB%.lib ..\lib\rdd.lib ..\lib\macro.lib ..\lib\pp.lib ..\lib\dbfntx.lib ..\lib\dbfcdx.lib ..\lib\common.lib user32.lib
if "%HB_COMPILER%" == "msvc" echo Ignore LNK4033 warning
goto END

View File

@@ -49,20 +49,22 @@ rem if "%HB_GT_LIB%" == "" set HB_GT_LIB=
pause
echo HB_COMPILER:
echo - When HB_ARCHITECTURE=dos
echo - bcc16 (Borland C++ 3.x, 16-bit DOS)
echo - djgpp (GCC (DJGPP), 32-bit Windows)
echo - watcom
echo - bcc16 (Borland C++ 3.x, DOS 16-bit)
echo - djgpp (Delorie GNU C, DOS 32-bit)
echo - rxs32 (EMX/RSXNT/DOS GNU C, DOS 32-bit)
echo - watcom (Watcom C++ 9.x, 10.x, 11.x, DOS 32-bit)
echo - When HB_ARCHITECTURE=w32
echo - bcc32 (Borland C++ 4.x,5.x, 32-bit Windows)
echo - gcc (GCC (Cygnus), 32-bit Windows)
echo - mingw32 (GCC (Cygnus/MingW32), Windows 32 bit)
echo - icc
echo - msvc (Microsoft Visual C++, Windows 32 bit)
echo - bcc32 (Borland C++ 4.x, 5.x, Windows 32-bit)
echo - gcc (Cygnus/Cygwin GNU C, Windows 32-bit)
echo - mingw32 (Cygnus/Mingw32 GNU C, Windows 32-bit)
echo - rxsnt (EMX/RSXNT/Win32 GNU C, Windows 32-bit)
echo - icc (IBM Visual Age C++, Windows 32-bit)
echo - msvc (Microsoft Visual C++, Windows 32-bit)
echo - When HB_ARCHITECTURE=linux
echo - gcc
echo - gcc (GNU C, 32-bit)
echo - When HB_ARCHITECTURE=os2
echo - gcc (GCC (EMX), 32-bit OS/2)
echo - icc (ICC (IBM Visual Age C++ 3.0), 32-bit OS/2)
echo - gcc (EMX GNU C, OS/2 32-bit)
echo - icc (IBM Visual Age C++ 3.0, OS/2 32-bit)
echo.
pause
echo HB_GT_LIB:
@@ -107,6 +109,7 @@ rem if "%HB_GT_LIB%" == "" set HB_GT_LIB=
if "%HB_COMPILER%" == "bcc16" bcc -O2 -mh -I..\include -L..\lib %1.c tools.lib debug.lib vm.lib rtl.lib %HB_GT_LIB%.lib rdd.lib macro.lib pp.lib dbfntx.lib dbfcdx.lib common.lib
if "%HB_COMPILER%" == "djgpp" gcc %1.c -o%1.exe -I..\include -L..\lib -ltools -ldebug -lvm -lrtl -l%HB_GT_LIB% -lrdd -lrtl -lvm -lmacro -lpp -ldbfnt -ldbfcd -lcommo
if "%HB_COMPILER%" == "rsx32" gcc %1.c -Zrsx32 -I..\include -L..\lib -ltools -ldebug -lvm -lrtl -l%HB_GT_LIB% -lrdd -lrtl -lvm -lmacro -lpp -ldbfntx -ldbfcdx -lcommon
goto END
:A_W32
@@ -118,6 +121,7 @@ rem if "%HB_GT_LIB%" == "" set HB_GT_LIB=
if "%HB_COMPILER%" == "bcc32" bcc32 -O2 -I..\include -L..\lib %1.c tools.lib debug.lib vm.lib rtl.lib %HB_GT_LIB%.lib rdd.lib macro.lib pp.lib dbfntx.lib dbfcdx.lib common.lib
if "%HB_COMPILER%" == "gcc" gcc %1.c -o%1.exe -I..\include -L..\lib -ltools -ldebug -lvm -lrtl -l%HB_GT_LIB% -lrdd -lrtl -lvm -lmacro -lpp -ldbfntx -ldbfcdx -lcommon
if "%HB_COMPILER%" == "mingw32" gcc %1.c -o%1.exe -mno-cygwin -I..\include -L..\lib -ltools -ldebug -lvm -lrtl -l%HB_GT_LIB% -lrdd -lrtl -lvm -lmacro -lpp -ldbfntx -ldbfcdx -lcommon
if "%HB_COMPILER%" == "rsxnt" gcc %1.c -Zwin32 -I..\include -L..\lib -ltools -ldebug -lvm -lrtl -l%HB_GT_LIB% -lrdd -lrtl -lvm -lmacro -lpp -ldbfntx -ldbfcdx -lcommon
if "%HB_COMPILER%" == "msvc" cl -Fd..\bin\harbour -w -Zi -TP -GZ -GA -I..\include %1.c /link /subsystem:CONSOLE ..\lib\tools.lib ..\lib\debug.lib ..\lib\vm.lib ..\lib\rtl.lib ..\lib\%HB_GT_LIB%.lib ..\lib\rdd.lib ..\lib\macro.lib ..\lib\pp.lib ..\lib\dbfntx.lib ..\lib\dbfcdx.lib ..\lib\common.lib user32.lib
if "%HB_COMPILER%" == "msvc" echo Ignore LNK4033 warning
goto END

View File

@@ -49,20 +49,22 @@ if [ -z "$1" ] || [ -z "$HB_ARCHITECTURE" ] || [ -z "$HB_COMPILER" ]; then
read
echo " HB_COMPILER:"
echo " - When HB_ARCHITECTURE=dos"
echo " - bcc16 (Borland C++ 3.x, 16-bit DOS)"
echo " - djgpp (GCC (DJGPP), 32-bit Windows)"
echo " - watcom"
echo " - bcc16 (Borland C++ 3.x, DOS 16-bit)"
echo " - djgpp (Delorie GNU C, DOS 32-bit)"
echo " - rxs32 (EMX/RSXNT/DOS GNU C, DOS 32-bit)"
echo " - watcom (Watcom C++ 9.x, 10.x, 11.x, DOS 32-bit)"
echo " - When HB_ARCHITECTURE=w32"
echo " - bcc32 (Borland C++ 4.x,5.x, 32-bit Windows)"
echo " - gcc (GCC (Cygnus), 32-bit Windows)"
echo " - mingw32 (GCC (Cygnus/MingW32), Windows 32 bit)"
echo " - icc"
echo " - msvc (Microsoft Visual C++, Windows 32 bit)"
echo " - bcc32 (Borland C++ 4.x, 5.x, Windows 32-bit)"
echo " - gcc (Cygnus/Cygwin GNU C, Windows 32-bit)"
echo " - mingw32 (Cygnus/Mingw32 GNU C, Windows 32-bit)"
echo " - rxsnt (EMX/RSXNT/Win32 GNU C, Windows 32-bit)"
echo " - icc (IBM Visual Age C++, Windows 32-bit)"
echo " - msvc (Microsoft Visual C++, Windows 32-bit)"
echo " - When HB_ARCHITECTURE=linux"
echo " - gcc"
echo " - gcc (GNU C, 32-bit)"
echo " - When HB_ARCHITECTURE=os2"
echo " - gcc (GCC (EMX), 32-bit OS/2)"
echo " - icc (ICC (IBM Visual Age C++ 3.0), 32-bit OS/2)"
echo " - gcc (EMX GNU C, OS/2 32-bit)"
echo " - icc (IBM Visual Age C++ 3.0, OS/2 32-bit)"
echo
read
echo " HB_GT_LIB:"
@@ -87,6 +89,8 @@ else
bcc -O2 -mh -I..\include -L..\lib $1.c tools.lib debug.lib vm.lib rtl.lib $HB_GT_LIB.lib rdd.lib macro.lib pp.lib dbfntx.lib dbfcdx.lib common.lib
elif [ "$HB_COMPILER" == "djgpp" ]; then
gcc $1.c -o$1.exe -I..\include -L..\lib -ltools -ldebug -lvm -lrtl -l$HB_GT_LIB -lrdd -lrtl -lvm -lmacro -lpp -ldbfnt -ldbfcd -lcommo
elif [ "$HB_COMPILER" == "rsx32" ]; then
gcc $1.c -Zrsx32 -I..\include -L..\lib -ltools -ldebug -lvm -lrtl -l$HB_GT_LIB -lrdd -lrtl -lvm -lmacro -lpp -ldbfntx -ldbfcdx -lcommon
else
echo Error: HB_COMPILER value is unsupported.
fi
@@ -101,6 +105,8 @@ else
gcc $1.c -o$1.exe -I..\include -L..\lib -ltools -ldebug -lvm -lrtl -l$HB_GT_LIB -lrdd -lrtl -lvm -lmacro -lpp -ldbfntx -ldbfcdx -lcommon
elif [ "$HB_COMPILER" == "mingw32" ]; then
gcc $1.c -o$1.exe -mno-cygwin -I..\include -L..\lib -ltools -ldebug -lvm -lrtl -l$HB_GT_LIB -lrdd -lrtl -lvm -lmacro -lpp -ldbfntx -ldbfcdx -lcommon
elif [ "$HB_COMPILER" == "rsxnt" ]; then
gcc $1.c -Zwin32 -I..\include -L..\lib -ltools -ldebug -lvm -lrtl -l$HB_GT_LIB -lrdd -lrtl -lvm -lmacro -lpp -ldbfntx -ldbfcdx -lcommon
elif [ "$HB_COMPILER" == "msvc" ]; then
cl -Fd..\bin\harbour -w -Zi -TP -GZ -GA -I..\include $1.c /link /subsystem:CONSOLE ..\lib\tools.lib ..\lib\debug.lib ..\lib\vm.lib ..\lib\rtl.lib ..\lib\$HB_GT_LIB.lib ..\lib\rdd.lib ..\lib\macro.lib ..\lib\pp.lib ..\lib\dbfntx.lib ..\lib\dbfcdx.
echo Ignore LNK4033 warning

View File

@@ -24,7 +24,6 @@ LINKPATHS += $(foreach lib, $(LIBS), -L$(TOP)$(ROOT)source/$(lib)/$(ARCH))
else
LINKPATHS += -L$(HB_LIB_COMPILE)
endif
# LINKLIBS += -Wl,-(
LINKLIBS += $(foreach lib, $(LIBS), -l$(lib))
# If LIBS specifies the rdd library, add all DB drivers.
@@ -39,10 +38,7 @@ LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_LIB)/$(ARCH)
LINKLIBS += -l$(HB_GT_LIB)
endif
# LINKLIBS += -Wl,-)
LDFLAGS = $(LINKPATHS)
# Note: The empty line directly before 'endef' HAVE TO exist!
# NOTE: The empty line directly before 'endef' HAVE TO exist!
# It causes that every echo command will be separated by LF
define lib_object
echo ADDMOD $(file) >> __lib__.tmp
@@ -59,8 +55,23 @@ echo END >> __lib__.tmp
$(AR) -M < __lib__.tmp
endef
# NOTE: The empty line below HAVE TO exist!
define link_file
echo $(file) >> __link__.tmp
endef
define link_exe_file
echo $(LDFLAGS) $(LD_OUT)$@ > __link__.tmp
$(foreach file, $^, $(link_file))
echo $(LINKPATHS) $(LINKLIBS) >> __link__.tmp
-$(LD) @__link__.tmp
endef
AR = ar
ARFLAGS =
AR_RULE = $(create_library)
LD_RULE = $(link_exe_file)
include $(TOP)$(ROOT)config/rules.cf

View File

@@ -30,7 +30,19 @@ else
ifeq ($(HB_COMPILER),bcc16)
#Use standard dos path, which is already set up.
else
COMSPEC := $(subst \,/,$(COMSPEC))
ifeq ($(HB_COMPILER),rsx32)
#Use standard dos path, which is already set up.
else
ifeq ($(HB_COMPILER),watcom)
#Use standard dos path, which is already set up.
else
ifeq ($(HB_COMPILER),djgpp)
#Use standard dos path, which is already set up.
else
COMSPEC := $(subst \,/,$(COMSPEC))
endif
endif
endif
endif
endif

View File

@@ -0,0 +1,69 @@
#
# $Id$
#
# GNU Make file for RSXNT for DOS target
include $(TOP)$(ROOT)config/$(HB_ARCHITECTURE)/global.cf
OBJ_EXT = .o
EXE_EXT = .exe
LIB_PREF =
LIB_EXT = .a
CC = gcc
CC_IN = -c
CC_OUT = -o
CPPFLAGS = -I. -I$(HB_INC_COMPILE) -Zrsx32
CFLAGS = -Wall
LD = gcc
LDFLAGS = -Zrsx32
# Note the space after -o
LD_OUT = -o
# Add all libraries specified in LIBS.
ifeq ($(HB_LIB_COMPILE),)
LINKPATHS += $(foreach lib, $(LIBS), -L$(TOP)$(ROOT)source/$(lib)/$(ARCH))
else
LINKPATHS += -L$(HB_LIB_COMPILE)
endif
# The -( option could be appropriate to link against libraries with
# cyclic dependencies, but I think it is not really necessary if the
# libraries are kept in proper order.
# LINKLIBS += -Wl,-(
LINKLIBS += $(foreach lib, $(LIBS), -l$(lib))
# If LIBS specifies the rdd library, add all DB drivers.
ifeq ($(findstring rdd,$(LIBS)),rdd)
LINKPATHS += $(foreach drv, $(HB_DB_DRIVERS), -L$(TOP)$(ROOT)source/rdd/$(drv)/$(ARCH))
LINKLIBS += $(foreach drv, $(HB_DB_DRIVERS), -l$(drv))
endif
# Add the specified GT driver library
ifeq ($(findstring rtl,$(LIBS)),rtl)
LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_LIB)/$(ARCH)
LINKLIBS += -l$(HB_GT_LIB)
endif
# HB_SCREEN_LIB: empty, or one of ncurses, slang
# HB_SCREEN_LIB=ncurses
# HB_SCREEN_LIB=slang
ifneq ($(HB_SCREEN_LIB),)
LINKLIBS += -l$(HB_SCREEN_LIB)
endif
# The -) option could be appropriate to link against libraries with
# cyclic dependencies, but I think it is not really necessary if the
# libraries are kept in proper order.
# LINKLIBS += -Wl,-)
LDFLAGS += $(LINKPATHS)
AR = ar
ARFLAGS =
AR_RULE = $(AR) $(ARFLAGS) r $@ $^ || $(RM) $@
include $(TOP)$(ROOT)config/rules.cf

View File

@@ -12,10 +12,11 @@ LIB_EXT = .a
CC = gcc
CC_IN = -c
CC_OUT = -o
CPPFLAGS = -I. -I$(HB_INC_COMPILE) -DHARBOUR_GCC_OS2
CPPFLAGS = -I. -I$(HB_INC_COMPILE)
CFLAGS = -Wall
LD = gcc
LDFLAGS =
LD_OUT = -o $(SPACE)
# Add all libraries specified in LIBS.
@@ -40,7 +41,7 @@ LINKLIBS += -l$(HB_GT_LIB)
endif
#LINKLIBS += -Wl,-)
LDFLAGS = $(LINKPATHS)
LDFLAGS += $(LINKPATHS)
# Note: The empty line directly before 'endef' HAVE TO exist!
# It causes that every echo command will be separated by LF

View File

@@ -0,0 +1,72 @@
#
# $Id$
#
include $(TOP)$(ROOT)config/$(HB_ARCHITECTURE)/global.cf
OBJ_EXT = .o
EXE_EXT = .exe
LIB_PREF =
LIB_EXT = .a
CC = gcc
CC_IN = -c
CC_OUT = -o
CPPFLAGS = -I. -I$(HB_INC_COMPILE) -Zwin32
CFLAGS = -Wall
LD = gcc
LDFLAGS = -Zwin32
# Note the space after -o
LD_OUT = -o
# Add all libraries specified in LIBS.
ifeq ($(HB_LIB_COMPILE),)
LINKPATHS += $(foreach lib, $(LIBS), -L$(TOP)$(ROOT)source/$(lib)/$(ARCH))
else
LINKPATHS += -L$(HB_LIB_COMPILE)
endif
# The -( option could be appropriate to link against libraries with
# cyclic dependencies, but I think it is not really necessary if the
# libraries are kept in proper order.
# LINKLIBS += -Wl,-(
LINKLIBS += $(foreach lib, $(LIBS), -l$(lib))
# This library is needed for CharToOemBuff() and OemToCharBuff() support.
# it's automatically added by RSXNT
#LINKLIBS += -luser32
# If LIBS specifies the rdd library, add all DB drivers.
ifeq ($(findstring rdd,$(LIBS)),rdd)
LINKPATHS += $(foreach drv, $(HB_DB_DRIVERS), -L$(TOP)$(ROOT)source/rdd/$(drv)/$(ARCH))
LINKLIBS += $(foreach drv, $(HB_DB_DRIVERS), -l$(drv))
endif
# Add the specified GT driver library
ifeq ($(findstring rtl,$(LIBS)),rtl)
LINKPATHS += -L$(TOP)$(ROOT)source/rtl/$(HB_GT_LIB)/$(ARCH)
LINKLIBS += -l$(HB_GT_LIB)
endif
# HB_SCREEN_LIB: empty, or one of ncurses, slang
# HB_SCREEN_LIB=ncurses
# HB_SCREEN_LIB=slang
ifneq ($(HB_SCREEN_LIB),)
LINKLIBS += -l$(HB_SCREEN_LIB)
endif
# The -) option could be appropriate to link against libraries with
# cyclic dependencies, but I think it is not really necessary if the
# libraries are kept in proper order.
# LINKLIBS += -Wl,-)
LDFLAGS += $(LINKPATHS)
AR = ar
ARFLAGS =
AR_RULE = $(AR) $(ARFLAGS) r $@ $^ || $(RM) $@
include $(TOP)$(ROOT)config/rules.cf

View File

@@ -274,6 +274,7 @@ extern void hb_ret( void ); /* post a NIL return value */
extern void hb_retc( char * szText ); /* returns a string */
extern void hb_retclen( char * szText, ULONG ulLen ); /* returns a string with a specific length */
extern void hb_retds( char * szDate ); /* returns a date, must use yyyymmdd format */
extern void hb_retd( long lDay, long lMonth, long lYear ); /* returns a date */
extern void hb_retl( int iTrueFalse ); /* returns a logical integer */
extern void hb_retnd( double dNumber ); /* returns a double */
extern void hb_retni( int iNumber ); /* returns a integer number */

View File

@@ -47,14 +47,15 @@
/* Include windows.h if applicable and requested */
#if defined(HB_OS_WIN_32_USED) && defined(HB_OS_WIN_32)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#if defined(__GNUC__)
#define HB_DONT_DEFINE_BASIC_TYPES
#endif
#endif
#if defined(__IBMCPP__) || defined(HARBOUR_GCC_OS2)
#elif defined(HB_OS_OS2)
/* With the exception of WORD, the IBM Visual Age C++ compiler has
its own definitions of the Harbour types most of which conflict with the
Harbour #undefs, due to typedef being the prevalent method of
@@ -76,7 +77,23 @@
#undef INT
#undef UINT
#define HB_DONT_DEFINE_BASIC_TYPES
#endif /* __IBMCPP__ */
#elif defined(HB_OS_DOS)
#include <dos.h>
#if defined(__WATCOMC__)
#include <i86.h>
#endif
#if defined(__WATCOMC__) && defined(__386__) && !defined(__WINDOWS_386__)
#define HB_DOS_INT86 int386
#elif defined(__RSX32__)
#define HB_DOS_INT86 _int86
#else
#define HB_DOS_INT86 int86
#endif
#endif
#if ! defined(HB_DONT_DEFINE_BASIC_TYPES)

View File

@@ -95,13 +95,6 @@
*/
#define HB_FM_STATISTICS
/* ***********************************************************************
* This symbol defines if we are trying to compile using GCC for OS/2
*
* By default it is disabled (symbol is not defined)
*/
/*#define HARBOUR_GCC_OS2*/
/* ***********************************************************************
* This symbol defines which national language module should be included
* in the Harbour run time library. See source/rtl/msgxxx for all allowed
@@ -163,12 +156,18 @@
*/
#endif
/* Detect GCC/OS2 */
#if defined(__EMX__) && ! defined(__RSXNT__)
#define HARBOUR_GCC_OS2
#endif
/* ***********************************************************************
* Operating system specific definitions
*/
#if defined(__GNUC__)
/* The GNU C compiler is used */
#if defined(__DJGPP__) || defined(HARBOUR_GCC_OS2) || defined(_Windows) || defined(_WIN32)
#if defined(__DJGPP__) || defined(__EMX__) || defined(_Windows) || defined(_WIN32)
/* The DJGPP port of GNU C is used - for DOS platform */
#define OS_DOS_COMPATIBLE
#define OS_PATH_LIST_SEPARATOR ';'
@@ -202,7 +201,7 @@
*/
#ifndef HB_OS_DOS
#if defined(DOS) || defined(_QC) || defined(__DOS__) || defined(MSDOS) || defined(__MSDOS__)
#if defined(DOS) || defined(_QC) || defined(__DOS__) || defined(MSDOS) || defined(__MSDOS__) || defined(__RSX32__)
#define HB_OS_DOS
#if defined(__386__)
#define HB_OS_DOS_32
@@ -222,7 +221,7 @@
#endif
#ifndef HB_OS_WIN_32
#if defined(WINNT) || defined(_Windows) || defined(__NT__) || defined(_WIN32) || defined(_WINDOWS_) || defined(__WINDOWS_386__)
#if defined(WINNT) || defined(_Windows) || defined(__NT__) || defined(_WIN32) || defined(_WINDOWS_) || defined(__WINDOWS_386__) || defined(__WIN32__)
#define HB_OS_WIN_32
#endif
#endif

View File

@@ -61,20 +61,22 @@ set HB_INC_INSTALL=include\
pause
echo HB_COMPILER:
echo - When HB_ARCHITECTURE=dos
echo - bcc16 (Borland C++ 3.x, 16-bit DOS)
echo - djgpp (GCC (DJGPP), 32-bit Windows)
echo - watcom
echo - bcc16 (Borland C++ 3.x, DOS 16-bit)
echo - djgpp (Delorie GNU C, DOS 32-bit)
echo - rxs32 (EMX/RSXNT/DOS GNU C, DOS 32-bit)
echo - watcom (Watcom C++ 9.x, 10.x, 11.x, DOS 32-bit)
echo - When HB_ARCHITECTURE=w32
echo - bcc32 (Borland C++ 4.x,5.x, 32-bit Windows)
echo - gcc (GCC (Cygnus), 32-bit Windows)
echo - mingw32 (GCC (Cygnus/MingW32), Windows 32 bit)
echo - icc
echo - msvc (Microsoft Visual C++, Windows 32 bit)
echo - bcc32 (Borland C++ 4.x, 5.x, Windows 32-bit)
echo - gcc (Cygnus/Cygwin GNU C, Windows 32-bit)
echo - mingw32 (Cygnus/Mingw32 GNU C, Windows 32-bit)
echo - rxsnt (EMX/RSXNT/Win32 GNU C, Windows 32-bit)
echo - icc (IBM Visual Age C++, Windows 32-bit)
echo - msvc (Microsoft Visual C++, Windows 32-bit)
echo - When HB_ARCHITECTURE=linux
echo - gcc
echo - gcc (GNU C, 32-bit)
echo - When HB_ARCHITECTURE=os2
echo - gcc (GCC (EMX), 32-bit OS/2)
echo - icc (ICC (IBM Visual Age C++ 3.0), 32-bit OS/2)
echo - gcc (EMX GNU C, OS/2 32-bit)
echo - icc (IBM Visual Age C++ 3.0, OS/2 32-bit)
echo.
pause
echo HB_GT_LIB:

View File

@@ -61,20 +61,22 @@ set HB_INC_INSTALL=include\
pause
echo HB_COMPILER:
echo - When HB_ARCHITECTURE=dos
echo - bcc16 (Borland C++ 3.x, 16-bit DOS)
echo - djgpp (GCC (DJGPP), 32-bit Windows)
echo - watcom
echo - bcc16 (Borland C++ 3.x, DOS 16-bit)
echo - djgpp (Delorie GNU C, DOS 32-bit)
echo - rxs32 (EMX/RSXNT/DOS GNU C, DOS 32-bit)
echo - watcom (Watcom C++ 9.x, 10.x, 11.x, DOS 32-bit)
echo - When HB_ARCHITECTURE=w32
echo - bcc32 (Borland C++ 4.x,5.x, 32-bit Windows)
echo - gcc (GCC (Cygnus), 32-bit Windows)
echo - mingw32 (GCC (Cygnus/MingW32), Windows 32 bit)
echo - icc
echo - msvc (Microsoft Visual C++, Windows 32 bit)
echo - bcc32 (Borland C++ 4.x, 5.x, Windows 32-bit)
echo - gcc (Cygnus/Cygwin GNU C, Windows 32-bit)
echo - mingw32 (Cygnus/Mingw32 GNU C, Windows 32-bit)
echo - rxsnt (EMX/RSXNT/Win32 GNU C, Windows 32-bit)
echo - icc (IBM Visual Age C++, Windows 32-bit)
echo - msvc (Microsoft Visual C++, Windows 32-bit)
echo - When HB_ARCHITECTURE=linux
echo - gcc
echo - gcc (GNU C, 32-bit)
echo - When HB_ARCHITECTURE=os2
echo - gcc (GCC (EMX), 32-bit OS/2)
echo - icc (ICC (IBM Visual Age C++ 3.0), 32-bit OS/2)
echo - gcc (EMX GNU C, OS/2 32-bit)
echo - icc (IBM Visual Age C++ 3.0, OS/2 32-bit)
echo.
pause
echo HB_GT_LIB:

View File

@@ -61,20 +61,22 @@ if [ -z "$HB_ARCHITECTURE" ] || [ -z "$HB_COMPILER" ]; then
read
echo " HB_COMPILER:"
echo " - When HB_ARCHITECTURE=dos"
echo " - bcc16 (Borland C++ 3.x, 16-bit DOS)"
echo " - djgpp (GCC (DJGPP), 32-bit Windows)"
echo " - watcom"
echo " - bcc16 (Borland C++ 3.x, DOS 16-bit)"
echo " - djgpp (Delorie GNU C, DOS 32-bit)"
echo " - rxs32 (EMX/RSXNT/DOS GNU C, DOS 32-bit)"
echo " - watcom (Watcom C++ 9.x, 10.x, 11.x, DOS 32-bit)"
echo " - When HB_ARCHITECTURE=w32"
echo " - bcc32 (Borland C++ 4.x,5.x, 32-bit Windows)"
echo " - gcc (GCC (Cygnus), 32-bit Windows)"
echo " - mingw32 (GCC (Cygnus/MingW32), Windows 32 bit)"
echo " - icc"
echo " - msvc (Microsoft Visual C++, Windows 32 bit)"
echo " - bcc32 (Borland C++ 4.x, 5.x, Windows 32-bit)"
echo " - gcc (Cygnus/Cygwin GNU C, Windows 32-bit)"
echo " - mingw32 (Cygnus/Mingw32 GNU C, Windows 32-bit)"
echo " - rxsnt (EMX/RSXNT/Win32 GNU C, Windows 32-bit)"
echo " - icc (IBM Visual Age C++, Windows 32-bit)"
echo " - msvc (Microsoft Visual C++, Windows 32-bit)"
echo " - When HB_ARCHITECTURE=linux"
echo " - gcc"
echo " - gcc (GNU C, 32-bit)"
echo " - When HB_ARCHITECTURE=os2"
echo " - gcc (GCC (EMX), 32-bit OS/2)"
echo " - icc (ICC (IBM Visual Age C++ 3.0), 32-bit OS/2)"
echo " - gcc (EMX GNU C, OS/2 32-bit)"
echo " - icc (IBM Visual Age C++ 3.0, OS/2 32-bit)"
echo
read
echo " HB_GT_LIB:"

File diff suppressed because it is too large Load Diff

View File

@@ -66,30 +66,19 @@
#include "hbver.h"
#if defined(HB_OS_WIN_32)
#include <ctype.h>
#if ! defined(VER_PLATFORM_WIN32_WINDOWS)
#ifndef VER_PLATFORM_WIN32_WINDOWS
#define VER_PLATFORM_WIN32_WINDOWS 1
#endif
#if ! defined(VER_PLATFORM_WIN32_CE)
#ifndef VER_PLATFORM_WIN32_CE
#define VER_PLATFORM_WIN32_CE 3
#endif
#endif
#if defined(HB_OS_DOS)
#include <dos.h>
#if defined(__WATCOMC__)
#include <i86.h>
#endif
#elif defined(HB_OS_UNIX)
#if defined(__WATCOMC__) && defined(__386__) && !defined(__WINDOWS_386__)
#define INT_86 int386
#else
#define INT_86 int86
#endif
#endif
#if defined(HB_OS_UNIX)
#include <sys/utsname.h>
#endif
/* NOTE: OS() function, as a primary goal will detect the version number
@@ -115,19 +104,15 @@ char * hb_verPlatform( void )
union REGS regs;
regs.h.ah = 0x30;
INT_86( 0x21, &regs, &regs );
HB_DOS_INT86( 0x21, &regs, &regs );
sprintf( pszPlatform, "DOS %d.%02d", regs.h.al, regs.h.ah );
/* Host OS detection: Windows 2.x, 3.x, 95/98 */
{
#if defined(__BORLANDC__) || defined(_MSC_VER)
regs.x.ax = 0x1600;
#else
regs.w.ax = 0x1600;
#endif
INT_86( 0x2F, &regs, &regs );
regs.x.ax = 0x1600;
HB_DOS_INT86( 0x2F, &regs, &regs );
if( regs.h.al != 0x00 && regs.h.al != 0x80 )
{
@@ -145,26 +130,18 @@ char * hb_verPlatform( void )
/* Host OS detection: Windows NT/2000 */
{
#if defined(__BORLANDC__) || defined(_MSC_VER)
regs.x.ax = 0x3306;
#else
regs.w.ax = 0x3306;
#endif
INT_86( 0x21, &regs, &regs );
regs.x.ax = 0x3306;
HB_DOS_INT86( 0x21, &regs, &regs );
#if defined(__BORLANDC__) || defined(_MSC_VER)
if( regs.x.bx == 0x3205 )
#else
if( regs.w.bx == 0x3205 )
#endif
strcat( pszPlatform, " (Windows NT/2000)" );
if( regs.x.bx == 0x3205 )
strcat( pszPlatform, " (Windows NT/2000)" );
}
/* Host OS detection: OS/2 */
{
regs.h.ah = 0x30;
INT_86( 0x21, &regs, &regs );
HB_DOS_INT86( 0x21, &regs, &regs );
if( regs.h.al >= 10 )
{
@@ -235,11 +212,11 @@ char * hb_verPlatform( void )
break;
}
sprintf( pszPlatform, "%s %d.%02d.%04d",
sprintf( pszPlatform, "%s %lu.%02lu.%04d",
pszName,
osVer.dwMajorVersion,
osVer.dwMinorVersion,
LOWORD( osVer.dwBuildNumber ) );
( ULONG ) osVer.dwMajorVersion,
( ULONG ) osVer.dwMinorVersion,
( USHORT ) LOWORD( osVer.dwBuildNumber ) );
/* Add service pack/other info */
@@ -248,7 +225,7 @@ char * hb_verPlatform( void )
int i;
/* Skip the leading spaces (Win95B, Win98) */
for( i = 0; osVer.szCSDVersion[ i ] != '\0' && isspace( osVer.szCSDVersion[ i ] ); i++ );
for( i = 0; osVer.szCSDVersion[ i ] != '\0' && isspace( ( int ) osVer.szCSDVersion[ i ] ); i++ );
if( osVer.szCSDVersion[ i ] != '\0' )
{
@@ -363,15 +340,19 @@ char * hb_verCompiler( void )
#elif defined(__GNUC__)
#if defined(__DJGPP__)
pszName = "Delorie GCC";
pszName = "Delorie GNU C";
#elif defined(__CYGWIN__)
pszName = "Cygnus Cygwin GCC";
pszName = "Cygnus Cygwin GNU C";
#elif defined(__MINGW32__)
pszName = "Cygnus Mingw32 GCC";
pszName = "Cygnus Mingw32 GNU C";
#elif defined(__RSX32__)
pszName = "EMX/RSXNT/DOS GNU C";
#elif defined(__RSXNT__)
pszName = "EMX/RSXNT/Win32 GNU C";
#elif defined(__EMX__)
pszName = "EMX GCC";
pszName = "EMX GNU C";
#else
pszName = "GCC";
pszName = "GNU C";
#endif
iVerMajor = __GNUC__;
@@ -386,10 +367,20 @@ char * hb_verCompiler( void )
#endif
if( pszName )
sprintf( pszCompiler, "%s %d.%d", pszName, iVerMajor, iVerMinor );
sprintf( pszCompiler, "%s %hd.%hd", pszName, iVerMajor, iVerMinor );
else
strcpy( pszCompiler, "(unknown)" );
#if defined(__DJGPP__)
{
char szSub[ 32 ];
sprintf( szSub, " (DJGPP %i.%02i)", ( int ) __DJGPP__, ( int ) __DJGPP_MINOR__ );
strcat( pszCompiler, szSub );
}
#endif
return pszCompiler;
}

View File

@@ -121,7 +121,7 @@ static void DebugPragma( char *, int, BOOL );
static BOOL s_bTracePragma = FALSE;
#define ISNAME( c ) ( isalnum( c ) || ( c ) == '_' || ( c ) > 0x7E )
#define ISNAME( c ) ( isalnum( ( int ) c ) || ( c ) == '_' || ( c ) > 0x7E )
#define MAX_NAME 255
#define MAX_EXP 1024
#define PATTERN_SIZE 2048

View File

@@ -69,9 +69,6 @@
#else
#include <sys\timeb.h>
#endif
#if defined(__TURBOC__) || defined(__BORLANDC__) || defined(__DJGPP__)
#include <dos.h>
#endif
HB_FUNC( CTOD )
{

View File

@@ -33,17 +33,6 @@
*
*/
/*
* The following parts are Copyright of the individual authors.
* www - http://www.harbour-project.org
*
* Copyright 1999 Luiz Rafael Culik <culik@sl.conex.net>
* Parts of DOS support
*
* See doc/license.txt for licensing terms.
*
*/
/* NOTE: DISKSPACE() supports larger disks than 2GB. CA-Cl*pper will always
return a (long) value, Harbour may return a (double) for large
values, the decimal places are always set to zero, though. */
@@ -54,10 +43,6 @@
#include "hbapierr.h"
#include "hbapifs.h"
#if defined(HB_OS_DOS) || defined(__WATCOMC__)
#include <dos.h>
#endif
#if defined(HB_OS_OS2)
#define INCL_BASE
#define INCL_DOSERRORS
@@ -76,49 +61,59 @@ HB_FUNC( DISKSPACE )
if( uiType > HB_DISK_TOTAL )
uiType = HB_DISK_TOTAL;
#if defined(HB_OS_DOS) || defined(__WATCOMC__)
#if defined(HB_OS_DOS)
{
struct diskfree_t disk;
unsigned uiResult;
while( ( uiResult = _dos_getdiskfree( uiDrive, &disk ) ) != 0 )
while( TRUE )
{
USHORT uiAction = hb_errRT_BASE_Ext1( EG_OPEN, 2018, NULL, NULL, 0, EF_CANDEFAULT );
/* NOTE: Under 'Standard' behaviour, this error does not allow 'retry'
but if you should wish to make it so, then or EF_CANRETRY with
EF_CANDEFAULT above)
*/
if( uiAction != E_RETRY )
break;
}
if( uiResult != 0 )
{
switch( uiType )
union REGS regs;
regs.x.dx = uiDrive;
regs.h.ah = 0x36;
HB_DOS_INT86( 0x21, &regs, &regs );
if( regs.x.ax != 0xFFFF )
{
case HB_DISK_AVAIL:
case HB_DISK_FREE:
dSpace = ( double ) disk.avail_clusters *
( double ) disk.sectors_per_cluster *
( double ) disk.bytes_per_sector;
break;
case HB_DISK_USED:
case HB_DISK_TOTAL:
dSpace = ( double ) disk.total_clusters *
( double ) disk.sectors_per_cluster *
( double ) disk.bytes_per_sector;
if( uiType == HB_DISK_USED )
dSpace -= ( double ) disk.avail_clusters *
( double ) disk.sectors_per_cluster *
( double ) disk.bytes_per_sector;
break;
USHORT uiClusterTotal = regs.x.dx;
USHORT uiClusterFree = regs.x.bx;
USHORT uiSecPerCluster = regs.x.ax;
USHORT uiSectorSize = regs.x.cx;
switch( uiType )
{
case HB_DISK_AVAIL:
case HB_DISK_FREE:
dSpace = ( double ) uiClusterFree *
( double ) uiSecPerCluster *
( double ) uiSectorSize;
break;
case HB_DISK_USED:
case HB_DISK_TOTAL:
dSpace = ( double ) uiClusterTotal *
( double ) uiSecPerCluster *
( double ) uiSectorSize;
if( uiType == HB_DISK_USED )
dSpace -= ( double ) uiClusterFree *
( double ) uiSecPerCluster *
( double ) uiSectorSize;
break;
}
}
else
{
USHORT uiAction = hb_errRT_BASE_Ext1( EG_OPEN, 2018, NULL, NULL, 0, EF_CANDEFAULT );
/* NOTE: Under 'Standard' behaviour, this error does not allow 'retry'
but if you should wish to make it so, then or EF_CANRETRY
with EF_CANDEFAULT above)
*/
if( uiAction == E_RETRY )
continue;
}
break;
}
}
@@ -184,7 +179,7 @@ HB_FUNC( DISKSPACE )
memcpy( &i64RetVal, &i64TotalBytes, sizeof( ULARGE_INTEGER ) );
}
#if defined(__GNUC__) || defined(_MSC_VER)
#if (defined(__GNUC__) || defined(_MSC_VER)) && !defined(__RSXNT__)
dSpace = ( double ) i64RetVal.LowPart +
( double ) i64RetVal.HighPart +
@@ -286,7 +281,7 @@ HB_FUNC( DISKSPACE )
USHORT rc;
/* Query level 1 info from filesystem */
while( ( rc = DosQueryFSInfo( uiDrive, 1, &fsa, sizeof( fsa )) ) != 0 )
while( ( rc = DosQueryFSInfo( uiDrive, 1, &fsa, sizeof( fsa ) ) ) != 0 )
{
USHORT uiAction = hb_errRT_BASE_Ext1( EG_OPEN, 2018, NULL, NULL, 0, EF_CANDEFAULT );

View File

@@ -852,39 +852,39 @@ BOOL hb_fsLock ( FHANDLE hFileHandle, ULONG ulStart,
s_uiErrorLast = errno;
#elif defined(HB_OS_OS2)
{
/* 08/04/2000 - maurilio.longo@libero.it */
struct _FILELOCK fl, ful;
{
/* 08/04/2000 - maurilio.longo@libero.it */
struct _FILELOCK fl, ful;
errno = 0;
switch(uiMode) {
case FL_LOCK:
fl.lOffset = ulStart;
fl.lRange = ulLength;
ful.lOffset = 0;
ful.lRange = 0;
/* lock region, 2 seconds timeout, exclusive access - no atomic */
iResult = (int) DosSetFileLocks(hFileHandle, &ful, &fl, 2000L, 0L);
break;
switch(uiMode) {
case FL_LOCK:
case FL_UNLOCK:
fl.lOffset = 0;
fl.lRange = 0;
ful.lOffset = ulStart;
ful.lRange = ulLength;
/* unlock region, 2 seconds timeout, exclusive access - no atomic */
iResult = (int) DosSetFileLocks(hFileHandle, &ful, &fl, 2000L, 0L);
break;
fl.lOffset = ulStart;
fl.lRange = ulLength;
ful.lOffset = 0;
ful.lRange = 0;
default:
iResult = 0;
}
/* lock region, 2 seconds timeout, exclusive access - no atomic */
iResult = (int) DosSetFileLocks(hFileHandle, &ful, &fl, 2000L, 0L);
break;
case FL_UNLOCK:
fl.lOffset = 0;
fl.lRange = 0;
ful.lOffset = ulStart;
ful.lRange = ulLength;
/* unlock region, 2 seconds timeout, exclusive access - no atomic */
iResult = (int) DosSetFileLocks(hFileHandle, &ful, &fl, 2000L, 0L);
break;
default:
iResult = 0;
}
s_uiErrorLast = errno;
}
@@ -965,12 +965,12 @@ void hb_fsCommit( FHANDLE hFileHandle )
}
#elif defined(HB_OS_OS2)
{
{
errno = 0;
/* 08/04/2000 - maurilio.longo@libero.it
TODO: what about error code from DosResetBuffer() call? */
/* 08/04/2000 - maurilio.longo@libero.it
TODO: what about error code from DosResetBuffer() call? */
DosResetBuffer(hFileHandle);
s_uiErrorLast = errno;
@@ -1334,6 +1334,9 @@ FHANDLE hb_fsExtOpen( BYTE * pFilename, BYTE * pDefExt,
return s_uiErrorLast;
}
/* TOFIX: CA-Cl*pper will allow wildcards in the filename. This should be
added to Harbour. [vszakats] */
BOOL hb_fsFile( BYTE * pFilename )
{
BOOL bIsFile;

View File

@@ -61,7 +61,6 @@
#include "inkey.ch"
#include <string.h>
#include <dos.h>
#include <time.h>
#include <conio.h>
@@ -69,33 +68,14 @@
#include <pc.h>
#include <sys\exceptn.h>
#include <sys\farptr.h>
#elif defined(__WATCOMC__)
#include <i86.h>
#elif defined(_MSC_VER)
#include <signal.h>
#endif
#if defined(__WATCOMC__)
#if defined(__386__) && !defined(__WINDOWS_386__)
#define INT_86 int386
#define DOS_REGS REGS
#else
#define INT_86 int86
#define DOS_REGS REGS
#endif
#elif defined(_MSC_VER)
#define INT_86 _int86
#define DOS_REGS _REGS
#else
#define INT_86 int86
#define DOS_REGS REGS
#endif
/* For screen support */
#if defined(__POWERC) || (defined(__TURBOC__) && !defined(__BORLANDC__)) || \
(defined(__ZTC__) && !defined(__SC__))
#if defined(__POWERC) || (defined(__TURBOC__) && !defined(__BORLANDC__)) || (defined(__ZTC__) && !defined(__SC__))
#define FAR far
#elif defined(HB_OS_DOS) && !defined(__DJGPP__)
#elif defined(HB_OS_DOS) && !defined(__DJGPP__) && !defined(__RSX32__)
#define FAR _far
#else
#define FAR
@@ -121,7 +101,7 @@ static void hb_gt_GetCursorSize( char * start, char * end );
#endif
#include <signal.h>
#endif
#ifndef __DJGPP__
#if !defined(__DJGPP__)
static char FAR * scrnPtr;
static char FAR * scrnStealth = NULL;
static char FAR * hb_gt_ScreenAddress( void );
@@ -130,7 +110,21 @@ static void hb_gt_GetCursorSize( char * start, char * end );
static BOOL s_bBreak; /* Used to signal Ctrl+Break to hb_inkeyPoll() */
static USHORT s_uiDispCount;
#ifndef __DJGPP__
#if defined(__RSX32__)
static int kbhit( void )
{
union REGS regs;
regs.h.ah = 0x0B;
HB_DOS_INT86( 0x21, &regs, &regs );
return regs.x.ax;
}
#endif
#if !defined(__DJGPP__) && !defined(__RSX32__)
#if defined(__WATCOMC__) || defined(_MSC_VER)
static void hb_gt_CtrlBreak_Handler( int iSignal )
{
@@ -155,10 +149,10 @@ static void hb_gt_CtrlBrkRestore( void )
{
HB_TRACE(HB_TR_DEBUG, ("hb_gt_CtrlBrkRestore()"));
#if defined(__WATCOMC__)
signal( SIGBREAK, SIG_DFL);
signal( SIGBREAK, SIG_DFL );
#elif defined(_MSC_VER)
signal( SIGINT, SIG_DFL);
#else
signal( SIGINT, SIG_DFL );
#elif !defined(__RSX32__)
setcbrk( s_iOldCtrlBreak );
#endif
}
@@ -175,28 +169,41 @@ void hb_gt_Init( int iFilenoStdin, int iFilenoStdout, int iFilenoStderr )
s_bBreak = FALSE;
s_uiDispCount = 0;
/* Set the Ctrl+Break handler [vszakats] */
#if defined(__DJGPP__)
gppconio_init();
__djgpp_hwint_flags |= 2; /* Count Ctrl+Break instead of killing program */
__djgpp_set_ctrl_c( 0 ); /* Disable Ctrl+C */
__djgpp_set_sigquit_key( 0 ); /* Disable Ctrl+\ */
#else
/* Set the Ctrl+Break handler [vszakats] */
#elif defined(__WATCOMC__)
#if defined(__WATCOMC__)
signal( SIGBREAK, hb_gt_CtrlBreak_Handler );
#elif defined(_MSC_VER)
signal( SIGINT, hb_gt_CtrlBreak_Handler );
#else
ctrlbrk( hb_gt_CtrlBrkHandler );
s_iOldCtrlBreak = getcbrk();
setcbrk( 1 );
#endif
signal( SIGBREAK, hb_gt_CtrlBreak_Handler );
atexit( hb_gt_CtrlBrkRestore );
#elif defined(_MSC_VER)
signal( SIGINT, hb_gt_CtrlBreak_Handler );
atexit( hb_gt_CtrlBrkRestore );
#elif defined(__RSX32__)
/* TODO */
#else
ctrlbrk( hb_gt_CtrlBrkHandler );
s_iOldCtrlBreak = getcbrk();
setcbrk( 1 );
atexit( hb_gt_CtrlBrkRestore );
#endif
/* */
#if !defined(__DJGPP__)
scrnStealth = ( char * ) -1;
scrnPtr = hb_gt_ScreenAddress();
#endif
@@ -206,7 +213,7 @@ void hb_gt_Done( void )
{
HB_TRACE(HB_TR_DEBUG, ("hb_gt_Done()"));
#ifndef __DJGPP__
#if !defined(__DJGPP__)
if( scrnStealth != ( char * ) -1 )
hb_xfree( scrnStealth );
#endif
@@ -381,31 +388,18 @@ int hb_gt_ReadKey( HB_inkey_enum eventmask )
BOOL hb_gt_AdjustPos( BYTE * pStr, ULONG ulLen )
{
union REGS regs;
HB_TRACE(HB_TR_DEBUG, ("hb_gt_AdjustPos(%s, %lu)", pStr, ulLen ));
HB_SYMBOL_UNUSED( pStr );
HB_SYMBOL_UNUSED( ulLen );
#if defined(__TURBOC__)
{
_AH = 0x03;
_BH = 0;
geninterrupt( 0x10 );
hb_gtSetPos( _DH, _DL );
}
#else
{
union REGS regs;
regs.h.ah = 0x03;
regs.h.bh = 0;
#if defined(__WATCOMC__) && defined(__386__)
int386( 0x10, &regs, &regs );
#else
int86( 0x10, &regs, &regs );
#endif
hb_gtSetPos( regs.h.dh, regs.h.dl );
}
#endif
regs.h.ah = 0x03;
regs.h.bh = 0;
HB_DOS_INT86( 0x10, &regs, &regs );
hb_gtSetPos( regs.h.dh, regs.h.dl );
return TRUE;
}
@@ -417,7 +411,7 @@ BOOL hb_gt_IsColor( void )
return hb_gt_GetScreenMode() != 7;
}
#ifndef __DJGPP__
#if !defined(__DJGPP__)
static char FAR * hb_gt_ScreenAddress()
{
char FAR * ptr;
@@ -426,29 +420,21 @@ static char FAR * hb_gt_ScreenAddress()
#if defined(__WATCOMC__) && defined(__386__)
if( hb_gt_IsColor() )
{
ptr = ( char * ) ( 0xB800 << 4 );
}
else
{
ptr = ( char * )( 0xB000 << 4 );
}
#else
if( hb_gt_IsColor() )
{
ptr = ( char FAR * ) MK_FP( 0xB800, 0x0000 );
}
else
{
ptr = ( char FAR * ) MK_FP( 0xB000, 0x0000 );
}
#endif
return ptr;
}
#endif
#ifndef __DJGPP__
#if !defined(__DJGPP__)
char FAR * hb_gt_ScreenPtr( USHORT cRow, USHORT cCol )
{
HB_TRACE(HB_TR_DEBUG, ("hb_gt_ScreenPtr(%hu, %hu)", cRow, cCol));
@@ -498,88 +484,40 @@ USHORT hb_gt_GetScreenHeight( void )
void hb_gt_SetPos( SHORT iRow, SHORT iCol )
{
union REGS regs;
HB_TRACE(HB_TR_DEBUG, ("hb_gt_SetPos(%hd, %hd)", iRow, iCol));
#if defined(__TURBOC__)
{
BYTE cRow, cCol;
cRow = ( BYTE ) iRow;
cCol = ( BYTE ) iCol;
_AH = 0x02;
_BH = 0;
_DH = cRow;
_DL = cCol;
geninterrupt( 0x10 );
}
#else
{
union REGS regs;
regs.h.ah = 0x02;
regs.h.bh = 0;
regs.h.dh = ( BYTE ) iRow;
regs.h.dl = ( BYTE ) iCol;
#if defined(__WATCOMC__) && defined(__386__)
int386( 0x10, &regs, &regs );
#else
int86( 0x10, &regs, &regs );
#endif
}
#endif
regs.h.ah = 0x02;
regs.h.bh = 0;
regs.h.dh = ( BYTE ) iRow;
regs.h.dl = ( BYTE ) iCol;
HB_DOS_INT86( 0x10, &regs, &regs );
}
static void hb_gt_SetCursorSize( char start, char end )
{
union REGS regs;
HB_TRACE(HB_TR_DEBUG, ("hb_gt_SetCursorSize(%d, %d)", (int) start, (int) end));
#if defined(__TURBOC__)
{
_AH = 0x01;
_CH = start;
_CL = end;
geninterrupt( 0x10 );
}
#else
{
union REGS regs;
regs.h.ah = 0x01;
regs.h.ch = start;
regs.h.cl = end;
#if defined(__WATCOMC__) && defined(__386__)
int386( 0x10, &regs, &regs );
#else
int86( 0x10, &regs, &regs );
#endif
}
#endif
regs.h.ah = 0x01;
regs.h.ch = start;
regs.h.cl = end;
HB_DOS_INT86( 0x10, &regs, &regs );
}
static void hb_gt_GetCursorSize( char * start, char *end )
{
union REGS regs;
HB_TRACE(HB_TR_DEBUG, ("hb_gt_GetCursorSize(%p, %p)", start, end));
#if defined(__TURBOC__)
{
_AH = 0x03;
_BH = 0;
geninterrupt( 0x10 );
*start = _CH;
*end = _CL;
}
#else
{
union REGS regs;
regs.h.ah = 0x03;
regs.h.bh = 0;
#if defined(__WATCOMC__) && defined(__386__)
int386( 0x10, &regs, &regs );
#else
int86( 0x10, &regs, &regs );
#endif
*start = regs.h.ch;
*end = regs.h.cl;
}
#endif
regs.h.ah = 0x03;
regs.h.bh = 0;
HB_DOS_INT86( 0x10, &regs, &regs );
*start = regs.h.ch;
*end = regs.h.cl;
}
USHORT hb_gt_GetCursorStyle( void )
@@ -812,54 +750,28 @@ void hb_gt_SetAttribute( USHORT usTop, USHORT usLeft, USHORT usBottom, USHORT us
SHORT hb_gt_Col( void )
{
union REGS regs;
HB_TRACE(HB_TR_DEBUG, ("hb_gt_Col()"));
#if defined(__TURBOC__)
{
_AH = 0x03;
_BH = 0;
geninterrupt( 0x10 );
return _DL;
}
#else
{
union REGS regs;
regs.h.ah = 0x03;
regs.h.bh = 0;
#if defined(__WATCOMC__) && defined(__386__)
int386( 0x10, &regs, &regs );
#else
int86( 0x10, &regs, &regs );
#endif
return regs.h.dl;
}
#endif
regs.h.ah = 0x03;
regs.h.bh = 0;
HB_DOS_INT86( 0x10, &regs, &regs );
return regs.h.dl;
}
SHORT hb_gt_Row( void )
{
union REGS regs;
HB_TRACE(HB_TR_DEBUG, ("hb_gt_Row()"));
#if defined(__TURBOC__)
{
_AH = 0x03;
_BH = 0;
geninterrupt( 0x10 );
return _DH;
}
#else
{
union REGS regs;
regs.h.ah = 0x03;
regs.h.bh = 0;
#if defined(__WATCOMC__) && defined(__386__)
int386( 0x10, &regs, &regs );
#else
int86( 0x10, &regs, &regs );
#endif
return regs.h.dh;
}
#endif
regs.h.ah = 0x03;
regs.h.bh = 0;
HB_DOS_INT86( 0x10, &regs, &regs );
return regs.h.dh;
}
void hb_gt_Scroll( USHORT usTop, USHORT usLeft, USHORT usBottom, USHORT usRight, BYTE attr, SHORT sVert, SHORT sHoriz )
@@ -933,7 +845,7 @@ void hb_gt_DispBegin( void )
HB_TRACE(HB_TR_DEBUG, ("hb_gt_DispBegin()"));
/* ptucker */
#ifndef __DJGPP__
#if !defined(__DJGPP__)
if( ++s_uiDispCount == 1 )
{
char FAR * ptr;
@@ -955,7 +867,7 @@ void hb_gt_DispEnd( void )
HB_TRACE(HB_TR_DEBUG, ("hb_gt_DispEnd()"));
/* ptucker */
#ifndef __DJGPP__
#if !defined(__DJGPP__)
if( --s_uiDispCount == 0 )
{
char FAR * ptr;
@@ -1006,28 +918,15 @@ BOOL hb_gt_GetBlink()
void hb_gt_SetBlink( BOOL bBlink )
{
union REGS regs;
HB_TRACE(HB_TR_DEBUG, ("hb_gt_SetBlink(%d)", (int) bBlink));
#if defined(__TURBOC__)
{
_AX = 0x1003;
_BX = bBlink;
geninterrupt( 0x10 );
}
#else
{
union REGS regs;
regs.h.ah = 0x10;
regs.h.al = 0x03;
regs.h.bh = 0;
regs.h.bl = bBlink;
#if defined(__WATCOMC__) && defined(__386__)
int386( 0x10, &regs, &regs );
#else
int86( 0x10, &regs, &regs );
#endif
}
#endif
regs.h.ah = 0x10;
regs.h.al = 0x03;
regs.h.bh = 0;
regs.h.bl = bBlink;
HB_DOS_INT86( 0x10, &regs, &regs );
}
void hb_gt_Tone( double dFrequency, double dDuration )

View File

@@ -34,19 +34,6 @@
*
*/
/* TOFIX: Change this to something better */
/* #define BORLANDC */
#if defined(__DJGPP__) || defined(__BORLANDC__)
#define MOUSE_INTERRUPT 0x33
#include <dos.h>
#endif
#if defined(_MSC_VER)
#define MOUSE_INTERRUPT 0x33
#include <bios.h>
#endif
#include "hbapigt.h"
/* C callable low-level interface */
@@ -59,19 +46,12 @@ static int s_iInitRow = 0; /* Init mouse pos */
void hb_mouse_Init( void )
{
/* TODO: */
union REGS regs;
#if defined(__DJGPP__) || defined(__BORLANDC__)
{
union REGS regs;
regs.x.ax = 0;
int86( MOUSE_INTERRUPT, &regs, &regs );
s_bPresent = regs.x.ax;
s_iButtons = regs.x.bx;
}
#endif
regs.x.ax = 0;
HB_DOS_INT86( 0x33, &regs, &regs );
s_bPresent = regs.x.ax;
s_iButtons = regs.x.bx;
if( s_bPresent )
{
@@ -93,83 +73,63 @@ BOOL hb_mouse_IsPresent( void )
void hb_mouse_Show( void )
{
/* TODO: */
if( s_bPresent )
{
#if defined(__DJGPP__) || defined(__BORLANDC__)
union REGS regs;
regs.x.ax = 1;
int86( MOUSE_INTERRUPT, &regs, &regs );
HB_DOS_INT86( 0x33, &regs, &regs );
s_iCursorVisible = TRUE;
#endif
}
}
void hb_mouse_Hide( void )
{
/* TODO: */
if( s_bPresent )
{
#if defined(__DJGPP__) || defined(__BORLANDC__)
union REGS regs;
regs.x.ax = 2;
int86( MOUSE_INTERRUPT, &regs, &regs );
HB_DOS_INT86( 0x33, &regs, &regs );
s_iCursorVisible = FALSE;
#endif
}
}
int hb_mouse_Col( void )
{
/* TODO: */
if( s_bPresent )
{
#if defined(__DJGPP__) || defined(__BORLANDC__)
union REGS regs;
regs.x.ax = 3;
int86( MOUSE_INTERRUPT, &regs, &regs );
HB_DOS_INT86( 0x33, &regs, &regs );
return regs.x.cx / 8;
#else
return 0;
#endif
}
return -1;
else
return -1;
}
int hb_mouse_Row( void )
{
if( s_bPresent )
{
#if defined(__DJGPP__) || defined(__BORLANDC__)
union REGS regs;
regs.x.ax = 3;
int86( MOUSE_INTERRUPT, &regs, &regs );
HB_DOS_INT86( 0x33, &regs, &regs );
return regs.x.dx / 8;
#else
return 0;
#endif
}
return -1;
else
return -1;
}
void hb_mouse_SetPos( int iRow, int iCol )
{
/* TODO: */
if( s_bPresent )
{
union REGS regs;
@@ -177,58 +137,45 @@ void hb_mouse_SetPos( int iRow, int iCol )
regs.x.ax = 4;
regs.x.cx = iRow * 8;
regs.x.dx = iCol * 8;
int86( MOUSE_INTERRUPT, &regs, &regs );
HB_DOS_INT86( 0x33, &regs, &regs );
}
}
BOOL hb_mouse_IsButtonPressed( int iButton )
{
/* TODO: */
if( s_bPresent )
{
#if defined(__DJGPP__) || defined(__BORLANDC__)
union REGS regs;
regs.x.ax = 5;
regs.x.bx = iButton;
int86( MOUSE_INTERRUPT, &regs, &regs );
HB_DOS_INT86( 0x33, &regs, &regs );
return regs.x.bx;
#else
return FALSE;
#endif
return regs.x.bx ? TRUE : FALSE;
}
return FALSE;
else
return FALSE;
}
int hb_mouse_CountButton( void )
{
/* TODO: */
if( s_bPresent )
{
#if defined(__DJGPP__) || defined(__BORLANDC__)
union REGS regs;
regs.x.ax = 3;
int86( MOUSE_INTERRUPT, &regs, &regs );
HB_DOS_INT86( 0x33, &regs, &regs );
return regs.x.bx;
#endif
}
return 0;
else
return 0;
}
void hb_mouse_SetBounds( int iTop, int iLeft, int iBottom, int iRight )
{
/* TODO: */
if( s_bPresent )
{
#if defined(__DJGPP__) || defined(__BORLANDC__)
union REGS regs;
iLeft *= 8;
@@ -237,7 +184,7 @@ void hb_mouse_SetBounds( int iTop, int iLeft, int iBottom, int iRight )
regs.x.ax = 7;
regs.x.cx = iLeft;
regs.x.dx = iRight;
int86( MOUSE_INTERRUPT, &regs, &regs );
HB_DOS_INT86( 0x33, &regs, &regs );
iTop *= 8;
iBottom *= 8;
@@ -245,8 +192,7 @@ void hb_mouse_SetBounds( int iTop, int iLeft, int iBottom, int iRight )
regs.x.ax = 8;
regs.x.cx = iTop;
regs.x.dx = iBottom;
int86( MOUSE_INTERRUPT, &regs, &regs );
#endif
HB_DOS_INT86( 0x33, &regs, &regs );
}
}
@@ -254,19 +200,17 @@ void hb_mouse_GetBounds( int * piTop, int * piLeft, int * piBottom, int * piRigh
{
if( s_bPresent )
{
#if defined(__DJGPP__) || defined(__BORLANDC__)
union REGS regs;
regs.x.ax = 7;
int86( MOUSE_INTERRUPT, &regs, &regs );
HB_DOS_INT86( 0x33, &regs, &regs );
*piLeft = regs.x.cx / 8;
*piRight = regs.x.dx / 8;
regs.x.ax = 8;
int86( MOUSE_INTERRUPT, &regs, &regs );
HB_DOS_INT86( 0x33, &regs, &regs );
*piTop = regs.x.cx / 8;
*piBottom = regs.x.dx / 8;
#endif
}
}

View File

@@ -85,6 +85,21 @@
typedef WORD far * LPWORD;
#endif
#if defined(__RSXNT__)
#ifndef FROM_LEFT_1ST_BUTTON_PRESSED
#define FROM_LEFT_1ST_BUTTON_PRESSED 0x0001
#endif
#ifndef RIGHTMOST_BUTTON_PRESSED
#define RIGHTMOST_BUTTON_PRESSED 0x0002
#endif
#ifndef MOUSE_MOVED
#define MOUSE_MOVED 0x0001
#endif
#ifndef DOUBLE_CLICK
#define DOUBLE_CLICK 0x0002
#endif
#endif
#if 0
static HANDLE s_HOsave; /* work in progress */
static HANDLE s_HDOutput;

View File

@@ -53,8 +53,6 @@
#define INCL_NOPMAPI
#endif
#define HB_OS_WIN_32_USED
#include "hbapi.h"
#include "hbapierr.h"
#include "hbapiitm.h"
@@ -63,42 +61,8 @@
#include "hbset.h"
#include "inkey.ch"
#if defined(__TURBOC__) || defined(__BORLANDC__) || defined(_MSC_VER) || defined(__MINGW32__)
#include <conio.h>
#include <dos.h>
#elif defined(__DJGPP__)
#include <pc.h>
#include <dos.h>
#include <sys\exceptn.h>
#elif defined(HARBOUR_GCC_OS2)
#include <stdlib.h>
#elif defined(__IBMCPP__)
#include <bsedos.h>
#include <conio.h>
#endif
#include <time.h>
#if defined(__WATCOMC__)
#include <conio.h>
#include <i86.h>
#if defined(__386__) && !defined(__WINDOWS_386__)
#define INT_86 int386
#define DOS_REGS REGS
#else
#define INT_86 int86
#define DOS_REGS REGS
#endif
#elif defined(__EMX__)
#define INT_86 _int86
#define DOS_REGS REGS
#elif defined(_MSC_VER)
#define INT_86 _int86
#define DOS_REGS _REGS
#else
#define INT_86 int86
#define DOS_REGS REGS
#endif
#if defined(HARBOUR_GCC_OS2)
ULONG DosSleep( ULONG ulMilliseconds );
#endif
@@ -113,43 +77,39 @@ static HB_inkey_enum s_eventmask;
void hb_releaseCPU( void )
{
/* TODO: Add code to release time slices on all platforms */
#if defined(_WINDOWS_) || defined(__MINGW32__)
HB_TRACE(HB_TR_DEBUG, ("releaseCPU()"));
/* TODO: Add code to release time slices on all platforms */
#if defined(HB_OS_WIN_32)
/* according to ms docs, you should not do this in a Win app. dos only */
#elif defined(HB_OS_OS2)
DosSleep( 25 ); /* Duration is in milliseconds */
#elif defined(HB_OS_DOS)
/* NOTE: there is a bug under NT 4 and 2000 - if the app is running
in protected mode, time slices will _not_ be released - you must switch
to real mode first, execute the following, and switch back.
It just occurred to me that this is actually by design. Since MS doesn't
want you to do this from a console app, their solution was to not allow
the call to work in protected mode - screw the rest of the planet <g>.
/* NOTE: there is a bug under NT 4 and 2000 - if the app is running
in protected mode, time slices will _not_ be released - you must switch
to real mode first, execute the following, and switch back.
It just occurred to me that this is actually by design. Since MS doesn't
want you to do this from a console app, their solution was to not allow
the call to work in protected mode - screw the rest of the planet <g>.
returns zero on failure. (means not supported)
*/
returns zero on failure. (means not supported)
*/
#if defined(__TURBOC__)
_AX = 0x1680;
geninterrupt( 0x2f );
_AH = 0;
_AL ^= 0x80;
#elif ! defined(__DJGPP__)
{
union REGS regs;
regs.h.ah = 0x16;
regs.h.al = 0x80;
#if defined(__WATCOMC__) && defined(__386__)
int386( 0x2f, &regs, &regs );
#else
int86( 0x2f, &regs, &regs );
#endif
regs.h.ah = 0;
regs.h.al ^= 0x80;
#endif
#elif defined(OS_UNIX_COMPATIBLE)
regs.h.ah = 2;
regs.x.ax = 0x1680;
HB_DOS_INT86( 0x2F, &regs, &regs );
}
#elif defined(HB_OS_UNIX)
#else
#endif
HB_TRACE(HB_TR_DEBUG, ("releaseCPU()"));
}
int hb_inkey( double seconds, HB_inkey_enum event_mask, BOOL wait, BOOL forever )

View File

@@ -43,7 +43,7 @@
HB_FUNC( ISALPHA )
{
hb_retl( isalpha( *hb_parc( 1 ) ) );
hb_retl( isalpha( ( int ) *hb_parc( 1 ) ) );
}
/* determines if first char of string is digit */
@@ -52,7 +52,7 @@ HB_FUNC( ISALPHA )
HB_FUNC( ISDIGIT )
{
hb_retl( isdigit( *hb_parc( 1 ) ) );
hb_retl( isdigit( ( int ) *hb_parc( 1 ) ) );
}
/* determines if first char of string is upper-case */
@@ -61,7 +61,7 @@ HB_FUNC( ISDIGIT )
HB_FUNC( ISUPPER )
{
hb_retl( isupper( *hb_parc( 1 ) ) );
hb_retl( isupper( ( int ) *hb_parc( 1 ) ) );
}
/* determines if first char of string is lower-case */
@@ -70,6 +70,6 @@ HB_FUNC( ISUPPER )
HB_FUNC( ISLOWER )
{
hb_retl( islower( *hb_parc( 1 ) ) );
hb_retl( islower( ( int ) *hb_parc( 1 ) ) );
}

View File

@@ -38,31 +38,6 @@
#include "hbapi.h"
#include "hbapifs.h"
#if defined(__TURBOC__) || defined(__BORLANDC__) || defined(_MSC_VER) || defined(__DJGPP__)
#include <dos.h>
#endif
#if defined(__WATCOMC__)
#include <i86.h>
#if defined(__386__) && !defined(__WINDOWS_386__)
#define INT_86 int386
#else
#define INT_86 int86
#endif
#else
#if defined(__EMX__)
#define INT_86 _int86
#else
#define INT_86 int86
#endif
#endif
#if defined(__TURBOC__) || defined(__BORLANDC__) || defined(_MSC_VER) || defined(__DJGPP__)
#if !(defined(_Windows) || defined(__NT__) || defined(WINNT) || defined(_WINDOWS_))
#define HB_LOCAL_DOS
#endif
#endif
/* NOTE: The parameter is an extension over CA-Cl*pper, it's also supported
by Xbase++. [vszakats] */
@@ -72,7 +47,7 @@ HB_FUNC( ISPRINTER )
USHORT uiPort = atoi( pszDOSPort + 3 );
BOOL bIsPrinter = FALSE;
#if defined(HB_LOCAL_DOS)
#if defined(HB_OS_DOS)
/* NOTE: DOS specific solution, using BIOS interrupt */
@@ -81,13 +56,9 @@ HB_FUNC( ISPRINTER )
union REGS regs;
regs.h.ah = 2;
#if defined(__BORLANDC__) || defined(_MSC_VER)
regs.x.dx = uiPort - 1;
#else
regs.w.dx = uiPort - 1;
#endif
INT_86( 0x17, &regs, &regs );
HB_DOS_INT86( 0x17, &regs, &regs );
bIsPrinter = ( regs.h.ah == 0x90 );
}

View File

@@ -277,7 +277,7 @@ static char * NumPicture( char * szPic, ULONG ulPicLen, USHORT * puiPicFlags, do
}
else if( cPic == ',' ) /* Comma */
{
if( iCount && isdigit( szStr[ iCount - 1 ] ) )
if( iCount && isdigit( ( int ) szStr[ iCount - 1 ] ) )
{ /* May we place it */
if( uiPicFlags & PF_EXCHANG )
szResult[ i ] = '.';
@@ -293,11 +293,11 @@ static char * NumPicture( char * szPic, ULONG ulPicLen, USHORT * puiPicFlags, do
if( ( uiPicFlags & PF_PARNEG ) && ( dValue < 0 ) )
{
if( isdigit( *szResult ) ) /* Overflow */
if( isdigit( ( int ) *szResult ) ) /* Overflow */
{
for( iCount = 1; ( ULONG ) iCount < i; iCount++ )
{
if( isdigit( szResult[ iCount ] ) )
if( isdigit( ( int ) szResult[ iCount ] ) )
szResult[ iCount ] = '*';
}
}

View File

@@ -60,25 +60,9 @@ HB_FUNC( HB_COMPILER )
hb_xfree( pszCompiler );
}
/* NOTE: The parameter accepted is a Harbour extension. */
HB_FUNC( VERSION )
{
char * pszVersion = hb_verHarbour();
if( hb_pcount() > 0 )
{
char * pszCompiler = hb_verCompiler();
pszVersion = ( char * ) hb_xrealloc( pszVersion, strlen( pszVersion ) + strlen( pszCompiler ) + ( 4 * sizeof( char ) ) );
strcat( pszVersion, " (" );
strcat( pszVersion, pszCompiler );
strcat( pszVersion, ")" );
hb_xfree( pszCompiler );
}
hb_retc( pszVersion );
hb_xfree( pszVersion );
}

View File

@@ -43,6 +43,9 @@
* hb_retnllen()
* hb_retndlen()
*
* Copyright 2000 Jose Lalin <dezac@corevia.com>
* hb_retd()
*
* See doc/license.txt for licensing terms.
*
*/
@@ -488,6 +491,13 @@ void hb_retds( char * szDate )
hb_itemPutDS( &hb_stack.Return, szDate );
}
void hb_retd( long lDay, long lMonth, long lYear )
{
HB_TRACE(HB_TR_DEBUG, ("hb_retd(%02i, %02i, %04i)", lDay, lMonth, lYear));
hb_itemPutDL( &hb_stack.Return, hb_dateEncode( lDay, lMonth, lYear ) );
}
void hb_retl( int iLogical )
{
HB_TRACE(HB_TR_DEBUG, ("hb_retl(%d)", iLogical));

View File

@@ -351,6 +351,8 @@ ULONG hb_xsize( void * pMem ) /* returns the size of an allocated memory block *
#ifdef HB_FM_STATISTICS
return ( ( PHB_MEMINFO ) ( ( char * ) pMem - sizeof( HB_MEMINFO ) ) )->ulSize;
#else
HB_SYMBOL_UNUSED( pMem );
return 0;
#endif
}

View File

@@ -33,11 +33,12 @@
*
*/
#if defined(_Windows) || defined(_WIN32)
#define HB_OS_WIN_32_USED
#include <windows.h>
#include "hbvm.h"
#if defined(HB_OS_WIN_32)
#if defined(__BORLANDC__)
BOOL WINAPI _export
#else

View File

@@ -33,12 +33,13 @@
*
*/
#if defined(_Windows) || defined(_WIN32)
#define HB_OS_WIN_32_USED
#include <windows.h>
#include "hbapi.h"
#include "hbvm.h"
#if defined(HB_OS_WIN_32)
HANDLE hb_hInstance = 0;
HANDLE hb_hPrevInstance = 0;

View File

@@ -11,7 +11,6 @@
function Main()
outstd( chr( 34 ) + version() + chr( 34 ) + hb_osnewline() )
outstd( chr( 34 ) + version( NIL ) + chr( 34 ) + hb_osnewline() )
outstd( chr( 34 ) + hb_compiler() + chr( 34 ) + hb_osnewline() )
outstd( chr( 34 ) + os() + chr( 34 ) + hb_osnewline() )

View File

@@ -217,12 +217,12 @@ STATIC FUNCTION TEST_BEGIN( cParam )
/* Feedback */
/* NOTE: The 0 parameter of Version() will force Harbour to include the
compiler version in the version string. */
FWrite( s_nFhnd, "---------------------------------------------------------------------------" + HB_OSNewLine() +;
" Version: " + Version( 0 ) + HB_OSNewLine() +;
" OS: " + OS() + HB_OSNewLine() +;
" Version: " + Version() + HB_OSNewLine() )
#ifdef __HARBOUR__
FWrite( s_nFhnd, " Compiler: " + HB_Compiler() + HB_OSNewLine() )
#endif
FWrite( s_nFhnd, " OS: " + OS() + HB_OSNewLine() +;
" Date, Time: " + DToC( Date() ) + " " + Time() + HB_OSNewLine() +;
" Output: " + s_cFileName + HB_OSNewLine() +;
"Shortcut opt.: " + iif( s_lShortcut, "ON", "OFF" ) + HB_OSNewLine() +;