3 /* ddt_remote - Stuff needed to get datadescs about remote hosts */
5 /* Authors: Olivier Aumage, Martin Quinson */
6 /* Copyright (C) 2003, 2004 the GRAS posse. */
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. */
11 #include "DataDesc/datadesc_private.h"
15 *** Table of all known architectures.
18 const gras_arch_sizes_t gras_arch_sizes[gras_arch_count] = {
19 {"i386", 0, {1,2,4,4,8, 4,4, 4,8}}
25 * gime that memory back, dude. I mean it.
27 static void gras_free_ddt(void *ddt) {
28 gras_datadesc_type_t *type= (gras_datadesc_type_t *)ddt;
38 * Add a type to a type set
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,
48 * gras_datadesc_by_name:
50 * Retrieve a type from its name
52 gras_error_t gras_datadesc_by_name(const char *name,
53 gras_datadesc_type_t **type) {
54 return gras_set_get_by_name(gras_datadesc_set_local,
55 name,(gras_set_elm_t**)type);
59 * gras_datadesc_by_id:
61 * Retrieve a type from its code
63 gras_error_t gras_datadesc_by_id(long int code,
64 gras_datadesc_type_t **type) {
65 return gras_set_get_by_id(gras_datadesc_set_local,
66 code,(gras_set_elm_t**)type);
70 * gras_dd_convert_elm:
72 * Convert the element described by @type comming from architecture @r_arch.
73 * The data to be converted is stored in @src, and is to be stored in @dst.
74 * Both pointers may be the same location if no resizing is needed.
77 gras_dd_convert_elm(gras_datadesc_type_t *type,
79 void *src, void *dst) {
81 if (r_arch != GRAS_THISARCH)
90 * returns the ID of the architecture the process is running on
93 gras_arch_selfid(void) {