1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 #ifndef _SIR_FILECACHE_H_INCLUDED
34 # define _SIR_FILECACHE_H_INCLUDED
35
36 # include "sir/types.h"
37
38 typedef bool (*sir_fcache_pred)(const void* match, const sirfile* iter);
39
40 sirfileid _sir_addfile(const char* path, sir_levels levels, sir_options opts);
41 bool _sir_updatefile(sirfileid id, const sir_update_config_data* data);
42 bool _sir_remfile(sirfileid id);
43
44 sirfile* _sirfile_create(const char* path, sir_levels levels, sir_options opts);
45 bool _sirfile_open(sirfile* sf);
46 void _sirfile_close(sirfile* sf);
47 bool _sirfile_write(sirfile* sf, const char* output);
48 bool _sirfile_writeheader(sirfile* sf, const char* msg);
49 bool _sirfile_needsroll(sirfile* sf);
50 bool _sirfile_roll(sirfile* sf, char** newpath);
51 void _sirfile_rollifneeded(sirfile* sf);
52 bool _sirfile_archive(sirfile* sf, const char* newpath);
53 bool _sirfile_splitpath(const sirfile* sf, char** name, char** ext);
54 void _sirfile_destroy(sirfile** sf);
55 bool _sirfile_validate(const sirfile* sf);
56 bool _sirfile_update(sirfile* sf, const sir_update_config_data* data);
57
58 sirfileid _sir_fcache_add(sirfcache* sfc, const char* path, sir_levels levels,
59 sir_options opts);
60 bool _sir_fcache_update(const sirfcache* sfc, sirfileid id, const sir_update_config_data* data);
61 bool _sir_fcache_rem(sirfcache* sfc, sirfileid id);
62 void _sir_fcache_shift(sirfcache* sfc, size_t idx);
63
64 bool _sir_fcache_pred_path(const void* match, const sirfile* iter);
65 bool _sir_fcache_pred_id(const void* match, const sirfile* iter);
66 sirfile* _sir_fcache_find(const sirfcache* sfc, const void* match, sir_fcache_pred pred);
67
68 bool _sir_fcache_destroy(sirfcache* sfc);
69 bool _sir_fcache_dispatch(const sirfcache* sfc, sir_level level, sirbuf* buf,
70 size_t* dispatched, size_t* wanted);
71
72 void _sir_fflush(FILE* f);
73
74 #endif