diff options
Diffstat (limited to 'src/analysis/binary.c')
-rw-r--r-- | src/analysis/binary.c | 67 |
1 files changed, 9 insertions, 58 deletions
diff --git a/src/analysis/binary.c b/src/analysis/binary.c index 55b984a..96e774c 100644 --- a/src/analysis/binary.c +++ b/src/analysis/binary.c @@ -232,7 +232,7 @@ static void g_loaded_binary_finalize(GLoadedBinary *binary) * Remarques : - * * * ******************************************************************************/ -#include "db/items/bookmark.h" + GLoadedBinary *g_loaded_binary_new_from_xml(xmlXPathContextPtr context, const char *path) { GLoadedBinary *result; /* Adresse à retourner */ @@ -303,61 +303,6 @@ GLoadedBinary *g_loaded_binary_new_from_xml(xmlXPathContextPtr context, const ch status = g_db_client_start(result->local, host, port, author); - - - - - /* --------- %< --------- %< --------- %< --------- %< --------- */ - - do - { - vmpa2t addr; - GDbBookmark *bm; - bool status; - - - init_vmpa(&addr, 0xaeb4, VMPA_NO_VIRTUAL); - - bm = g_db_bookmark_new(&addr, "Premier commentaire"); - - - - status = g_loaded_binary_add_to_collection(result, DBF_BOOKMARKS, G_DB_ITEM(bm)); - - if (status) - printf("send OK\n"); - else - printf("send nok\n"); - - - g_db_client_save(result->local); - - - - /* - safe_send(client->fd, (uint32_t []) { htobe32(DBC_COLLECTION) }, sizeof(uint32_t), MSG_MORE); - safe_send(client->fd, (uint32_t []) { htobe32(DBF_BOOKMARKS) }, sizeof(uint32_t), MSG_MORE); - safe_send(client->fd, (uint32_t []) { htobe32(DBA_ADD_ITEM) }, sizeof(uint32_t), MSG_MORE); - - if (g_db_item_send(G_DB_ITEM(bm), client->fd, 0)) - printf("send OK\n"); - else - printf("send nok\n"); - - */ - - - } - while (0); - - /* --------- %< --------- %< --------- %< --------- %< --------- */ - - - - - - - printf("DB status :: %d\n", status); return result; @@ -394,6 +339,11 @@ bool g_loaded_binary_save(const GLoadedBinary *binary, xmlDocPtr xdoc, xmlXPathC result = g_loaded_binary_save_storage(binary, xdoc, context, path); + + //// + g_db_client_save(binary->local); + + return result; } @@ -797,6 +747,7 @@ GDbCollection *g_loaded_binary_find_collection(GLoadedBinary *binary, DBFeatures * Paramètres : binary = élément binaire à consulter. * * feature = fonctionnalité visée par la requête. * * item = élémnent à pousser vers un serveur de collection. * +* lock = indique si le verrou d'écriture doit être posé. * * * * Description : Demande l'intégration d'une modification dans une collection.* * * @@ -806,7 +757,7 @@ GDbCollection *g_loaded_binary_find_collection(GLoadedBinary *binary, DBFeatures * * ******************************************************************************/ -bool g_loaded_binary_add_to_collection(GLoadedBinary *binary, DBFeatures feature, GDbItem *item) +bool _g_loaded_binary_add_to_collection(GLoadedBinary *binary, DBFeatures feature, GDbItem *item, bool lock) { bool result; /* Bilan à faire remonter */ GDbCollection *collec; /* Collection visée au final */ @@ -819,7 +770,7 @@ bool g_loaded_binary_add_to_collection(GLoadedBinary *binary, DBFeatures feature /* S'il n'y a pas besoin de sauvegarde... */ if (g_db_item_is_volatile(item)) - g_db_collection_add_item(collec, item); + _g_db_collection_add_item(collec, item, lock); /* Sinon on envoie par le réseau ! */ else |