summaryrefslogtreecommitdiff
path: root/src/analysis/db/item-int.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-07-28 21:32:57 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-07-28 21:32:57 (GMT)
commit41efd099244b53a0edb40d097b34bf28a05b6367 (patch)
tree90f2419db6584e672b9f190e7e61e589e0345459 /src/analysis/db/item-int.h
parente56a0553f710235d829f36b1edbf3cea00148a98 (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/item-int.h')
-rw-r--r--src/analysis/db/item-int.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/analysis/db/item-int.h b/src/analysis/db/item-int.h
index 12c69f3..1af1048 100644
--- a/src/analysis/db/item-int.h
+++ b/src/analysis/db/item-int.h
@@ -36,12 +36,18 @@
+/* Effectue la comparaison entre deux éléments de collection. */
+typedef gint (* cmp_db_item_fc) (GDbItem *, GDbItem *, bool);
+
/* Importe la définition d'une base d'éléments pour collection. */
typedef bool (* recv_db_item_fc) (GDbItem *, int, int);
/* Exporte la définition d'une base d'éléments pour collection. */
typedef bool (* send_db_item_fc) (const GDbItem *, int, int);
+/* Construit la description humaine d'un signet sur un tampon. */
+typedef void (* build_item_label_fc) (GDbItem *);
+
/* Exécute un élément de collection sur un binaire. */
typedef bool (* run_item_fc) (GDbItem *, GLoadedBinary *);
@@ -57,13 +63,15 @@ struct _GDbItem
{
GObject parent; /* A laisser en premier */
- uint64_t created; /* Date de création */
- uint64_t modified; /* Date de modification */
+ bool server_side; /* Instance côté serveur */
+
+ timestamp_t created; /* Date de création */
+ timestamp_t timestamp; /* Date dernière activité */
rle_string author; /* Utilisateur d'origine */
rle_string tool; /* Eventuel outil automatique ?*/
- rle_string label; /* Représentation humaine */
+ char *label; /* Représentation humaine */
bool is_volatile; /* Pas besoin de sauvegarde ? */
@@ -78,10 +86,12 @@ struct _GDbItemClass
{
GObjectClass parent; /* A laisser en premier */
- GCompareFunc cmp; /* Comparaison entre éléments */
+ cmp_db_item_fc cmp; /* Comparaison entre éléments */
recv_db_item_fc recv; /* Réception depuis le réseau */
send_db_item_fc send; /* Emission depuis le réseau */
+
+ build_item_label_fc build_label; /* Construction de description */
run_item_fc apply; /* Application de l'élément */
run_item_fc cancel; /* Retrait de l'élément */
@@ -93,8 +103,8 @@ struct _GDbItemClass
/* Définition du tronc commun pour les créations SQLite */
#define SQLITE_DB_ITEM_CREATE \
- "created INTEGER, " \
- "modified INTEGER, " \
+ SQLITE_TIMESTAMP_CREATE("created") ", " \
+ SQLITE_TIMESTAMP_CREATE("timestamp") ", " \
SQLITE_RLESTR_CREATE("author") ", " \
SQLITE_RLESTR_CREATE("tool") ", " \
SQLITE_RLESTR_CREATE("label")