summaryrefslogtreecommitdiff
path: root/src/analysis/type.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2010-05-13 12:32:03 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2010-05-13 12:32:03 (GMT)
commit118a668adbf6ca9d4c549618e54f58330f46ce58 (patch)
tree10e75f1a7e83ab48aba82a5a595441a065a6037e /src/analysis/type.c
parente56b4db3aae87f0458319019635dea4968a5c529 (diff)
Supported Dalvik VM / DEX (partially).
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@155 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/type.c')
-rw-r--r--src/analysis/type.c41
1 files changed, 38 insertions, 3 deletions
diff --git a/src/analysis/type.c b/src/analysis/type.c
index c113499..3282e2b 100644
--- a/src/analysis/type.c
+++ b/src/analysis/type.c
@@ -52,6 +52,7 @@ struct _GOpenidaType
type_dup_fc dup; /* Copie d'instance existante */
type_to_string_fc to_string; /* Conversion au format texte */
+ GOpenidaType *namespace; /* Espace de noms / classe */
TypeQualifier qualifiers; /* Eventuels qualificatifs */
GTypesManager *manager; /* Gestionnaire global */
@@ -343,6 +344,28 @@ GOpenidaType *g_openida_type_dup(const GOpenidaType *type)
/******************************************************************************
* *
+* Paramètres : type = type à mettre à jour. *
+* namespace = instance d'appartenance. *
+* *
+* Description : Définit le groupe d'appartenance d'un type donné. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void g_openida_type_set_namespace(GOpenidaType *type, GOpenidaType *namespace)
+{
+ g_object_ref(G_OBJECT(namespace));
+
+ type->namespace = namespace;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : type = type à convertir. *
* *
* Description : Décrit le type fourni sous forme de caractères. *
@@ -356,17 +379,29 @@ GOpenidaType *g_openida_type_dup(const GOpenidaType *type)
char *g_openida_type_to_string(const GOpenidaType *type)
{
char *result; /* Chaîne à retourner */
+ char *namespace; /* Groupe d'appartenance */
result = type->to_string(type);
+ if (type->namespace != NULL)
+ {
+ namespace = g_openida_type_to_string(type->namespace);
+
+ result = strprep(result, "::");
+ result = strprep(result, namespace);
+
+ free(namespace);
+
+ }
+
if (type->qualifiers & TQF_RESTRICT)
- strprep(result, "restrict ");
+ result = strprep(result, "restrict ");
if (type->qualifiers & TQF_VOLATILE)
- strprep(result, "volatile ");
+ result = strprep(result, "volatile ");
if (type->qualifiers & TQF_CONST)
- strprep(result, "const ");
+ result = strprep(result, "const ");
return result;