diff options
Diffstat (limited to 'src/analysis/db/collection.h')
-rw-r--r-- | src/analysis/db/collection.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/analysis/db/collection.h b/src/analysis/db/collection.h index e550009..ac3e60f 100644 --- a/src/analysis/db/collection.h +++ b/src/analysis/db/collection.h @@ -84,14 +84,12 @@ bool g_db_collection_send_all_updates(GDbCollection *, int); /* Met à disposition un encadrement des accès aux éléments. */ void g_db_collection_lock_unlock(GDbCollection *, bool, bool); - #define g_db_collection_wlock(col) g_db_collection_lock_unlock(col, true, true); #define g_db_collection_wunlock(col) g_db_collection_lock_unlock(col, true, false); #define g_db_collection_rlock(col) g_db_collection_lock_unlock(col, false, true); #define g_db_collection_runlock(col) g_db_collection_lock_unlock(col, false, false); - /* Renvoie la liste des éléments rassemblés. */ GList *g_db_collection_list_items(const GDbCollection *); @@ -104,11 +102,17 @@ bool g_db_collection_has_item(GDbCollection *, GDbItem *); /* Procède à l'ajout d'un nouvel élément dans la collection. */ bool _g_db_collection_add_item(GDbCollection *, GDbItem *, bool); -/* Procède à la modification d'un élément dans la collection. */ -bool _g_db_collection_modify_item(GDbCollection *, GDbItem *, bool); +/* Met à jour le statut d'activité d'un élément de collection. */ +bool _g_db_collection_update_item_activity(GDbCollection *, GDbItem *, bool); #define g_db_collection_add_item(c, i) _g_db_collection_add_item(c, i, true) -#define g_db_collection_modify_item(c, i) _g_db_collection_modify_item(c, i, true) +#define g_db_collection_update_item_activity(c, i) _g_db_collection_update_item_activity(c, i, true) + +/* Active les éléments en amont d'un horodatage donné. */ +GList *g_db_collection_set_last_active(GDbCollection *, timestamp_t, timestamp_t *, sqlite3 *); + +/* Désactive les éléments en aval d'un horodatage donné. */ +bool g_db_collection_set_inactive(GDbCollection *, GDbItem *, timestamp_t *); @@ -132,6 +136,18 @@ void attach_binary_to_collections(GList *, GLoadedBinary *); /* Recherche une collection correspondant à un type donné. */ GDbCollection *find_collection_in_list(GList *, uint32_t); +/* Met à disposition un encadrement des accès aux éléments. */ +void lock_unlock_collections(GList *, bool, bool); + +#define wlock_collections(lst) lock_unlock_collections(lst, true, true); +#define wunlock_collections(lst) lock_unlock_collections(lst, true, false); + +#define rlock_collections(lst) lock_unlock_collections(lst, false, true); +#define runlock_collections(lst) lock_unlock_collections(lst, false, false); + +/* Met à jour les statuts d'activité des éléments. */ +bool update_activity_in_collections(GList *, int, sqlite3 *); + #endif /* _ANALYSIS_DB_COLLECTION_H */ |