summaryrefslogtreecommitdiff
path: root/src/glibext
diff options
context:
space:
mode:
Diffstat (limited to 'src/glibext')
-rw-r--r--src/glibext/gbinarycursor.c38
-rw-r--r--src/glibext/gbinarycursor.h4
-rw-r--r--src/glibext/glinecursor-int.h8
-rw-r--r--src/glibext/glinecursor.c6
-rw-r--r--src/glibext/glinecursor.h2
5 files changed, 14 insertions, 44 deletions
diff --git a/src/glibext/gbinarycursor.c b/src/glibext/gbinarycursor.c
index ee9eb5f..9c4e82b 100644
--- a/src/glibext/gbinarycursor.c
+++ b/src/glibext/gbinarycursor.c
@@ -97,9 +97,6 @@ static bool g_binary_cursor_unserialize(GBinaryCursor *, packed_buffer *);
/* Charge les valeurs utiles pour une localisation. */
static bool g_binary_cursor_load(GBinaryCursor *, const char *, const bound_value *, size_t);
-/* Constitue les champs destinés à une insertion / modification. */
-static bool g_binary_cursor_prepare_db_statement(const GBinaryCursor *, const char *, bound_value **, size_t *);
-
/* ---------------------------------------------------------------------------------- */
@@ -145,9 +142,8 @@ static void g_binary_cursor_class_init(GBinaryCursorClass *class)
line->unserialize = (unserialize_cursor_fc)g_binary_cursor_unserialize;
line->create_db = (create_cursor_db_table_fc)g_binary_cursor_create_db_table;
- line->setup_load = (setup_cursor_load_fc)g_binary_cursor_setup_load;
line->load = (load_cursor_fc)g_binary_cursor_load;
- line->prepare = (prepare_cursor_db_statement_fc)g_binary_cursor_prepare_db_statement;
+ line->store = (store_cursor_fc)g_binary_cursor_store;
}
@@ -500,31 +496,6 @@ char *g_binary_cursor_create_db_table(const char *base)
/******************************************************************************
* *
-* Paramètres : base = tronc commun pour les champs de la base de données. *
-* values = tableau d'éléments à compléter. [OUT] *
-* count = nombre de descriptions renseignées. [OUT] *
-* *
-* Description : Décrit les colonnes utiles à un chargement de données. *
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool g_binary_cursor_setup_load(const char *base, bound_value **values, size_t *count)
-{
- bool result; /* Bilan à renvoyer */
-
- result = setup_load_for_vmpa(base, values, count);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
* Paramètres : cursor = suivi de positions dont la définition est à définir.*
* base = tronc commun pour les champs de la base de données. *
* values = tableau d'éléments à consulter. *
@@ -564,11 +535,14 @@ static bool g_binary_cursor_load(GBinaryCursor *cursor, const char *base, const
* *
******************************************************************************/
-static bool g_binary_cursor_prepare_db_statement(const GBinaryCursor *cursor, const char *base, bound_value **values, size_t *count)
+bool g_binary_cursor_store(const GBinaryCursor *cursor, const char *base, bound_value **values, size_t *count)
{
bool result; /* Bilan à renvoyer */
- result = prepare_vmpa_db_statement(&cursor->addr, base, values, count);
+ if (cursor == NULL)
+ result = store_vmpa(NULL, base, values, count);
+ else
+ result = store_vmpa(&cursor->addr, base, values, count);
return result;
diff --git a/src/glibext/gbinarycursor.h b/src/glibext/gbinarycursor.h
index 63a6f1b..ffac19a 100644
--- a/src/glibext/gbinarycursor.h
+++ b/src/glibext/gbinarycursor.h
@@ -71,8 +71,8 @@ void g_binary_cursor_get_info(const GBinaryCursor *, vmpa2t *);
/* Donne les éléments requis pour la construction d'une table. */
char *g_binary_cursor_create_db_table(const char *);
-/* Décrit les colonnes utiles à un chargement de données. */
-bool g_binary_cursor_setup_load(const char *, bound_value **, size_t *);
+/* Constitue les champs destinés à une insertion / modification. */
+bool g_binary_cursor_store(const GBinaryCursor *, const char *, bound_value **, size_t *);
diff --git a/src/glibext/glinecursor-int.h b/src/glibext/glinecursor-int.h
index 18ec147..b6a0f19 100644
--- a/src/glibext/glinecursor-int.h
+++ b/src/glibext/glinecursor-int.h
@@ -54,14 +54,11 @@ typedef bool (* unserialize_cursor_fc) (GLineCursor *, packed_buffer *);
/* Donne les éléments requis pour la construction d'une table. */
typedef char *(* create_cursor_db_table_fc) (const char *);
-/* Décrit les colonnes utiles à un chargement de données. */
-typedef bool (* setup_cursor_load_fc) (const char *, bound_value **, size_t *);
-
/* Charge les valeurs utiles pour une localisation. */
typedef bool (* load_cursor_fc) (GLineCursor *, const char *, const bound_value *, size_t);
/* Constitue les champs destinés à une insertion / modification. */
-typedef bool (* prepare_cursor_db_statement_fc) (const GLineCursor *, const char *, bound_value **, size_t *);
+typedef bool (* store_cursor_fc) (const GLineCursor *, const char *, bound_value **, size_t *);
/* Suivi de positions dans un panneau de chargement (instance) */
@@ -86,9 +83,8 @@ struct _GLineCursorClass
unserialize_cursor_fc unserialize; /* Chargement d'un emplacement */
create_cursor_db_table_fc create_db; /* Création de table */
- setup_cursor_load_fc setup_load; /* Préparation du chargement */
load_cursor_fc load; /* Chargement de valeurs */
- prepare_cursor_db_statement_fc prepare; /* Préparation d'enregistrement*/
+ store_cursor_fc store; /* Préparation d'enregistrement*/
};
diff --git a/src/glibext/glinecursor.c b/src/glibext/glinecursor.c
index 64521f4..bef9cb6 100644
--- a/src/glibext/glinecursor.c
+++ b/src/glibext/glinecursor.c
@@ -356,7 +356,7 @@ bool g_line_cursor_setup_load(const GLineCursor *cursor, const char *base, bound
{
bool result; /* Bilan à renvoyer */
- result = G_LINE_CURSOR_GET_CLASS(cursor)->setup_load(base, values, count);
+ result = G_LINE_CURSOR_GET_CLASS(cursor)->store(NULL, base, values, count);
return result;
@@ -404,11 +404,11 @@ bool g_line_cursor_load(GLineCursor *cursor, const char *base, const bound_value
* *
******************************************************************************/
-bool g_line_cursor_prepare_db_statement(const GLineCursor *cursor, const char *base, bound_value **values, size_t *count)
+bool g_line_cursor_store(const GLineCursor *cursor, const char *base, bound_value **values, size_t *count)
{
bool result; /* Bilan à renvoyer */
- result = G_LINE_CURSOR_GET_CLASS(cursor)->prepare(cursor, base, values, count);
+ result = G_LINE_CURSOR_GET_CLASS(cursor)->store(cursor, base, values, count);
return result;
diff --git a/src/glibext/glinecursor.h b/src/glibext/glinecursor.h
index 4fa93c1..c373562 100644
--- a/src/glibext/glinecursor.h
+++ b/src/glibext/glinecursor.h
@@ -102,7 +102,7 @@ bool g_line_cursor_setup_load(const GLineCursor *, const char *, bound_value **,
bool g_line_cursor_load(GLineCursor *, const char *, const bound_value *, size_t);
/* Constitue les champs destinés à une insertion / modification. */
-bool g_line_cursor_prepare_db_statement(const GLineCursor *, const char *, bound_value **, size_t *);
+bool g_line_cursor_store(const GLineCursor *, const char *, bound_value **, size_t *);