-
- void gras_msg_send(gras_socket_t sock,
- gras_msgtype_t msgtype,
- void *payload);
- void gras_msg_wait(double timeout,
- gras_msgtype_t msgt_want,
- gras_socket_t *expeditor,
- void *payload);
- void gras_msg_handle(double timeOut);
+/** \brief Send the data pointed by \a payload as a message \a msgname on the \a sock
+ * @hideinitializer
+ *
+ * Using gras_msg_wait() is a bit slower than using gras_msg_wait_() since GRAS
+ * has to search for the given msgtype in the hash table.
+ */
+#define gras_msg_send(sock,name,payload) gras_msg_send_(sock,gras_msgtype_by_name(name),payload)
+ XBT_PUBLIC(void) gras_msg_send_(gras_socket_t sock,
+ gras_msgtype_t msgtype,
+ void *payload);
+
+/** \brief Waits for a message to come in over a given socket
+ * @hideinitializer
+ * @param timeout: How long should we wait for this message.
+ * @param msgt_want: type of awaited msg
+ * @param[out] expeditor: where to create a socket to answer the incomming message
+ * @param[out] payload: where to write the payload of the incomming message
+ * @return the error code (or no_error).
+ *
+ * Every message of another type received before the one waited will be queued
+ * and used by subsequent call to this function or gras_msg_handle().
+ *
+ * Using gras_msg_wait() is a bit slower than using gras_msg_wait_() since GRAS
+ * has to search for the given msgtype in the hash table.
+ */
+
+#define gras_msg_wait(timeout,msgt_want,expeditor,payload) gras_msg_wait_(timeout,gras_msgtype_by_name(msgt_want),expeditor,payload)
+ XBT_PUBLIC(void) gras_msg_wait_(double timeout,
+ gras_msgtype_t msgt_want,
+ gras_socket_t *expeditor,
+ void *payload);
+ XBT_PUBLIC(void) gras_msg_handleall(double period);
+ XBT_PUBLIC(void) gras_msg_handle(double timeOut);