diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-07-22 21:23:49 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-07-22 21:23:49 (GMT) |
commit | 21537636cd8318cf5a720211619ad3c3023b52e9 (patch) | |
tree | 93380a9152f18e39cf0ba427ede96533c5c6f16a /src/analysis/db/item-int.h | |
parent | 361a0953c73635c6c383516280a8d634768f8226 (diff) |
Fortified the client/server protocol and first exchanges.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@554 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/db/item-int.h')
-rw-r--r-- | src/analysis/db/item-int.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/analysis/db/item-int.h b/src/analysis/db/item-int.h index 0f75ed4..7b99f4a 100644 --- a/src/analysis/db/item-int.h +++ b/src/analysis/db/item-int.h @@ -31,9 +31,7 @@ #include <stdint.h> - - - +#include "misc/rlestr.h" @@ -44,7 +42,10 @@ typedef bool (* recv_db_item_fc) (GDbItem *, int, int); typedef bool (* send_db_item_fc) (const GDbItem *, int, int); /* Constitue les champs destinés à une insertion / modification. */ -typedef bool (* prepare_db_statement) (const GDbItem *, bool, bound_value **, size_t *); +typedef bool (* prepare_db_statement) (const GDbItem *, bound_value **, size_t *); + +/* Charge les valeurs utiles pour une localisation. */ +typedef bool (* load_db_item_fc) (GDbItem *, const bound_value *, size_t); /* Base d'un élément pour collection générique (instance) */ @@ -55,6 +56,11 @@ struct _GDbItem uint64_t created; /* Date de création */ uint64_t modified; /* Date de modification */ + rle_string author; /* Utilisateur d'origine */ + rle_string tool; /* Eventuel outil automatique ?*/ + + rle_string label; /* Représentation humaine */ + bool is_volatile; /* Pas besoin de sauvegarde ? */ }; @@ -70,9 +76,19 @@ struct _GDbItemClass send_db_item_fc send; /* Emission depuis le réseau */ prepare_db_statement prepare_stmt; /* Préparation d'une requête */ + load_db_item_fc load; /* Chargement à partir d'une BD*/ }; +/* Définition du tronc commun pour les créations SQLite */ +#define SQLITE_DB_ITEM_CREATE \ + "created INTEGER, " \ + "modified INTEGER, " \ + SQLITE_RLESTR_CREATE("author") ", " \ + SQLITE_RLESTR_CREATE("tool") ", " \ + SQLITE_RLESTR_CREATE("label") + + #endif /* _ANALYSIS_DB_ITEM_INT_H */ |