summaryrefslogtreecommitdiffabout
path: root/libical/src/libicalss/icaldirset.h
Unidiff
Diffstat (limited to 'libical/src/libicalss/icaldirset.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libical/src/libicalss/icaldirset.h54
1 files changed, 35 insertions, 19 deletions
diff --git a/libical/src/libicalss/icaldirset.h b/libical/src/libicalss/icaldirset.h
index 7d205ec..a2d577d 100644
--- a/libical/src/libicalss/icaldirset.h
+++ b/libical/src/libicalss/icaldirset.h
@@ -21,62 +21,78 @@
21 the License at http://www.mozilla.org/MPL/ 21 the License at http://www.mozilla.org/MPL/
22 22
23 The Original Code is eric. The Initial Developer of the Original 23 The Original Code is eric. The Initial Developer of the Original
24 Code is Eric Busboom 24 Code is Eric Busboom
25 25
26 26
27======================================================================*/ 27======================================================================*/
28 28
29#ifndef ICALDIRSET_H 29#ifndef ICALDIRSET_H
30#define ICALDIRSET_H 30#define ICALDIRSET_H
31 31
32#include "ical.h" 32#include "ical.h"
33#include "icalset.h"
34#include "icalcluster.h"
35#include "icalgauge.h"
33 36
34/* icaldirset Routines for storing, fetching, and searching for ical 37/* icaldirset Routines for storing, fetching, and searching for ical
35 * objects in a database */ 38 * objects in a database */
36 39
37typedef void icaldirset; 40typedef struct icaldirset_impl icaldirset;
38 41
42icalset* icaldirset_new(const char* path);
39 43
40icaldirset* icaldirset_new(const char* path); 44icalset* icaldirset_new_reader(const char* path);
45icalset* icaldirset_new_writer(const char* path);
41 46
42void icaldirset_free(icaldirset* store);
43 47
44const char* icaldirset_path(icaldirset* store); 48icalset* icaldirset_init(icalset* set, const char *dsn, void *options);
49void icaldirset_free(icalset* set);
50
51const char* icaldirset_path(icalset* set);
45 52
46/* Mark the cluster as changed, so it will be written to disk when it 53/* Mark the cluster as changed, so it will be written to disk when it
47 is freed. Commit writes to disk immediately*/ 54 is freed. Commit writes to disk immediately*/
48void icaldirset_mark(icaldirset* store); 55void icaldirset_mark(icalset* set);
49icalerrorenum icaldirset_commit(icaldirset* store); 56icalerrorenum icaldirset_commit(icalset* set);
50 57
51icalerrorenum icaldirset_add_component(icaldirset* store, icalcomponent* comp); 58icalerrorenum icaldirset_add_component(icalset* store, icalcomponent* comp);
52icalerrorenum icaldirset_remove_component(icaldirset* store, icalcomponent* comp); 59icalerrorenum icaldirset_remove_component(icalset* store, icalcomponent* comp);
53 60
54int icaldirset_count_components(icaldirset* store, 61int icaldirset_count_components(icalset* store,
55 icalcomponent_kind kind); 62 icalcomponent_kind kind);
56 63
57/* Restrict the component returned by icaldirset_first, _next to those 64/* Restrict the component returned by icaldirset_first, _next to those
58 that pass the gauge. _clear removes the gauge. */ 65 that pass the gauge. _clear removes the gauge. */
59icalerrorenum icaldirset_select(icaldirset* store, icalcomponent* gauge); 66icalerrorenum icaldirset_select(icalset* store, icalgauge* gauge);
60void icaldirset_clear(icaldirset* store); 67void icaldirset_clear(icalset* store);
61 68
62/* Get a component by uid */ 69/* Get a component by uid */
63icalcomponent* icaldirset_fetch(icaldirset* store, const char* uid); 70icalcomponent* icaldirset_fetch(icalset* store, const char* uid);
64int icaldirset_has_uid(icaldirset* store, const char* uid); 71int icaldirset_has_uid(icalset* store, const char* uid);
65icalcomponent* icaldirset_fetch_match(icaldirset* set, icalcomponent *c); 72icalcomponent* icaldirset_fetch_match(icalset* set, icalcomponent *c);
66 73
67/* Modify components according to the MODIFY method of CAP. Works on 74/* Modify components according to the MODIFY method of CAP. Works on
68 the currently selected components. */ 75 the currently selected components. */
69icalerrorenum icaldirset_modify(icaldirset* store, icalcomponent *oldc, 76icalerrorenum icaldirset_modify(icalset* store, icalcomponent *oldc,
70 icalcomponent *newc); 77 icalcomponent *newc);
71 78
72/* Iterate through the components. If a guage has been defined, these 79/* Iterate through the components. If a gauge has been defined, these
73 will skip over components that do not pass the gauge */ 80 will skip over components that do not pass the gauge */
74 81
75icalcomponent* icaldirset_get_current_component(icaldirset* store); 82icalcomponent* icaldirset_get_current_component(icalset* store);
76icalcomponent* icaldirset_get_first_component(icaldirset* store); 83icalcomponent* icaldirset_get_first_component(icalset* store);
77icalcomponent* icaldirset_get_next_component(icaldirset* store); 84icalcomponent* icaldirset_get_next_component(icalset* store);
85
86/* External iterator for thread safety */
87icalsetiter icaldirset_begin_component(icalset* set, icalcomponent_kind kind, icalgauge* gauge);
88icalcomponent* icaldirsetiter_to_next(icalset* set, icalsetiter* i);
89icalcomponent* icaldirsetiter_to_prior(icalset* set, icalsetiter* i);
90
91typedef struct icaldirset_options {
92 int flags; /**< flags corresponding to the open() system call O_RDWR, etc. */
93} icaldirset_options;
78 94
79#endif /* !ICALDIRSET_H */ 95#endif /* !ICALDIRSET_H */
80 96
81 97
82 98