From a0a1f3748d1270dfe369754fdbaa01674f88963a Mon Sep 17 00:00:00 2001 From: Luiz Rafael Culik Date: Fri, 18 Feb 2000 12:05:43 +0000 Subject: [PATCH] See changelog 20000218 10:02 --- harbour/ChangeLog | 6 ++ harbour/doc/compiler.txt | 6 +- harbour/doc/readme.txt | 4 +- harbour/source/rtl/typefile.prg | 120 +++++++------------------------- 4 files changed, 37 insertions(+), 99 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 83728af442..e39fff2a6a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,9 @@ +20000218-10:02 GMT-3 Luiz Rafael Culik + *doc/compiler.txt + doc/readme.txt + Small formating by Brian Hays + *source/rtl/typefile.prg + *Fixed to use the Habour RTL 20000218-00:04 GMT+1 Victor Szakats - source/runner/stdalone/external.prg * makefile.bc diff --git a/harbour/doc/compiler.txt b/harbour/doc/compiler.txt index 7e474d1baf..488e1add17 100644 --- a/harbour/doc/compiler.txt +++ b/harbour/doc/compiler.txt @@ -46,10 +46,10 @@ * the compiler (accessed by DOS ERRORLEVEL command) * is equal to 0 if there are no errors in compiled * source file. - * /es1 - all warnings are ignored and exit code returned by - * the compiler is set to a non-zero value. + * /es1 - any warnings generate a non-zero exit code, but + * output is still created. * /es2 - all warnings are treated as errors and no output - * file is created. The exit code is set to non-zero + * file is created. The exit code is set to a non-zero * value. * * /g output type generated is diff --git a/harbour/doc/readme.txt b/harbour/doc/readme.txt index f5985fe64f..7eb26ecbe2 100644 --- a/harbour/doc/readme.txt +++ b/harbour/doc/readme.txt @@ -4,7 +4,7 @@ - The Harbour Project + The Harbour Project ************************************************************************ * This file contains information on obtaining, installing, and using * @@ -54,7 +54,7 @@ Installation directories. 2. Compile Harbour using your C compiler. Make files for different - platforms are included in the HARBOUR\HARBOUR directory. + platforms are included in the main Harbour directory. --- COPYRIGHT --- diff --git a/harbour/source/rtl/typefile.prg b/harbour/source/rtl/typefile.prg index 26ced148c1..4de021e21d 100644 --- a/harbour/source/rtl/typefile.prg +++ b/harbour/source/rtl/typefile.prg @@ -33,18 +33,18 @@ * */ -/* TOFIX: The usage of non-standard Harbour functionality (TFileRead()) should - be replaced with plain RTL function calls. Now it requires TOOLS to - link at all. [vszakats] */ #include 'common.ch' #include 'error.ch' +#include 'fileio.ch' +#define pBUFFER_LENGTH 4096 +#define CRLF HB_OSNEWLINE() -STATIC theHandle +#xtranslate FTELL() => FSEEK(,0,FS_RELATIVE) +Static TheHandle #ifdef TEST function main -type alpha.lnk -type x.lnk +type treport.prg return nil #endif @@ -83,8 +83,8 @@ IF nHandle <0 err:OsCode := 2 Eval(ErrorBlock(), err) ENDIF -DO WHILE !lEof - cBuffer := TRIM(ReadLN( @lEof )) + +DO WHILE Freadln(thehandle,@cbuffer,pBUFFER_LENGTH) ? cBuffer ENDDO @@ -97,7 +97,7 @@ ENDIF RETURN NIL -#define xReadBuffer 4096 + /**** * FT_FUSE(cFile,nMode) ---> nHandle * Open a File @@ -115,94 +115,26 @@ STATIC FUNCTION ft_fuse( cFile, nMode ) nMode := 2 ENDIF IF cFile == Nil - theHandle:close() + fclose(theHandle) ENDIF IF cFile <> Nil IF nMode <> 0 - theHandle := TFileRead():new( cFile ):open( nMode ) + theHandle := FOPEN( cFile , nMode ) ELSE - theHandle := TFileRead():new( cFile ):open() + theHandle := FOPEN( cFile) ENDIF ENDIF -RETURN theHandle:nHan - -*+北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北 -*+ -*+ STATIC FUNCTION ft_FEOF() -*+ -*+北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北 -*+ -STATIC FUNCTION ft_FEOF() - - LOCAL lRETURN := theHandle:lEOF - -RETURN lRETURN - -*+北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北 -*+ -*+ STATIC FUNCTION FReadLn() -*+ -*+北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北 -*+ -STATIC FUNCTION FReadLn( nH, cLine ) - - // cline:= thehandle:readline() - // ENDIF - IF theHandle:MoreToRead() - cLine := theHandle:ReadLine() - ELSE - FSEEK( theHandle:nHan, 0, 0 ) - theHandle:lEOF := .f. - - cLine := theHandle:ReadLine() - ENDIF -RETURN cLine - -STATIC FUNCTION ReadLN( leof ) - - LOCAL cBuffer := "" - - cBuffer := FT_FREADLN() - FT_FSKIP( 1 ) - lEof := FT_FEOF() - -RETURN cBuffer -// End of ReadLN - -*+北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北 -*+ -*+ STATIC FUNCTION FT_FReadLn() -*+ -*+北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北 -*+ -STATIC FUNCTION FT_FReadLn() - - LOCAL cBuffer := '' - - cBuffer := FReadLn( theHandle:nHan, @cBuffer ) - -RETURN cBuffer - -*+北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北 -*+ -*+ STATIC FUNCTION FT_FGotop() -*+ -*+北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北 -*+ -STATIC FUNCTION FT_FGotop() - - FSEEK( theHandle:nHan, 0, 0 ) - -RETURN NIL - -*+北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北 -*+ -*+ STATIC FUNCTION ft_fskip() -*+ -*+北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北北 -*+ -STATIC FUNCTION ft_fskip( ) - -RETURN nil - - +RETURN theHandle +Static function Freadln(nh,cb,nmaxline) +local cline,nsavepos,neol,nnumread +cline:=space(nmaxline) +cb:='' +nsavepos:=FTELL(nh) +nnumread:=fread(nh,@cline,nmaxline) +if (neol:= at(CRLF,substr(cline,1,nnumread)))==0 + cb:=cline +else + cb:=substr(cline,1,neol-1) + fseek(nh,nsavepos+neol+1,FS_SET) +endif +return nnumread != 0