From b0fff9b9e5becf35cdd051a81d0574a3a6c3be2a Mon Sep 17 00:00:00 2001 From: chatty Date: Tue, 10 May 1994 11:36:23 +0000 Subject: replaced TRUE/FALSE by true/false --- comm/OLD/TextServer.cc | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'comm/OLD/TextServer.cc') diff --git a/comm/OLD/TextServer.cc b/comm/OLD/TextServer.cc index 4b9ac14..5808fba 100644 --- a/comm/OLD/TextServer.cc +++ b/comm/OLD/TextServer.cc @@ -19,6 +19,12 @@ #include "PortServer.h" #include +#ifdef __osf__ +extern "C" { + int accept (int, struct sockaddr*, int*); +} +#endif + /* every REG_TIME milliseconds, the server registers to the port server we want this time to be shorter than the REG_TIME of the port server. half the value of the port server's REG_TIME seems reasonable */ @@ -64,9 +70,9 @@ if \typ{MY_CLIENT} is the derived class of \var{UchTextClient} defined by the application and \var{s} is this server. ?*/ UchTextServer :: UchTextServer (const char* serv, fNEW_CLIENT newcl) -: UchStream (new UchInetAddress (ANYADDR), 0), +: UchStream (new UchInetAddress (ANYADDR, 0), 0), Timer (0), - ok (FALSE), + ok (false), Clients () { service = serv; @@ -93,15 +99,15 @@ UchTextServer :: Init (UchBaseMultiplexer& mpx) { if (Listen () < 0) { // calls Setup SysError (ErrWarn, "UchTextServer::Setup"); - return FALSE; + return false; } mpx.Add (*this); - ok = TRUE; + ok = true; char buf [128]; sprintf (buf, "listening on port #%d", (void*) ((UchInetAddress*) BoundTo ())->Port ()); - Error (ErrLog, "UchTextServer::Init", buf); + ::Error (ErrLog, "UchTextServer::Init", buf); Timer = new UchTextServerTimer (this); - return TRUE; + return true; } /*? @@ -117,7 +123,7 @@ UchTextServer :: Quit () { if (! ok) return; - ok = FALSE; + ok = false; // a bit tricky because of the smart pointers: // each tstream probably is referenced only through the multiplexer // removing it from the multiplexer hence deletes it. @@ -156,7 +162,7 @@ UchTextServer :: Remove (UchTextClient* s) int found = Clients.Remove (s); if (!found) - Error (ErrWarn, "UchTextServer::Remove", "stream not in client list"); + ::Error (ErrWarn, "UchTextServer::Remove", "stream not in client list"); if (Mpx) Mpx->Remove (*s); @@ -220,7 +226,7 @@ UchTextClient :: UchTextClient (UchTextServer* s) : UchTextStream (), MyServer (s) { - sendToOut = FALSE; + sendToOut = false; out = 0; } @@ -247,8 +253,8 @@ UchTextClient :: Starting () /*? This protected virtual function is called by \fun{HandleRead} when -an end-of-file is read (the argument is then TRUE) or when an error occured -while reading (the argument is then FALSE). +an end-of-file is read (the argument is then true) or when an error occured +while reading (the argument is then false). It calls the server's \fun{Remove} function for this client, which should result in the destruction of the client. This virtual function can be redefined in derived classes, but the @@ -321,7 +327,7 @@ If \var{ch} is 0, output is simply discarded. void UchTextClient :: SetOutput (UchChannel* ch) { - sendToOut = TRUE; + sendToOut = true; out = ch; } @@ -332,6 +338,6 @@ void UchTextClient :: ResetOutput () { out = 0; - sendToOut = FALSE; + sendToOut = false; } -- cgit v1.1