Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
J'en ai marre de faire des messages detailles. 'Current state' ;)
[simgrid.git] / src / gras / DataDesc / datadesc_interface.h
1 /* $Id$ */
2
3 /* datadesc - describing the data to exchange                               */
4
5 /* module's public interface exported within GRAS, but not to end user.     */
6
7 /* Authors: Olivier Aumage, Martin Quinson                                  */
8 /* Copyright (C) 2003, 2004 the GRAS posse.                                 */
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_DATADESC_INTERFACE_H
14 #define GRAS_DATADESC_INTERFACE_H
15
16 #include "gras_private.h"
17
18 void gras_datadesc_init(void);
19 void gras_datadesc_exit(void);
20
21 /* - main functions - */
22 /* compare two data type description */
23 int
24 gras_datadesc_type_cmp(const gras_datadesc_type_t *d1,
25                        const gras_datadesc_type_t *d2);
26
27
28 /* Copy a described data in memory */
29 gras_error_t 
30 gras_datadesc_cpy(gras_datadesc_type_t *type, void *src, void **dst);
31
32 /* Send stuff */
33 gras_error_t 
34 gras_datadesc_send(gras_socket_t *sock, gras_datadesc_type_t *type, void *src);
35
36 /* Receive (and convert) stuff */
37 gras_error_t
38 gras_datadesc_recv(gras_socket_t *sock, gras_datadesc_type_t *type, void **dst);
39
40
41 /* -- */
42
43 /* free a given ddt */
44 void gras_ddt_free(gras_datadesc_type_t **type);
45
46 /* declare in the given set, and retrieve afterward */
47 gras_error_t gras_ddt_register(gras_datadesc_type_t *type);
48 gras_error_t gras_ddt_get_by_name(const char            *name,
49                                   gras_datadesc_type_t **type);
50 gras_error_t gras_ddt_get_by_code(int                    code,
51                                   gras_datadesc_type_t **type);
52
53
54 #endif /* GRAS_DATADESC_INTERFACE_H */