+/** @name Message declaration and retrival
+ *
+ * GRAS messages can only accept one type of payload. If you absolutely want to declare a message
+ * able to convey several datatypes, you can always say that it conveys a generic reference (see
+ * \ref gras_datadesc_ref_generic).
+ *
+ * In order to ease the upgrade of GRAS applications, it is possible to \e version the messages, ie
+ * to add a version number to the message (by default, the version is set to 0). Any messages of the
+ * wrong version will be ignored by the applications not providing any specific callback for them.
+ *
+ * This mecanism (stolen from the dynamic loader one) should ensure you to change the semantic of a given
+ * message while still understanding the old one.
+ */
+/** @{ */
+/** \brief Opaque type */
+typedef struct s_gras_msgtype *gras_msgtype_t;
+
+/** \brief declare a new message type of the given name. It only accepts the given datadesc as payload */
+void gras_msgtype_declare (const char *name,
+ gras_datadesc_type_t payload);
+/** \brief declare a new versionned message type of the given name and payload. */
+void gras_msgtype_declare_v(const char *name,
+ short int version,
+ gras_datadesc_type_t payload);
+
+/** \brief retrive an existing message type from its name. */
+gras_msgtype_t gras_msgtype_by_name (const char *name);
+/** \brief retrive an existing message type from its name and version number. */
+gras_msgtype_t gras_msgtype_by_namev(const char *name,
+ short int version);
+/** @} */
+
+/** @name Callback declaration and use
+ *
+ * This is how to register a given function so that it gets called when a
+ * given type of message arrives.
+ *
+ * You can register several callbacks to the same kind of messages, and
+ * they will get stacked. The lastly added callback gets the message first.
+ * If it consumes the message, it should return a true value when done. If
+ * not, it should return 0, and the message will be passed to the second
+ * callback of the stack, if any.
+ *
+ * @{
+ */
+
+/** \brief Type of message callback functions.
+ * \param msg: The message itself
+ * \return true if the message was consumed by the callback, false if the message was
+ * refused by the callback (and should be passed to the next callback of the stack for
+ * this message)