summaryrefslogtreecommitdiffstats
path: root/src/statfile.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/statfile.h')
-rw-r--r--src/statfile.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/statfile.h b/src/statfile.h
index 76efe264f..2269d7ced 100644
--- a/src/statfile.h
+++ b/src/statfile.h
@@ -23,10 +23,13 @@
*/
struct stat_file_header {
u_char magic[3]; /**< magic signature ('r' 's' 'd') */
- u_char version[2]; /**< version of statfile (1.0) */
+ u_char version[2]; /**< version of statfile */
u_char padding[3]; /**< padding */
uint64_t create_time; /**< create time (time_t->uint64_t) */
-} __attribute__((__packed__));
+ uint64_t revision; /**< revision number */
+ uint64_t rev_time; /**< revision time */
+ u_char unused[255]; /**< some bytes that can be used in future */
+};
/**
* Section header
@@ -206,4 +209,24 @@ gboolean statfile_pool_add_section (statfile_pool_t *pool, stat_file_t *file, ui
*/
uint32_t statfile_get_section_by_name (const char *name);
+/**
+ * Set statfile revision and revision time
+ * @param pool statfile pool object
+ * @param filename name of statfile
+ * @param revision number of revision
+ * @param time time of revision
+ * @return TRUE if revision was set
+ */
+gboolean statfile_set_revision (statfile_pool_t *pool, stat_file_t *file, uint64_t rev, time_t time);
+
+/**
+ * Set statfile revision and revision time
+ * @param pool statfile pool object
+ * @param filename name of statfile
+ * @param revision saved number of revision
+ * @param time saved time of revision
+ * @return TRUE if revision was saved in rev and time
+ */
+gboolean statfile_get_revision (statfile_pool_t *pool, stat_file_t *file, uint64_t *rev, time_t *time);
+
#endif