2013-03-02 12:07 UTC+0100 Viktor Szakats (harbour syenar.net)
* utils/hbmk2/hbmk2.prg
! HBSHELL_CLIPPER() extended to reset the date format
to Clipper default as well
+ documented that the default date format for strings
is the ISO one (yyyy-mm-dd)
* src/rtl/filesys.c
! hb_fsSetAttr() (and hb_FSetAttr()/SetFAttr()/etc)
to handle the archive attribute correctly on Windows.
Previously a call was always setting it.
Thanks for the report and research to Tony Quick.
; Checkme
* contrib/hbnf/fttext.c
! fixed internal error in FT_READLN() when used on an
LF delimited text file. This API pbly needs more
thorough review regarding portable EOL handling, f.e.
it seems buggy when CRLF pair falls onto the buffer
(length = 4096) boundary.
! fixed 1 byte read past buffer in internal _findeol()
function
; Checkme
* contrib/hbnf/doc/en/fttext.txt
* updates regarding EOL
* contrib/hbcups/tests/test.prg
* contrib/hbmisc/tests/hb_f.prg
* contrib/hbnf/tests/dfile.prg
* contrib/hbnf/tests/fttext.prg
+ accept filename as parameter
* contrib/hbpgsql/tests/test.prg
* contrib/hbwin/tests/mapimail.prg
* contrib/xhb/tests/copyfile.prg
! minor cleanups
* bin/3rdpatch.hb
* tests/fixcase.hb
* minor formatting
This commit is contained in:
@@ -10,6 +10,48 @@
|
||||
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
|
||||
*/
|
||||
|
||||
2013-03-02 12:07 UTC+0100 Viktor Szakats (harbour syenar.net)
|
||||
* utils/hbmk2/hbmk2.prg
|
||||
! HBSHELL_CLIPPER() extended to reset the date format
|
||||
to Clipper default as well
|
||||
+ documented that the default date format for strings
|
||||
is the ISO one (yyyy-mm-dd)
|
||||
|
||||
* src/rtl/filesys.c
|
||||
! hb_fsSetAttr() (and hb_FSetAttr()/SetFAttr()/etc)
|
||||
to handle the archive attribute correctly on Windows.
|
||||
Previously a call was always setting it.
|
||||
Thanks for the report and research to Tony Quick.
|
||||
; Checkme
|
||||
|
||||
* contrib/hbnf/fttext.c
|
||||
! fixed internal error in FT_READLN() when used on an
|
||||
LF delimited text file. This API pbly needs more
|
||||
thorough review regarding portable EOL handling, f.e.
|
||||
it seems buggy when CRLF pair falls onto the buffer
|
||||
(length = 4096) boundary.
|
||||
! fixed 1 byte read past buffer in internal _findeol()
|
||||
function
|
||||
; Checkme
|
||||
|
||||
* contrib/hbnf/doc/en/fttext.txt
|
||||
* updates regarding EOL
|
||||
|
||||
* contrib/hbcups/tests/test.prg
|
||||
* contrib/hbmisc/tests/hb_f.prg
|
||||
* contrib/hbnf/tests/dfile.prg
|
||||
* contrib/hbnf/tests/fttext.prg
|
||||
+ accept filename as parameter
|
||||
|
||||
* contrib/hbpgsql/tests/test.prg
|
||||
* contrib/hbwin/tests/mapimail.prg
|
||||
* contrib/xhb/tests/copyfile.prg
|
||||
! minor cleanups
|
||||
|
||||
* bin/3rdpatch.hb
|
||||
* tests/fixcase.hb
|
||||
* minor formatting
|
||||
|
||||
2013-03-02 09:55 UTC+0100 Tamas TEVESZ (ice extreme.hu)
|
||||
* src/rtl/gtcrs/gtcrs.h
|
||||
* utils/hbmk2/hbmk2.prg
|
||||
|
||||
@@ -220,9 +220,9 @@
|
||||
#include "directry.ch"
|
||||
|
||||
#if defined( _TRACE )
|
||||
# define TRACE( str ) OutStd( "T: " + str + hb_eol() )
|
||||
#define TRACE( str ) OutStd( "T: " + str + hb_eol() )
|
||||
#else
|
||||
# define TRACE( str )
|
||||
#define TRACE( str )
|
||||
#endif
|
||||
|
||||
#define ONEARG_KW 2 /* one-arg line keyword */
|
||||
@@ -239,16 +239,15 @@ STATIC s_cTempDir := NIL
|
||||
STATIC s_nErrors := 0 /* error indicator */
|
||||
STATIC s_cSourceRoot := NIL /* top directory of the newly-unpacked source tree */
|
||||
|
||||
STATIC s_aTools := { ;
|
||||
"patch" => NIL, ;
|
||||
"diff" => NIL, ;
|
||||
"curl" => NIL, ;
|
||||
"tar" => NIL, ;
|
||||
"gzip" => NIL, ;
|
||||
"bzip2" => NIL, ;
|
||||
"xz" => NIL, ;
|
||||
"unzip" => NIL ;
|
||||
}
|
||||
STATIC s_aTools := { ;
|
||||
"patch" => NIL, ;
|
||||
"diff" => NIL, ;
|
||||
"curl" => NIL, ;
|
||||
"tar" => NIL, ;
|
||||
"gzip" => NIL, ;
|
||||
"bzip2" => NIL, ;
|
||||
"xz" => NIL, ;
|
||||
"unzip" => NIL }
|
||||
|
||||
PROCEDURE Main( ... )
|
||||
|
||||
|
||||
@@ -4,11 +4,13 @@
|
||||
|
||||
#require "hbcups"
|
||||
|
||||
PROCEDURE Main()
|
||||
PROCEDURE Main( cFile )
|
||||
|
||||
LOCAL i
|
||||
LOCAL aPrinter
|
||||
|
||||
hb_default( @cFile, __FILE__ )
|
||||
|
||||
IF Empty( cupsGetDefault() )
|
||||
? "No default printer configured"
|
||||
ELSE
|
||||
@@ -27,15 +29,15 @@ PROCEDURE Main()
|
||||
CLS
|
||||
aPrinter := cupsGetDests()
|
||||
i := AChoice( 2, 5, 30, Len( aPrinter ) + 2, aPrinter )
|
||||
? "Printing... Job ID:", cupsPrintFile( aPrinter[ i ], __FILE__, "Harbour CUPS Printing" )
|
||||
? "Printing... Job ID:", cupsPrintFile( aPrinter[ i ], cFile, "Harbour CUPS Printing" )
|
||||
#if 0
|
||||
/* for duplex printing, tested on OKI B410 */
|
||||
? "Printing... Job ID:", cupsPrintFile( aPrinter[ i ], ".." + hb_ps() + "core.c", "Harbour CUPS Printing", { "sides=two-sided-short-edge" } )
|
||||
#endif
|
||||
ELSE
|
||||
? "Printing... Job ID:", cupsPrintFile( cupsGetDefault(), __FILE__, "Harbour CUPS Printing", { "sides=one-sided" } )
|
||||
? "Printing... Job ID:", cupsPrintFile( cupsGetDefault(), cFile, "Harbour CUPS Printing", { "sides=one-sided" } )
|
||||
#if 0
|
||||
? "Printing... Job ID:", cupsPrintFile( cupsGetDefault(), __FILE__, "Harbour CUPS Printing", { "sides" => "one-sided" } )
|
||||
? "Printing... Job ID:", cupsPrintFile( cupsGetDefault(), cFile, "Harbour CUPS Printing", { "sides" => "one-sided" } )
|
||||
#endif
|
||||
ENDIF
|
||||
|
||||
|
||||
@@ -6,10 +6,12 @@
|
||||
|
||||
#include "fileio.ch"
|
||||
|
||||
PROCEDURE Main()
|
||||
PROCEDURE Main( cFile )
|
||||
|
||||
hb_default( @cFile, __FILE__ )
|
||||
|
||||
// open a text file here
|
||||
IF hb_FUse( __FILE__, FO_READ ) > 1
|
||||
IF hb_FUse( cFile, FO_READ ) > 1
|
||||
|
||||
DO WHILE ! hb_FAtEof()
|
||||
? "line " + Str( hb_FRecNo(), 2 ) + " " + hb_FReadLn()
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
$DESCRIPTION$
|
||||
The FT_F*() file functions are for reading text files, that is,
|
||||
files where each line (record) is delimited by a CRLF pair.
|
||||
files where each line (record) is delimited by a CRLF/LF.
|
||||
|
||||
Each file is opened in its own "workarea", similar to the concept
|
||||
use by dbf files. As provided, a maximum of 10 files (in 10
|
||||
@@ -133,7 +133,7 @@
|
||||
This function moves the record pointer to the first record
|
||||
in the currently selected text file workarea.
|
||||
|
||||
A text file "record" is a line of text terminated by a CRLF pair.
|
||||
A text file "record" is a line of text terminated by a CRLF/LF.
|
||||
|
||||
$EXAMPLES$
|
||||
ft_FUse( "text.c" ) // open text file
|
||||
@@ -209,7 +209,7 @@
|
||||
This function returns the current record number of the file open
|
||||
in the currently selected text file workarea.
|
||||
|
||||
A text file "record" is a line of text terminated by a CRLF pair.
|
||||
A text file "record" is a line of text terminated by a CRLF/LF.
|
||||
|
||||
$EXAMPLES$
|
||||
ft_FUse( "text.c" ) // open text file
|
||||
@@ -252,7 +252,7 @@
|
||||
|
||||
If a read error occurs ^ft_FError()^n will contain the error code.
|
||||
|
||||
A text file "record" is a line of text terminated by a CRLF pair.
|
||||
A text file "record" is a line of text terminated by a CRLF/LF.
|
||||
|
||||
$EXAMPLES$
|
||||
// read last line
|
||||
@@ -295,7 +295,7 @@
|
||||
|
||||
If a read error occurs ^ft_FError()^n will contain the error code.
|
||||
|
||||
A text file "record" is a line of text terminated by a CRLF pair.
|
||||
A text file "record" is a line of text terminated by a CRLF/LF.
|
||||
|
||||
$EXAMPLES$
|
||||
// display each record of a text file
|
||||
@@ -333,7 +333,7 @@
|
||||
$DESCRIPTION$
|
||||
This function returns a line of text read from the file in the
|
||||
currently selected text file workarea. Text lines are delimited
|
||||
with a CRLF pair. The record pointer is not moved.
|
||||
with a CRLF/LF. The record pointer is not moved.
|
||||
|
||||
Currently the maximum record size is 4096 characters. You may
|
||||
increase the maximum record size by changing the value of ^b#define
|
||||
@@ -343,7 +343,7 @@
|
||||
|
||||
If a read error occurs ^ft_FError()^n will contain the error code.
|
||||
|
||||
A text file "record" is a line of text terminated by a CRLF pair.
|
||||
A text file "record" is a line of text terminated by a CRLF/LF.
|
||||
|
||||
$EXAMPLES$
|
||||
// display each record of a text file
|
||||
@@ -384,7 +384,7 @@
|
||||
$DESCRIPTION$
|
||||
This function deletes one or several lines of text from the file
|
||||
in the currently selected text file workarea. Text lines are
|
||||
delimited with a CRLF pair. The record pointer is not moved,
|
||||
delimited with a CRLF/LF. The record pointer is not moved,
|
||||
unless the deleted lines occur at the end of the file, in which
|
||||
case ^bft_fRecno()^n will equal ^bft_fLastRe()^n and ^bft_fEOF()^n
|
||||
will be set to TRUE.
|
||||
@@ -422,11 +422,11 @@
|
||||
$DESCRIPTION$
|
||||
This function inserts a line of text in the file in the currently
|
||||
selected text file workarea. Text lines are delimited with a
|
||||
CRLF pair.
|
||||
CRLF/LF.
|
||||
|
||||
The record pointer is not moved.
|
||||
|
||||
A text file "record" is a line of text terminated by a CRLF pair.
|
||||
A text file "record" is a line of text terminated by a CRLF/LF.
|
||||
Each line inserted with this function will be empty.
|
||||
|
||||
$EXAMPLES$
|
||||
@@ -463,19 +463,19 @@
|
||||
$DESCRIPTION$
|
||||
This function appends a line of text to the file in the currently
|
||||
selected text file workarea. Text lines are delimited with a
|
||||
CRLF pair. The record pointer is moved to the last appended
|
||||
CRLF/LF. The record pointer is moved to the last appended
|
||||
record.
|
||||
|
||||
Multiple lines may be appended with one call to ft_FAppend().
|
||||
|
||||
A text file "record" is a line of text terminated by a CRLF pair.
|
||||
A text file "record" is a line of text terminated by a CRLF/LF.
|
||||
Each line appended with this function will be empty.
|
||||
|
||||
NOTE: Occasionally a text file may contain a non-CRLF terminated
|
||||
NOTE: Occasionally a text file may contain a non-CRLF/LF terminated
|
||||
line, at the end of the file ("stragglers"). This function assumes
|
||||
these stragglers to be the last line of the file, and begins
|
||||
appending the new lines after this line. In other words, if the
|
||||
last line in the text file is not terminated with a CRLF pair prior
|
||||
last line in the text file is not terminated with a CRLF/LF prior
|
||||
to calling ft_FAppend(), the function will terminate that last line
|
||||
before appending any new lines.
|
||||
|
||||
@@ -521,7 +521,7 @@
|
||||
$DESCRIPTION$
|
||||
This function writes a line of text to the file in the currently
|
||||
selected text file workarea. Text lines are delimited with a
|
||||
CRLF pair. The record pointer is not moved.
|
||||
CRLF/LF. The record pointer is not moved.
|
||||
|
||||
The contents of the current record are updated to reflect the new
|
||||
new line written, unless the Insert option is selected.
|
||||
@@ -530,7 +530,7 @@
|
||||
if in overstrike mode, else inserting a new line (same as
|
||||
ft_FInsert()).
|
||||
|
||||
A text file "record" is a line of text terminated by a CRLF pair.
|
||||
A text file "record" is a line of text terminated by a CRLF/LF.
|
||||
|
||||
$EXAMPLES$
|
||||
// write a line of text to a file
|
||||
@@ -570,7 +570,7 @@
|
||||
$DESCRIPTION$
|
||||
This function returns the number of the last record in a text file.
|
||||
|
||||
A text file "record" is a line of text terminated by a CRLF pair.
|
||||
A text file "record" is a line of text terminated by a CRLF/LF.
|
||||
|
||||
$EXAMPLES$
|
||||
ft_FUse( "text.c" )
|
||||
@@ -601,7 +601,7 @@
|
||||
$DESCRIPTION$
|
||||
This function is similar to the CLIPPER Eof() function.
|
||||
|
||||
A text file "record" is a line of text terminated by a CRLF pair.
|
||||
A text file "record" is a line of text terminated by a CRLF/LF.
|
||||
|
||||
$EXAMPLES$
|
||||
ft_FUse( "fttext.c" )
|
||||
@@ -636,7 +636,7 @@
|
||||
$DESCRIPTION$
|
||||
This function is similar to the CLIPPER Bof() function.
|
||||
|
||||
A text file "record" is a line of text terminated by a CRLF pair.
|
||||
A text file "record" is a line of text terminated by a CRLF/LF.
|
||||
|
||||
$EXAMPLES$
|
||||
ft_FUse( "fttext.c" )
|
||||
@@ -685,7 +685,7 @@
|
||||
large and the current record is a high number, you may see some
|
||||
delay as ft_FGoto(0) skips through the file.
|
||||
|
||||
A text file "record" is a line of text terminated by a CRLF pair.
|
||||
A text file "record" is a line of text terminated by a CRLF/LF.
|
||||
|
||||
$EXAMPLES$
|
||||
// read 5th line of text from file
|
||||
|
||||
@@ -135,12 +135,12 @@
|
||||
Some sample Clipper code which would use these functions is listed
|
||||
below. It will print out the contents of this file.
|
||||
|
||||
ft_fuse( "text.c" )
|
||||
DO WHILE ! ft_feof()
|
||||
? ft_freadln()
|
||||
ft_fskip()
|
||||
ft_FUse( "text.c" )
|
||||
DO WHILE ! ft_FEof()
|
||||
? ft_FReadLn()
|
||||
ft_FSkip()
|
||||
ENDDO
|
||||
ft_fuse()
|
||||
ft_FUse()
|
||||
|
||||
*/
|
||||
|
||||
@@ -186,7 +186,7 @@ static void s_ft_text_init( void * cargo )
|
||||
static HB_TSD_NEW( s_ft_text, sizeof( FT_TEXT ), s_ft_text_init, NULL );
|
||||
|
||||
/* routines internal to this module */
|
||||
static HB_ISIZ _findeol( char * buf, HB_ISIZ buf_len );
|
||||
static HB_ISIZ _findeol( char * buf, HB_ISIZ buf_len, HB_ISIZ * eol_len );
|
||||
static HB_ISIZ _findbol( char * buf, HB_ISIZ buf_len );
|
||||
static int _ins_buff( PFT_TEXT ft_text, HB_ISIZ iLen );
|
||||
static int _del_buff( PFT_TEXT ft_text, HB_ISIZ iLen );
|
||||
@@ -380,11 +380,11 @@ static long _ft_skip( long iRecs )
|
||||
do
|
||||
{
|
||||
/* get count of chars in this line */
|
||||
iByteCount = _findeol( cPtr, iBytesRemaining );
|
||||
iByteCount = _findeol( cPtr, iBytesRemaining, NULL );
|
||||
|
||||
if( iByteCount > 0 && iByteCount != iBytesRemaining )
|
||||
{
|
||||
/* found a CRLF, iByteCount points to first char of next
|
||||
/* found an EOL, iByteCount points to first char of next
|
||||
record */
|
||||
iBytesRemaining -= iByteCount;
|
||||
fpOffset += iByteCount;
|
||||
@@ -398,7 +398,7 @@ static long _ft_skip( long iRecs )
|
||||
else
|
||||
{
|
||||
|
||||
/* no more CRLFs in this buffer, or CRLF is last
|
||||
/* no more EOLs in this buffer, or EOL is last
|
||||
chars in the buffer */
|
||||
|
||||
/* check for EOF */
|
||||
@@ -414,7 +414,7 @@ static long _ft_skip( long iRecs )
|
||||
else
|
||||
{
|
||||
/* buffer was full, so probably not EOF, but maybe
|
||||
CRLF straddled end of buffer, so back up pointer a bit
|
||||
EOL straddled end of buffer, so back up pointer a bit
|
||||
before doing the next read */
|
||||
fpOffset = hb_fsSeekLarge( ft_text->handles[ ft_text->area ], 0, FS_RELATIVE ) - 1;
|
||||
iBytesRemaining = 0;
|
||||
@@ -470,7 +470,7 @@ static long _ft_skip( long iRecs )
|
||||
|
||||
if( iByteCount > 0 )
|
||||
{
|
||||
/* found a CRLF, iByteCount points to first char of next
|
||||
/* found an EOL, iByteCount points to first char of next
|
||||
record */
|
||||
iBytesRemaining -= iByteCount;
|
||||
ft_text->offset[ ft_text->area ] -= iByteCount;
|
||||
@@ -483,7 +483,7 @@ static long _ft_skip( long iRecs )
|
||||
}
|
||||
else
|
||||
{
|
||||
/* no more CRLFs in this buffer so we're either at
|
||||
/* no more EOLs in this buffer so we're either at
|
||||
BOF or record crosses buffer boundary */
|
||||
/* check for BOF */
|
||||
if( iBytesRead != BUFFSIZE )
|
||||
@@ -523,6 +523,7 @@ HB_FUNC( FT_FREADLN )
|
||||
|
||||
HB_ISIZ iByteCount;
|
||||
HB_ISIZ iBytesRead;
|
||||
HB_ISIZ eol_len;
|
||||
char * cPtr = ( char * ) hb_xgrab( BUFFSIZE );
|
||||
|
||||
hb_fsSeekLarge( ft_text->handles[ ft_text->area ], ft_text->offset[ ft_text->area ], FS_SET );
|
||||
@@ -533,10 +534,9 @@ HB_FUNC( FT_FREADLN )
|
||||
if( ! iBytesRead )
|
||||
ft_text->error[ ft_text->area ] = hb_fsError();
|
||||
|
||||
iByteCount = _findeol( cPtr, iBytesRead );
|
||||
|
||||
iByteCount = _findeol( cPtr, iBytesRead, &eol_len );
|
||||
if( iByteCount )
|
||||
hb_retclen( cPtr, iByteCount - 2 );
|
||||
hb_retclen( cPtr, iByteCount - eol_len );
|
||||
else
|
||||
hb_retclen( cPtr, iBytesRead );
|
||||
|
||||
@@ -644,10 +644,10 @@ HB_FUNC( FT_FAPPEND )
|
||||
hb_fsSeekLarge( ft_text->handles[ ft_text->area ], ft_text->offset[ ft_text->area ], FS_SET );
|
||||
iRead = hb_fsRead( ft_text->handles[ ft_text->area ], buff, BUFFSIZE ); /* now read in a big glob */
|
||||
|
||||
/* determine if CRLF pair exists, if not, add one */
|
||||
/* determine if EOL exists, if not, add one */
|
||||
|
||||
/* get count of chars in this line */
|
||||
iByteCount = _findeol( buff, iRead );
|
||||
iByteCount = _findeol( buff, iRead, NULL );
|
||||
if( iByteCount == 0 )
|
||||
hb_fsSeekLarge( ft_text->handles[ ft_text->area ], 0, FS_END );
|
||||
else
|
||||
@@ -701,7 +701,7 @@ HB_FUNC( FT_FWRITELN )
|
||||
|
||||
if( bInsert )
|
||||
{
|
||||
/* insert mode, insert the length of new string + crlf */
|
||||
/* insert mode, insert the length of new string + EOL */
|
||||
err = _ins_buff( ft_text, iDataLen + 2 );
|
||||
|
||||
if( ! err )
|
||||
@@ -722,7 +722,7 @@ HB_FUNC( FT_FWRITELN )
|
||||
do
|
||||
{
|
||||
iRead = hb_fsRead( ft_text->handles[ ft_text->area ], buffer, BUFFSIZE );
|
||||
iEOL = _findeol( buffer, iRead );
|
||||
iEOL = _findeol( buffer, iRead, NULL );
|
||||
if( iEOL == 0 )
|
||||
{
|
||||
iLineLen += iRead;
|
||||
@@ -825,26 +825,34 @@ HB_FUNC( FT_FGOTO )
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
In-line assembler routine to parse a buffer
|
||||
for a CRLF pair
|
||||
for an EOL
|
||||
|
||||
Returns count to first character _after_ next
|
||||
CRLF pair (beginning of next line). Current line
|
||||
will contain the trailing CRLF. 1Ah and trailing
|
||||
EOL (beginning of next line). Current line
|
||||
will contain the trailing EOL. 1Ah and trailing
|
||||
LFs will be ignored (included in count).
|
||||
|
||||
If no CRLF found return is zero. (could mean EOF or
|
||||
If no EOL found return is zero. (could mean EOF or
|
||||
line is longer than buffer end)
|
||||
*/
|
||||
static HB_ISIZ _findeol( char * buf, HB_ISIZ buf_len )
|
||||
static HB_ISIZ _findeol( char * buf, HB_ISIZ buf_len, HB_ISIZ * eol_len )
|
||||
{
|
||||
HB_ISIZ tmp;
|
||||
|
||||
for( tmp = 0; tmp < buf_len; tmp++ )
|
||||
{
|
||||
if( buf[ tmp ] == FT_CHR_CR && buf[ tmp + 1 ] == FT_CHR_LF )
|
||||
if( tmp < buf_len - 1 && buf[ tmp ] == FT_CHR_CR && buf[ tmp + 1 ] == FT_CHR_LF )
|
||||
{
|
||||
if( eol_len )
|
||||
*eol_len = 2;
|
||||
return tmp + 2;
|
||||
}
|
||||
else if( buf[ tmp ] == FT_CHR_LF )
|
||||
{
|
||||
if( eol_len )
|
||||
*eol_len = 1;
|
||||
return tmp + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -852,13 +860,13 @@ static HB_ISIZ _findeol( char * buf, HB_ISIZ buf_len )
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
In-line assembler routine to parse a buffer
|
||||
for a CRLF pair
|
||||
for a EOL
|
||||
|
||||
buf pointer points at beginning of search (end
|
||||
of the buffer), all searches are conducted
|
||||
backwards, returns No. of characters betw.
|
||||
initial position and first character _after_
|
||||
the preceding CRLF pair (beginning of line).
|
||||
the preceding EOL (beginning of line).
|
||||
*/
|
||||
static HB_ISIZ _findbol( char * buf, HB_ISIZ buf_len )
|
||||
{
|
||||
@@ -1059,7 +1067,7 @@ static int _del_buff( PFT_TEXT ft_text, HB_ISIZ iLen )
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
/* writes a line of data to the file, including the terminating CRLF */
|
||||
/* writes a line of data to the file, including the terminating EOL */
|
||||
static int _writeLine( PFT_TEXT ft_text, const char * theData, HB_SIZE iDataLen )
|
||||
{
|
||||
int err = 0;
|
||||
@@ -1079,8 +1087,8 @@ static int _writeLine( PFT_TEXT ft_text, const char * theData, HB_SIZE iDataLen
|
||||
|
||||
static HB_BOOL _writeeol( HB_FHANDLE fhnd )
|
||||
{
|
||||
const char * crlf = hb_conNewLine();
|
||||
HB_SIZE len = strlen( crlf );
|
||||
const char * eol = hb_conNewLine();
|
||||
HB_SIZE len = strlen( eol );
|
||||
|
||||
return hb_fsWriteLarge( fhnd, crlf, len ) == len;
|
||||
return hb_fsWriteLarge( fhnd, eol, len ) == len;
|
||||
}
|
||||
|
||||
@@ -6,18 +6,17 @@
|
||||
|
||||
#include "inkey.ch"
|
||||
|
||||
PROCEDURE Main()
|
||||
PROCEDURE Main( cInFile )
|
||||
|
||||
LOCAL cInFile := __FILE__
|
||||
LOCAL nKey
|
||||
LOCAL NNCOLOR := 7
|
||||
LOCAL NHCOLOR := 15
|
||||
LOCAL NCOLSKIP := 5
|
||||
LOCAL NRMARGIN := 132
|
||||
LOCAL CEXITKEYS := PadR( "AABBC", 12 )
|
||||
LOCAL LBROWSE := .F.
|
||||
LOCAL NSTART := 1
|
||||
LOCAL NBUFFSIZE := 4096
|
||||
LOCAL nNColor := 7
|
||||
LOCAL nHColor := 15
|
||||
LOCAL nColSkip := 5
|
||||
LOCAL nRMargin := 132
|
||||
LOCAL cExitKeys := PadR( "AABBC", 12 )
|
||||
LOCAL lBrowse := .F.
|
||||
LOCAL nStart := 1
|
||||
LOCAL nBuffSize := 4096
|
||||
LOCAL GetList := {}
|
||||
|
||||
LOCAL aExitKeys
|
||||
@@ -25,14 +24,18 @@ PROCEDURE Main()
|
||||
|
||||
CLS
|
||||
|
||||
@ 0, 0 SAY "ENTER FILENAME: " GET CINFILE
|
||||
@ 1, 0 SAY " FOREGROUND: " GET NNCOLOR PICTURE "999"
|
||||
@ 2, 0 SAY " HIGHLIGHT: " GET NHCOLOR PICTURE "999"
|
||||
@ 3, 0 SAY " EXIT KEYS: " GET CEXITKEYS
|
||||
@ 4, 0 SAY " BUFFER SIZE: " GET NBUFFSIZE PICTURE "9999"
|
||||
@ 1, 40 SAY "COLUMN INCREMENT: " GET NCOLSKIP PICTURE "999"
|
||||
@ 2, 40 SAY " MAX LINE SIZE: " GET NRMARGIN PICTURE "999"
|
||||
@ 3, 40 SAY " BROWSE MODE? " GET LBROWSE PICTURE "Y"
|
||||
hb_default( @cInFile, __FILE__ )
|
||||
|
||||
cInFile := PadR( cInFile, 128 )
|
||||
|
||||
@ 0, 0 SAY "ENTER FILENAME: " GET cInFile PICTURE "@S30"
|
||||
@ 1, 0 SAY " FOREGROUND: " GET nNColor PICTURE "999"
|
||||
@ 2, 0 SAY " HIGHLIGHT: " GET nHColor PICTURE "999"
|
||||
@ 3, 0 SAY " EXIT KEYS: " GET cEXitKeys
|
||||
@ 4, 0 SAY " BUFFER SIZE: " GET nBUffSize PICTURE "9999"
|
||||
@ 1, 40 SAY "COLUMN INCREMENT: " GET nCOlSkip PICTURE "999"
|
||||
@ 2, 40 SAY " MAX LINE SIZE: " GET nRMargin PICTURE "999"
|
||||
@ 3, 40 SAY " BROWSE MODE? " GET lBRowse PICTURE "Y"
|
||||
|
||||
READ
|
||||
|
||||
@@ -52,7 +55,7 @@ PROCEDURE Main()
|
||||
|
||||
@ 4, 9 TO 11, 71
|
||||
|
||||
ft_DFSetup( cInFile, 5, 10, 10, 70, nStart, ;
|
||||
ft_DFSetup( AllTrim( cInFile ), 5, 10, 10, 70, nStart, ;
|
||||
nNColor, nHColor, aExitKeys, ;
|
||||
lBrowse, nColSkip, nRMargin, nBuffSize )
|
||||
|
||||
|
||||
@@ -6,10 +6,12 @@
|
||||
|
||||
#include "fileio.ch"
|
||||
|
||||
PROCEDURE Main()
|
||||
PROCEDURE Main( cFile )
|
||||
|
||||
hb_default( @cFile, __FILE__ )
|
||||
|
||||
// open a text file here
|
||||
IF ft_FUse( __FILE__, FO_READ ) > 1
|
||||
IF ft_FUse( cFile, FO_READ ) > 1
|
||||
|
||||
DO WHILE ! ft_FEof()
|
||||
? "line " + Str( ft_FRecNo(), 2 ) + " " + ft_FReadLn()
|
||||
|
||||
@@ -83,7 +83,7 @@ PROCEDURE Main()
|
||||
PQexec( conn, "begin" )
|
||||
|
||||
? ( x := lo_import( conn, __FILE__ ) )
|
||||
? lo_export( conn, x, "test.new" )
|
||||
? lo_export( conn, x, hb_FNameExtSet( __FILE__, ".new" ) )
|
||||
? lo_unlink( conn, x )
|
||||
|
||||
PQexec( conn, "commit" )
|
||||
|
||||
@@ -14,7 +14,7 @@ PROCEDURE Main()
|
||||
LOCAL lFromUser := .T.
|
||||
LOCAL aSender := { "test from", "from@test.com" }
|
||||
LOCAL aDest := { { "test to", "to@test.com", WIN_MAPI_TO } }
|
||||
LOCAL aFiles := { { __FILE__, "testmapi" } }
|
||||
LOCAL aFiles := { { __FILE__, hb_FNameName( __FILE__ ) } }
|
||||
|
||||
? win_MAPISendMail( ;
|
||||
cSubject, ; // subject
|
||||
|
||||
@@ -6,6 +6,6 @@
|
||||
|
||||
PROCEDURE Main()
|
||||
|
||||
xhb_CopyFile( __FILE__, "testcp.bak", {| x | QOut( x ) } )
|
||||
xhb_CopyFile( __FILE__, hb_FNameExtSet( __FILE__, ".bak" ), {| x | QOut( x ) } )
|
||||
|
||||
RETURN
|
||||
|
||||
@@ -1686,7 +1686,7 @@ HB_BOOL hb_fsSetAttr( const char * pszFileName, HB_FATTR ulAttr )
|
||||
{
|
||||
LPCTSTR lpFileName;
|
||||
LPTSTR lpFree;
|
||||
DWORD dwFlags = FILE_ATTRIBUTE_ARCHIVE;
|
||||
DWORD dwFlags = 0;
|
||||
|
||||
lpFileName = HB_FSNAMECONV( pszFileName, &lpFree );
|
||||
|
||||
@@ -1696,8 +1696,10 @@ HB_BOOL hb_fsSetAttr( const char * pszFileName, HB_FATTR ulAttr )
|
||||
dwFlags |= FILE_ATTRIBUTE_HIDDEN;
|
||||
if( ulAttr & HB_FA_SYSTEM )
|
||||
dwFlags |= FILE_ATTRIBUTE_SYSTEM;
|
||||
if( ulAttr & HB_FA_NORMAL )
|
||||
dwFlags |= FILE_ATTRIBUTE_NORMAL;
|
||||
if( ulAttr & HB_FA_ARCHIVE )
|
||||
dwFlags |= FILE_ATTRIBUTE_ARCHIVE;
|
||||
if( dwFlags == 0 )
|
||||
dwFlags = FILE_ATTRIBUTE_NORMAL;
|
||||
fResult = SetFileAttributes( lpFileName, dwFlags ) != 0;
|
||||
hb_fsSetIOError( fResult, 0 );
|
||||
|
||||
|
||||
@@ -27,66 +27,66 @@ PROCEDURE Main( cFile )
|
||||
LOCAL hAll := { => }
|
||||
|
||||
LOCAL hExtExceptions := { ;
|
||||
hb_libExt() => NIL, ;
|
||||
".zip" => NIL, ;
|
||||
".7z" => NIL, ;
|
||||
".exe" => NIL, ;
|
||||
".o" => NIL, ;
|
||||
".js" => NIL, ;
|
||||
".dif" => NIL, ;
|
||||
".c" => NIL, ;
|
||||
".h" => NIL, ;
|
||||
".api" => NIL, ;
|
||||
".exe" => NIL, ;
|
||||
".y" => NIL, ;
|
||||
".yyc" => NIL, ;
|
||||
".yyh" => NIL, ;
|
||||
".a" => NIL, ;
|
||||
".afm" => NIL, ;
|
||||
".bmp" => NIL, ;
|
||||
".dat" => NIL, ;
|
||||
".dbf" => NIL, ;
|
||||
".exe" => NIL, ;
|
||||
".frm" => NIL, ;
|
||||
".gif" => NIL, ;
|
||||
".icns" => NIL, ;
|
||||
".ico" => NIL, ;
|
||||
".jpg" => NIL, ;
|
||||
".lbl" => NIL, ;
|
||||
".lib" => NIL, ;
|
||||
".mdb" => NIL, ;
|
||||
".ng" => NIL, ;
|
||||
".odt" => NIL, ;
|
||||
".pdf" => NIL, ;
|
||||
".pfb" => NIL, ;
|
||||
".png" => NIL, ;
|
||||
".sq3" => NIL, ;
|
||||
".tif" => NIL }
|
||||
hb_libExt() =>, ;
|
||||
".zip" =>, ;
|
||||
".7z" =>, ;
|
||||
".exe" =>, ;
|
||||
".o" =>, ;
|
||||
".js" =>, ;
|
||||
".dif" =>, ;
|
||||
".c" =>, ;
|
||||
".h" =>, ;
|
||||
".api" =>, ;
|
||||
".exe" =>, ;
|
||||
".y" =>, ;
|
||||
".yyc" =>, ;
|
||||
".yyh" =>, ;
|
||||
".a" =>, ;
|
||||
".afm" =>, ;
|
||||
".bmp" =>, ;
|
||||
".dat" =>, ;
|
||||
".dbf" =>, ;
|
||||
".exe" =>, ;
|
||||
".frm" =>, ;
|
||||
".gif" =>, ;
|
||||
".icns" =>, ;
|
||||
".ico" =>, ;
|
||||
".jpg" =>, ;
|
||||
".lbl" =>, ;
|
||||
".lib" =>, ;
|
||||
".mdb" =>, ;
|
||||
".ng" =>, ;
|
||||
".odt" =>, ;
|
||||
".pdf" =>, ;
|
||||
".pfb" =>, ;
|
||||
".png" =>, ;
|
||||
".sq3" =>, ;
|
||||
".tif" => }
|
||||
|
||||
LOCAL hFileExceptions := { ;
|
||||
"ChangeLog.txt" => NIL, ;
|
||||
"std.ch" => NIL, ;
|
||||
"wcecon.prg" => NIL, ;
|
||||
"uc16_gen.prg" => NIL, ;
|
||||
"clsscope.prg" => NIL, ;
|
||||
"speedstr.prg" => NIL, ;
|
||||
"cpinfo.prg" => NIL, ;
|
||||
"clsccast.prg" => NIL, ;
|
||||
"clsicast.prg" => NIL, ;
|
||||
"clsscast.prg" => NIL, ;
|
||||
"big5_gen.prg" => NIL, ;
|
||||
"foreach2.prg" => NIL, ;
|
||||
"speedtst.prg" => NIL, ;
|
||||
"keywords.prg" => NIL, ;
|
||||
"xhb-diff.txt" => NIL, ;
|
||||
"pp.txt" => NIL, ;
|
||||
"locks.txt" => NIL, ;
|
||||
"oldnews.txt" => NIL, ;
|
||||
"news.html" => NIL, ;
|
||||
"news1.html" => NIL, ;
|
||||
"c_std.txt" => NIL, ;
|
||||
"tracing.txt" => NIL, ;
|
||||
"pcode.txt" => NIL }
|
||||
"ChangeLog.txt" =>, ;
|
||||
"std.ch" =>, ;
|
||||
"wcecon.prg" =>, ;
|
||||
"uc16_gen.prg" =>, ;
|
||||
"clsscope.prg" =>, ;
|
||||
"speedstr.prg" =>, ;
|
||||
"cpinfo.prg" =>, ;
|
||||
"clsccast.prg" =>, ;
|
||||
"clsicast.prg" =>, ;
|
||||
"clsscast.prg" =>, ;
|
||||
"big5_gen.prg" =>, ;
|
||||
"foreach2.prg" =>, ;
|
||||
"speedtst.prg" =>, ;
|
||||
"keywords.prg" =>, ;
|
||||
"xhb-diff.txt" =>, ;
|
||||
"pp.txt" =>, ;
|
||||
"locks.txt" =>, ;
|
||||
"oldnews.txt" =>, ;
|
||||
"news.html" =>, ;
|
||||
"news1.html" =>, ;
|
||||
"c_std.txt" =>, ;
|
||||
"tracing.txt" =>, ;
|
||||
"pcode.txt" => }
|
||||
|
||||
LOCAL aMaskExceptions := { ;
|
||||
"contrib/xhb/thtm.prg" , ;
|
||||
|
||||
@@ -13697,8 +13697,8 @@ STATIC PROCEDURE __hbshell( cFile, ... )
|
||||
- dynamic libs will reference and automatically load all their dependencies
|
||||
(true on all systems so far)
|
||||
- this tool is located in well known place inside the Harbour dir tree.
|
||||
- contribs/addons are located in well-known place inside the Harbour dir tree
|
||||
- 3rd party addons can be loaded, too if they are installed into the Harbour dir tree
|
||||
- contribs/add-ons are located in well-known place inside the Harbour dir tree
|
||||
- 3rd party add-ons can be loaded, too if they are installed into the Harbour dir tree
|
||||
and built the same way as contribs.
|
||||
- dynamic libs are installed into bin dir.
|
||||
(this is not true on *nix, there they are in lib dir, and it is a problem
|
||||
@@ -14815,6 +14815,7 @@ FUNCTION hbshell_Clipper()
|
||||
hb_gtInfo( HB_GTI_COMPATBUFFER, .T. )
|
||||
hb_gtInfo( HB_GTI_BOXCP, "EN" )
|
||||
hb_langSelect( "en" )
|
||||
Set( _SET_DATEFORMAT, "mm/dd/yy" )
|
||||
|
||||
RETURN NIL
|
||||
|
||||
@@ -16033,7 +16034,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lMore, lLong )
|
||||
I_( "Libraries and object files built with/for CA-Cl*pper will not work with any supported platform/compiler." ), ;
|
||||
I_( "Defaults and feature support may vary by platform/compiler." ), ;
|
||||
hb_StrFormat( I_( "GNU Make or any C compiler specific make tool and MSYS (on Windows) are not needed to run %1$s." ), _SELF_NAME_ ), ;
|
||||
hb_StrFormat( I_( ".hb or .hrb file passed as first parameter will be run as Harbour script. Note, for Harbour scripts, the codepage is set to UTF-8 by default. The default core header 'hb.ch' is automatically #included. The default GT is '%1$s', unless full-screen CUI calls are detected, when '%2$s' [*] is automatically selected." ), Lower( _HBMK_GT_DEF_ ), Lower( __hbshell_gtDefault() ) ), ;
|
||||
hb_StrFormat( I_( ".hb or .hrb file passed as first parameter will be run as Harbour script. Note, for Harbour scripts, the codepage is set to UTF-8 by default. The default core header 'hb.ch' is automatically #included. The default date format is the ISO standard: yyyy-mm-dd. The default GT is '%1$s', unless full-screen CUI calls are detected, when '%2$s' [*] is automatically selected." ), Lower( _HBMK_GT_DEF_ ), Lower( __hbshell_gtDefault() ) ), ;
|
||||
I_( ". (dot) passed as first parameter will enter the interactive Harbour shell." ), ;
|
||||
hb_StrFormat( I_( "Values marked with [*] may be host platform and/or configuration dependent. This help was generated on '%1$s' host platform." ), Lower( hb_Version( HB_VERSION_PLATFORM ) ) ) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user