summaryrefslogtreecommitdiff
path: root/src/analysis/db/cdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/db/cdb.c')
-rw-r--r--src/analysis/db/cdb.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/analysis/db/cdb.c b/src/analysis/db/cdb.c
index 96e69d5..70e0dc5 100644
--- a/src/analysis/db/cdb.c
+++ b/src/analysis/db/cdb.c
@@ -140,8 +140,9 @@ static bool g_cdb_archive_check_xml_version(const GCdbArchive *);
/* ------------------------- ACCES A LA BASE DE DONNEES SQL ------------------------- */
+
/* Crée la base de données correspondant à l'archive. */
-static bool g_cdb_archive_create_db(const GCdbArchive *, const core_db_info *);
+static bool g_cdb_archive_create_db(const GCdbArchive *);
@@ -333,7 +334,7 @@ GCdbArchive *g_cdb_archive_new(const char *owner, const rle_string *hash, const
if (errno != ENOENT) goto gcan_error;
g_cdb_archive_create_xml_desc(result, user);
- g_cdb_archive_create_db(result, NULL);
+ g_cdb_archive_create_db(result);
*error = g_cdb_archive_write(result);
@@ -623,7 +624,8 @@ int g_cdb_archive_compare_hash(const GCdbArchive *archive, const rle_string *has
static bool g_cdb_archive_create_xml_desc(GCdbArchive *archive, const rle_string *user)
{
bool result; /* Bilan à retourner */
- char tmp[sizeof(XSTR(UINT32_MAX))]; /* Stockage temporaire */
+ timestamp_t timestamp; /* Date de création */
+ char tmp[sizeof(XSTR(UINT64_MAX))]; /* Stockage temporaire */
result = create_new_xml_file(&archive->xdoc, &archive->context);
if (!result) return false;
@@ -640,7 +642,8 @@ static bool g_cdb_archive_create_xml_desc(GCdbArchive *archive, const rle_string
result &= add_content_to_node(archive->xdoc, archive->context,
"/ChrysalideBinary/Creation/Author", user->data);
- snprintf(tmp, sizeof(tmp), "%" PRIu64, (uint64_t)time(NULL));
+ init_timestamp(&timestamp);
+ snprintf(tmp, sizeof(tmp), "%" PRIu64, timestamp);
result &= add_content_to_node(archive->xdoc, archive->context,
"/ChrysalideBinary/Creation/Date", tmp);
@@ -694,7 +697,6 @@ static bool g_cdb_archive_check_xml_version(const GCdbArchive *archive)
/******************************************************************************
* *
* Paramètres : archive = archive à constituer. *
-* info = informations de base associées à la requête. *
* *
* Description : Crée la base de données correspondant à l'archive. *
* *
@@ -704,7 +706,7 @@ static bool g_cdb_archive_check_xml_version(const GCdbArchive *archive)
* *
******************************************************************************/
-static bool g_cdb_archive_create_db(const GCdbArchive *archive, const core_db_info *info)
+static bool g_cdb_archive_create_db(const GCdbArchive *archive)
{
bool result; /* Bilan à retourner */
sqlite3 *db; /* Base de données à constituer*/
@@ -728,7 +730,6 @@ static bool g_cdb_archive_create_db(const GCdbArchive *archive, const core_db_in
{
collec = G_DB_COLLECTION(iter->data);
result = g_db_collection_create_db_table(collec, db);
- fprintf(stderr, "STATUS :: %d\n", result);
}
sqlite3_close(db);
@@ -953,6 +954,13 @@ static void *g_cdb_archive_process(GCdbArchive *archive)
break;
+ case DBC_SET_LAST_ACTIVE:
+
+ status = update_activity_in_collections(archive->collections, fds[i].fd, archive->db);
+ if (!status) goto gcap_bad_exchange;
+
+ break;
+
default:
printf("bad command :: 0x%08x\n", command);
goto gcap_bad_exchange;