summaryrefslogtreecommitdiffstats
path: root/src/statfile.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-11-12 19:50:28 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-11-12 19:50:28 +0300
commit1ad9f1f651ef3f0ee26d69007dd27e60f99f1f12 (patch)
tree876c16874df447aee95619091d2722aedd19af10 /src/statfile.h
parenta447a10790c37b862d5673a53ef63c0b7239ef73 (diff)
downloadrspamd-1ad9f1f651ef3f0ee26d69007dd27e60f99f1f12.tar.gz
rspamd-1ad9f1f651ef3f0ee26d69007dd27e60f99f1f12.zip
* New version of rspamd statfiles that can be used in sync
* Add convertion routines for converting 1.0 to 1.2 statfiles * Reserve some place in header for future features
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