summaryrefslogtreecommitdiff
path: root/plugins/elf/format.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/elf/format.c')
-rw-r--r--plugins/elf/format.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/plugins/elf/format.c b/plugins/elf/format.c
index d102ad8..75b9a6c 100644
--- a/plugins/elf/format.c
+++ b/plugins/elf/format.c
@@ -63,10 +63,10 @@ static void g_elf_format_dispose(GElfFormat *);
static void g_elf_format_finalize(GElfFormat *);
/* Indique la désignation interne du format. */
-static const char *g_elf_format_get_name(const GElfFormat *);
+static char *g_elf_format_get_key(const GElfFormat *);
/* Fournit une description humaine du format. */
-static const char *g_elf_format_get_description(const GElfFormat *);
+static char *g_elf_format_get_description(const GElfFormat *);
/* Assure l'interprétation d'un format en différé. */
static bool g_elf_format_analyze(GElfFormat *, wgroup_id_t, GtkStatusStack *);
@@ -137,6 +137,7 @@ G_DEFINE_TYPE(GElfFormat, g_elf_format, G_TYPE_EXE_FORMAT);
static void g_elf_format_class_init(GElfFormatClass *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 */
@@ -145,11 +146,14 @@ static void g_elf_format_class_init(GElfFormatClass *klass)
object->dispose = (GObjectFinalizeFunc/* ! */)g_elf_format_dispose;
object->finalize = (GObjectFinalizeFunc)g_elf_format_finalize;
+ known = G_KNOWN_FORMAT_CLASS(klass);
+
+ known->get_key = (known_get_key_fc)g_elf_format_get_key;
+ known->get_desc = (known_get_desc_fc)g_elf_format_get_description;
+ known->analyze = (known_analyze_fc)g_elf_format_analyze;
+
fmt = G_BIN_FORMAT_CLASS(klass);
- fmt->get_name = (format_get_name_fc)g_elf_format_get_name;
- fmt->get_desc = (format_get_desc_fc)g_elf_format_get_description;
- fmt->analyze = (format_analyze_fc)g_elf_format_analyze;
fmt->get_endian = (format_get_endian_fc)g_elf_format_get_endianness;
exe = G_EXE_FORMAT_CLASS(klass);
@@ -249,7 +253,7 @@ GExeFormat *g_elf_format_new(GBinContent *content)
result = g_object_new(G_TYPE_ELF_FORMAT, NULL);
- g_binary_format_set_content(G_BIN_FORMAT(result), content);
+ g_known_format_set_content(G_KNOWN_FORMAT(result), content);
return G_EXE_FORMAT(result);
@@ -262,17 +266,17 @@ GExeFormat *g_elf_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_elf_format_get_name(const GElfFormat *format)
+static char *g_elf_format_get_key(const GElfFormat *format)
{
- const char *result; /* Désignation à retourner */
+ char *result; /* Désignation à retourner */
- result = "elf";
+ result = strdup("elf");
return result;
@@ -291,11 +295,11 @@ static const char *g_elf_format_get_name(const GElfFormat *format)
* *
******************************************************************************/
-static const char *g_elf_format_get_description(const GElfFormat *format)
+static char *g_elf_format_get_description(const GElfFormat *format)
{
- const char *result; /* Désignation à retourner */
+ char *result; /* Désignation à retourner */
- result = "Executable and Linkable Format";
+ result = strdup("Executable and Linkable Format");
return result;