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/misc/rlestr.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/misc/rlestr.h')
-rw-r--r-- | src/analysis/db/misc/rlestr.h | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/analysis/db/misc/rlestr.h b/src/analysis/db/misc/rlestr.h index 2aa863f..7faafd0 100644 --- a/src/analysis/db/misc/rlestr.h +++ b/src/analysis/db/misc/rlestr.h @@ -30,6 +30,9 @@ #include <sys/types.h> +#include "../../../common/sqlite.h" + + /* Informations de base pour tout élément ajouté */ typedef struct _rle_string @@ -49,6 +52,8 @@ void init_rle_string(rle_string *, const char *); #define get_rle_string(rle) (rle)->data +#define is_rle_string_empty(rle) ((rle)->data == NULL) + /* Constitue une représentation de chaîne de caractères. */ void set_rle_string(rle_string *, const char *); @@ -58,25 +63,29 @@ void unset_rle_string(rle_string *); /* Effectue la comparaison entre deux chaînes de caractères. */ int cmp_rle_string(const rle_string *, const rle_string *); - - /* Importe la définition d'une chaîne de caractères. */ -bool load_rle_string(rle_string *, int); +bool recv_rle_string(rle_string *, int, int); /* Exporte la définition d'une chaîne de caractères. */ -bool store_rle_string(const rle_string *, int); +bool send_rle_string(const rle_string *, int, int); -#define is_rle_string_empty(rle) ((rle)->data == NULL) +/* --------------------- MANIPULATIONS AVEC UNE BASE DE DONNEES --------------------- */ +/* Définition du tronc commun pour les créations SQLite */ +#define SQLITE_RLESTR_CREATE(n) \ + n " TEXT" -/* Importe la définition d'une chaîne de caractères. */ -bool recv_rle_string(rle_string *, int, int); +/* Constitue les champs destinés à une insertion / modification. */ +bool prepare_db_statement_for_rle_string(const rle_string *, const char *, bound_value **, size_t *); -/* Exporte la définition d'une chaîne de caractères. */ -bool send_rle_string(const rle_string *, int, int); +/* Décrit les colonnes utiles à une chaîne de caractères. */ +bool setup_load_of_rle_string(const rle_string *, const char *, bound_value **, size_t *); + +/* Charge les valeurs utiles pour une chaîne de caractères. */ +bool load_rle_string(rle_string *, const char *, const bound_value *, size_t); |