diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2008-11-28 19:29:00 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2008-11-28 19:29:00 +0300 |
commit | 06661f20cbb9d2f1d0f8a68fb7bc46dcd97c6276 (patch) | |
tree | d1054848d24437038adb3f75cbfc028c94e69548 /src/statfile.h | |
parent | f1fdc9c6c1fa897f6eac5abc4cd193b55d31e7bc (diff) | |
download | rspamd-06661f20cbb9d2f1d0f8a68fb7bc46dcd97c6276.tar.gz rspamd-06661f20cbb9d2f1d0f8a68fb7bc46dcd97c6276.zip |
* Write functions to operate blocks in stat files
* Write test case for statistics files API
Diffstat (limited to 'src/statfile.h')
-rw-r--r-- | src/statfile.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/statfile.h b/src/statfile.h index 801d1dae2..624ea64ee 100644 --- a/src/statfile.h +++ b/src/statfile.h @@ -14,11 +14,14 @@ #endif #include "mem_pool.h" +#define CHAIN_LENGTH 128 + struct stat_file_header { u_char magic[3]; u_char version[2]; + u_char padding[3]; uint64_t create_time; -}; +} __attribute__((__packed__)); struct stat_file_block { uint32_t hash1; @@ -57,5 +60,10 @@ int statfile_pool_open (statfile_pool_t *pool, char *filename); int statfile_pool_create (statfile_pool_t *pool, char *filename, size_t len); int statfile_pool_close (statfile_pool_t *pool, char *filename); void statfile_pool_delete (statfile_pool_t *pool); +void statfile_pool_lock_file (statfile_pool_t *pool, char *filename); +void statfile_pool_unlock_file (statfile_pool_t *pool, char *filename); +uint32_t statfile_pool_get_block (statfile_pool_t *pool, char *filename, uint32_t h1, uint32_t h2, time_t now); +void statfile_pool_set_block (statfile_pool_t *pool, char *filename, uint32_t h1, uint32_t h2, time_t now, uint32_t value); +int statfile_pool_is_open (statfile_pool_t *pool, char *filename); #endif |