2010-01-13 20:14 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/src/vm/hashes.c
    ! fixed missing HB_STACK_TLS_PRELOAD - thanks to Xavi

  * harbour/contrib/hbnetio/netiosrv.c
    ! fixed wrong declaration and casting of rpcFilter - thanks to Xavi

  + harbour/contrib/hbnetio/readme.txt
    + added small description of NETIO functions - now only client parts

  * harbour/contrib/hbwin/win_tprn.prg
    * updated class name in comments

  * harbour/contrib/hbwin/win_prn1.c
    * minor formatting

  * harbour/contrib/hbwin/win_prn3.c
    % removed unnecessary rest of buffer clearing in hb_tstrncat()
This commit is contained in:
Przemyslaw Czerpak
2010-01-13 19:15:05 +00:00
parent 25f48aa426
commit 7c110952da
7 changed files with 130 additions and 10 deletions

View File

@@ -17,6 +17,25 @@
past entries belonging to author(s): Viktor Szakats.
*/
2010-01-13 20:14 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/vm/hashes.c
! fixed missing HB_STACK_TLS_PRELOAD - thanks to Xavi
* harbour/contrib/hbnetio/netiosrv.c
! fixed wrong declaration and casting of rpcFilter - thanks to Xavi
+ harbour/contrib/hbnetio/readme.txt
+ added small description of NETIO functions - now only client parts
* harbour/contrib/hbwin/win_tprn.prg
* updated class name in comments
* harbour/contrib/hbwin/win_prn1.c
* minor formatting
* harbour/contrib/hbwin/win_prn3.c
% removed unnecessary rest of buffer clearing in hb_tstrncat()
2010-01-13 18:11 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* src/rtl/tget.prg
! Fixed cursor positioning bug, when @S picture length is

View File

@@ -97,7 +97,7 @@ typedef struct _HB_CONSRV
BOOL rpc;
BOOL login;
PHB_SYMB rpcFunc;
PHB_SYMB rpcFilter;
PHB_ITEM rpcFilter;
int rootPathLen;
char rootPath[ HB_PATH_MAX ];
}
@@ -491,7 +491,7 @@ HB_FUNC( NETIO_RPCFILTER )
PHB_ITEM pHash = hb_param( 2, HB_IT_HASH );
if( pHash )
{
conn->rpcFilter = hb_itemNew( pHash );
conn->rpcFilter = ( PHB_ITEM ) hb_itemNew( pHash );
hb_gcUnlock( conn->rpcFilter );
}
}

View File

@@ -0,0 +1,103 @@
/*
* $Id$
*
* Copyright 2010 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
* www - http://www.harbour-project.org
*/
HBNETIO is implementation of alternative RDD IO API for Harbour with
additional RPC support. It contains either client and server code.
It supports connection stream compression using ZLIB compression and
encryption using blowfish algorithm.
After registering on the client side all files used by Harbour native
RDDs with name starting with "net:" are redirected to the hbnetio server.
Client side functions:
======================
NETIO_CONNECT( [<cServer>], [<cPort>], [<nTimeOut>], ;
[<cPasswd>], [<nCompressionLevel>], [<nStrategy>] )
-> <lConnected>
Register HBNETIO as alternative RDD IO API redirecting all files
with name starting with "net:" to HBNETIO server, set default
server address, port and connection parameters and tries to set
the connection to this server.
When executed 1-st time it sets default connection parameters
for all threads. Each thread can overwrite these default settings
with its own local ones calling NETIO_CONNECT() function.
Each successful call to NETIO_CONNECT() increase the reference
counter for given connection. NETIO_DISCONNECT() decrease the
reference. Connection is closed when the counter reach 0. It
means that each NETIO_CONNECT() call needs corresponding call
to NETIO_DISCONNECT(). The connections are recognized by IP server
address and port number and they are shared between threads. So when
more then one thread call NETIO_CONNECT() then only one connection
is created. It also means that NETIO_DISCONNECT() does not have to
be called by the same thread which called NETIO_CONNECT().
On application exist all connections are automatically closed.
It possible to open many different connections and keep them open.
In RDD IO operations and RPC calls it's possible to specify server
address as part of file or procedure/function name, i.e.
USE net:192.168.0.2:2942:path/to/file
NETIO_PROCEXEC( "192.168.0.2:2942:procname" )
or using UNC paths:
USE net://192.168.0.2:2942/path/to/file
NETIO_PROCEXEC( "//192.168.0.2:2942/procname" )
It's also possible to specify the password. The connection string
is in format:
<server>[:<port>[:<passwd>]]:<filepath|funcname>
or:
//<server>:<port>:<passwd>:<filepath|funcname>
or:
//<server>[:<port>]/<filepath|funcname>
Backslashes '\' are also supported and can be used instead of '/'.
Password is always terminated by ":" and whole connection string
is terminated by CHR(0) so it's not possible to use these two
characters as part of password. Anyhow when passwords are required
then it's recommended to open the connection by NETIO_CONNECT()
and then specify only server and port is server is not unique
enough to chose from existing connections. If server is not
given then default connection is chosen.
NETIO_DISCONNECT( [<cServer>], [<cPort>] ) -> <lOK>
Close the connection created by NETIO_CONNECT()
NETIO_PROCEXISTS( <cProcName> ) -> <lExists>
Check if function or procedure exists on the server side.
NETIO_PROCEXEC( <cProcName> [, <params,...>] ) -> <lSent>
Execute function or procedure on server the side do not wait for
confirmation from the server.
NETIO_PROCEXECW( <cProcName> [, <params,...>] ) -> <lExecuted>
Execute function or procedure on the server side and wait for
confirmation from the server.
NETIO_FUNCEXEC( <cFuncName> [, <params,...>] ) -> <xFuncRetVal>
Execute function on the server side and wait for function return
value sent by the server.
Server side functions:
======================
NETIO_LISTEN( [<nPort>], [<cIfAddr>], [<cRootDir>], [<lRPC>] )
-> <pListenSocket> | NIL
NETIO_ACCEPT( <pListenSocket>, [<nTimeOut>],
[<cPass>], [<nCompressionLevel>], [<nStrategy>] )
-> <pConnectionSocket> | NIL
NETIO_COMPRESS( <pConnectionSocket>,
[<cPass>], [<nCompressionLevel>], [<nStrategy>] ) -> NIL
NETIO_SERVER( <pConnectionSocket> ) -> NIL
NETIO_RPC( <pListenSocket> | <pConnectionSocket> [, <lEnable>] ) -> <lPrev>
NETIO_RPCFILTER( <pConnectionSocket>,
<sFuncSym> | <hValue> | NIL ) -> NIL
NETIO_SERVERSTOP( <pListenSocket> | <pConnectionSocket> [, <lStop>] ) -> NIL
NETIO_MTSERVER( [<nPort>], [<cIfAddr>], [<cRootDir>],
[<lRPC> | <sFuncSym> | <hValue>],
[<cPasswd>], [<nCompressionLevel>], [<nStrategy>] )
-> <pListenSocket>

View File

@@ -323,8 +323,8 @@ HB_FUNC( WIN_GETTEXTSIZE )
{
SIZE sSize;
GetTextExtentPoint32( hDC, lpData, ( int ) nLen, &sSize ); /* Get the length of the text in device size */
GetTextExtentPoint32( hDC, lpData, ( int ) nLen, &sSize ); /* Get the length of the text in device size */
if( ! hb_parldef( 4, 1 ) )
lResult = ( long ) sSize.cy; /* return the height */
else

View File

@@ -81,9 +81,6 @@ static TCHAR * hb_tstrncat( TCHAR * pDest, const TCHAR * pSource, ULONG ulLen )
ulLen--;
}
while( ulLen && ( *pDest++ = *pSource++ ) != '\0' )
ulLen--;
return pBuf;
}

View File

@@ -51,9 +51,9 @@
*/
/*
TPRINT() was designed to make it easy to emulate Clipper Dot Matrix printing.
WIN_PRN() was designed to make it easy to emulate Clipper Dot Matrix printing.
Dot Matrix printing was in CPI ( Characters per inch & Lines per inch ).
Even though "Mapping Mode" for TPRINT() is MM_TEXT, ::SetFont() accepts the
Even though "Mapping Mode" for WIN_PRN() is MM_TEXT, ::SetFont() accepts the
nWidth parameter in CPI not Pixels. Also the default ::LineHeight is for
6 lines per inch so ::NewLine() works as per "LineFeed" on Dot Matrix printers.
If you do not like this then inherit from the class and override anything you want
@@ -661,7 +661,7 @@ METHOD Create() CLASS WIN_BMP // Compatibility function for Alaska Xbase++
METHOD Destroy() CLASS WIN_BMP // Compatibility function for Alaska Xbase++
RETURN NIL
METHOD Draw( oPrn, aRectangle ) CLASS WIN_BMP // Pass a TPRINT class reference & Rectangle array
METHOD Draw( oPrn, aRectangle ) CLASS WIN_BMP // Pass a WIN_PRN object reference & Rectangle array
::Rect := aRectangle
RETURN oPrn:DrawBitMap( Self )

View File

@@ -481,6 +481,7 @@ PHB_ITEM hb_hashGetCItemPtr( PHB_ITEM pHash, const char * pszKey )
if( HB_IS_HASH( pHash ) )
{
HB_STACK_TLS_PRELOAD
/* we will not make any copy of pKey (autoadd is disabled) so it's
* safe to use hb_itemPutCConst()
*/