summaryrefslogtreecommitdiff
path: root/src/arch/vmpa.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2014-10-16 22:04:29 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2014-10-16 22:04:29 (GMT)
commit6d34dbbb00da0c276261d0e1ce4bf862f22fd8e0 (patch)
treea5d3c8644691934ba84a91919f7db177f70743f1 /src/arch/vmpa.c
parente75f44a99c8f984af4c47fa9a2c8e7e9841700d8 (diff)
Stored a bookmark into the data base and saved the archive.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@414 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/vmpa.c')
-rw-r--r--src/arch/vmpa.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/arch/vmpa.c b/src/arch/vmpa.c
index 6f305fb..024161c 100644
--- a/src/arch/vmpa.c
+++ b/src/arch/vmpa.c
@@ -482,6 +482,62 @@ vmpa2t *string_to_vmpa_virt(const char *buffer)
}
+/******************************************************************************
+* *
+* Paramètres : addr = adresse virtuelle ou physique à traiter. *
+* create = indique si la préparation vise une création ou non. *
+* values = couples de champs et de valeurs à lier. [OUT] *
+* count = nombre de ces couples. [OUT] *
+* *
+* Description : Constitue les champs destinés à une insertion / modification.*
+* *
+* Retour : Bilan de l'opération : succès ou non. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+bool prepare_vmpa_db_statement(const vmpa2t *addr, bool create, bound_value **values, size_t *count)
+{
+ bound_value *value; /* Valeur à éditer / définir */
+
+ *values = (bound_value *)realloc(*values, ++(*count) * sizeof(bound_value));
+ value = &(*values)[*count - 1];
+
+ value->name = "phys";
+
+ if (addr->physical != VMPA_NO_PHYSICAL)
+ {
+ value->type = SQLITE_INT64;
+ value->integer64 = addr->physical;
+ }
+ else
+ {
+ value->type = SQLITE_RAW;
+ value->cstring = "NULL";
+ }
+
+ *values = (bound_value *)realloc(*values, ++(*count) * sizeof(bound_value));
+ value = &(*values)[*count - 1];
+
+ value->name = "virt";
+
+ if (addr->virtual != VMPA_NO_VIRTUAL)
+ {
+ value->type = SQLITE_INT64;
+ value->integer64 = addr->virtual;
+ }
+ else
+ {
+ value->type = SQLITE_RAW;
+ value->cstring = "NULL";
+ }
+
+ return true;
+
+}
+
+
/* ---------------------------------------------------------------------------------- */
/* DEFINITION D'UNE ZONE EN MEMOIRE */