Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics
[simgrid.git] / src / gras / DataDesc / ddt_remote.c
1 /* $Id$ */
2
3 /* ddt_remote - Stuff needed to get datadescs about remote hosts            */
4
5 /* Authors: Olivier Aumage, Martin Quinson                                  */
6 /* Copyright (C) 2003, 2004 the GRAS posse.                                 */
7
8 /* This program is free software; you can redistribute it and/or modify it
9    under the terms of the license (GNU LGPL) which comes with this package. */
10
11 #include "DataDesc/datadesc_private.h"
12
13
14 /***
15  *** Table of all known architectures. 
16  ***/
17
18 const gras_arch_sizes_t gras_arch_sizes[gras_arch_count] = {
19   {"i386",   0,   {1,2,4,4,8,   4,4,   4,8}}
20 };
21
22 /**
23  * gras_free_ddt:
24  *
25  * gime that memory back, dude. I mean it.
26  */
27 static void gras_free_ddt(void *ddt) {
28   gras_datadesc_type_t *type= (gras_datadesc_type_t *)ddt;
29   
30   if (type) {
31     gras_ddt_free(&type);
32   }
33 }
34
35 /**
36  * gras_ddt_register:
37  *
38  * Add a type to a type set
39  */
40 gras_error_t gras_ddt_register(gras_datadesc_type_t *type) {
41   return gras_set_add(gras_datadesc_set_local,
42                       (gras_set_elm_t*)type,
43                        &gras_free_ddt);
44
45 }
46
47 /**
48  * gras_ddt_get_by_name:
49  *
50  * Retrieve a type from its name
51  */
52 gras_error_t gras_ddt_get_by_name(const char            *name,
53                                   gras_datadesc_type_t **type) {
54   return gras_set_get_by_name(gras_datadesc_set_local,name,(gras_set_elm_t**)type);
55 }
56
57 /**
58  * gras_ddt_get_by_code:
59  *
60  * Retrieve a type from its name
61  */
62 gras_error_t gras_ddt_get_by_code(int                    code,
63                                   gras_datadesc_type_t **type) {
64   return gras_set_get_by_id(gras_datadesc_set_local,code,(gras_set_elm_t**)type);
65 }