From 8a274412cccd5237e03481028bcfab96a5e85070 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 13:01:31 +0000 Subject: Utilisateur : Fcolin Date : 18/10/01 Heure : 18:24 Créé (vss 1) --- Ivy/IvyCbindings.cxx | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 Ivy/IvyCbindings.cxx (limited to 'Ivy/IvyCbindings.cxx') diff --git a/Ivy/IvyCbindings.cxx b/Ivy/IvyCbindings.cxx new file mode 100644 index 0000000..de87db4 --- /dev/null +++ b/Ivy/IvyCbindings.cxx @@ -0,0 +1,73 @@ + +#include "stdafx.h" + +#include "Ivy.h" +#include "IvyApplication.h" + +/* filtrage des regexps */ +void IvyClasses( int argc, const char **argv) +{ +} + +void IvyInit( + const char *AppName, /* nom de l'application */ + const char *ready, /* ready Message peut etre NULL */ + IvyApplicationCallback callback, /* callback appele sur connection deconnection d'une appli */ + void *data, /* user data passe au callback */ + IvyDieCallback die_callback, /* last change callback before die */ + void *die_data ) /* user data */ +{ +} +void IvyStart (const char*) +{ +} +void IvyStop () +{ +} + +/* query sur les applications connectees */ +char *IvyGetApplicationName( IvyClientPtr app ) +{ +} +char *IvyGetApplicationHost( IvyClientPtr app ) +{ +} +IvyClientPtr IvyGetApplication( char *name ) +{ +} +char *IvyGetApplicationList() +{ +} +char **IvyGetApplicationMessages( IvyClientPtr app) +{ +} + +MsgRcvPtr IvyBindMsg( MsgCallback callback, void *user_data, const char *fmt_regexp, ... ) +{ +} +void IvyUnbindMsg( MsgRcvPtr id ) +{ +} + +/* emission d'un message d'erreur */ +void IvySendError( IvyClientPtr app, int id, const char *fmt, ... ) +{ +} + +/* emmission d'un message die pour terminer l'application */ +void IvySendDieMsg( IvyClientPtr app ) +{ +} + +/* emission d'un message retourne le nb effectivement emis */ + +int IvySendMsg( const char *fmt_message, ... ) +{ +} + +void IvyBindDirectMsg( MsgDirectCallback callback, void *user_data) +{ +} +void IvySendDirectMsg( IvyClientPtr app, int id, char *msg ) +{ +} -- cgit v1.1 From 55eaa424173f390b66f3eb392c48f069c357533b Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 13:01:33 +0000 Subject: Utilisateur : Fcolin Date : 25/10/01 Heure : 18:39 Archivé dans $/Ivy (vss 2) --- Ivy/IvyCbindings.cxx | 76 +++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 64 insertions(+), 12 deletions(-) (limited to 'Ivy/IvyCbindings.cxx') diff --git a/Ivy/IvyCbindings.cxx b/Ivy/IvyCbindings.cxx index de87db4..07becfc 100644 --- a/Ivy/IvyCbindings.cxx +++ b/Ivy/IvyCbindings.cxx @@ -1,71 +1,123 @@ #include "stdafx.h" - +#include #include "Ivy.h" #include "IvyApplication.h" -/* filtrage des regexps */ -void IvyClasses( int argc, const char **argv) +#include "IvyCbindings.h" + +static Ivy *bus = NULL; + +// application callback wrappers +IvyCApplicationCallback app_cb = NULL; +void * app_user_data = NULL; +void app_conn( IvyApplication *app ) +{ + (*app_cb)(app, app_user_data, IvyApplicationConnected ); +} +void app_discon( IvyApplication *app ) { + (*app_cb)(app, app_user_data, IvyApplicationDisconnected ); } void IvyInit( const char *AppName, /* nom de l'application */ const char *ready, /* ready Message peut etre NULL */ - IvyApplicationCallback callback, /* callback appele sur connection deconnection d'une appli */ + IvyCApplicationCallback callback, /* callback appele sur connection deconnection d'une appli */ void *data, /* user data passe au callback */ - IvyDieCallback die_callback, /* last change callback before die */ + IvyCDieCallback die_callback, /* last change callback before die */ void *die_data ) /* user data */ { + bus = new Ivy(AppName, ready, BUS_APPLICATION_CALLBACK(app_conn,app_discon) ); +} +/* filtrage des regexps */ +void IvyClasses( int argc, const char **argv) +{ + bus->Classes( argc, argv ); } -void IvyStart (const char*) + +void IvyStart (const char* domain) { + bus->start(domain); } void IvyStop () { + bus->stop(); } /* query sur les applications connectees */ -char *IvyGetApplicationName( IvyClientPtr app ) +const char *IvyGetApplicationName( IvyClientPtr app ) { + return ((IvyApplication*)app)->GetName(); } -char *IvyGetApplicationHost( IvyClientPtr app ) +const char *IvyGetApplicationHost( IvyClientPtr app ) { + string host; + UINT port; + ((IvyApplication*)app)->GetPeerName(host,port); + return host.c_str(); } IvyClientPtr IvyGetApplication( char *name ) { + return NULL; } -char *IvyGetApplicationList() +const char *IvyGetApplicationList() { + return "Not yiet implemented"; } -char **IvyGetApplicationMessages( IvyClientPtr app) +const char **IvyGetApplicationMessages( IvyClientPtr app) { + return NULL; } -MsgRcvPtr IvyBindMsg( MsgCallback callback, void *user_data, const char *fmt_regexp, ... ) +MsgRcvPtr IvyBindMsg( IvyCMsgCallback callback, void *user_data, const char *fmt_regexp, ... ) { + int count; + char buf_regexp[2048]; + va_list args; + va_start( args, fmt_regexp ); + vsprintf( buf_regexp, fmt_regexp, args ); + count = bus->BindMsg(buf_regexp, BUS_CALLBACK( ((IvyMessageCallbackFunction::IvyMessageCallback_fun)callback), user_data ) ); + va_end( args ); + return count; } void IvyUnbindMsg( MsgRcvPtr id ) { + bus->UnbindMsg( id ); } /* emission d'un message d'erreur */ void IvySendError( IvyClientPtr app, int id, const char *fmt, ... ) { + char buf[2048]; + va_list args; + va_start( args, fmt ); + vsprintf( buf, fmt, args ); + ((IvyApplication*)app)->SendMsg( IvyApplication::Error, id, buf ); + va_end( args ); } /* emmission d'un message die pour terminer l'application */ void IvySendDieMsg( IvyClientPtr app ) { + ((IvyApplication*)app)->SendMsg( IvyApplication::Die, 0 ); } /* emission d'un message retourne le nb effectivement emis */ int IvySendMsg( const char *fmt_message, ... ) { + int count; + char buf[2048]; + va_list args; + va_start( args, fmt_message ); + vsprintf( buf, fmt_message, args ); + count = bus->SendMsg(buf); + va_end( args ); + return count; } -void IvyBindDirectMsg( MsgDirectCallback callback, void *user_data) +void IvyBindDirectMsg( IvyCMsgDirectCallback callback, void *user_data) { } void IvySendDirectMsg( IvyClientPtr app, int id, char *msg ) -- cgit v1.1 From 28cc6cec36580bba460de5f77700c994a0b04a7f Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 13:01:35 +0000 Subject: Utilisateur : Fcolin Date : 24/05/05 Heure : 11:29 Archivé dans $/Bus/Ivy Commentaire: Ajout MainLoop binding Ivy C (vss 3) --- Ivy/IvyCbindings.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Ivy/IvyCbindings.cxx') diff --git a/Ivy/IvyCbindings.cxx b/Ivy/IvyCbindings.cxx index 07becfc..18d5268 100644 --- a/Ivy/IvyCbindings.cxx +++ b/Ivy/IvyCbindings.cxx @@ -123,3 +123,7 @@ void IvyBindDirectMsg( IvyCMsgDirectCallback callback, void *user_data) void IvySendDirectMsg( IvyClientPtr app, int id, char *msg ) { } +void IvyMainLoop( void(*hook)(void) ) +{ + Sleep( INFINITE ); +} -- cgit v1.1 From b3c991e52707bf1447d1c63b5b6a78fa300753e3 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 13:01:37 +0000 Subject: Utilisateur : Fcolin Date : 1/06/05 Heure : 16:45 Archivé dans $/Bus/Ivy Commentaire: (vss 4) --- Ivy/IvyCbindings.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Ivy/IvyCbindings.cxx') diff --git a/Ivy/IvyCbindings.cxx b/Ivy/IvyCbindings.cxx index 18d5268..9ab5efb 100644 --- a/Ivy/IvyCbindings.cxx +++ b/Ivy/IvyCbindings.cxx @@ -1,5 +1,5 @@ -#include "stdafx.h" +#include "IvyStdAfx.h" #include #include "Ivy.h" #include "IvyApplication.h" @@ -76,7 +76,7 @@ MsgRcvPtr IvyBindMsg( IvyCMsgCallback callback, void *user_data, const char *fmt char buf_regexp[2048]; va_list args; va_start( args, fmt_regexp ); - vsprintf( buf_regexp, fmt_regexp, args ); + _vsnprintf( buf_regexp, sizeof(buf_regexp), fmt_regexp, args ); count = bus->BindMsg(buf_regexp, BUS_CALLBACK( ((IvyMessageCallbackFunction::IvyMessageCallback_fun)callback), user_data ) ); va_end( args ); return count; @@ -92,7 +92,7 @@ void IvySendError( IvyClientPtr app, int id, const char *fmt, ... ) char buf[2048]; va_list args; va_start( args, fmt ); - vsprintf( buf, fmt, args ); + _vsnprintf( buf, sizeof(buf), fmt, args ); ((IvyApplication*)app)->SendMsg( IvyApplication::Error, id, buf ); va_end( args ); } @@ -111,7 +111,7 @@ int IvySendMsg( const char *fmt_message, ... ) char buf[2048]; va_list args; va_start( args, fmt_message ); - vsprintf( buf, fmt_message, args ); + _vsnprintf( buf, sizeof(buf), fmt_message, args ); count = bus->SendMsg(buf); va_end( args ); return count; -- cgit v1.1 From e63bd03a298522ad519fd2070faad9d6a36ed403 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 13:01:39 +0000 Subject: Utilisateur : Fcolin Date : 2/06/05 Heure : 18:42 Archivé dans $/Bus/Ivy Commentaire: Suppression de la STL et ajout d'un namespace pour les datatypes internes Ivy (vss 5) --- Ivy/IvyCbindings.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Ivy/IvyCbindings.cxx') diff --git a/Ivy/IvyCbindings.cxx b/Ivy/IvyCbindings.cxx index 9ab5efb..9a188ab 100644 --- a/Ivy/IvyCbindings.cxx +++ b/Ivy/IvyCbindings.cxx @@ -52,7 +52,7 @@ const char *IvyGetApplicationName( IvyClientPtr app ) } const char *IvyGetApplicationHost( IvyClientPtr app ) { - string host; + ivy::string host; UINT port; ((IvyApplication*)app)->GetPeerName(host,port); return host.c_str(); -- cgit v1.1 From f06851fa71982d57d257119435876aa48bc6ab86 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 13:01:41 +0000 Subject: Utilisateur : Fcolin Date : 16/11/05 Heure : 9:54 Archivé dans $/Bus/Ivy Commentaire: 64 bits ports (vss 6) --- Ivy/IvyCbindings.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Ivy/IvyCbindings.cxx') diff --git a/Ivy/IvyCbindings.cxx b/Ivy/IvyCbindings.cxx index 9a188ab..7f11339 100644 --- a/Ivy/IvyCbindings.cxx +++ b/Ivy/IvyCbindings.cxx @@ -76,7 +76,7 @@ MsgRcvPtr IvyBindMsg( IvyCMsgCallback callback, void *user_data, const char *fmt char buf_regexp[2048]; va_list args; va_start( args, fmt_regexp ); - _vsnprintf( buf_regexp, sizeof(buf_regexp), fmt_regexp, args ); + _vsnprintf_s( buf_regexp, sizeof(buf_regexp), sizeof(buf_regexp)-1, fmt_regexp, args ); count = bus->BindMsg(buf_regexp, BUS_CALLBACK( ((IvyMessageCallbackFunction::IvyMessageCallback_fun)callback), user_data ) ); va_end( args ); return count; @@ -92,7 +92,7 @@ void IvySendError( IvyClientPtr app, int id, const char *fmt, ... ) char buf[2048]; va_list args; va_start( args, fmt ); - _vsnprintf( buf, sizeof(buf), fmt, args ); + _vsnprintf_s( buf, sizeof(buf), sizeof(buf)-1, fmt, args ); ((IvyApplication*)app)->SendMsg( IvyApplication::Error, id, buf ); va_end( args ); } @@ -111,7 +111,7 @@ int IvySendMsg( const char *fmt_message, ... ) char buf[2048]; va_list args; va_start( args, fmt_message ); - _vsnprintf( buf, sizeof(buf), fmt_message, args ); + _vsnprintf_s( buf, sizeof(buf), sizeof(buf)-1, fmt_message, args ); count = bus->SendMsg(buf); va_end( args ); return count; -- cgit v1.1 From 93e316c3985bd8327b64dba94791ac3efa63ed4b Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 13:01:43 +0000 Subject: Utilisateur : Fcolin Date : 1/06/06 Heure : 10:14 Archivé dans $/Bus/Ivy Commentaire: ajout Binding Callback et SetFilter (vss 7) --- Ivy/IvyCbindings.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Ivy/IvyCbindings.cxx') diff --git a/Ivy/IvyCbindings.cxx b/Ivy/IvyCbindings.cxx index 7f11339..8876bbf 100644 --- a/Ivy/IvyCbindings.cxx +++ b/Ivy/IvyCbindings.cxx @@ -31,9 +31,9 @@ void IvyInit( bus = new Ivy(AppName, ready, BUS_APPLICATION_CALLBACK(app_conn,app_discon) ); } /* filtrage des regexps */ -void IvyClasses( int argc, const char **argv) +void IvySetFilter( int argc, const char **argv) { - bus->Classes( argc, argv ); + bus->SetFilter( argc, argv ); } void IvyStart (const char* domain) -- cgit v1.1