summaryrefslogtreecommitdiff
path: root/src/format/elf
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2009-02-16 22:05:28 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2009-02-16 22:05:28 (GMT)
commitd7765c0e6d2685b57625f607325f4a80eb28dbe5 (patch)
treeb590e3b4b28b28584fdade28d17059db1ad2bcac /src/format/elf
parent14abff97c2ba0940c2dcf2e37eb080ebdb923c6f (diff)
Begun to add a real support of DragAndDropping for panels.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@48 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/elf')
-rw-r--r--src/format/elf/e_elf.c24
-rw-r--r--src/format/elf/e_elf.h2
2 files changed, 26 insertions, 0 deletions
diff --git a/src/format/elf/e_elf.c b/src/format/elf/e_elf.c
index 48b4455..a69be68 100644
--- a/src/format/elf/e_elf.c
+++ b/src/format/elf/e_elf.c
@@ -44,7 +44,31 @@ size_t get_elf_resolved_items(const elf_format *, char ***, ResolvedType **, uin
+/******************************************************************************
+* *
+* Paramètres : content = contenu binaire à parcourir. *
+* length = taille du contenu en question. *
+* *
+* Description : Indique si le format peut être pris en charge ici. *
+* *
+* Retour : true si la réponse est positive, false sinon. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+bool elf_is_matching(const uint8_t *content, off_t length)
+{
+ bool result; /* Bilan à faire connaître */
+
+ result = false;
+ if (length >= 4)
+ result = (strncmp((const char *)content, "\x7f\x45\x4c\x46" /* .ELF */, 4) == 0);
+
+ return result;
+
+}
/******************************************************************************
diff --git a/src/format/elf/e_elf.h b/src/format/elf/e_elf.h
index b11fb24..fffeff2 100644
--- a/src/format/elf/e_elf.h
+++ b/src/format/elf/e_elf.h
@@ -38,6 +38,8 @@
typedef struct _elf_format elf_format;
+/* Indique si le format peut être pris en charge ici. */
+bool elf_is_matching(const uint8_t *, off_t);
/* Prend en charge un nouvel ELF. */
elf_format *load_elf(const uint8_t *, off_t);