summaryrefslogtreecommitdiff
path: root/src/analysis/variable.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2010-04-18 00:31:49 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2010-04-18 00:31:49 (GMT)
commitef29fbc801e23f547b9ee7666b713bcf32d7e787 (patch)
treefb7466a56e2246c53a51d0475c1b5fc70ef3b8f9 /src/analysis/variable.c
parent49468379e912806400c5874f8e359cb934516228 (diff)
Improved the Itanium demangler.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@152 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/variable.c')
-rw-r--r--src/analysis/variable.c164
1 files changed, 164 insertions, 0 deletions
diff --git a/src/analysis/variable.c b/src/analysis/variable.c
index 01c780e..e24f7e1 100644
--- a/src/analysis/variable.c
+++ b/src/analysis/variable.c
@@ -24,6 +24,162 @@
#include "variable.h"
+#include "../common/extstr.h"
+
+
+
+/* ------------------- ASSOCIATION D'UN TYPE ET D'UNE DESIGNATION ------------------- */
+
+
+/* Variable typée (instance) */
+struct _GBinVariable
+{
+ GObject parent; /* A laisser en premier */
+
+ GOpenidaType *type; /* Type de la variable */
+ char *name; /* Désignation humaine */
+
+};
+
+/* Variable typée (classe) */
+struct _GBinVariableClass
+{
+ GObjectClass parent; /* A laisser en premier */
+
+};
+
+
+/* Initialise la classe des variables. */
+static void g_binary_variable_class_init(GBinVariableClass *);
+
+/* Initialise l'instande d'une variable. */
+static void g_binary_variable_init(GBinVariable *);
+
+
+
+/* ---------------------------------------------------------------------------------- */
+/* ASSOCIATION D'UN TYPE ET D'UNE DESIGNATION */
+/* ---------------------------------------------------------------------------------- */
+
+
+/* Indique le type défini pour une base de variable. */
+G_DEFINE_TYPE(GBinVariable, g_binary_variable, G_TYPE_OBJECT);
+
+
+/******************************************************************************
+* *
+* Paramètres : klass = classe à initialiser. *
+* *
+* Description : Initialise la classe des variables. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_binary_variable_class_init(GBinVariableClass *klass)
+{
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : var = instance à initialiser. *
+* *
+* Description : Initialise l'instande d'une variable. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static void g_binary_variable_init(GBinVariable *var)
+{
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : type = type de la variable à mettre en place. *
+* *
+* Description : Crée une représentation de variable de type donné. *
+* *
+* Retour : Variable mise en place. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+GBinVariable *g_binary_variable_new(GOpenidaType *type)
+{
+ GBinVariable *result; /* Variable à retourner */
+
+ result = g_object_new(G_TYPE_BIN_VARIABLE, NULL);
+
+ result->type = type;
+ g_object_ref(G_OBJECT(type));
+
+ return result;
+
+}
+
+
+
+
+
+
+
+
+/******************************************************************************
+* *
+* Paramètres : var = variable à convertir. *
+* *
+* Description : Décrit la variable donnée sous forme de caractères. *
+* *
+* Retour : Chaîne à libérer de la mémoire après usage. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+char *g_binary_variable_to_string(const GBinVariable *var)
+{
+ char *result; /* Valeur à retourner */
+
+ result = g_openida_type_to_string(var->type);
+
+ if (var->name != NULL)
+ {
+ if (!g_openida_type_is_pointer(var->type, true))
+ result = stradd(result, " ");
+
+ result = stradd(result, var->name);
+
+ }
+
+ return result;
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#include <malloc.h>
#include <stdint.h>
#include <string.h>
@@ -34,6 +190,14 @@
+
+
+
+
+
+
+
+
/* -------------------- BASE DE VARIABLES OU VARIABLES INCONNUES -------------------- */