summaryrefslogtreecommitdiff
path: root/src/analysis/db/misc
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-10-20 13:01:24 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-10-20 13:01:24 (GMT)
commitb1c08dd388a86d9a9d7c379ca143ae85310c3c68 (patch)
treea1a078e09ce4d8bd0db24c9139d5fad640353d79 /src/analysis/db/misc
parentf2c79b92f09fa796afe66d5886e678e9a7275ac1 (diff)
Provided a way to update snapshots name and description.
Diffstat (limited to 'src/analysis/db/misc')
-rw-r--r--src/analysis/db/misc/snapshot.c52
-rw-r--r--src/analysis/db/misc/snapshot.h6
2 files changed, 58 insertions, 0 deletions
diff --git a/src/analysis/db/misc/snapshot.c b/src/analysis/db/misc/snapshot.c
index c441ead..723ba75 100644
--- a/src/analysis/db/misc/snapshot.c
+++ b/src/analysis/db/misc/snapshot.c
@@ -509,3 +509,55 @@ bool pack_snapshot_info(const snapshot_info_t *info, packed_buffer *pbuf)
return result;
}
+
+
+/******************************************************************************
+* *
+* Paramètres : info = informations à mettre à jour. *
+* name = nouvelle désignation à considérer. *
+* *
+* Description : Change la désignation dans les informations d'un instantané. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void set_snapshot_info_name(snapshot_info_t *info, const char *name)
+{
+ if (info->name == NULL)
+ free(info->name);
+
+ if (name == NULL)
+ info->name = NULL;
+ else
+ info->name = strdup(name);
+
+}
+
+
+/******************************************************************************
+* *
+* Paramètres : info = informations à mettre à jour. *
+* desc = nouvelle description à considérer. *
+* *
+* Description : Change la description dans les informations d'un instantané. *
+* *
+* Retour : - *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+void set_snapshot_info_desc(snapshot_info_t *info, const char *desc)
+{
+ if (info->desc == NULL)
+ free(info->desc);
+
+ if (desc == NULL)
+ info->desc = NULL;
+ else
+ info->desc = strdup(desc);
+
+}
diff --git a/src/analysis/db/misc/snapshot.h b/src/analysis/db/misc/snapshot.h
index 8f9a598..3f55b50 100644
--- a/src/analysis/db/misc/snapshot.h
+++ b/src/analysis/db/misc/snapshot.h
@@ -122,6 +122,12 @@ bool unpack_snapshot_info(snapshot_info_t *, packed_buffer *);
/* Exporte la description d'un identifiant d'instantané. */
bool pack_snapshot_info(const snapshot_info_t *, packed_buffer *);
+/* Change la désignation dans les informations d'un instantané. */
+void set_snapshot_info_name(snapshot_info_t *, const char *);
+
+/* Change la description dans les informations d'un instantané. */
+void set_snapshot_info_desc(snapshot_info_t *, const char *);
+
#endif /* _ANALYSIS_DB_MISC_SNAPSHOT_H */