diff options
Diffstat (limited to 'src/analysis/db/misc')
-rw-r--r-- | src/analysis/db/misc/snapshot.c | 52 | ||||
-rw-r--r-- | src/analysis/db/misc/snapshot.h | 6 |
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 */ |