2009-07-10 16:18 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

- examples/terminal/terminal.ch
  * examples/terminal/trm_cli.hbp
  * examples/terminal/trm_srv.hbp
  * examples/terminal/trm_app.hbp
  * examples/terminal/trm_cli.prg
  * examples/terminal/terminal.prg
  * examples/terminal/trm_srv.prg
    * Cleanup.
    + Raised warning level to -w3, fixed all warnings.

  * utils/hbformat/hbformat.hbp
  * utils/hbmk2/hbmk2.hbp
  * utils/hbtest/hbtest.hbp
  * utils/hbi18n/hbi18n.hbp
  * utils/hbrun/hbrun.hbp
  * examples/terminal/trm_cli.hbp
  * examples/terminal/trm_srv.hbp
  * examples/terminal/trm_app.hbp
    + Added standard set of Harbour switches.
This commit is contained in:
Viktor Szakats
2009-07-10 14:19:15 +00:00
parent fb5998784e
commit fa31d81896
13 changed files with 93 additions and 217 deletions

View File

@@ -17,6 +17,27 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-07-10 16:18 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
- examples/terminal/terminal.ch
* examples/terminal/trm_cli.hbp
* examples/terminal/trm_srv.hbp
* examples/terminal/trm_app.hbp
* examples/terminal/trm_cli.prg
* examples/terminal/terminal.prg
* examples/terminal/trm_srv.prg
* Cleanup.
+ Raised warning level to -w3, fixed all warnings.
* utils/hbformat/hbformat.hbp
* utils/hbmk2/hbmk2.hbp
* utils/hbtest/hbtest.hbp
* utils/hbi18n/hbi18n.hbp
* utils/hbrun/hbrun.hbp
* examples/terminal/trm_cli.hbp
* examples/terminal/trm_srv.hbp
* examples/terminal/trm_app.hbp
+ Added standard set of Harbour switches.
2009-07-10 15:59 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* examples/terminal/trm_misc.c
- Deleted module no longer needed.

View File

@@ -1,126 +0,0 @@
/*
* $Id$
*/
/*
* Harbour Project source code:
*
* Copyright 2009 Pritpal Bedi <pritpal@vouchcac.com>
* http://www.harbour-project.org
*
* 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.
*
* 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/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* 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.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* 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.
*
*/
#define WSABASEERR 10000
/*
* Windows Sockets definitions of regular Microsoft C error constants
*/
#define WSAEINTR (WSABASEERR+4)
#define WSAEBADF (WSABASEERR+9)
#define WSAEACCES (WSABASEERR+13)
#define WSAEFAULT (WSABASEERR+14)
#define WSAEINVAL (WSABASEERR+22)
#define WSAEMFILE (WSABASEERR+24)
/*
* Windows Sockets definitions of regular Berkeley error constants
*/
#define WSAEWOULDBLOCK (WSABASEERR+35)
#define WSAEINPROGRESS (WSABASEERR+36)
#define WSAEALREADY (WSABASEERR+37)
#define WSAENOTSOCK (WSABASEERR+38)
#define WSAEDESTADDRREQ (WSABASEERR+39)
#define WSAEMSGSIZE (WSABASEERR+40)
#define WSAEPROTOTYPE (WSABASEERR+41)
#define WSAENOPROTOOPT (WSABASEERR+42)
#define WSAEPROTONOSUPPORT (WSABASEERR+43)
#define WSAESOCKTNOSUPPORT (WSABASEERR+44)
#define WSAEOPNOTSUPP (WSABASEERR+45)
#define WSAEPFNOSUPPORT (WSABASEERR+46)
#define WSAEAFNOSUPPORT (WSABASEERR+47)
#define WSAEADDRINUSE (WSABASEERR+48)
#define WSAEADDRNOTAVAIL (WSABASEERR+49)
#define WSAENETDOWN (WSABASEERR+50)
#define WSAENETUNREACH (WSABASEERR+51)
#define WSAENETRESET (WSABASEERR+52)
#define WSAECONNABORTED (WSABASEERR+53)
#define WSAECONNRESET (WSABASEERR+54)
#define WSAENOBUFS (WSABASEERR+55)
#define WSAEISCONN (WSABASEERR+56)
#define WSAENOTCONN (WSABASEERR+57)
#define WSAESHUTDOWN (WSABASEERR+58)
#define WSAETOOMANYREFS (WSABASEERR+59)
#define WSAETIMEDOUT (WSABASEERR+60)
#define WSAECONNREFUSED (WSABASEERR+61)
#define WSAELOOP (WSABASEERR+62)
#define WSAENAMETOOLONG (WSABASEERR+63)
#define WSAEHOSTDOWN (WSABASEERR+64)
#define WSAEHOSTUNREACH (WSABASEERR+65)
#define WSAENOTEMPTY (WSABASEERR+66)
#define WSAEPROCLIM (WSABASEERR+67)
#define WSAEUSERS (WSABASEERR+68)
#define WSAEDQUOT (WSABASEERR+69)
#define WSAESTALE (WSABASEERR+70)
#define WSAEREMOTE (WSABASEERR+71)
/*
* Extended Windows Sockets error constant definitions
*/
#define WSASYSNOTREADY (WSABASEERR+91)
#define WSAVERNOTSUPPORTED (WSABASEERR+92)
#define WSANOTINITIALISED (WSABASEERR+93)
#define WSAEDISCON (WSABASEERR+101)
#define WSAENOMORE (WSABASEERR+102)
#define WSAECANCELLED (WSABASEERR+103)
#define WSAEINVALIDPROCTABLE (WSABASEERR+104)
#define WSAEINVALIDPROVIDER (WSABASEERR+105)
#define WSAEPROVIDERFAILEDINIT (WSABASEERR+106)
#define WSASYSCALLFAILURE (WSABASEERR+107)
#define WSASERVICE_NOT_FOUND (WSABASEERR+108)
#define WSATYPE_NOT_FOUND (WSABASEERR+109)
#define WSA_E_NO_MORE (WSABASEERR+110)
#define WSA_E_CANCELLED (WSABASEERR+111)
#define WSAEREFUSED (WSABASEERR+112)
//----------------------------------------------------------------------//
//----------------------------------------------------------------------//
//----------------------------------------------------------------------//

View File

@@ -62,10 +62,13 @@
//----------------------------------------------------------------------//
#include "common.ch"
#include "terminal.ch"
//#include "wvtwin.ch"
#define WSABASEERR 10000
#define WSAECONNABORTED (WSABASEERR+53)
#define WSAECONNRESET (WSABASEERR+54)
//----------------------------------------------------------------------//
#define TOP t_[ 1 ]
@@ -94,7 +97,6 @@ STATIC s_mutexSend := hb_mutexCreate()
Function RmtSvrInitialize( cServerInfo, nTimeoutClient, nTimeRefresh )
Local lExit := .t.
Local nTimeOut := 50 // PICK FROM EXTERNASL SOURCE
s_srvrSocket := NIL
s_commSocket := NIL
@@ -173,7 +175,7 @@ TrmDebug( "SERVER: Connection Failed" )
//
Static Function RmtSvrAcceptClient( Socket, pClientSocket )
Local lRet := .t.
Local i := 0
// Local i := 0
Do While .t.
pClientSocket := Hb_InetAccept( Socket )
@@ -184,7 +186,7 @@ Static Function RmtSvrAcceptClient( Socket, pClientSocket )
exit
TrmDebug( "SvrConnectClient()", i++, "TRY..." )
//TrmDebug( "SvrConnectClient()", i++, "TRY..." )
enddo
if lRet
@@ -198,7 +200,7 @@ TrmDebug( "CLIENT: Connection TimedOut!" )
//----------------------------------------------------------------------//
Function RmtSvrSendClient( nMode, xData )
Local cScr, cCurs, nError, nBytesSent, nBytesToSend, t_, cOdd, cEvn, cOdd0, cEvn0
Local cCurs, nError, nBytesSent, nBytesToSend, t_, cOdd, cEvn, cOdd0, cEvn0
Local lSendCurs := .f.
Local lSendScrn := .f.
Local cData := ""
@@ -488,29 +490,20 @@ Function TrmDebug( p1,p2,p3,p4,p5,p6,p7,p8,p9,p10 )
//----------------------------------------------------------------------//
Function TrmXtoS( xVar )
Local cVar := ''
Local cType := valtype( xVar )
FUNCTION TrmXtoS( xVar )
do case
case cType == 'C'
cVar := xVar
SWITCH ValType( xVar )
CASE "C"
RETURN xVar
CASE "N"
RETURN Str( xVar )
CASE "D"
RETURN DToC( xVar )
CASE "L"
RETURN iif( xVar, "T", "F" )
ENDSWITCH
case cType == 'N'
cVar := str( xVar )
case cType == 'D'
cVar := dtoc( xVar )
case cType == 'L'
cVar := if( xVar, 'T','F' )
otherwise
cVar := 'NIL'
endcase
Return cVar
RETURN "NIL"
//----------------------------------------------------------------------//

View File

@@ -2,5 +2,7 @@
# $Id$
#
-q0 -w3 -es2 -kmo -l
trm_app.prg
terminal.prg

View File

@@ -2,4 +2,6 @@
# $Id$
#
-q0 -w3 -es2 -kmo -l
trm_cli.prg

View File

@@ -102,7 +102,7 @@ static nTrace := 0
static aDat := { {"",""} }
Function Main( cAddress, cPort, cAppln, cParams, cDirectory )
LOCAL Socket, n, cText, cResponse, nThread, hMutex, hMutex1
LOCAL Socket, n, cText, cResponse
ResolveParams( @cAddress, @cPort, @cAppln, @cParams, @cDirectory )
@@ -156,8 +156,8 @@ Function Main( cAddress, cPort, cAppln, cParams, cDirectory )
STATIC FUNCTION ResolveParams( cAddress, cPort, cAppln, cParams, cDirectory )
Local i, n, cLine, cVal, nLines, cTxt, cPath, cFile
Local lFile := .f.
Local dat_ := {}
LOCAL lFile
if PCount() == 1
cFile := cAddress
@@ -180,7 +180,6 @@ STATIC FUNCTION ResolveParams( cAddress, cPort, cAppln, cParams, cDirectory )
if empty( cAddress ) .and. lFile
alert( "File found: "+cFile )
lFile := .t.
cTxt := memoread( cFile )
nLines := mlCount( cTxt,254,3,.f. )
for i := 1 to nLines
@@ -243,7 +242,7 @@ STATIC FUNCTION ResolveParams( cAddress, cPort, cAppln, cParams, cDirectory )
//----------------------------------------------------------------------//
Function TrmServeServer( Socket, cAddress, cServerInfo )
Local nPort, hDlg, a_, nError
Local nPort, a_, nError
Local nSeconds := Seconds()
a_:= hb_aTokens( cServerInfo, ";" )
@@ -283,7 +282,6 @@ Function TrmServeServer( Socket, cAddress, cServerInfo )
hb_threadStart( @Thread_Ping() , 3 )
hb_threadStart( @Thread_Clock() , 5 )
nSeconds := Seconds()
do while .t.
// Wvt_ProcessMessages()
hb_idleSleep()
@@ -304,7 +302,7 @@ Function TrmServeServer( Socket, cAddress, cServerInfo )
//----------------------------------------------------------------------//
Function TrmReceiveServer()
Local a_, b_, cBuffer, nBytes, cCommand, cData, nError, cOdd, cEvn, n, cMix
Local a_, b_, cBuffer, nBytes, cCommand, cData, cOdd, cEvn, n
LOCAL cOdd1, cEvn1
if !( lReceiving ) .and. ( commSocket != NIL )
@@ -581,29 +579,20 @@ Static Function Str2A( cStr, cDel )
//----------------------------------------------------------------------//
Static Function uiXtos( xVar )
Local cVar := ""
Local cType := valtype( xVar )
FUNCTION uiXtos( xVar )
do case
case cType == "C"
cVar := xVar
SWITCH ValType( xVar )
CASE "C"
RETURN xVar
CASE "N"
RETURN Str( xVar )
CASE "D"
RETURN DToC( xVar )
CASE "L"
RETURN iif( xVar, "Yes", "No " )
ENDSWITCH
case cType == "N"
cVar := str( xVar )
case cType == "D"
cVar := dtoc( xVar )
case cType == "L"
cVar := if( xVar, "Yes","No " )
otherwise
cVar := "NIL"
endcase
Return cVar
RETURN "NIL"
//----------------------------------------------------------------------//
@@ -764,9 +753,9 @@ Static Function PlayMusic( cTheme )
Static Function GetForm( cForm )
Local cReply := ""
Local i, scr , n,s
Local aFields := {}
Local a_:={}
Local i, scr
Local aFields
Local a_
Local frm_:={}
Local getlist := {}

View File

@@ -2,4 +2,6 @@
# $Id$
#
-q0 -w3 -es2 -kmo -l
trm_srv.prg

View File

@@ -76,11 +76,8 @@ Static nMaxCol
//----------------------------------------------------------------------//
Function Main( cPort )
LOCAL GetList
LOCAL socket
LOCAL Key, nKey
LOCAL cCommand
LOCAL hView, hAccept
LOCAL nKey
nMaxCol := maxcol()+1
@@ -88,7 +85,6 @@ Function Main( cPort )
cPort := "8085"
ENDIF
GetList := {}
g_nUserCount := 0
g_nTotalCount := 0
@@ -106,8 +102,8 @@ Function Main( cPort )
DispOutAt( 3, 0, padc( "Waiting for connections on port " + cPort, nMaxCol ), "W+/N" )
hView := hb_ThreadStart( @ViewUpdate() , Socket )
hAccept := hb_ThreadStart( @AcceptIncoming(), Socket )
hb_ThreadStart( @ViewUpdate() , Socket )
hb_ThreadStart( @AcceptIncoming(), Socket )
DO WHILE .T.
nKey := inkey(0)
@@ -161,14 +157,10 @@ PROCEDURE AcceptIncoming( Socket )
// Service incoming connection
//
PROCEDURE ServeClient( Socket )
LOCAL cRequest, cReply, cReq, cCmdLine, cLine, lExit, aFields
LOCAL oXmlDoc, oXmlForm, oXmlName, cFields, cData, oXmlData, oXmlNode
LOCAL aProcessInfo := array( 4 )
LOCAL cPostData := ""
LOCAL cRequest, cReply, cReq, cCmdLine, lExit
LOCAL nLength := 0
LOCAL nContLen := 0
Local nn := 0
Local a_ := {}
LOCAL nn := 0
LOCAL a_
static nServerPort := 45000
@@ -429,26 +421,17 @@ Function uiDebug( p1,p2,p3,p4,p5,p6,p7,p8,p9,p10 )
//----------------------------------------------------------------------//
Function uiXtos( xVar )
Local cVar := ''
Local cType := valtype( xVar )
FUNCTION uiXtos( xVar )
do case
case cType == 'C'
cVar := xVar
SWITCH ValType( xVar )
CASE "C"
RETURN xVar
CASE "N"
RETURN Str( xVar )
CASE "D"
RETURN DToC( xVar )
CASE "L"
RETURN iif( xVar, "Yes", "No " )
ENDSWITCH
case cType == 'N'
cVar := str( xVar )
case cType == 'D'
cVar := dtoc( xVar )
case cType == 'L'
cVar := if( xVar, 'Yes','No ' )
otherwise
cVar := 'NIL'
endcase
Return cVar
RETURN "NIL"

View File

@@ -2,6 +2,8 @@
# $Id$
#
-q0 -w3 -es2 -kmo -l
-nulrdd
hbformat.prg
hbformac.c

View File

@@ -2,5 +2,7 @@
# $Id$
#
-q0 -w3 -es2 -kmo -l
-nulrdd
hbi18n.prg

View File

@@ -2,6 +2,8 @@
# $Id$
#
-q0 -w3 -es2 -kmo -l
-nulrdd
-mt
hbmk2.prg

View File

@@ -2,6 +2,8 @@
# $Id$
#
-q0 -w3 -es2 -kmo -l
hbrun.prg
-lhbcplr

View File

@@ -2,6 +2,8 @@
# $Id$
#
-q0 -w3 -es2 -kmo -l-
hbtest.prg
rt_array.prg
rt_date.prg