Diffstat (limited to 'libical/src/libicalss/icaldirset.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libical/src/libicalss/icaldirset.h | 54 |
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 | |||
@@ -30,51 +30,67 @@ | |||
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 | ||
37 | typedef void icaldirset; | 40 | typedef struct icaldirset_impl icaldirset; |
38 | 41 | ||
42 | icalset* icaldirset_new(const char* path); | ||
39 | 43 | ||
40 | icaldirset* icaldirset_new(const char* path); | 44 | icalset* icaldirset_new_reader(const char* path); |
45 | icalset* icaldirset_new_writer(const char* path); | ||
41 | 46 | ||
42 | void icaldirset_free(icaldirset* store); | ||
43 | 47 | ||
44 | const char* icaldirset_path(icaldirset* store); | 48 | icalset* icaldirset_init(icalset* set, const char *dsn, void *options); |
49 | void icaldirset_free(icalset* set); | ||
50 | |||
51 | const 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*/ |
48 | void icaldirset_mark(icaldirset* store); | 55 | void icaldirset_mark(icalset* set); |
49 | icalerrorenum icaldirset_commit(icaldirset* store); | 56 | icalerrorenum icaldirset_commit(icalset* set); |
50 | 57 | ||
51 | icalerrorenum icaldirset_add_component(icaldirset* store, icalcomponent* comp); | 58 | icalerrorenum icaldirset_add_component(icalset* store, icalcomponent* comp); |
52 | icalerrorenum icaldirset_remove_component(icaldirset* store, icalcomponent* comp); | 59 | icalerrorenum icaldirset_remove_component(icalset* store, icalcomponent* comp); |
53 | 60 | ||
54 | int icaldirset_count_components(icaldirset* store, | 61 | int 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. */ |
59 | icalerrorenum icaldirset_select(icaldirset* store, icalcomponent* gauge); | 66 | icalerrorenum icaldirset_select(icalset* store, icalgauge* gauge); |
60 | void icaldirset_clear(icaldirset* store); | 67 | void icaldirset_clear(icalset* store); |
61 | 68 | ||
62 | /* Get a component by uid */ | 69 | /* Get a component by uid */ |
63 | icalcomponent* icaldirset_fetch(icaldirset* store, const char* uid); | 70 | icalcomponent* icaldirset_fetch(icalset* store, const char* uid); |
64 | int icaldirset_has_uid(icaldirset* store, const char* uid); | 71 | int icaldirset_has_uid(icalset* store, const char* uid); |
65 | icalcomponent* icaldirset_fetch_match(icaldirset* set, icalcomponent *c); | 72 | icalcomponent* 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. */ |
69 | icalerrorenum icaldirset_modify(icaldirset* store, icalcomponent *oldc, | 76 | icalerrorenum 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 | ||
75 | icalcomponent* icaldirset_get_current_component(icaldirset* store); | 82 | icalcomponent* icaldirset_get_current_component(icalset* store); |
76 | icalcomponent* icaldirset_get_first_component(icaldirset* store); | 83 | icalcomponent* icaldirset_get_first_component(icalset* store); |
77 | icalcomponent* icaldirset_get_next_component(icaldirset* store); | 84 | icalcomponent* icaldirset_get_next_component(icalset* store); |
85 | |||
86 | /* External iterator for thread safety */ | ||
87 | icalsetiter icaldirset_begin_component(icalset* set, icalcomponent_kind kind, icalgauge* gauge); | ||
88 | icalcomponent* icaldirsetiter_to_next(icalset* set, icalsetiter* i); | ||
89 | icalcomponent* icaldirsetiter_to_prior(icalset* set, icalsetiter* i); | ||
90 | |||
91 | typedef 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 | ||