X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3d0d626e19a7b79320e7d922c9c1dcf122076cea..3d630a8a0429ae6e380bf1e002a6e55c21cd078f:/include/gras/messages.h diff --git a/include/gras/messages.h b/include/gras/messages.h index b794e142c3..5cfc2b40c8 100644 --- a/include/gras/messages.h +++ b/include/gras/messages.h @@ -1,52 +1,34 @@ /* $Id$ */ /* messaging - high level communication (send/receive messages) */ - /* module's public interface exported to end user. */ -/* Authors: Martin Quinson */ -/* Copyright (C) 2003, 2004 Martin Quinson. */ +/* Copyright (c) 2003, 2004 Martin Quinson. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it - under the terms of the license (GNU LGPL) which comes with this package. */ - + * under the terms of the license (GNU LGPL) which comes with this package. */ #ifndef GRAS_MESSAGES_H #define GRAS_MESSAGES_H -/*! C++ users need love */ -#ifndef BEGIN_DECL -# ifdef __cplusplus -# define BEGIN_DECL extern "C" { -# else -# define BEGIN_DECL -# endif -#endif - -/*! C++ users need love */ -#ifndef END_DECL -# ifdef __cplusplus -# define END_DECL } -# else -# define END_DECL -# endif -#endif -/* End of cruft for C++ */ +#include "xbt/misc.h" +#include "gras/transport.h" +#include "gras/datadesc.h" BEGIN_DECL /* msgtype declaration and retrival */ -typedef struct s_gras_msgtype gras_msgtype_t; +typedef struct s_gras_msgtype *gras_msgtype_t; -void gras_msgtype_declare (const char *name, - gras_datadesc_type_t *payload); -void gras_msgtype_declare_v(const char *name, - short int version, - gras_datadesc_type_t *payload); +void gras_msgtype_declare (const char *name, + gras_datadesc_type_t payload); +void gras_msgtype_declare_v(const char *name, + short int version, + gras_datadesc_type_t payload); -gras_msgtype_t *gras_msgtype_by_name (const char *name); -gras_msgtype_t *gras_msgtype_by_namev(const char *name, - short int version); +gras_msgtype_t gras_msgtype_by_name (const char *name); +gras_msgtype_t gras_msgtype_by_namev(const char *name, + short int version); /** * gras_cb_t: @@ -59,21 +41,21 @@ gras_msgtype_t *gras_msgtype_by_namev(const char *name, * * If the callback accepts the message, it should free it after use. */ -typedef int (*gras_cb_t)(gras_socket_t *expeditor, - void *payload); -void gras_cb_register (gras_msgtype_t *msgtype, - gras_cb_t cb); -void gras_cb_unregister(gras_msgtype_t *msgtype, - gras_cb_t cb); - -gras_error_t gras_msg_send(gras_socket_t *sock, - gras_msgtype_t *msgtype, +typedef int (*gras_cb_t)(gras_socket_t expeditor, + void *payload); +void gras_cb_register (gras_msgtype_t msgtype, + gras_cb_t cb); +void gras_cb_unregister(gras_msgtype_t msgtype, + gras_cb_t cb); + +xbt_error_t gras_msg_send(gras_socket_t sock, + gras_msgtype_t msgtype, + void *payload); +xbt_error_t gras_msg_wait(double timeout, + gras_msgtype_t msgt_want, + gras_socket_t *expeditor, void *payload); -gras_error_t gras_msg_wait(double timeout, - gras_msgtype_t *msgt_want, - gras_socket_t **expeditor, - void *payload); -gras_error_t gras_msg_handle(double timeOut); +xbt_error_t gras_msg_handle(double timeOut); END_DECL