diff options
Diffstat (limited to 'plugins/dex/format.c')
-rw-r--r-- | plugins/dex/format.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/plugins/dex/format.c b/plugins/dex/format.c index 495f327..84ddb4d 100644 --- a/plugins/dex/format.c +++ b/plugins/dex/format.c @@ -53,10 +53,10 @@ static void g_dex_format_dispose(GDexFormat *); static void g_dex_format_finalize(GDexFormat *); /* Indique la désignation interne du format. */ -static const char *g_dex_format_get_name(const GDexFormat *); +static char *g_dex_format_get_key(const GDexFormat *); /* Fournit une description humaine du format. */ -static const char *g_dex_format_get_description(const GDexFormat *); +static char *g_dex_format_get_description(const GDexFormat *); /* Assure l'interprétation d'un format en différé. */ static bool g_dex_format_analyze(GDexFormat *, wgroup_id_t, GtkStatusStack *); @@ -139,6 +139,7 @@ G_DEFINE_TYPE(GDexFormat, g_dex_format, G_TYPE_EXE_FORMAT); static void g_dex_format_class_init(GDexFormatClass *klass) { GObjectClass *object; /* Autre version de la classe */ + GKnownFormatClass *known; /* Version de format connu */ GBinFormatClass *fmt; /* Version en format basique */ GExeFormatClass *exe; /* Version en exécutable */ @@ -147,11 +148,14 @@ static void g_dex_format_class_init(GDexFormatClass *klass) object->dispose = (GObjectFinalizeFunc/* ! */)g_dex_format_dispose; object->finalize = (GObjectFinalizeFunc)g_dex_format_finalize; + known = G_KNOWN_FORMAT_CLASS(klass); + + known->get_key = (known_get_key_fc)g_dex_format_get_key; + known->get_desc = (known_get_desc_fc)g_dex_format_get_description; + known->analyze = (known_analyze_fc)g_dex_format_analyze; + fmt = G_BIN_FORMAT_CLASS(klass); - fmt->get_name = (format_get_name_fc)g_dex_format_get_name; - fmt->get_desc = (format_get_desc_fc)g_dex_format_get_description; - fmt->analyze = (format_analyze_fc)g_dex_format_analyze; fmt->get_endian = (format_get_endian_fc)g_dex_format_get_endianness; exe = G_EXE_FORMAT_CLASS(klass); @@ -252,7 +256,7 @@ GExeFormat *g_dex_format_new(GBinContent *content) result = g_object_new(G_TYPE_DEX_FORMAT, NULL); - g_binary_format_set_content(G_BIN_FORMAT(result), content); + g_known_format_set_content(G_KNOWN_FORMAT(result), content); result->pool = g_dex_pool_new(result); @@ -267,17 +271,17 @@ GExeFormat *g_dex_format_new(GBinContent *content) * * * Description : Indique la désignation interne du format. * * * -* Retour : Description du format. * +* Retour : Désignation du format. * * * * Remarques : - * * * ******************************************************************************/ -static const char *g_dex_format_get_name(const GDexFormat *format) +static char *g_dex_format_get_key(const GDexFormat *format) { - const char *result; /* Désignation à retourner */ + char *result; /* Désignation à retourner */ - result = "dex"; + result = strdup("dex"); return result; @@ -296,11 +300,11 @@ static const char *g_dex_format_get_name(const GDexFormat *format) * * ******************************************************************************/ -static const char *g_dex_format_get_description(const GDexFormat *format) +static char *g_dex_format_get_description(const GDexFormat *format) { - const char *result; /* Désignation à retourner */ + char *result; /* Désignation à retourner */ - result = "Dalvik Executable format (version '035')"; + result = strdup("Dalvik Executable format (version '035')"); return result; @@ -344,7 +348,7 @@ static bool g_dex_format_analyze(GDexFormat *format, wgroup_id_t gid, GtkStatusS /* Vérification des tailles fournies */ - size = g_binary_content_compute_size(base->content); + size = g_binary_content_compute_size(G_KNOWN_FORMAT(base)->content); if (size >= 0xffffffffllu) { |