2012-10-16 20:34 UTC+0200 Viktor Szakats (harbour syenar.net)

* contrib/hbnf/descendn.c
    + enabled FT_DESCEND() for all platforms

  * contrib/hbnf/hbnf.hbp
  * contrib/hbnf/hbnf.hbx
  * contrib/hbnf/peek.c
  * contrib/hbnf/poke.c
    * FT_PEEK(), FT_POKE() will now be compiled and returning
      permanent failure on all platforms.

  * contrib/hbnf/ftisprn.c
  * contrib/hbnf/ftshadow.c
  * contrib/hbnf/kspeed.c
  * contrib/hbnf/setkeys.c
  * contrib/hbnf/setlastk.c
    * use HB_FUNC_TRANSLATE()

  * contrib/hbnf/getver.c
  * contrib/hbnf/mkdir.c
  * contrib/hbnf/proper.c
    * minor fmt
This commit is contained in:
Viktor Szakats
2012-10-16 18:37:52 +00:00
parent 0253060316
commit 56c37cd3ba
14 changed files with 98 additions and 155 deletions

View File

@@ -16,6 +16,29 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-10-16 20:34 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/hbnf/descendn.c
+ enabled FT_DESCEND() for all platforms
* contrib/hbnf/hbnf.hbp
* contrib/hbnf/hbnf.hbx
* contrib/hbnf/peek.c
* contrib/hbnf/poke.c
* FT_PEEK(), FT_POKE() will now be compiled and returning
permanent failure on all platforms.
* contrib/hbnf/ftisprn.c
* contrib/hbnf/ftshadow.c
* contrib/hbnf/kspeed.c
* contrib/hbnf/setkeys.c
* contrib/hbnf/setlastk.c
* use HB_FUNC_TRANSLATE()
* contrib/hbnf/getver.c
* contrib/hbnf/mkdir.c
* contrib/hbnf/proper.c
* minor fmt
2012-10-16 19:24 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/hbzebra/datamtrx.c
! fixed a char truncation warning

View File

@@ -25,50 +25,45 @@
HB_FUNC( FT_DESCEND )
{
#if defined( HB_OS_DOS ) || defined( HB_OS_WIN )
PHB_ITEM iP = hb_itemParam( 1 );
HB_TYPE uiType = hb_itemType( iP );
PHB_ITEM iR = NULL;
if( ( uiType & HB_IT_NUMERIC ) && ( uiType & HB_IT_DOUBLE ) )
iR = hb_itemPutND( 0, 0 - hb_itemGetND( iP ) );
else if( uiType & HB_IT_NUMERIC )
iR = hb_itemPutNL( 0, 0 - hb_itemGetNL( iP ) );
else if( uiType & HB_IT_DATE )
iR = hb_itemPutNL( 0, 0x4FD4C0L - hb_itemGetNL( iP ) );
else if( uiType & HB_IT_TIMESTAMP )
iR = hb_itemPutND( 0, 0x4FD4C0L - hb_itemGetTD( iP ) );
else if( uiType & HB_IT_LOGICAL )
iR = hb_itemPutL( 0, ( hb_itemGetL( iP ) > 0 ) ? 0 : 1 );
else if( uiType & HB_IT_STRING )
{
PHB_ITEM iP = hb_itemParam( 1 );
HB_TYPE uiType = hb_itemType( iP );
HB_SIZE uiLen = hb_itemSize( iP );
HB_SIZE n;
PHB_ITEM iR = NULL;
HB_SIZE uiLen, n;
char * pDescend;
char * pDescend = ( char * ) hb_xgrab( uiLen );
if( ( uiType & HB_IT_NUMERIC ) && ( uiType & HB_IT_DOUBLE ) )
iR = hb_itemPutND( 0, 0 - hb_itemGetND( iP ) );
hb_itemCopyC( iP, pDescend, uiLen );
else if( uiType & HB_IT_NUMERIC )
iR = hb_itemPutNL( 0, 0 - hb_itemGetNL( iP ) );
for( n = 0; n < uiLen; n++ )
pDescend[ n ] = ( char ) 0 - pDescend[ n ];
else if( uiType & HB_IT_DATE )
iR = hb_itemPutNL( 0, 0x4FD4C0L - hb_itemGetNL( iP ) );
iR = hb_itemPutCL( 0, pDescend, uiLen );
else if( uiType & HB_IT_TIMESTAMP )
iR = hb_itemPutND( 0, 0x4FD4C0L - hb_itemGetTD( iP ) );
else if( uiType & HB_IT_LOGICAL )
iR = hb_itemPutL( 0, ( hb_itemGetL( iP ) > 0 ) ? 0 : 1 );
else if( uiType & HB_IT_STRING )
{
uiLen = hb_itemSize( iP );
pDescend = ( char * ) hb_xgrab( uiLen );
hb_itemCopyC( iP, pDescend, uiLen );
for( n = 0; n < uiLen; n++ )
pDescend[ n ] = ( char ) 0 - pDescend[ n ];
iR = hb_itemPutCL( 0, pDescend, uiLen );
hb_xfree( pDescend );
}
hb_itemReturn( iR );
hb_itemRelease( iP );
hb_itemRelease( iR );
hb_xfree( pDescend );
}
#endif
hb_itemReturn( iR );
hb_itemRelease( iP );
hb_itemRelease( iR );
}

View File

@@ -79,10 +79,4 @@
#include "hbapi.h"
/* TOFIX: Has different behaviour depending on platform/parameter. [vszakats] */
HB_FUNC_EXTERN( HB_ISPRINTER );
HB_FUNC( FT_ISPRINT )
{
HB_FUNC_EXEC( HB_ISPRINTER )
}
HB_FUNC_TRANSLATE( FT_ISPRINT, HB_ISPRINTER )

View File

@@ -54,12 +54,7 @@
#include "hbapi.h"
#include "hbapigt.h"
HB_FUNC_EXTERN( HB_SHADOW );
HB_FUNC( FT_SHADOW )
{
HB_FUNC_EXEC( HB_SHADOW );
}
HB_FUNC_TRANSLATE( FT_SHADOW, HB_SHADOW )
HB_FUNC( FT_SETATTR )
{

View File

@@ -95,6 +95,7 @@ HB_FUNC( FT_ISSHARE )
iShare = 0;
}
#endif
hb_retni( iShare );
}
@@ -105,15 +106,16 @@ HB_FUNC( _FT_NWKSTAT )
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.HB_XREGS.ax = 0xDC;
regs.HB_XREGS.ax = 0xDC;
HB_DOS_INT86( 0x2F, &regs, &regs );
iConnect = regs.h.al;
iConnect = regs.h.al;
}
#else
{
iConnect = 0;
}
#endif
hb_retni( iConnect );
}
@@ -122,8 +124,8 @@ HB_FUNC( FT_SETMODE )
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.h.ah = 0;
regs.h.al = hb_parni( 1 );
regs.h.ah = 0;
regs.h.al = hb_parni( 1 );
HB_DOS_INT86( 0x10, &regs, &regs );
}
#endif
@@ -136,15 +138,16 @@ HB_FUNC( FT_GETMODE )
#if defined( HB_OS_DOS )
{
union REGS regs;
regs.h.ah = 0x0F;
regs.h.ah = 0x0F;
HB_DOS_INT86( 0x10, &regs, &regs );
iMode = regs.h.al;
iMode = regs.h.al;
}
#else
{
iMode = 0;
}
#endif
hb_retni( iMode );
}

View File

@@ -37,6 +37,8 @@ mouse.c
n2color.c
numlock.c
origin.c
peek.c
poke.c
proper.c
prtscr.c
putkey.c
@@ -46,10 +48,6 @@ setlastk.c
shift.c
stod.c
# BAD_C_SOURCES
#peek.c
#poke.c
aading.prg
aavg.prg
acctadj.prg

View File

@@ -174,9 +174,11 @@ DYNAMIC FT_NWUID
DYNAMIC FT_ONTICK
DYNAMIC FT_ORIGIN
DYNAMIC FT_PCHR
DYNAMIC FT_PEEK
DYNAMIC FT_PEGS
DYNAMIC FT_PENDING
DYNAMIC FT_PICKDAY
DYNAMIC FT_POKE
DYNAMIC FT_POPVID
DYNAMIC FT_PROMPT
DYNAMIC FT_PROPER

View File

@@ -24,6 +24,7 @@
*/
#include "hbapi.h"
#if defined( HB_OS_DOS )
# include "dos.h"
#endif

View File

@@ -3,25 +3,25 @@
*/
/*
; Author....: Ted Means
; CIS ID....: 73067,3332
;
; This is an original work by Ted Means and is placed in the
; public domain.
;
; Modification history:
; ---------------------
;
; Rev 1.2 15 Aug 1991 23:06:58 GLENN
; Forest Belt proofread/edited/cleaned up doc
;
; Rev 1.1 14 Jun 1991 19:54:44 GLENN
; Minor edit to file header
;
; Rev 1.0 01 Apr 1991 01:03:32 GLENN
; Nanforum Toolkit
;
;
* Author....: Ted Means
* CIS ID....: 73067,3332
*
* This is an original work by Ted Means and is placed in the
* public domain.
*
* Modification history:
* ---------------------
*
* Rev 1.2 15 Aug 1991 23:06:58 GLENN
* Forest Belt proofread/edited/cleaned up doc
*
* Rev 1.1 14 Jun 1991 19:54:44 GLENN
* Minor edit to file header
*
* Rev 1.0 01 Apr 1991 01:03:32 GLENN
* Nanforum Toolkit
*
*
*/
#include "hbapi.h"

View File

@@ -29,35 +29,7 @@
#include "hbapi.h"
#include "cpmi.h"
#define FP_SEG( fp ) ( *( ( unsigned int * ) &( fp ) + 1 ) )
#define FP_OFF( fp ) ( *( ( unsigned int * ) &( fp ) ) )
HB_FUNC( FT_PEEK )
{
auto unsigned int ProtMode = cpmiIsProtected();
auto unsigned char * bytePtr;
if( PCOUNT >= 2 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) )
{
FP_SEG( bytePtr ) = hb_parni( 1 );
FP_OFF( bytePtr ) = hb_parni( 2 );
if( ProtMode )
{
FP_SEG( bytePtr ) = hb_cpmiProtectedPtr( bytePtr, 1 );
FP_OFF( bytePtr ) = 0;
if( FP_SEG( bytePtr ) == 0 )
goto Bogus;
}
hb_retni( ( int ) *bytePtr );
if( ProtMode )
hb_cpmiFreeSelector( FP_SEG( bytePtr ) );
}
else
Bogus: hb_retni( -1 );
hb_retni( -1 );
}

View File

@@ -29,37 +29,7 @@
#include "hbapi.h"
#include "cpmi.h"
#define FP_SEG( fp ) ( *( ( unsigned int * ) &( fp ) + 1 ) )
#define FP_OFF( fp ) ( *( ( unsigned int * ) &( fp ) ) )
HB_FUNC( FT_POKE )
{
auto unsigned int ProtMode = hb_cpmiIsProtected();
auto unsigned char * bytePtr;
if( PCOUNT >= 3 && HB_ISNUM( 1 ) && HB_ISNUM( 2 ) && HB_ISNUM( 3 ) )
{
FP_SEG( bytePtr ) = hb_parni( 1 );
FP_OFF( bytePtr ) = hb_parni( 2 );
if( ProtMode )
{
FP_SEG( bytePtr ) = hb_cpmiProtectedPtr( bytePtr, 1 );
FP_OFF( bytePtr ) = 0;
if( FP_SEG( bytePtr ) == 0 )
goto Bogus;
}
*bytePtr = ( unsigned char ) hb_parni( 3 );
if( ProtMode )
hb_cpmiFreeSelector( FP_SEG( bytePtr ) );
hb_retl( HB_TRUE );
}
else
Bogus: hb_retl( HB_FALSE );
hb_retl( HB_FALSE );
}

View File

@@ -98,8 +98,8 @@ HB_FUNC( FT_PROPER )
/* // If "Mc" was found, Cap next letter if Alpha
if( iPos > 1 )
if( iPos < iLen )
if( ! _ftIsUpper( cStr[iPos] ) )
cStr[iPos] = _ftToUpper( cStr[iPos] );
if( ! _ftIsUpper( cStr[ iPos ] ) )
cStr[ iPos ] = _ftToUpper( cStr[ iPos ] );
*/
if( cDst )
hb_retclen_buffer( cDst, iLen );

View File

@@ -67,9 +67,4 @@
#include "hbapi.h"
HB_FUNC_EXTERN( HB_SETKEYSAVE );
HB_FUNC( FT_SETKEYS )
{
HB_FUNC_EXEC( HB_SETKEYSAVE )
}
HB_FUNC_TRANSLATE( FT_SETKEYS, HB_SETKEYSAVE )

View File

@@ -67,9 +67,4 @@
#include "hbapi.h"
HB_FUNC_EXTERN( HB_SETLASTKEY );
HB_FUNC( FT_LASTKEY )
{
HB_FUNC_EXEC( HB_SETLASTKEY )
}
HB_FUNC_TRANSLATE( FT_LASTKEY, HB_SETLASTKEY )