summaryrefslogtreecommitdiff
path: root/src/analysis/scan/matches/pending.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/scan/matches/pending.c')
-rw-r--r--src/analysis/scan/matches/pending.c55
1 files changed, 51 insertions, 4 deletions
diff --git a/src/analysis/scan/matches/pending.c b/src/analysis/scan/matches/pending.c
index 9ed4de3..57c63d7 100644
--- a/src/analysis/scan/matches/pending.c
+++ b/src/analysis/scan/matches/pending.c
@@ -48,10 +48,6 @@ static int compare_match_area(const match_area_t *, const match_area_t *);
-
-
-
-
/* ---------------------------------------------------------------------------------- */
/* MEMORISATION D'UNE ZONE BORNEE */
/* ---------------------------------------------------------------------------------- */
@@ -82,6 +78,12 @@ static int compare_match_area(const match_area_t *a, const match_area_t *b)
if (result == 0)
result = sort_unsigned_long_long(a->ttl, b->ttl);
+ if (result == 0)
+ result = sort_unsigned_long_long(a->has_mod_path, b->has_mod_path);
+
+ if (result == 0)
+ result = sort_unsigned_long_long(a->mod_path_index, b->mod_path_index);
+
return result;
}
@@ -293,6 +295,51 @@ void add_pending_match(pending_matches_t *matches, phys_t start, phys_t length)
area->ttl = 1;
+ area->has_mod_path = false;
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : matches = suivi de correspondances à compléter. *
+* start = point de départ d'une nouvelle correspondance. *
+* length = taille de la zone couverte. *
+* index = indice de construction pour le motif concerné. *
+* *
+* Description : Ajoute au suivi la définition d'une nouvelle correspondance. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void add_pending_match_with_path(pending_matches_t *matches, phys_t start, phys_t length, size_t index)
+{
+ match_area_t *area; /* Zone à initialiser */
+
+ if (matches->used == matches->allocated)
+ {
+ matches->allocated += PENDING_ALLOC_SIZE;
+
+ matches->areas = realloc(matches->areas, matches->allocated * sizeof(match_area_t));
+
+ }
+
+ area = &matches->areas[matches->used++];
+
+ area->start = start;
+ area->end = start + length;
+
+ assert(matches->content_start <= area->start);
+ assert(area->end <= matches->content_end);
+
+ area->ttl = 1;
+
+ area->mod_path_index = index;
+ area->has_mod_path = true;
+
}