20000326-08:06 GMT+1 Victor Szakats <info@szelvesz.hu>
This commit is contained in:
@@ -1,3 +1,91 @@
|
||||
20000326-08:06 GMT+1 Victor Szakats <info@szelvesz.hu>
|
||||
|
||||
* include/hbdefs.h
|
||||
* include/clipdefs.h
|
||||
* Now the HARBOUR keyword requires the function name to be in uppercase.
|
||||
The compatibility CLIPPER keyword still allows for mixed case function
|
||||
names on some platforms. The reason is that "pascal" keyword is
|
||||
non-portable, and the above requiremenet was already there for some
|
||||
platforms, now it's a generic rule.
|
||||
- Removed the __attribute__ ((stdcall)) for the __GNUC__ branch. Setting
|
||||
any specific calling convention is not needed, since we don't need to
|
||||
deal with compatibility with precompiled legacy libs, there's no
|
||||
such thing, CA-Cl*pper never supported GNU C.
|
||||
; Now the HARBOUR macro is quite simple, it's plain "void".
|
||||
|
||||
* source/pp/ppcore.c
|
||||
+ Added predefined macro __HB_MAIN__. The macro is undefined or holds the
|
||||
value of HARBOUR_START_PROCEDURE depending on the compiler.
|
||||
Use this code to make your Harbour startup procedure platform
|
||||
independent:
|
||||
#ifndef __HB_MAIN__
|
||||
#define __HB_MAIN__ AppMain /* Or whatever you wish to call it */
|
||||
#endif
|
||||
FUNCTION __HB_MAIN__()
|
||||
|
||||
+ contrib/hbclip/hbclip.h
|
||||
+ Added header file which can be used to maintain common C source code
|
||||
for CA-Cl*pper and Harbour. The legacy code need a one-time conversion
|
||||
to make this work.
|
||||
|
||||
* source/rtl/dir.c
|
||||
! Fixed #elif guard (BCC31 was not working). (|| -> &&)
|
||||
|
||||
* source/rtl/gete.c
|
||||
* source/rtl/math.c
|
||||
* source/rtl/abs.c
|
||||
* source/rtl/minmax.c
|
||||
* source/rtl/mod.c
|
||||
* source/rtl/round.c
|
||||
* source/rtl/dir.c
|
||||
* source/rtl/binnum.c
|
||||
* source/rtl/philes.c
|
||||
* source/rtl/empty.c
|
||||
* source/rtl/setpos.c
|
||||
* source/rtl/saverest.c
|
||||
* source/rtl/setcurs.c
|
||||
* source/rtl/gx.c
|
||||
* source/rtl/len.c
|
||||
* source/rtl/valtype.c
|
||||
* source/rtl/msgxxx.c
|
||||
* source/vm/pcount.c
|
||||
* source/vm/proc.c
|
||||
* source/vm/break.c
|
||||
* source/vm/initexit.c
|
||||
+ Added copyrights for some files which didn't have any. The source is
|
||||
the Harbour mailing list archive.
|
||||
|
||||
* source/tools/html.prg -> utils/hbdoc/
|
||||
* source/tools/ng.prg -> utils/hbdoc/
|
||||
* source/tools/os2.prg -> utils/hbdoc/
|
||||
* source/tools/rtf.prg -> utils/hbdoc/
|
||||
* source/tools/troff.prg -> utils/hbdoc/
|
||||
* source/tools/fileread.prg -> utils/hbdoc/ (copied)
|
||||
* source/tools/Makefile
|
||||
* utils/hbdoc/Makefile
|
||||
* makefile.vc
|
||||
* makefile.bc
|
||||
* Some HBDOC specific source files moved to their local directory.
|
||||
* One tools file copied to hbdoc for local usage.
|
||||
- Removed tools lib.
|
||||
|
||||
* samples/guestbk/testcgi.prg
|
||||
* samples/guestbk/Makefile
|
||||
* samples/guestbk/bld_b32.bat
|
||||
! #include hbclip.ch guarded
|
||||
- Removed tools lib.
|
||||
|
||||
* samples/misc/Makefile
|
||||
* samples/pe/Makefile
|
||||
- Removed tools lib.
|
||||
|
||||
* utils/hbtest/hbtest.prg
|
||||
! Typo (suit -> suite)
|
||||
* source/rtl/gtwin/gtwin.c
|
||||
! Unused variable warning fixed.
|
||||
* doc/gmake.txt
|
||||
! make_tpl -> make_gnu
|
||||
|
||||
20000326-03:37 GMT+1 Victor Szakats <info@szelvesz.hu>
|
||||
|
||||
- make_tpl.*
|
||||
|
||||
48
harbour/contrib/hbclip/hbclip.h
Normal file
48
harbour/contrib/hbclip/hbclip.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Compatibility Library for CA-Cl*pper source code:
|
||||
* Header file to help compile C file for both Harbour and Clipper
|
||||
*
|
||||
* Copyright 2000 Victor Szakats <info@szelvesz.hu>
|
||||
* 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 of the License, or
|
||||
* (at your option) any later version, with one exception:
|
||||
*
|
||||
* The exception is that if you link the Harbour Runtime Library (HRL)
|
||||
* and/or the Harbour Virtual Machine (HVM) 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 HRL
|
||||
* and/or HVM code into it.
|
||||
*
|
||||
* 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit
|
||||
* their web site at http://www.gnu.org/).
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HB_CLIP_H_
|
||||
#define HB_CLIP_H_
|
||||
|
||||
#ifdef __HARBOUR__
|
||||
#include "hbdefs.h"
|
||||
#define HB_FUNCL( funcname, funcshort ) HB_FUNC( funcname )
|
||||
#else
|
||||
#define HB_FUNC( funcname ) CLIPPER funcname ( void )
|
||||
#define HB_FUNCL( funcname, funcshort ) CLIPPER funcshort ( void )
|
||||
#endif
|
||||
|
||||
#endif /* HB_CLIP_H_ */
|
||||
|
||||
@@ -155,7 +155,7 @@ For MSVC on Win95/WinNT:
|
||||
If you have MAKE_MODE in your dos environment, make sure it is
|
||||
not set to unix
|
||||
|
||||
For best results, in your copy of make_tpl.bat, also set:
|
||||
For best results, in your copy of make_gnu.bat, also set:
|
||||
C_USR=-TP
|
||||
HB_ARCHITECTURE w32
|
||||
HB_COMPILER msvc
|
||||
|
||||
@@ -96,7 +96,11 @@ typedef USHORT ( * FUNCP )( USHORT param, ...);
|
||||
typedef FUNCP * FUNCPP;
|
||||
|
||||
#define HIDE static
|
||||
#define CLIPPER HARBOUR
|
||||
#if defined(_MSC_VER) || defined(__IBMCPP__)
|
||||
#define CLIPPER HARBOUR
|
||||
#else
|
||||
#define CLIPPER HARBOUR pascal
|
||||
#endif
|
||||
|
||||
#ifndef NIL
|
||||
#define NIL '\0'
|
||||
|
||||
@@ -120,13 +120,7 @@
|
||||
|
||||
#define HB_SYMBOL_UNUSED( symbol ) ( void ) symbol
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#define HARBOUR void __attribute__ ((stdcall))
|
||||
#elif defined(_MSC_VER) || defined(__IBMCPP__)
|
||||
#define HARBOUR void
|
||||
#else
|
||||
#define HARBOUR void pascal
|
||||
#endif
|
||||
#define HARBOUR void
|
||||
|
||||
#define __HARBOUR__
|
||||
|
||||
|
||||
@@ -312,15 +312,10 @@ TOOLS_LIB_OBJS = \
|
||||
$(OBJ_DIR)\strright.obj \
|
||||
\
|
||||
$(OBJ_DIR)\fileread.obj \
|
||||
$(OBJ_DIR)\html.obj \
|
||||
$(OBJ_DIR)\nconvert.obj \
|
||||
$(OBJ_DIR)\ng.obj \
|
||||
$(OBJ_DIR)\numtxten.obj \
|
||||
$(OBJ_DIR)\numtxthu.obj \
|
||||
$(OBJ_DIR)\os2.obj \
|
||||
$(OBJ_DIR)\rtf.obj \
|
||||
$(OBJ_DIR)\stringp.obj \
|
||||
$(OBJ_DIR)\troff.obj
|
||||
$(OBJ_DIR)\stringp.obj
|
||||
|
||||
#
|
||||
# MACRO.LIB rules
|
||||
@@ -518,7 +513,13 @@ HBDOC_EXE_OBJS = \
|
||||
$(OBJ_DIR)\genng.obj \
|
||||
$(OBJ_DIR)\genos2.obj \
|
||||
$(OBJ_DIR)\genrtf.obj \
|
||||
$(OBJ_DIR)\gentrf.obj
|
||||
$(OBJ_DIR)\gentrf.obj \
|
||||
$(OBJ_DIR)\html.obj \
|
||||
$(OBJ_DIR)\ng.obj \
|
||||
$(OBJ_DIR)\os2.obj \
|
||||
$(OBJ_DIR)\rtf.obj \
|
||||
$(OBJ_DIR)\troff.obj \
|
||||
$(OBJ_DIR)\fileread.obj
|
||||
|
||||
#
|
||||
# Our default target
|
||||
@@ -1564,13 +1565,6 @@ $(OBJ_DIR)\hb_f.obj : $(TOOLS_DIR)\hb_f.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
tlib $(TOOLS_LIB) -+$@,,
|
||||
|
||||
$(OBJ_DIR)\html.c : $(TOOLS_DIR)\html.prg
|
||||
$(HARBOUR_EXE) $(HARBOURFLAGS) $** -o$@
|
||||
|
||||
$(OBJ_DIR)\html.obj : $(OBJ_DIR)\html.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
tlib $(TOOLS_LIB) -+$@,,
|
||||
|
||||
$(OBJ_DIR)\mathx.obj : $(TOOLS_DIR)\mathx.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
tlib $(TOOLS_LIB) -+$@,,
|
||||
@@ -1582,13 +1576,6 @@ $(OBJ_DIR)\nconvert.obj : $(OBJ_DIR)\nconvert.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
tlib $(TOOLS_LIB) -+$@,,
|
||||
|
||||
$(OBJ_DIR)\ng.c : $(TOOLS_DIR)\ng.prg
|
||||
$(HARBOUR_EXE) $(HARBOURFLAGS) $** -o$@
|
||||
|
||||
$(OBJ_DIR)\ng.obj : $(OBJ_DIR)\ng.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
tlib $(TOOLS_LIB) -+$@,,
|
||||
|
||||
$(OBJ_DIR)\numtxten.c : $(TOOLS_DIR)\numtxten.prg
|
||||
$(HARBOUR_EXE) $(HARBOURFLAGS) $** -o$@
|
||||
|
||||
@@ -1603,20 +1590,6 @@ $(OBJ_DIR)\numtxthu.obj : $(OBJ_DIR)\numtxthu.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
tlib $(TOOLS_LIB) -+$@,,
|
||||
|
||||
$(OBJ_DIR)\os2.c : $(TOOLS_DIR)\os2.prg
|
||||
$(HARBOUR_EXE) $(HARBOURFLAGS) $** -o$@
|
||||
|
||||
$(OBJ_DIR)\os2.obj : $(OBJ_DIR)\os2.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
tlib $(TOOLS_LIB) -+$@,,
|
||||
|
||||
$(OBJ_DIR)\rtf.c : $(TOOLS_DIR)\rtf.prg
|
||||
$(HARBOUR_EXE) $(HARBOURFLAGS) $** -o$@
|
||||
|
||||
$(OBJ_DIR)\rtf.obj : $(OBJ_DIR)\rtf.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
tlib $(TOOLS_LIB) -+$@,,
|
||||
|
||||
$(OBJ_DIR)\strasint.obj : $(TOOLS_DIR)\strasint.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
tlib $(TOOLS_LIB) -+$@,,
|
||||
@@ -1664,13 +1637,6 @@ $(OBJ_DIR)\strright.obj : $(TOOLS_DIR)\strright.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
tlib $(TOOLS_LIB) -+$@,,
|
||||
|
||||
$(OBJ_DIR)\troff.c : $(TOOLS_DIR)\troff.prg
|
||||
$(HARBOUR_EXE) $(HARBOURFLAGS) $** -o$@
|
||||
|
||||
$(OBJ_DIR)\troff.obj : $(OBJ_DIR)\troff.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
tlib $(TOOLS_LIB) -+$@,,
|
||||
|
||||
#
|
||||
# MACRO.LIB dependencies
|
||||
#
|
||||
@@ -1970,6 +1936,12 @@ $(HBDOC_EXE) : $(HBDOC_EXE_OBJS)
|
||||
echo. $(OBJ_DIR)\genos2.obj >> make.tmp
|
||||
echo. $(OBJ_DIR)\genrtf.obj >> make.tmp
|
||||
echo. $(OBJ_DIR)\gentrf.obj >> make.tmp
|
||||
echo. $(OBJ_DIR)\html.obj >> make.tmp
|
||||
echo. $(OBJ_DIR)\ng.obj >> make.tmp
|
||||
echo. $(OBJ_DIR)\os2.obj >> make.tmp
|
||||
echo. $(OBJ_DIR)\rtf.obj >> make.tmp
|
||||
echo. $(OBJ_DIR)\troff.obj >> make.tmp
|
||||
echo. $(OBJ_DIR)\fileread.obj >> make.tmp
|
||||
echo. $(PP_LIB) >> make.tmp
|
||||
echo. $(COMMON_LIB) >> make.tmp
|
||||
echo. $(VM_LIB) >> make.tmp
|
||||
@@ -2031,3 +2003,38 @@ $(OBJ_DIR)\gentrf.c : $(HBDOC_DIR)\gentrf.prg
|
||||
$(OBJ_DIR)\gentrf.obj : $(OBJ_DIR)\gentrf.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\html.c : $(HBDOC_DIR)\html.prg
|
||||
$(HARBOUR_EXE) $(HARBOURFLAGS) $** -o$@
|
||||
|
||||
$(OBJ_DIR)\html.obj : $(OBJ_DIR)\html.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\ng.c : $(HBDOC_DIR)\ng.prg
|
||||
$(HARBOUR_EXE) $(HARBOURFLAGS) $** -o$@
|
||||
|
||||
$(OBJ_DIR)\ng.obj : $(OBJ_DIR)\ng.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\os2.c : $(HBDOC_DIR)\os2.prg
|
||||
$(HARBOUR_EXE) $(HARBOURFLAGS) $** -o$@
|
||||
|
||||
$(OBJ_DIR)\os2.obj : $(OBJ_DIR)\os2.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\rtf.c : $(HBDOC_DIR)\rtf.prg
|
||||
$(HARBOUR_EXE) $(HARBOURFLAGS) $** -o$@
|
||||
|
||||
$(OBJ_DIR)\rtf.obj : $(OBJ_DIR)\rtf.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\troff.c : $(HBDOC_DIR)\troff.prg
|
||||
$(HARBOUR_EXE) $(HARBOURFLAGS) $** -o$@
|
||||
|
||||
$(OBJ_DIR)\troff.obj : $(OBJ_DIR)\troff.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\fileread.c : $(HBDOC_DIR)\fileread.prg
|
||||
$(HARBOUR_EXE) $(HARBOURFLAGS) $** -o$@
|
||||
|
||||
$(OBJ_DIR)\fileread.obj : $(OBJ_DIR)\fileread.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
@@ -359,15 +359,10 @@ TOOLS_LIB_OBJS = \
|
||||
$(OBJ_DIR)\strright.obj \
|
||||
\
|
||||
$(OBJ_DIR)\fileread.obj \
|
||||
$(OBJ_DIR)\html.obj \
|
||||
$(OBJ_DIR)\nconvert.obj \
|
||||
$(OBJ_DIR)\ng.obj \
|
||||
$(OBJ_DIR)\numtxten.obj \
|
||||
$(OBJ_DIR)\numtxthu.obj \
|
||||
$(OBJ_DIR)\os2.obj \
|
||||
$(OBJ_DIR)\rtf.obj \
|
||||
$(OBJ_DIR)\stringp.obj \
|
||||
$(OBJ_DIR)\troff.obj
|
||||
$(OBJ_DIR)\stringp.obj
|
||||
|
||||
#
|
||||
# MACRO.LIB rules
|
||||
@@ -701,9 +696,15 @@ $(HBDOC_EXE) : \
|
||||
$(HBDOC_DIR)\genhtm.prg \
|
||||
$(HBDOC_DIR)\genrtf.prg \
|
||||
$(HBDOC_DIR)\genhpc.prg \
|
||||
$(HBDOC_DIR)\genasc.prg
|
||||
$(HBDOC_DIR)\genasc.prg \
|
||||
$(HBDOC_DIR)\html.prg \
|
||||
$(HBDOC_DIR)\ng.prg \
|
||||
$(HBDOC_DIR)\os2.prg \
|
||||
$(HBDOC_DIR)\rtf.prg \
|
||||
$(HBDOC_DIR)\troff.prg \
|
||||
$(HBDOC_DIR)\fileread.prg
|
||||
$(HARBOUR_EXE) $(HARBOURFLAGS) -o$(OBJ_DIR)\ $**
|
||||
$(CC) $(CFLAGS) -Fo$(OBJ_DIR)\ $(OBJ_DIR)\hbdoc.c $(OBJ_DIR)\genos2.c $(OBJ_DIR)\gentrf.c $(OBJ_DIR)\genng.c $(OBJ_DIR)\genhtm.c $(OBJ_DIR)\genrtf.c $(OBJ_DIR)\genhpc.c $(OBJ_DIR)\genasc.c -o $(HBDOC_EXE) /link $(LIBS2)
|
||||
$(CC) $(CFLAGS) -Fo$(OBJ_DIR)\ $(OBJ_DIR)\hbdoc.c $(OBJ_DIR)\genos2.c $(OBJ_DIR)\gentrf.c $(OBJ_DIR)\genng.c $(OBJ_DIR)\genhtm.c $(OBJ_DIR)\genrtf.c $(OBJ_DIR)\genhpc.c $(OBJ_DIR)\genasc.c $(OBJ_DIR)\html.c $(OBJ_DIR)\ng.c $(OBJ_DIR)\os2.c $(OBJ_DIR)\rtf.c $(OBJ_DIR)\troff.c $(OBJ_DIR)\fileread.c -o $(HBDOC_EXE) /link $(LIBS2)
|
||||
|
||||
#
|
||||
# HARBOUR.EXE rules
|
||||
|
||||
@@ -12,7 +12,6 @@ PRG_SOURCES=\
|
||||
PRG_MAIN=guestbk.prg
|
||||
|
||||
LIBS=\
|
||||
tools \
|
||||
debug \
|
||||
vm \
|
||||
rtl \
|
||||
|
||||
@@ -10,7 +10,6 @@ rem
|
||||
echo -O2 -I..\..\include -L..\..\lib > build.tmp
|
||||
echo -eguestbk.exe >> build.tmp
|
||||
echo guestbk.c inifiles.c testcgi.c >> build.tmp
|
||||
echo tools.lib >> build.tmp
|
||||
echo debug.lib >> build.tmp
|
||||
echo vm.lib >> build.tmp
|
||||
echo rtl.lib >> build.tmp
|
||||
|
||||
@@ -26,7 +26,10 @@
|
||||
**/
|
||||
|
||||
#include "cgi.ch"
|
||||
#include "hbclip.ch"
|
||||
|
||||
#ifndef __HARBOUR__
|
||||
#include "hbclip.ch"
|
||||
#endif
|
||||
|
||||
#define IF_BUFFER 65535
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ PRG_SOURCES=\
|
||||
PRG_MAIN=hscript.prg
|
||||
|
||||
LIBS=\
|
||||
tools \
|
||||
debug \
|
||||
vm \
|
||||
rtl \
|
||||
|
||||
@@ -4,5 +4,5 @@ rem $Id$
|
||||
rem
|
||||
|
||||
..\..\bin\harbour hscript /n /i..\..\include
|
||||
bcc32 -O2 -I..\..\include -L..\..\lib -ehscript.exe %hscript.c tools.lib debug.lib vm.lib rtl.lib rdd.lib macro.lib pp.lib dbfntx.lib dbfcdx.lib common.lib
|
||||
bcc32 -O2 -I..\..\include -L..\..\lib -ehscript.exe hscript.c debug.lib vm.lib rtl.lib gtwin.lib rdd.lib macro.lib pp.lib dbfntx.lib dbfcdx.lib common.lib
|
||||
rem del hscript.c
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
ROOT = ../../
|
||||
|
||||
LIBS=\
|
||||
tools \
|
||||
debug \
|
||||
vm \
|
||||
rtl \
|
||||
|
||||
@@ -13,7 +13,6 @@ C_SOURCES=\
|
||||
PRG_MAIN=pe.prg
|
||||
|
||||
LIBS=\
|
||||
tools \
|
||||
debug \
|
||||
vm \
|
||||
rtl \
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
* See doc/pragma.txt
|
||||
*
|
||||
* Copyright 2000 Victor Szakats <info@szelvesz.hu>
|
||||
* __DATE__, __TIME__ support
|
||||
* __DATE__, __TIME__, __HB_MAIN__ support
|
||||
*
|
||||
* See doc/license.txt for licensing terms.
|
||||
*
|
||||
@@ -261,6 +261,10 @@ void hb_pp_Init( void )
|
||||
sprintf( szResult, "\"%02d:%02d:%02d\"", oTime->tm_hour, oTime->tm_min, oTime->tm_sec );
|
||||
hb_pp_AddDefine( "__TIME__", szResult );
|
||||
}
|
||||
|
||||
#ifdef HARBOUR_START_PROCEDURE
|
||||
hb_pp_AddDefine( "__HB_MAIN__", HARBOUR_START_PROCEDURE );
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Table with parse warnings */
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* ABS() function
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 Matthew Hamilton <mhamilton@bunge.com.au>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* BIN2W(), BIN2I(), BIN2L(), I2BIN(), L2BIN() functions
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 Manuel Ruiz <mrt@joca.es>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* DIRECTORY() function
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 Leslee Griffith <les.griffith@vantagesystems.ca>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -623,7 +623,7 @@ HB_FUNC( DIRECTORY )
|
||||
strcpy( filename, ++pos );
|
||||
}
|
||||
|
||||
#elif defined(__BORLANDC__) || (__BORLANDC__ >= 1280)
|
||||
#elif defined(__BORLANDC__) && (__BORLANDC__ >= 1280)
|
||||
/* NOTE: _chmod( f, 0 ) => Get attribs
|
||||
_chmod( f, 1, n ) => Set attribs
|
||||
chmod() though, _will_ change the attributes */
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* EMPTY() function
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 Antonio Linares <alinares@fivetech.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* GETENV(), GETE() functions
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 Matthew Hamilton <mhamilton@bunge.com.au>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* The Terminal API
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 Bil Simser <bsimser@home.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -84,7 +84,9 @@
|
||||
typedef WORD far * LPWORD;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
static HANDLE s_HOsave;
|
||||
#endif
|
||||
static HANDLE s_HDOutput;
|
||||
static HANDLE s_HOriginal;
|
||||
static HANDLE s_HOutput;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
* The following parts are Copyright of the individual authors.
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 Paul Tucker <ptucker@sympatico.ca>
|
||||
* SETMODE()
|
||||
*
|
||||
* See doc/license.txt for licensing terms.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* LEN() function
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 Antonio Linares <alinares@fivetech.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* Math functions
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 Matthew Hamilton <mhamilton@bunge.com.au>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* MIN(), MAX() functions
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 Matthew Hamilton <mhamilton@bunge.com.au>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* MOD() function
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 Matthew Hamilton <mhamilton@bunge.com.au>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* Localization module includer for GNU compilers
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 Gonzalo Diethelm <gonzalo.diethelm@iname.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* The FileSys API (Harbour level)
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 Manuel Ruiz <mrt@joca.es>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* ROUND(), INT() functions
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 David G. Holm <dholm@jsd-llc.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -37,8 +37,8 @@
|
||||
* The following parts are Copyright of the individual authors.
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* Copyright 1999 David G. Holm <dholm@jsd-llc.com>
|
||||
* ROUND()
|
||||
* Copyright 1999 Matthew Hamilton <mhamilton@bunge.com.au>
|
||||
* INT()
|
||||
*
|
||||
* See doc/license.txt for licensing terms.
|
||||
*
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* SAVESCREEN(), RESTSCREEN() functions
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 Antonio Linares <alinares@fivetech.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* SETCURSOR() function
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 Antonio Linares <alinares@fivetech.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
* Harbour Project source code:
|
||||
* SETPOS(), SETPOSBS() functions
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 David G. Holm <dholm@jsd-llc.com>
|
||||
* Copyright 1999 Victor Szakats <info@szelvesz.hu>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* VALTYPE() function
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 Antonio Linares <alinares@fivetech.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -34,15 +34,10 @@ C_SOURCES=\
|
||||
|
||||
PRG_SOURCES=\
|
||||
fileread.prg \
|
||||
html.prg \
|
||||
nconvert.prg \
|
||||
ng.prg \
|
||||
numtxthu.prg \
|
||||
numtxten.prg \
|
||||
os2.prg \
|
||||
rtf.prg \
|
||||
stringp.prg \
|
||||
troff.prg \
|
||||
|
||||
LIBNAME=tools
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* BREAK() function
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 Ryszard Glab <rglab@imid.med.pl>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* __QUIT() function
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 Antonio Linares <alinares@fivetech.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* PCOUNT() function
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 Antonio Linares <alinares@fivetech.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Harbour Project source code:
|
||||
* PROCNAME(), PROCLINE() and PROCFILE() functions
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 Antonio Linares <alinares@fivetech.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -9,19 +9,24 @@ endif
|
||||
ROOT = ../../
|
||||
|
||||
PRG_SOURCES=\
|
||||
hbdoc.prg \
|
||||
genos2.prg \
|
||||
gentrf.prg \
|
||||
genng.prg \
|
||||
genhtm.prg \
|
||||
genrtf.prg \
|
||||
genhpc.prg \
|
||||
genasc.prg \
|
||||
hbdoc.prg \
|
||||
genos2.prg \
|
||||
gentrf.prg \
|
||||
genng.prg \
|
||||
genhtm.prg \
|
||||
genrtf.prg \
|
||||
genhpc.prg \
|
||||
genasc.prg \
|
||||
html.prg \
|
||||
ng.prg \
|
||||
os2.prg \
|
||||
rtf.prg \
|
||||
troff.prg \
|
||||
fileread.prg \
|
||||
|
||||
PRG_MAIN=hbdoc.prg
|
||||
|
||||
LIBS=\
|
||||
tools \
|
||||
debug \
|
||||
vm \
|
||||
rtl \
|
||||
|
||||
276
harbour/utils/hbdoc/fileread.prg
Normal file
276
harbour/utils/hbdoc/fileread.prg
Normal file
@@ -0,0 +1,276 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* A class that reads a file one line at a time
|
||||
*
|
||||
* Copyright 1999 David G. Holm <dholm@jsd-llc.com>
|
||||
* 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 of the License, or
|
||||
* (at your option) any later version, with one exception:
|
||||
*
|
||||
* The exception is that if you link the Harbour Runtime Library (HRL)
|
||||
* and/or the Harbour Virtual Machine (HVM) 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 HRL
|
||||
* and/or HVM code into it.
|
||||
*
|
||||
* 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 program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit
|
||||
* their web site at http://www.gnu.org/).
|
||||
*
|
||||
*/
|
||||
|
||||
#include "fileio.ch"
|
||||
|
||||
#define oF_ERROR_MIN 1
|
||||
#define oF_CREATE_OBJECT 1
|
||||
#define oF_OPEN_FILE 2
|
||||
#define oF_READ_FILE 3
|
||||
#define oF_CLOSE_FILE 4
|
||||
#define oF_ERROR_MAX 4
|
||||
#define oF_DEFAULT_READ_SIZE 4096
|
||||
|
||||
FUNCTION TFileRead()
|
||||
STATIC s_oClass
|
||||
|
||||
IF s_oClass == NIL
|
||||
s_oClass := TClass():New( "TFile" ) // New class
|
||||
s_oClass:AddClassData( "cFile" ) // The filename
|
||||
s_oClass:AddClassData( "nHan" ) // The open file handle
|
||||
s_oClass:AddClassData( "lEOF" ) // The end of file reached flag
|
||||
s_oClass:AddClassData( "nError" ) // The current file error code
|
||||
s_oClass:AddClassData( "nLastOp" ) // The last operation done (for error messages)
|
||||
s_oClass:AddClassData( "cBuffer" ) // The readahead buffer
|
||||
s_oClass:AddClassData( "nReadSize" ) // How much to add to the readahead buffer on
|
||||
// each read from the file
|
||||
|
||||
s_oClass:AddMethod( "New", @f_new() ) // Create a new class instance
|
||||
s_oClass:AddMethod( "Open", @f_open() ) // Open the file for reading
|
||||
s_oClass:AddMethod( "Close", @f_close() ) // Close the file when done
|
||||
s_oClass:AddMethod( "ReadLine", @f_read() ) // Read a line from the file
|
||||
s_oClass:AddMethod( "Name", @f_name() ) // Retunrs the file name
|
||||
s_oClass:AddMethod( "IsOpen", @f_is_open() ) // Returns .T. if file is open
|
||||
s_oClass:AddMethod( "MoreToRead", @f_more() ) // Returns .T. if more to be read
|
||||
s_oClass:AddMethod( "Error", @f_error() ) // Returns .T. if error occurred
|
||||
s_oClass:AddMethod( "ErrorNo", @f_error_no() ) // Returns current error code
|
||||
s_oClass:AddMethod( "ErrorMsg", @f_error_msg() ) // Returns formatted error message
|
||||
s_oClass:Create()
|
||||
ENDIF
|
||||
|
||||
RETURN s_oClass:Instance()
|
||||
|
||||
STATIC FUNCTION f_new( cFile, nSize )
|
||||
LOCAL oSelf := Qself()
|
||||
|
||||
IF nSize == NIL .OR. nSize < 1
|
||||
// The readahead size can be set to as little as 1 byte, or as much as
|
||||
// 65535 bytes, but venturing out of bounds forces the default size.
|
||||
nSize := oF_DEFAULT_READ_SIZE
|
||||
ENDIF
|
||||
|
||||
oSelf:cFile := cFile // Save the file name
|
||||
oSelf:nHan := -1 // It's not open yet
|
||||
oSelf:lEOF := .T. // So it must be at EOF
|
||||
oSelf:nError := 0 // But there haven't been any errors
|
||||
oSelf:nLastOp := oF_CREATE_OBJECT // Because we just created the class
|
||||
oSelf:cBuffer := "" // and nothing has been read yet
|
||||
oSelf:nReadSize := nSize // But will be in this size chunks
|
||||
|
||||
RETURN oSelf
|
||||
|
||||
STATIC FUNCTION f_open( nMode )
|
||||
LOCAL oSelf := Qself()
|
||||
|
||||
IF oSelf:nHan == -1
|
||||
// Only open the file if it isn't already open.
|
||||
IF nMode == NIL
|
||||
nMode := FO_READ + FO_SHARED // Default to shared read-only mode
|
||||
ENDIF
|
||||
oSelf:nLastOp := oF_OPEN_FILE
|
||||
oSelf:nHan := FOPEN( oSelf:cFile, nMode ) // Try to open the file
|
||||
IF oSelf:nHan == -1
|
||||
oSelf:nError := FERROR() // It didn't work
|
||||
oSelf:lEOF := .T. // So force EOF
|
||||
ELSE
|
||||
oSelf:nError := 0 // It worked
|
||||
oSelf:lEOF := .F. // So clear EOF
|
||||
ENDIF
|
||||
ELSE
|
||||
// The file is already open, so rewind to the beginning.
|
||||
IF FSEEK( oSelf:nHan, 0 ) == 0
|
||||
oSelf:lEOF := .F. // Definitely not at EOF
|
||||
ELSE
|
||||
oSelf:nError := FERROR() // Save error code if not at BOF
|
||||
ENDIF
|
||||
oSelf:cBuffer := "" // Clear the readahead buffer
|
||||
ENDIF
|
||||
|
||||
RETURN oSelf
|
||||
|
||||
STATIC FUNCTION f_read()
|
||||
LOCAL oSelf := Qself()
|
||||
LOCAL cLine := ""
|
||||
LOCAL nPos
|
||||
|
||||
oSelf:nLastOp := oF_READ_FILE
|
||||
|
||||
IF oSelf:nHan == -1
|
||||
oSelf:nError := -1 // Set unknown error if file not open
|
||||
ELSE
|
||||
// Is there a whole line in the readahead buffer?
|
||||
nPos := f_EOL_pos( oSelf )
|
||||
WHILE ( nPos <= 0 .OR. nPos > LEN( oSelf:cBuffer ) - 3 ) .AND. !oSelf:lEOF
|
||||
// Either no or maybe, but there is possibly more to be read.
|
||||
// Maybe means that we found either a CR or an LF, but we don't
|
||||
// have enough characters to discriminate between the three types
|
||||
// of end of line conditions that the class recognizes (see below).
|
||||
cLine := FREADSTR( oSelf:nHan, oSelf:nReadSize )
|
||||
IF EMPTY( cLine )
|
||||
// There was nothing more to be read. Why? (Error or EOF.)
|
||||
oSelf:nError := FERROR()
|
||||
IF oSelf:nError == 0
|
||||
// Because the file is at EOF.
|
||||
oSelf:lEOF := .T.
|
||||
ENDIF
|
||||
ELSE
|
||||
// Add what was read to the readahead buffer.
|
||||
oSelf:cBuffer += cLine
|
||||
cLine := ""
|
||||
ENDIF
|
||||
// Is there a whole line in the readahead buffer yet?
|
||||
nPos := f_EOL_pos( oSelf )
|
||||
END WHILE
|
||||
// Is there a whole line in the readahead buffer?
|
||||
IF nPos <= 0
|
||||
// No, which means that there is nothing left in the file either, so
|
||||
// return the entire buffer contents as the last line in the file.
|
||||
cLine := oSelf:cBuffer
|
||||
oSelf:cBuffer := ""
|
||||
ELSE
|
||||
// Yes. Is there anything in the line?
|
||||
IF nPos > 1
|
||||
// Yes, so return the contents.
|
||||
cLine := LEFT( oSelf:cBuffer, nPos - 1 )
|
||||
ELSE
|
||||
// No, so return an empty string.
|
||||
cLine := ""
|
||||
ENDIF
|
||||
// Deal with multiple possible end of line conditions.
|
||||
DO CASE
|
||||
CASE SUBSTR( oSelf:cBuffer, nPos, 3 ) == CHR( 13 ) + CHR( 13 ) + CHR( 10 )
|
||||
// It's a messed up DOS newline (such as that created by a program
|
||||
// that uses "\r\n" as newline when writing to a text mode file,
|
||||
// which causes the '\n' to expand to "\r\n", giving "\r\r\n").
|
||||
nPos += 3
|
||||
CASE SUBSTR( oSelf:cBuffer, nPos, 2 ) == CHR( 13 ) + CHR( 10 )
|
||||
// It's a standard DOS newline
|
||||
nPos += 2
|
||||
OTHERWISE
|
||||
// It's probably a Mac or Unix newline
|
||||
nPos++
|
||||
ENDCASE
|
||||
oSelf:cBuffer := SUBSTR( oSelf:cBuffer, nPos )
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
RETURN cLine
|
||||
|
||||
STATIC FUNCTION f_EOL_pos( oFile )
|
||||
LOCAL nCRpos, nLFpos, nPos
|
||||
|
||||
// Look for both CR and LF in the file read buffer.
|
||||
nCRpos := AT( CHR( 13 ), oFile:cBuffer )
|
||||
nLFpos := AT( CHR( 10 ), oFile:cBuffer )
|
||||
DO CASE
|
||||
CASE nCRpos == 0
|
||||
// If there's no CR, use the LF position.
|
||||
nPos := nLFpos
|
||||
CASE nLFpos == 0
|
||||
// If there's no LF, use the CR position.
|
||||
nPos := nCRpos
|
||||
OTHERWISE
|
||||
// If there's both a CR and an LF, use the position of the first one.
|
||||
nPos := MIN( nCRpos, nLFpos )
|
||||
ENDCASE
|
||||
|
||||
RETURN nPos
|
||||
|
||||
STATIC FUNCTION f_close()
|
||||
LOCAL oSelf := Qself()
|
||||
|
||||
oSelf:nLastOp := oF_CLOSE_FILE
|
||||
oSelf:lEOF := .T.
|
||||
// Is the file already closed.
|
||||
IF oSelf:nHan == -1
|
||||
// Yes, so indicate an unknown error.
|
||||
oSelf:nError := -1
|
||||
ELSE
|
||||
// No, so close it already!
|
||||
FCLOSE( oSelf:nHan )
|
||||
oSelf:nError := FERROR()
|
||||
oSelf:nHan := -1 // The file is no longer open
|
||||
oSelf:lEOF := .T. // So force an EOF condition
|
||||
ENDIF
|
||||
|
||||
RETURN oSelf
|
||||
|
||||
STATIC FUNCTION f_name()
|
||||
LOCAL oSelf := Qself()
|
||||
// Returns the filename associated with this class instance.
|
||||
RETURN oSelf:cFile
|
||||
|
||||
STATIC FUNCTION f_is_open()
|
||||
LOCAL oSelf := Qself()
|
||||
// Returns .T. if the file is open.
|
||||
RETURN oSelf:nHan != -1
|
||||
|
||||
STATIC FUNCTION f_more()
|
||||
LOCAL oSelf := Qself()
|
||||
// Returns .T. if there is more to be read from either the file or the
|
||||
// readahead buffer. Only when both are exhausted is there no more to read.
|
||||
RETURN !oSelf:lEOF .OR. !EMPTY( oSelf:cBuffer )
|
||||
|
||||
STATIC FUNCTION f_error()
|
||||
LOCAL oSelf := Qself()
|
||||
// Returns .T. if an error was recorded.
|
||||
RETURN oSelf:nError != 0
|
||||
|
||||
STATIC FUNCTION f_error_no()
|
||||
LOCAL oSelf := Qself()
|
||||
// Returns the last error code that was recorded.
|
||||
RETURN oSelf:nError
|
||||
|
||||
STATIC FUNCTION f_error_msg( cText )
|
||||
STATIC s_cAction := {"on", "creating object for", "opening", "reading from", "closing"}
|
||||
LOCAL oSelf := Qself()
|
||||
LOCAL cMessage, nTemp
|
||||
|
||||
// Has an error been recorded?
|
||||
IF oSelf:nError == 0
|
||||
// No, so report that.
|
||||
cMessage := "No errors have been recorded for " + oSelf:cFile
|
||||
ELSE
|
||||
// Yes, so format a nice error message, while avoiding a bounds error.
|
||||
IF oSelf:nLastOp < oF_ERROR_MIN .OR. oSelf:nLastOp > oF_ERROR_MAX
|
||||
nTemp := 1
|
||||
ELSE
|
||||
nTemp := oSelf:nLastOp + 1
|
||||
ENDIF
|
||||
cMessage := IF( EMPTY( cText ), "", cText ) + "Error " + ALLTRIM( STR( oSelf:nError ) ) + " " + s_cAction[ nTemp ] + " " + oSelf:cFile
|
||||
ENDIF
|
||||
|
||||
RETURN cMessage
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
/* EMPTY() tests written by Eddie Runia <eddie@runia.com> */
|
||||
/* :class* tests written by Dave Pearson <davep@hagbard.demon.co.uk> */
|
||||
|
||||
/* NOTE: The test suit will not work if the DTOS() function is not included
|
||||
/* NOTE: The test suite will not work if the DTOS() function is not included
|
||||
in Harbour (-DHB_COMPAT_XPP). */
|
||||
/* NOTE: Always compile with /n switch */
|
||||
/* NOTE: It's worth to make tests with and without the /z switch */
|
||||
@@ -75,7 +75,7 @@ STATIC s_nEndTime
|
||||
|
||||
FUNCTION Main( cPar1, cPar2 )
|
||||
|
||||
OutStd( "Harbour Regression Test Suit" + HB_OSNewLine() +;
|
||||
OutStd( "Harbour Regression Test Suite" + HB_OSNewLine() +;
|
||||
"Copyright 1999-2000, http://www.harbour-project.org" + HB_OSNewLine() )
|
||||
|
||||
IF cPar1 == NIL
|
||||
|
||||
Reference in New Issue
Block a user