diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-07-28 21:32:57 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-07-28 21:32:57 (GMT) |
commit | 41efd099244b53a0edb40d097b34bf28a05b6367 (patch) | |
tree | 90f2419db6584e672b9f190e7e61e589e0345459 /src/analysis/db/items/bookmark.c | |
parent | e56a0553f710235d829f36b1edbf3cea00148a98 (diff) |
Begun to manage collection items as active or inactive using timestamps.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@558 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/db/items/bookmark.c')
-rw-r--r-- | src/analysis/db/items/bookmark.c | 40 |
1 files changed, 34 insertions, 6 deletions
diff --git a/src/analysis/db/items/bookmark.c b/src/analysis/db/items/bookmark.c index 8512406..ba64491 100644 --- a/src/analysis/db/items/bookmark.c +++ b/src/analysis/db/items/bookmark.c @@ -28,6 +28,9 @@ #include <sys/socket.h> +#include <i18n.h> + + #include "../collection-int.h" #include "../item-int.h" @@ -69,7 +72,7 @@ static void g_db_bookmark_dispose(GDbBookmark *); static void g_db_bookmark_finalize(GDbBookmark *); /* Effectue la comparaison entre deux signets de collection. */ -static gint g_db_bookmark_cmp(GDbBookmark *, GDbBookmark *); +static gint g_db_bookmark_cmp(GDbBookmark *, GDbBookmark *, bool); /* Importe la définition d'un signet dans un flux réseau. */ static bool g_db_bookmark_recv_from_fd(GDbBookmark *, int, int); @@ -80,6 +83,9 @@ static bool g_db_bookmark_send_to_fd(const GDbBookmark *, int, int); /* Exécute un signet sur un tampon de binaire chargé. */ static bool g_db_bookmark_run(GDbBookmark *, GLoadedBinary *, bool *, bool); +/* Construit la description humaine d'un signet sur un tampon. */ +static void g_db_bookmark_build_label(GDbBookmark *); + /* Applique un signet sur un tampon de binaire chargé. */ static bool g_db_bookmark_apply(GDbBookmark *, GLoadedBinary *); @@ -168,10 +174,12 @@ static void g_db_bookmark_class_init(GDbBookmarkClass *klass) item = G_DB_ITEM_CLASS(klass); - item->cmp = (GCompareFunc)g_db_bookmark_cmp; + item->cmp = (cmp_db_item_fc)g_db_bookmark_cmp; item->recv = (recv_db_item_fc)g_db_bookmark_recv_from_fd; item->send = (send_db_item_fc)g_db_bookmark_send_to_fd; + + item->build_label = (build_item_label_fc)g_db_bookmark_build_label; item->apply = (run_item_fc)g_db_bookmark_apply; item->cancel = (run_item_fc)g_db_bookmark_cancel; @@ -269,8 +277,9 @@ GDbBookmark *g_db_bookmark_new(const vmpa2t *addr, const char *comment) /****************************************************************************** * * -* Paramètres : a = premier élément à analyser. * -* b = second élément à analyser. * +* Paramètres : a = premier élément à analyser. * +* b = second élément à analyser. * +* with = précise les horodatages à prendre en compte. * * * * Description : Effectue la comparaison entre deux signets de collection. * * * @@ -280,7 +289,7 @@ GDbBookmark *g_db_bookmark_new(const vmpa2t *addr, const char *comment) * * ******************************************************************************/ -static gint g_db_bookmark_cmp(GDbBookmark *a, GDbBookmark *b) +static gint g_db_bookmark_cmp(GDbBookmark *a, GDbBookmark *b, bool with) { gint result; /* Bilan de la comparaison */ @@ -290,7 +299,7 @@ static gint g_db_bookmark_cmp(GDbBookmark *a, GDbBookmark *b) result = cmp_rle_string(&a->comment, &b->comment); if (result == 0) - result = G_DB_ITEM_CLASS(g_db_bookmark_parent_class)->cmp(G_DB_ITEM(a), G_DB_ITEM(b)); + result = G_DB_ITEM_CLASS(g_db_bookmark_parent_class)->cmp(G_DB_ITEM(a), G_DB_ITEM(b), with); return result; @@ -413,6 +422,25 @@ static bool g_db_bookmark_run(GDbBookmark *bookmark, GLoadedBinary *binary, bool /****************************************************************************** * * * Paramètres : bookmark = signet à manipuler. * +* * +* Description : Construit la description humaine d'un signet sur un tampon. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_db_bookmark_build_label(GDbBookmark *bookmark) +{ + asprintf(&G_DB_ITEM(bookmark)->label, _("Bookmark \"%s\""), get_rle_string(&bookmark->comment)); + +} + + +/****************************************************************************** +* * +* Paramètres : bookmark = signet à manipuler. * * binary = binaire chargé en mémoire à modifier. * * * * Description : Applique un signet sur un tampon de binaire chargé. * |