From 09f82d4e1e6dd1672b272c314c42d5cf30c91ea8 Mon Sep 17 00:00:00 2001 From: bustico Date: Mon, 19 May 2008 15:31:30 +0000 Subject: * make the lib and api more robust by adding const where they should be * compile with -Wall and eliminate remaining warnings --- src/ivy.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/ivy.h') diff --git a/src/ivy.h b/src/ivy.h index bd107ff..1701fc1 100644 --- a/src/ivy.h +++ b/src/ivy.h @@ -29,22 +29,23 @@ extern "C" { /* numero par default du bus */ -typedef struct _clnt_lst_dict *IvyClientPtr; +typedef struct _clnt_lst_dict *RWIvyClientPtr; +typedef const struct _clnt_lst_dict *IvyClientPtr; typedef enum { IvyApplicationConnected, IvyApplicationDisconnected, - IvyApplicationCongestion , IvyApplicationDecongestion , + IvyApplicationCongestion , IvyApplicationDecongestion, IvyApplicationFifoFull } IvyApplicationEvent; typedef enum { IvyAddBind, IvyRemoveBind, IvyFilterBind, IvyChangeBind } IvyBindEvent; extern void IvyDefaultApplicationCallback( IvyClientPtr app, void *user_data, IvyApplicationEvent event ) ; -extern void IvyDefaultBindCallback( IvyClientPtr app, void *user_data, int id, char* regexp, IvyBindEvent event ) ; +extern void IvyDefaultBindCallback( IvyClientPtr app, void *user_data, int id, const char* regexp, IvyBindEvent event ) ; /* callback callback appele sur connexion deconnexion d'une appli */ typedef void (*IvyApplicationCallback)( IvyClientPtr app, void *user_data, IvyApplicationEvent event ) ; /* callback callback appele sur ajout ou suppression d'un bind */ -typedef void (*IvyBindCallback)( IvyClientPtr app, void *user_data, int id, char* regexp, IvyBindEvent event ) ; +typedef void (*IvyBindCallback)( IvyClientPtr app, void *user_data, int id, const char* regexp, IvyBindEvent event ) ; /* callback appele sur reception de die */ typedef void (*IvyDieCallback)( IvyClientPtr app, void *user_data, int id ) ; @@ -93,11 +94,11 @@ __attribute__((format(printf,2,3))); /* avec sprintf prealable */ void IvyUnbindMsg( MsgRcvPtr id ); /* emission d'un message d'erreur */ -void IvySendError( IvyClientPtr app, int id, const char *fmt, ... ) +void IvySendError(IvyClientPtr app, int id, const char *fmt, ... ) __attribute__((format(printf,3,4))) ; /* avec sprintf prealable */ /* emmission d'un message die pour terminer l'application */ -void IvySendDieMsg( IvyClientPtr app ); +void IvySendDieMsg(IvyClientPtr app ); /* emission d'un message retourne le nb effectivement emis */ -- cgit v1.1