summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-07-01 19:22:17 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-07-01 19:22:17 (GMT)
commitbfd453d597d23b5c782aa8d40eb744d2ab56838e (patch)
treeb285ada70fcb80b367542ec876716b2aa33ebc5c /src/main.c
parent2f1a1323b4b6c5d4ff84a6d4d335e0cf56c5c8fa (diff)
Introduced attributes for loaded contents.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index c2aaf56..5dc9e3c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -491,6 +491,8 @@ static int open_binaries(char **files, int count)
int result; /* Bilan à retourner */
GStudyProject *project; /* Projet courant à compléter */
int i; /* Boucle de parcours */
+ GContentAttributes *attribs; /* Attributs à lier au contenu */
+ const char *filename; /* Chemin d'accès au contenu */
GBinContent *content; /* Contenu binaire à charger */
result = EXIT_SUCCESS;
@@ -499,16 +501,26 @@ static int open_binaries(char **files, int count)
for (i = 0; i < count && result == EXIT_SUCCESS; i++)
{
- content = g_file_content_new(files[i]);
+ attribs = g_content_attributes_new(files[i]);
+
+ filename = g_content_attributes_get_filename(attribs);
+
+ content = g_file_content_new(filename);
if (content != NULL)
{
+ g_binary_content_set_attributes(content, attribs);
+
g_study_project_discover_binary_content(project, content, !is_batch_mode(), NULL, NULL);
g_object_unref(G_OBJECT(content));
+
}
else
+ {
+ g_object_unref(G_OBJECT(attribs));
result = EXIT_FAILURE;
+ }
}