Libical API Documentation  3.0
icaldirset.h
1 /*======================================================================
2  FILE: icaldirset.h
3  CREATOR: eric 28 November 1999
4 
5  (C) COPYRIGHT 2000, Eric Busboom <eric@softwarestudio.org>
6  http://www.softwarestudio.org
7 
8  This library is free software; you can redistribute it and/or modify
9  it under the terms of either:
10 
11  The LGPL as published by the Free Software Foundation, version
12  2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html
13 
14  Or:
15 
16  The Mozilla Public License Version 2.0. You may obtain a copy of
17  the License at http://www.mozilla.org/MPL/
18 
19  The Original Code is eric. The Initial Developer of the Original
20  Code is Eric Busboom
21 ======================================================================*/
22 
23 #ifndef ICALDIRSET_H
24 #define ICALDIRSET_H
25 
26 #include "libical_icalss_export.h"
27 #include "icalset.h"
28 
29 /* icaldirset Routines for storing, fetching, and searching for ical
30  * objects in a database */
31 
32 typedef struct icaldirset_impl icaldirset;
33 
34 LIBICAL_ICALSS_EXPORT icalset *icaldirset_new(const char *path);
35 
36 LIBICAL_ICALSS_EXPORT icalset *icaldirset_new_reader(const char *path);
37 
38 LIBICAL_ICALSS_EXPORT icalset *icaldirset_new_writer(const char *path);
39 
40 LIBICAL_ICALSS_EXPORT icalset *icaldirset_init(icalset *set, const char *dsn, void *options);
41 
42 LIBICAL_ICALSS_EXPORT void icaldirset_free(icalset *set);
43 
44 LIBICAL_ICALSS_EXPORT const char *icaldirset_path(icalset *set);
45 
46 /* Mark the cluster as changed, so it will be written to disk when it
47  is freed. Commit writes to disk immediately*/
48 LIBICAL_ICALSS_EXPORT void icaldirset_mark(icalset *set);
49 
50 LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_commit(icalset *set);
51 
52 LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_add_component(icalset *store, icalcomponent *comp);
53 LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_remove_component(icalset *store,
54  icalcomponent *comp);
55 
56 LIBICAL_ICALSS_EXPORT int icaldirset_count_components(icalset *store, icalcomponent_kind kind);
57 
58 /* Restrict the component returned by icaldirset_first, _next to those
59  that pass the gauge. _clear removes the gauge. */
60 LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_select(icalset *store, icalgauge *gauge);
61 
62 LIBICAL_ICALSS_EXPORT void icaldirset_clear(icalset *store);
63 
64 /* Get a component by uid */
65 LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_fetch(icalset *store,
66  icalcomponent_kind kind, const char *uid);
67 
68 LIBICAL_ICALSS_EXPORT int icaldirset_has_uid(icalset *store, const char *uid);
69 
70 LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_fetch_match(icalset *set, icalcomponent *c);
71 
72 /* Modify components according to the MODIFY method of CAP. Works on
73  the currently selected components. */
74 LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_modify(icalset *store,
75  icalcomponent *oldc, icalcomponent *newc);
76 
77 /* Iterate through the components. If a gauge has been defined, these
78  will skip over components that do not pass the gauge */
79 
80 LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_get_current_component(icalset *store);
81 
82 LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_get_first_component(icalset *store);
83 
84 LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_get_next_component(icalset *store);
85 
86 /* External iterator for thread safety */
87 LIBICAL_ICALSS_EXPORT icalsetiter icaldirset_begin_component(icalset *set,
88  icalcomponent_kind kind,
89  icalgauge *gauge, const char *tzid);
90 
91 LIBICAL_ICALSS_EXPORT icalcomponent *icaldirsetiter_to_next(icalset *set, icalsetiter *i);
92 
93 LIBICAL_ICALSS_EXPORT icalcomponent *icaldirsetiter_to_prior(icalset *set, icalsetiter *i);
94 
95 typedef struct icaldirset_options
96 {
97  int flags;
99 
100 #endif /* !ICALDIRSET_H */
icalerrorenum icaldirset_add_component(icalset *set, icalcomponent *comp)
Definition: icaldirset.c:330
Definition: icalgaugeimpl.h:55
icaldirset_options options
Definition: icaldirsetimpl.h:35
int flags
Definition: icaldirset.h:97
Definition: icalset.h:51
icalerrorenum
Represents the different types of errors that can be triggered in libical.
Definition: icalerror.h:74
Definition: icaldirset.h:95
Definition: icalcomponent.c:33
Definition: icalset.h:60
icalgauge * gauge
Definition: icaldirsetimpl.h:37
Definition: icaldirsetimpl.h:31
icalerrorenum icaldirset_remove_component(icalset *set, icalcomponent *comp)
Definition: icaldirset.c:417