From a46b379fb2a8a1399606db6a753c85a6546f5336 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 12:59:43 +0000 Subject: Utilisateur : Fcolin Date : 14/02/01 Heure : 18:47 Archivé dans $/Ivy (vss 8) --- Ivy/IvyApplication.cxx | 52 +++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'Ivy/IvyApplication.cxx') diff --git a/Ivy/IvyApplication.cxx b/Ivy/IvyApplication.cxx index cbb3ee6..ef72bd1 100644 --- a/Ivy/IvyApplication.cxx +++ b/Ivy/IvyApplication.cxx @@ -11,7 +11,7 @@ #include "IvyApplication.h" #include "Regexp.h" -//#define DEBUG +#define IVY_DEBUG #define ARG_START "\002" #define ARG_END "\003" @@ -61,7 +61,7 @@ UINT IvyApplication::Create() Listen( SOMAXCONN ); GetSockName( host, port ); TRACE(" TCP %s:%d\n", host.c_str(), port ); -#ifdef DEBUG +#ifdef IVY_DEBUG TRACE( "IvyApplication::Create server socket %d\n", m_hSocket ); #endif return port; @@ -78,9 +78,9 @@ void IvyApplication::OnReceive(char * line) const char *argv[Regexp::NSUBEXP]; char *arg; -#ifdef DEBUG +#ifdef IVY_DEBUG TRACE("Receive %s\n",line); -#endif //DEBUG +#endif //IVY_DEBUG err = sscanf( line ,"%d %d", &kind_of_msg, &id); arg = strstr( line , ARG_START ); @@ -97,31 +97,31 @@ void IvyApplication::OnReceive(char * line) { case Bye: -#ifdef DEBUG +#ifdef IVY_DEBUG TRACE("Quitting %s\n", line); -#endif //DEBUG +#endif //IVY_DEBUG // bus->RemoveApplication( this ); Close(); break; case Error: -#ifdef DEBUG +#ifdef IVY_DEBUG TRACE("Receive error %d %s\n", id, arg); -#endif //DEBUG +#endif //IVY_DEBUG break; case AddRegexp: -#ifdef DEBUG +#ifdef IVY_DEBUG TRACE("Regexp id=%d exp='%s'\n", id, arg); -#endif //DEBUG +#endif //IVY_DEBUG if ( !bus->CheckRegexp( arg ) ) { -#ifdef DEBUG +#ifdef IVY_DEBUG TRACE("Warning exp='%s' can't match removing from %s\n",arg,appname.c_str()); -#endif //DEBUG +#endif //IVY_DEBUG return; } exp = new Regexp( arg ); @@ -140,9 +140,9 @@ void IvyApplication::OnReceive(char * line) break; case DelRegexp: -#ifdef DEBUG +#ifdef IVY_DEBUG TRACE("Regexp Delete id=%d\n", id); -#endif //DEBUG +#endif //IVY_DEBUG if ( regexp_in[id] ) { exp = regexp_in[ id ]; @@ -152,9 +152,9 @@ void IvyApplication::OnReceive(char * line) break; case StartRegexp: -#ifdef DEBUG +#ifdef IVY_DEBUG TRACE("Regexp Start id=%d\n", id); -#endif //DEBUG +#endif //IVY_DEBUG appname = arg; /* remote socket port */ @@ -169,9 +169,9 @@ void IvyApplication::OnReceive(char * line) break; case EndRegexp: -#ifdef DEBUG +#ifdef IVY_DEBUG TRACE("Regexp End id=%d\n", id); -#endif //DEBUG +#endif //IVY_DEBUG bus->CallApplicationConnectedCallback( this ); AppConnectedCallbackCalled = true; @@ -180,9 +180,9 @@ void IvyApplication::OnReceive(char * line) break; case Msg: -#ifdef DEBUG +#ifdef IVY_DEBUG TRACE("Message id=%d msg='%s'\n", id, arg); -#endif //DEBUG +#endif //IVY_DEBUG arg = strtok( arg, ARG_END); while ( arg ) @@ -194,17 +194,17 @@ void IvyApplication::OnReceive(char * line) break; case DirectMsg: -#ifdef DEBUG +#ifdef IVY_DEBUG TRACE("Direct Message id=%d msg='%s'\n", id, arg); -#endif //DEBUG +#endif //IVY_DEBUG bus->CallDirectMessageCallback( this, id, arg ); break; case Die: -#ifdef DEBUG +#ifdef IVY_DEBUG TRACE("Die Message id=%d msg='%s'\n", id, arg); -#endif //DEBUG +#endif //IVY_DEBUG if ( bus->CallDieCallback( this, id, arg ) ) { @@ -227,9 +227,9 @@ void IvyApplication::SendMsg(MsgType msg, int id, const char * arg) sprintf( buffer, "%d %d" ARG_START "%s\n", msg, id, arg ); else sprintf( buffer, "%d %d" ARG_START "\n", msg, id ); -#ifdef DEBUG +#ifdef IVY_DEBUG TRACE("SendMsg %s\n",buffer); -#endif //DEBUG +#endif //IVY_DEBUG Send( buffer ); } -- cgit v1.1