summaryrefslogtreecommitdiff
path: root/src/analysis/scan/matches/pending.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/scan/matches/pending.h')
-rw-r--r--src/analysis/scan/matches/pending.h36
1 files changed, 28 insertions, 8 deletions
diff --git a/src/analysis/scan/matches/pending.h b/src/analysis/scan/matches/pending.h
index 0a1fe5c..6df01c9 100644
--- a/src/analysis/scan/matches/pending.h
+++ b/src/analysis/scan/matches/pending.h
@@ -25,6 +25,7 @@
#define _ANALYSIS_SCAN_MATCHES_PENDING_H
+#include <assert.h>
#include <stdbool.h>
@@ -45,17 +46,28 @@ typedef struct _match_area_t
/* Suivi de correspondances */
typedef struct _pending_matches_t
{
+ phys_t content_start; /* Point de début du contenu */
+ phys_t content_end; /* Point de fin du contenu */
+
match_area_t *areas; /* Zones couvertes */
size_t allocated; /* Nombre d'allocations */
size_t used; /* Nombre de zones */
bool initialized; /* Etat du suivi */
+ bool abort; /* Inutilité d'une poursuite */
+
} pending_matches_t;
/* Initialise une structure de consolidation de correspondances. */
-void init_pending_matches(pending_matches_t *);
+void init_pending_matches(pending_matches_t *, const phys_t *, const phys_t *);
+
+/* Copie une structure de consolidation de correspondances. */
+void copy_pending_matches(pending_matches_t *, const pending_matches_t *);
+
+/* Fusionner une structure de consolidation avec une autre. */
+void merge_pending_matches(pending_matches_t *, const pending_matches_t *);
/* Libère la mémoire utilisée par une consolidation. */
void exit_pending_matches(pending_matches_t *);
@@ -69,26 +81,34 @@ void exit_pending_matches(pending_matches_t *);
size_t count_pending_matches(const pending_matches_t *);
/* Fournit la liste des correspondances établies à présent. */
-const match_area_t *get_all_pending_matches(const pending_matches_t *, size_t *);
+match_area_t * const *get_all_pending_matches(const pending_matches_t *, size_t *);
/* Ajoute au suivi la définition d'une nouvelle correspondance. */
void add_pending_match(pending_matches_t *, phys_t, phys_t);
/* Etend une zone couverte dans le suivi des correspondances. */
-void extend_pending_match(pending_matches_t *, size_t, phys_t);
+void extend_pending_match_beginning(pending_matches_t *, size_t, phys_t);
-/* Détermine si une correspondance se situe dans une plage. */
-bool has_pending_match_ending_between(const pending_matches_t *, size_t, phys_t, phys_t, phys_t);
-
-/* Détermine si une correspondance se termine à une position. */
-bool has_pending_match_ending_at(const pending_matches_t *, size_t, phys_t);
+/* Etend une zone couverte dans le suivi des correspondances. */
+void extend_pending_match_ending(pending_matches_t *, size_t, phys_t);
/* Réinitialisation à 0 tous les TTL de correspondances. */
void reset_pending_matches_ttl(pending_matches_t *);
+#define keep_pending_match(p) \
+ do \
+ { \
+ assert(p->ttl == 0); \
+ p->ttl = 1; \
+ } \
+ while (0);
+
/* Retire toutes les correspondances sans issue pour l'analyse. */
void purge_pending_matches(pending_matches_t *);
+/* Trie les correspondances et retire tous les doublons. */
+void sort_and_filter_pending_matches(pending_matches_t *);
+
#endif /* _ANALYSIS_SCAN_MATCHES_PENDING_H */