summaryrefslogtreecommitdiff
path: root/src/analysis/binary.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/binary.c')
-rw-r--r--src/analysis/binary.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/analysis/binary.c b/src/analysis/binary.c
index c6ae4e5..615e72e 100644
--- a/src/analysis/binary.c
+++ b/src/analysis/binary.c
@@ -862,6 +862,62 @@ bool _g_loaded_binary_add_to_collection(GLoadedBinary *binary, DBFeatures featur
+/******************************************************************************
+* *
+* Paramètres : binary = élément binaire à consulter. *
+* feature = fonctionnalité visée par la requête. *
+* item = élémnent à retirer d'un serveur de collection. *
+* lock = indique si le verrou d'écriture doit être posé. *
+* *
+* Description : Demande la suppression de modification dans une collection. *
+* *
+* Retour : Bilan partiel de l'opération demandée. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+bool _g_loaded_binary_remove_from_collection(GLoadedBinary *binary, DBFeatures feature, GDbItem *item, bool lock)
+{
+ bool result; /* Bilan à faire remonter */
+ GDbCollection *collec; /* Collection visée au final */
+ DBStorage storage; /* Forme d'enregistrement */
+ GDbClient *client; /* Liaison à utiliser */
+ int fd; /* Identifiant du canal de com.*/
+
+ collec = g_loaded_binary_find_collection(binary, feature);
+ if (collec == NULL) return false;
+
+ /* S'il n'y a pas besoin de sauvegarde... */
+ if (g_db_item_is_volatile(item))
+ _g_db_collection_remove_item(collec, item, lock);
+
+ /* Sinon on envoie par le réseau ! */
+ else
+ {
+ storage = g_loaded_binary_get_storage(binary, feature);
+
+
+ /* TODO : sélection du bon client... */
+ client = binary->local;
+
+
+ fd = g_db_client_get_fd(client);
+
+ result = g_db_collection_send(collec, fd, DBA_REM_ITEM, item);
+
+ g_db_client_put_fd(client);
+
+ }
+
+ g_object_unref(G_OBJECT(collec));
+
+ return result;
+
+}
+
+
+