diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2019-11-28 22:41:37 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2019-11-28 22:41:37 (GMT) |
commit | 48395d4471d87c20bdbd06bbab1ae3af938ff823 (patch) | |
tree | 00aaaabb7370d6163ed9a2a4f77f9a177f8126f7 /src/analysis/contents/file.c | |
parent | 472d566943f527e18eb95f31dbe70c50043396aa (diff) |
Improved the API for binary contents a little bit.
Diffstat (limited to 'src/analysis/contents/file.c')
-rw-r--r-- | src/analysis/contents/file.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/analysis/contents/file.c b/src/analysis/contents/file.c index 5509455..11d5802 100644 --- a/src/analysis/contents/file.c +++ b/src/analysis/contents/file.c @@ -179,6 +179,7 @@ static void g_file_content_class_init(GFileContentClass *klass) static void g_file_content_init(GFileContent *content) { GContentAttributes *empty; /* Jeu d'attributs vide */ + vmpa2t dummy; /* Localisation nulle */ content->attribs = NULL; @@ -186,6 +187,12 @@ static void g_file_content_init(GFileContent *content) g_binary_content_set_attributes(G_BIN_CONTENT(content), empty); + content->filename = NULL; + content->data = NULL; + + init_vmpa(&dummy, VMPA_NO_PHYSICAL, VMPA_NO_VIRTUAL); + init_mrange(&content->range, &dummy, 0); + } @@ -1003,3 +1010,26 @@ static bool g_file_content_read_leb128(const GFileContent *content, vmpa2t *addr return result; } + + +/****************************************************************************** +* * +* Paramètres : content = contenu binaire à venir consulter. * +* * +* Description : Fournit le nom de fichier associé au contenu binaire. * +* * +* Retour : Chemin d'accès au contenu binaire. * +* * +* Remarques : - * +* * +******************************************************************************/ + +const char *g_file_content_get_filename(const GFileContent *content) +{ + char *result; /* Chemin d'accès à retourner */ + + result = content->filename; + + return result; + +} |