diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 15cfb7fdd5..9e625faa89 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,31 @@ The license applies to all entries newer than 2009-04-28. */ +2012-10-17 20:39 UTC+0200 Viktor Szakats (harbour syenar.net) + * contrib/hbnf/hbnf.hbx + * contrib/hbnf/video1.c + + Implemented FT_REVATTR(), FT_REVCHR() + + * contrib/hbnf/floptst.prg + + Implemented FT_FLOPTST() + + * contrib/hbct/doc/en/*.txt + ! fixed lib name where wrong + + * contrib/hbnf/cint86.c + * contrib/hbnf/support.c + * changed TODOs to visible warnings on MS-DOS platform + + * contrib/hbnf/ftattr.c + % FT_RESTATT(): buffering output + * minor cleanups + + * contrib/hbnf/readme.txt + * updated + + * contrib/hbnf/doc/en/*.txt + ! minor fixes + 2012-10-17 16:31 UTC+0200 Viktor Szakats (harbour syenar.net) * contrib/hbct/doc/en/*.txt * doc/en/*.txt diff --git a/harbour/contrib/hbct/doc/en/addascii.txt b/harbour/contrib/hbct/doc/en/addascii.txt index 2e4bd9a4d2..d7a50585aa 100644 --- a/harbour/contrib/hbct/doc/en/addascii.txt +++ b/harbour/contrib/hbct/doc/en/addascii.txt @@ -60,7 +60,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CSETREF() * $END$ diff --git a/harbour/contrib/hbct/doc/en/asciisum.txt b/harbour/contrib/hbct/doc/en/asciisum.txt index 84dbfa90f8..885924c4b6 100644 --- a/harbour/contrib/hbct/doc/en/asciisum.txt +++ b/harbour/contrib/hbct/doc/en/asciisum.txt @@ -34,7 +34,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CHECKSUM() * $END$ diff --git a/harbour/contrib/hbct/doc/en/atadjust.txt b/harbour/contrib/hbct/doc/en/atadjust.txt index 0aa8ea2203..cda0795f67 100644 --- a/harbour/contrib/hbct/doc/en/atadjust.txt +++ b/harbour/contrib/hbct/doc/en/atadjust.txt @@ -40,7 +40,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * SETATLIKE(),CSETATMUPA() * $END$ diff --git a/harbour/contrib/hbct/doc/en/atnum.txt b/harbour/contrib/hbct/doc/en/atnum.txt index efc9458fa7..265c76fe1e 100644 --- a/harbour/contrib/hbct/doc/en/atnum.txt +++ b/harbour/contrib/hbct/doc/en/atnum.txt @@ -108,7 +108,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * ATNUM() AFTERATNUM() CSETATMUPA() SETATLIKE() * $END$ diff --git a/harbour/contrib/hbct/doc/en/atrepl.txt b/harbour/contrib/hbct/doc/en/atrepl.txt index 302d27584e..5b182467e7 100644 --- a/harbour/contrib/hbct/doc/en/atrepl.txt +++ b/harbour/contrib/hbct/doc/en/atrepl.txt @@ -61,7 +61,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CSETATMUPA() SETATLIKE() * $END$ diff --git a/harbour/contrib/hbct/doc/en/charevod.txt b/harbour/contrib/hbct/doc/en/charevod.txt index c6ba5dce1f..a79acb0fc6 100644 --- a/harbour/contrib/hbct/doc/en/charevod.txt +++ b/harbour/contrib/hbct/doc/en/charevod.txt @@ -32,7 +32,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CHARODD() CHARMIX() * $END$ @@ -67,7 +67,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CHAREVEN() CHARMIX() * $END$ diff --git a/harbour/contrib/hbct/doc/en/charmirr.txt b/harbour/contrib/hbct/doc/en/charmirr.txt index 64f44a65cf..8b65422b5e 100644 --- a/harbour/contrib/hbct/doc/en/charmirr.txt +++ b/harbour/contrib/hbct/doc/en/charmirr.txt @@ -41,7 +41,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CSETREF() * $END$ diff --git a/harbour/contrib/hbct/doc/en/charmix.txt b/harbour/contrib/hbct/doc/en/charmix.txt index fa023ff6b5..e75744d280 100644 --- a/harbour/contrib/hbct/doc/en/charmix.txt +++ b/harbour/contrib/hbct/doc/en/charmix.txt @@ -47,7 +47,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CHAREVEN() CHARODD() * $END$ diff --git a/harbour/contrib/hbct/doc/en/charone.txt b/harbour/contrib/hbct/doc/en/charone.txt index 989c4af29c..127be8aafc 100644 --- a/harbour/contrib/hbct/doc/en/charone.txt +++ b/harbour/contrib/hbct/doc/en/charone.txt @@ -40,7 +40,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CHARREM() WORDONE() * $END$ @@ -81,7 +81,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CHARONE() CHARREM() * $END$ diff --git a/harbour/contrib/hbct/doc/en/charonly.txt b/harbour/contrib/hbct/doc/en/charonly.txt index 666d5f236b..e0659a26c0 100644 --- a/harbour/contrib/hbct/doc/en/charonly.txt +++ b/harbour/contrib/hbct/doc/en/charonly.txt @@ -35,7 +35,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CHARREM() WORDONLY() WORDREM() * $END$ @@ -74,7 +74,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CHARONLY() CHARREM() WORDREM() * $END$ @@ -112,7 +112,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CHARONLY() WORDONLY() WORDREM() * $END$ @@ -151,7 +151,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CHARONLY CHARREM() WORDREM() * $END$ diff --git a/harbour/contrib/hbct/doc/en/charop.txt b/harbour/contrib/hbct/doc/en/charop.txt index 79c0dc2a67..3fc20ad7d1 100644 --- a/harbour/contrib/hbct/doc/en/charop.txt +++ b/harbour/contrib/hbct/doc/en/charop.txt @@ -43,7 +43,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CHARSUB() CHARAND() CHARNOT() * CHAROR() CHARXOR() CHARSHL() @@ -92,7 +92,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CHARADD() CHARSUB() CHARNOT() * CHAROR() CHARXOR() CHARSHL() @@ -137,7 +137,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CHARADD() CHARSUB() CHARAND() * CHAROR() CHARXOR() CHARSHL() @@ -186,7 +186,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CHARADD() CHARSUB() CHARNOT() * CHARAND() CHARXOR() CHARSHL() @@ -233,7 +233,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CHARADD() CHARSUB() CHARNOT() * CHARAND() CHAROR() CHARSHL() diff --git a/harbour/contrib/hbct/doc/en/charophb.txt b/harbour/contrib/hbct/doc/en/charophb.txt index 1ba9f56c3b..3fa4b1241b 100644 --- a/harbour/contrib/hbct/doc/en/charophb.txt +++ b/harbour/contrib/hbct/doc/en/charophb.txt @@ -43,7 +43,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CHARADD() CHARAND() CHARNOT() * CHAROR() CHARXOR() CHARSHL() @@ -89,7 +89,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CHARADD() CHARSUB() CHARAND() * CHAROR() CHARXOR() CHARNOT() @@ -135,7 +135,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CHARADD() CHARSUB() CHARAND() * CHAROR() CHARXOR() CHARNOT() @@ -181,7 +181,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CHARADD() CHARSUB() CHARAND() * CHAROR() CHARXOR() CHARNOT() @@ -227,7 +227,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CHARADD() CHARSUB() CHARAND() * CHAROR() CHARXOR() CHARNOT() diff --git a/harbour/contrib/hbct/doc/en/charrepl.txt b/harbour/contrib/hbct/doc/en/charrepl.txt index 7d7a077fe8..39933e15da 100644 --- a/harbour/contrib/hbct/doc/en/charrepl.txt +++ b/harbour/contrib/hbct/doc/en/charrepl.txt @@ -59,7 +59,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * WORDREPL() POSREPL() RANGEREPL() * CSETREF() diff --git a/harbour/contrib/hbct/doc/en/charsort.txt b/harbour/contrib/hbct/doc/en/charsort.txt index 055de82946..fbd593ca61 100644 --- a/harbour/contrib/hbct/doc/en/charsort.txt +++ b/harbour/contrib/hbct/doc/en/charsort.txt @@ -77,7 +77,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CSETREF() * $END$ diff --git a/harbour/contrib/hbct/doc/en/ctmath.txt b/harbour/contrib/hbct/doc/en/ctmath.txt index aec06e791f..71e9dcbf57 100644 --- a/harbour/contrib/hbct/doc/en/ctmath.txt +++ b/harbour/contrib/hbct/doc/en/ctmath.txt @@ -29,7 +29,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * * $END$ @@ -62,7 +62,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * * $END$ diff --git a/harbour/contrib/hbct/doc/en/ctstr.txt b/harbour/contrib/hbct/doc/en/ctstr.txt index a798f9d198..3b6e9625c5 100644 --- a/harbour/contrib/hbct/doc/en/ctstr.txt +++ b/harbour/contrib/hbct/doc/en/ctstr.txt @@ -50,7 +50,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * ADDASCII() BLANK() CHARADD() * CHARAND() CHARMIRR() CHARNOT() @@ -100,7 +100,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * ATNUM() AFTERATNUM() BEFORATNUM() * ATREPL() NUMAT() ATADJUST() @@ -164,7 +164,7 @@ * $PLATFORMS$ * All * $FILES$ - * Header is ct.ch, library is ct3. + * Header is ct.ch, library is libct. * $SEEALSO$ * * $END$ diff --git a/harbour/contrib/hbct/doc/en/wordrepl.txt b/harbour/contrib/hbct/doc/en/wordrepl.txt index 8274f55443..526e0369c8 100644 --- a/harbour/contrib/hbct/doc/en/wordrepl.txt +++ b/harbour/contrib/hbct/doc/en/wordrepl.txt @@ -60,7 +60,7 @@ * $PLATFORMS$ * All * $FILES$ - * Library is ct3. + * Library is libct. * $SEEALSO$ * CHARREPL(),RANGEREPL(),POSREPL(),CSETREF(),CSETATMUPA() * $END$ diff --git a/harbour/contrib/hbnf/cint86.c b/harbour/contrib/hbnf/cint86.c index 190118560d..3f9986221c 100644 --- a/harbour/contrib/hbnf/cint86.c +++ b/harbour/contrib/hbnf/cint86.c @@ -7,7 +7,9 @@ HB_FUNC( FT_INT86 ) { #if defined( HB_OS_DOS ) - /* TODO */ + { + int iTODO; + } #endif hb_retl( HB_FALSE ); } diff --git a/harbour/contrib/hbnf/doc/en/floptst.txt b/harbour/contrib/hbnf/doc/en/floptst.txt index 540c48ee80..8f00f6f54d 100644 --- a/harbour/contrib/hbnf/doc/en/floptst.txt +++ b/harbour/contrib/hbnf/doc/en/floptst.txt @@ -35,7 +35,7 @@ * should be no problems. * * This function does not currently check subst'd drives. So if you - * have SUBST E: A:\ then FT_FLOPTST( Asc("E")-Asc("A") ) == 4 + * have SUBST E: A:\ then FT_FLOPTST( Asc( "E" ) - Asc( "A" ) ) == 4 * Any suggestions to fix this limitation are appreciated. * * $EXAMPLES$ diff --git a/harbour/contrib/hbnf/doc/en/video1.txt b/harbour/contrib/hbnf/doc/en/video1.txt index b35944362f..e8325fbdbc 100644 --- a/harbour/contrib/hbnf/doc/en/video1.txt +++ b/harbour/contrib/hbnf/doc/en/video1.txt @@ -173,13 +173,13 @@ /* $DOC$ * $FUNCNAME$ - * FT_REVChr() + * FT_REVCHR() * $CATEGORY$ * Video * $ONELINER$ * Reverse the color of a single character on the screen * $SYNTAX$ - * FT_REVChr( , ) -> NIL + * FT_REVCHR( , ) -> NIL * $ARGUMENTS$ * , are the screen coordinates of the character. * $RETURNS$ @@ -190,7 +190,7 @@ * This function is the same as FT_REVATTR() except that it changes * only one character on screen and hence is faster and uses less memory. * $EXAMPLES$ - * FT_REVChr( 10, 20 ) + * FT_REVCHR( 10, 20 ) * * This example will change the text and background at 10, 20 to it's * reverse color attributes without changing or overwriting the diff --git a/harbour/contrib/hbnf/floptst.prg b/harbour/contrib/hbnf/floptst.prg index b1d4e58a17..dcd6e1e772 100644 --- a/harbour/contrib/hbnf/floptst.prg +++ b/harbour/contrib/hbnf/floptst.prg @@ -3,214 +3,90 @@ */ /* - * Author....: Gary Smith - * CIS ID....: 70714,3015 + * Harbour Project source code: + * FT_FLOPTST() * - * This work is based on an original work by Joseph LaCour that - * was placed in the public domain. This work is placed in the - * public domain. + * Copyright 2012 Viktor Szakats (harbour syenar.net) + * www - http://harbour-project.org * - * ACKNOWLEDGEMENTS: + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. * - * PAOLO RAMOZZI FOR HIS WORK IN DBDCHECK FOR SHOWING HOW TO - * USE INT 13H. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). * - * Modification history: - * --------------------- + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. * - * Rev 1.4 05 May 1995 03:05:00 TED - * Gary Smith ported ASM source to Clipper. + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. * - * Rev 1.3 23 Sep 1991 14:56:42 GLENN - * Bug reports from Craig Austin, James Finnal, and Ted Means. Line 128 - * had MOV FDRIVE,AL which should have been MOV FDRIVE,BL. This caused the - * function to erroneously use the last drive available instead of the one - * specified by the calling process. + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. * - * Rev 1.2 15 Aug 1991 23:07:48 GLENN - * Forest Belt proofread/edited/cleaned up doc + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. * - * Rev 1.1 11 May 1991 00:21:42 GLENN - * File header changed to conform to Toolkit standard. */ -#include "ftint86.ch" +#include "fileio.ch" -#define ERR_WRONG_PARAMETERS -1 +#define ERR_WRONG_PARAMETERS ( -1 ) #define ERR_NO_ERROR 0 -#define ERR_DRIVE_NOT_READY 1 -#define ERR_UNFORMATTED 2 +#define ERR_DRIVE_NOT_READY 1 /* unused */ +#define ERR_UNFORMATTED 2 /* unused */ #define ERR_WRITE_PROTECTED 3 -#define ERR_UNKNOWN 4 -// error code defined by ERR_* -FUNCTION FT_FLOPTST( nDriveNum_i /* letter of floppy drive */ ) - LOCAL cBuffer - LOCAL nErrorCode - LOCAL nRetCode +/* NOTE: Harbour port accepts a path as a string for checking + for writability. It also won't detected unformatted + state and "not ready" state. [vszakats] */ +FUNCTION FT_FLOPTST( nDriveNum ) + LOCAL cFileName + LOCAL fhnd - nRetCode := ERR_WRONG_PARAMETERS - IF HB_ISNUMERIC( nDriveNum_i ) - - IF _GetDisketteNum( nDriveNum_i ) - _ResetDisketteSystem() - _ReadBootSector( nDriveNum_i, @cBuffer, @nErrorCode ) - - IF nErrorCode == 0 - _WriteBootSector( nDriveNum_i, cBuffer, @nErrorCode ) - DO CASE - CASE nErrorCode == 0 - nRetCode := ERR_NO_ERROR - CASE nErrorCode == 3 - nRetCode := ERR_WRITE_PROTECTED - OTHERWISE - nRetCode := ERR_UNKNOWN - ENDCASE - ELSE - DO CASE - CASE nErrorCode == 128 // 80h - nRetCode := ERR_DRIVE_NOT_READY - CASE nErrorCode == 2 - nRetCode := ERR_UNFORMATTED - OTHERWISE - nRetCode := ERR_UNKNOWN - ENDCASE - ENDIF - ENDIF + IF HB_ISNUMERIC( nDriveNum ) + cFileName := Chr( Asc( "A" ) + nDriveNum ) + hb_osDriveSeparator() + ELSEIF HB_ISSTRING( nDriveNum ) + cFileName := nDriveNum + ELSE + RETURN ERR_WRONG_PARAMETERS ENDIF - RETURN nRetCode + cFileName := hb_DirSepAdd( cFileName ) + "nf$rwtst.tmp" -#define BITS_6AND7 192 // value of byte when bits 6&7 are high - -// returns false if no floppy drive installed or nDrive_i is invalid -STATIC FUNCTION _GetDisketteNum( nDrive_i ) // drive number to query status - - LOCAL aRegs[ INT86_MAX_REGS ] - LOCAL lRetCode - LOCAL nByte - LOCAL nDriveCount - - // ASSERT 0 <= nDrive_i - - lRetCode := .F. - IF FT_INT86( 1 * 16 + 1, aRegs ) // INT for equipment determination - nByte := LOWBYTE( aRegs[ AX ] ) - // bit 0 indicates floppy drive installed - IF Int( nByte / 2 ) * 2 != nByte // is it odd i.e. is bit 0 set?? - // bits 6 & 7 indicate number of floppies installed upto 4. - nDriveCount := hb_BCode( FT_BYTEAND( hb_BChar( nByte ), hb_BChar( BITS_6AND7 ) ) ) - IF nDriveCount >= nDrive_i - lRetCode := .T. - ENDIF + IF hb_FileExists( cFileName ) + IF ( fhnd := FOpen( cFileName, FO_DENYNONE + FO_READWRITE ) ) == F_ERROR + RETURN ERR_WRITE_PROTECTED ENDIF + FClose( fhnd ) + ELSE + IF ( fhnd := hb_FCreate( cFileName, FC_NORMAL, FO_DENYNONE + FO_READWRITE ) ) == F_ERROR + RETURN ERR_WRITE_PROTECTED + ENDIF + FClose( fhnd ) + + FErase( cFileName ) ENDIF - RETURN lRetCode - -STATIC PROCEDURE _ResetDisketteSystem() - - LOCAL aRegs[ INT86_MAX_REGS ] - - aRegs[ AX ] := 0 - - FT_INT86( 1 * 16 + 3, aRegs ) - - RETURN - -#define BUFFER_SIZEOF_SECTOR 512+1 - -STATIC FUNCTION _ReadBootSector( ; - nDriveNum, ; - cBuffer_o, ; - nErrCode_o ; - ) - - // call BIOS INT 13 for sector read - LOCAL aRegs[ INT86_MAX_REGS ] - LOCAL cBuffer := Space( BUFFER_SIZEOF_SECTOR ) - LOCAL lSuccess - LOCAL nErrorCode - LOCAL lCarryFlag - - aRegs[ DX ] := nDriveNum // DH = 0 Head 0, DL = drive number - aRegs[ CX ] := 1 // CH = 0 track 0, CL=1 sector 1 - aRegs[ BX ] := REG_ES // buffer in ES:BX - aRegs[ ES ] := cBuffer - aRegs[ AX ] := MAKEHI( 2 ) + 1 // AH = 02 read, AL=1 read one sector - - lSuccess := _CallInt13hRetry( aRegs, @lCarryFlag, @nErrorCode ) - - cBuffer_o := aRegs[ ES ] - nErrCode_o := nErrorCode - - RETURN lSuccess - -STATIC FUNCTION _WriteBootSector( ; - nDriveNum, ; - cBuffer_i, ; - nErrCode_o ; - ) - - // call BIOS INT 13 for sector write - LOCAL aRegs[ INT86_MAX_REGS ] - LOCAL lSuccess - LOCAL nErrorCode - LOCAL lCarryFlag - - aRegs[ DX ] := nDriveNum // DH = 0 Head 0, DL = drive number - aRegs[ CX ] := 1 // CH = 0 track 0, CL=1 sector 1 - aRegs[ BX ] := REG_ES // buffer in ES:BX - aRegs[ ES ] := cBuffer_i - aRegs[ AX ] := MAKEHI( 3 ) + 1 // AH = 03 write, AL=1 read one sector - - lSuccess := _CallInt13hRetry( aRegs, @lCarryFlag, @nErrorCode ) - - nErrCode_o := nErrorCode - - RETURN lSuccess - -STATIC FUNCTION _CallInt13hRetry( ; // logical: did the interrupt succeed? - aRegs_io, ; // registers values for INT 13h - lCarrySet_o, ; // status of carry flag if return code is true. - nDriveStatus_o ; // status of drive ( error code ) - ) - LOCAL lCarrySet - LOCAL aRegisters - LOCAL lSuccess - LOCAL nInterrupt_c := 1 * 16 + 3 // INT 13h - LOCAL i - - lCarrySet := .F. - aRegisters := AClone( aRegs_io ) - lSuccess := FT_INT86( nInterrupt_c, aRegisters ) - IF lSuccess - lCarrySet := CARRYSET( aRegisters[ FLAGS ] ) - IF lCarrySet - _ResetDisketteSystem() - - aRegisters := AClone( aRegs_io ) - FT_INT86( nInterrupt_c, aRegisters ) - lCarrySet := CARRYSET( aRegisters[ FLAGS ] ) - IF lCarrySet - _ResetDisketteSystem() - - aRegisters := AClone( aRegs_io ) - FT_INT86( nInterrupt_c, aRegisters ) - lCarrySet := CARRYSET( aRegisters[ FLAGS ] ) - IF lCarrySet - _ResetDisketteSystem() - ENDIF - ENDIF - ENDIF - ENDIF - - FOR i := 1 TO INT86_MAX_REGS - // pass altered register back up - aRegs_io[ i ] := aRegisters[ i ] - NEXT - lCarrySet_o := lCarrySet - nDriveStatus_o := HIGHBYTE( aRegisters[ AX ] ) - - RETURN lSuccess + RETURN ERR_NO_ERROR diff --git a/harbour/contrib/hbnf/ftattr.c b/harbour/contrib/hbnf/ftattr.c index f5c67db7cb..bb749ed8a7 100644 --- a/harbour/contrib/hbnf/ftattr.c +++ b/harbour/contrib/hbnf/ftattr.c @@ -35,7 +35,7 @@ HB_FUNC( FT_SAVEATT ) int iBottom = hb_parnidef( 3, iMaxRow ); int iRight = hb_parnidef( 4, iMaxRow ); - HB_SIZE ulSize; + HB_SIZE nSize; char * pBuffer; char * pAttrib; @@ -50,23 +50,23 @@ HB_FUNC( FT_SAVEATT ) if( iTop <= iBottom && iLeft <= iRight ) { - ulSize = ( iBottom - iTop + 1 ) * ( iRight - iLeft + 1 ); - pBuffer = pAttrib = ( char * ) hb_xgrab( ulSize + 1 ); + nSize = ( iBottom - iTop + 1 ) * ( iRight - iLeft + 1 ); + pBuffer = pAttrib = ( char * ) hb_xgrab( nSize + 1 ); while( iTop <= iBottom ) { int iCol = iLeft; while( iCol <= iRight ) { - int iColor; - HB_BYTE bAttr; - HB_USHORT usChar; + int iColor; + HB_BYTE bAttr; + HB_USHORT usChar; hb_gtGetChar( iTop, iCol, &iColor, &bAttr, &usChar ); *pBuffer++ = ( char ) iColor; ++iCol; } ++iTop; } - hb_retclen_buffer( pAttrib, ulSize ); + hb_retclen_buffer( pAttrib, nSize ); } else hb_retc_null(); @@ -96,17 +96,17 @@ HB_FUNC( FT_SAVEATT ) HB_FUNC( FT_RESTATT ) { - HB_SIZE ulLen = hb_parclen( 5 ); + HB_SIZE nLen = hb_parclen( 5 ); - if( ulLen ) + if( nLen ) { - int iTop = hb_parni( 1 ); /* Defaults to zero on bad type */ - int iLeft = hb_parni( 2 ); /* Defaults to zero on bad type */ - int iMaxRow = hb_gtMaxRow(); - int iMaxCol = hb_gtMaxCol(); - int iBottom = hb_parnidef( 3, iMaxRow ); - int iRight = hb_parnidef( 4, iMaxCol ); - const char * pAttrib = hb_parc( 5 ); + int iTop = hb_parni( 1 ); /* Defaults to zero on bad type */ + int iLeft = hb_parni( 2 ); /* Defaults to zero on bad type */ + int iMaxRow = hb_gtMaxRow(); + int iMaxCol = hb_gtMaxCol(); + int iBottom = hb_parnidef( 3, iMaxRow ); + int iRight = hb_parnidef( 4, iMaxCol ); + const char * pAttrib = hb_parc( 5 ); if( iTop < 0 ) iTop = 0; @@ -119,22 +119,26 @@ HB_FUNC( FT_RESTATT ) if( iTop <= iBottom && iLeft <= iRight ) { - while( ulLen && iTop <= iBottom ) + hb_gtDispBegin(); + + while( nLen && iTop <= iBottom ) { int iCol = iLeft; - while( ulLen && iCol <= iRight ) + while( nLen && iCol <= iRight ) { - int iColor; - HB_BYTE bAttr; - HB_USHORT usChar; + int iColor; + HB_BYTE bAttr; + HB_USHORT usChar; hb_gtGetChar( iTop, iCol, &iColor, &bAttr, &usChar ); iColor = ( HB_UCHAR ) *pAttrib++; hb_gtPutChar( iTop, iCol, iColor, bAttr, usChar ); ++iCol; - --ulLen; + --nLen; } ++iTop; } + + hb_gtDispEnd(); } } } diff --git a/harbour/contrib/hbnf/hbnf.hbx b/harbour/contrib/hbnf/hbnf.hbx index 985bf2df2c..de47206b5f 100644 --- a/harbour/contrib/hbnf/hbnf.hbx +++ b/harbour/contrib/hbnf/hbnf.hbx @@ -197,6 +197,8 @@ DYNAMIC FT_REBOOT DYNAMIC FT_RESTARR DYNAMIC FT_RESTATT DYNAMIC FT_RESTSETS +DYNAMIC FT_REVATTR +DYNAMIC FT_REVCHR DYNAMIC FT_RGNSTACK DYNAMIC FT_RMDIR DYNAMIC FT_ROUND diff --git a/harbour/contrib/hbnf/readme.txt b/harbour/contrib/hbnf/readme.txt index bbcc8abe71..a293b9921c 100644 --- a/harbour/contrib/hbnf/readme.txt +++ b/harbour/contrib/hbnf/readme.txt @@ -2,17 +2,8 @@ * $Id$ */ -Functions to be rewritten: - -c\video1.c FT_REVATTR(), FT_REVCHR() - -Functions to be fixed: - -cint86.c FT_INT86() - Functions using FT_INT86() to be rewritten: -floptst.prg FT_FLOPTST() nwsem.prg FT_NWSEMOPEN() nwsem.prg FT_NWSEMEX() nwsem.prg FT_NWSEMWAIT() @@ -21,8 +12,12 @@ nwsem.prg FT_NWSEMCLOSE() nwsem.prg FT_NWSEMLOCK() nwsem.prg FT_NWSEMUNLOCK() nwuid.prg FT_NWUID() + scancode.prg FT_SCANCODE() + setdate.prg FT_SETDATE() settime.prg FT_SETTIME() + sysmem.prg FT_SYSMEM() + vidcur.prg FT_GETVCUR(), FT_SETVCUR() diff --git a/harbour/contrib/hbnf/support.c b/harbour/contrib/hbnf/support.c index 378088acea..f199191396 100644 --- a/harbour/contrib/hbnf/support.c +++ b/harbour/contrib/hbnf/support.c @@ -119,7 +119,9 @@ HB_FUNC( _FT_TEMPFIL ) HB_FUNC( FT_INP ) { #if defined( HB_OS_DOS ) - /* TODO */ + { + int iTODO; + } #endif hb_retni( 0 ); } @@ -127,7 +129,9 @@ HB_FUNC( FT_INP ) HB_FUNC( FT_OUTP ) { #if defined( HB_OS_DOS ) - /* TODO */ + { + int iTODO; + } #endif hb_retl( HB_FALSE ); } @@ -135,7 +139,9 @@ HB_FUNC( FT_OUTP ) HB_FUNC( FT_REBOOT ) { #if defined( HB_OS_DOS ) - /* TODO */ + { + int iTODO; + } #endif hb_ret(); } diff --git a/harbour/contrib/hbnf/video1.c b/harbour/contrib/hbnf/video1.c index 6354ca83f0..4d01884e08 100644 --- a/harbour/contrib/hbnf/video1.c +++ b/harbour/contrib/hbnf/video1.c @@ -4,10 +4,10 @@ /* * Harbour Project source code: - * NF function: FT_SETATTR() + * NF functions: FT_SETATTR(), FT_REVATTR(), FT_REVCHR() * * Copyright 2007 Przemyslaw Czerpak - * + * Copyright 2012 Viktor Szakats (harbour syenar.net) * www - http://harbour-project.org * * This program is free software; you can redistribute it and/or modify @@ -63,16 +63,58 @@ HB_FUNC( FT_SETATTR ) hb_parni( 5 ) ); } -#if 0 - HB_FUNC( FT_REVATTR ) { - hb_ret(); + int iTop = hb_parni( 1 ); /* Defaults to zero on bad type */ + int iLeft = hb_parni( 2 ); /* Defaults to zero on bad type */ + int iMaxRow = hb_gtMaxRow(); + int iMaxCol = hb_gtMaxCol(); + int iBottom = hb_parnidef( 3, iMaxRow ); + int iRight = hb_parnidef( 4, iMaxCol ); + + if( iTop < 0 ) + iTop = 0; + if( iLeft < 0 ) + iLeft = 0; + if( iBottom > iMaxRow ) + iBottom = iMaxRow; + if( iRight > iMaxCol ) + iRight = iMaxCol; + + if( iTop <= iBottom && iLeft <= iRight ) + { + hb_gtDispBegin(); + + while( iTop <= iBottom ) + { + int iCol = iLeft; + while( iCol <= iRight ) + { + int iColor; + HB_BYTE bAttr; + HB_USHORT usChar; + hb_gtGetChar( iTop, iCol, &iColor, &bAttr, &usChar ); + iColor = ( iColor << 4 ) | ( iColor >> 4 ); + hb_gtPutChar( iTop, iCol, iColor, bAttr, usChar ); + ++iCol; + } + ++iTop; + } + + hb_gtDispEnd(); + } } HB_FUNC( FT_REVCHR ) { - hb_ret(); -} + int iRow = hb_parni( 1 ); + int iCol = hb_parni( 2 ); -#endif + int iColor; + HB_BYTE bAttr; + HB_USHORT usChar; + + hb_gtGetChar( iRow, iCol, &iColor, &bAttr, &usChar ); + iColor = ( iColor << 4 ) | ( iColor >> 4 ); + hb_gtPutChar( iRow, iCol, iColor, bAttr, usChar ); +}