Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
2cc7607d44f213a1f95c439ecca852267c58801d
[simgrid.git] / src / gras / Msg / msg_private.h
1 /* $Id$ */
2
3 /* messaging - high level communication (send/receive messages)             */
4
5 /* module's private interface masked even to other parts of GRAS.           */
6
7 /* Authors: Martin Quinson                                                  */
8 /* Copyright (C) 2003, 2004 Martin Quinson.                                 */
9
10 /* This program is free software; you can redistribute it and/or modify it
11    under the terms of the license (GNU LGPL) which comes with this package. */
12
13 #ifndef GRAS_MESSAGE_PRIVATE_H
14 #define GRAS_MESSAGE_PRIVATE_H
15
16 #include "gras_config.h"
17
18 #include "xbt/sysdep.h"
19 #include "xbt/log.h"
20 #include "xbt/error.h"
21 #include "xbt/dynar.h"
22 #include "xbt/set.h"
23 #include "gras/transport.h"
24 #include "gras/datadesc.h"
25 #include "gras/virtu.h"
26
27 #include "gras/messages.h"
28 #include "gras_modinter.h"
29
30 #include "gras/Msg/msg_interface.h"
31
32 /**
33  * gras_msgtype_t:
34  *
35  * Message type descriptor. There one of these for each registered version.
36  */
37 typedef struct s_gras_msgtype {
38   /* headers for the data set */
39   unsigned int   code;
40   char          *name;
41   unsigned int   name_len;
42         
43   /* payload */
44   short int version;
45   gras_datadesc_type_t ctn_type;
46 } s_gras_msgtype_t;
47
48 extern gras_set_t _gras_msgtype_set; /* of gras_msgtype_t */
49 void gras_msgtype_free(void *msgtype);
50
51
52 gras_error_t gras_msg_recv(gras_socket_t    sock,
53                            gras_msgtype_t  *msgtype,
54                            void           **payload,
55                            int             *payload_size);
56
57 /**
58  * gras_cblist_t:
59  *
60  * association between msg ID and cb list for a given process
61  */
62 struct s_gras_cblist {
63   long int id;
64   gras_dynar_t cbs; /* of gras_msg_cb_t */
65 };
66
67 void gras_cblist_free(void *cbl);
68
69 #endif  /* GRAS_MESSAGE_PRIVATE_H */