Libical API Documentation  3.0
icaldirset.h
Go to the documentation of this file.
1 /*======================================================================
2  FILE: icaldirset.h
3  CREATOR: eric 28 November 1999
4 
5  (C) COPYRIGHT 2000, Eric Busboom <eric@civicknowledge.com>
6 
7  This library is free software; you can redistribute it and/or modify
8  it under the terms of either:
9 
10  The LGPL as published by the Free Software Foundation, version
11  2.1, available at: https://www.gnu.org/licenses/lgpl-2.1.html
12 
13  Or:
14 
15  The Mozilla Public License Version 2.0. You may obtain a copy of
16  the License at https://www.mozilla.org/MPL/
17 
18  The Original Code is eric. The Initial Developer of the Original
19  Code is Eric Busboom
20 ======================================================================*/
21 
48 #ifndef ICALDIRSET_H
49 #define ICALDIRSET_H
50 
51 #include "libical_icalss_export.h"
52 #include "icalset.h"
53 
54 /* icaldirset Routines for storing, fetching, and searching for ical
55  * objects in a database */
56 
57 typedef struct icaldirset_impl icaldirset;
58 
59 LIBICAL_ICALSS_EXPORT icalset *icaldirset_new(const char *path);
60 
61 LIBICAL_ICALSS_EXPORT icalset *icaldirset_new_reader(const char *path);
62 
63 LIBICAL_ICALSS_EXPORT icalset *icaldirset_new_writer(const char *path);
64 
65 LIBICAL_ICALSS_EXPORT icalset *icaldirset_init(icalset *set, const char *dsn, void *options);
66 
67 LIBICAL_ICALSS_EXPORT void icaldirset_free(icalset *set);
68 
69 LIBICAL_ICALSS_EXPORT const char *icaldirset_path(icalset *set);
70 
71 /* Marks the cluster as changed, so it will be written to disk when it
72  is freed. Commit writes to disk immediately*/
73 LIBICAL_ICALSS_EXPORT void icaldirset_mark(icalset *set);
74 
75 LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_commit(icalset *set);
76 
82 LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_add_component(icalset *store, icalcomponent *comp);
83 LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_remove_component(icalset *store,
84  icalcomponent *comp);
85 
86 LIBICAL_ICALSS_EXPORT int icaldirset_count_components(icalset *store, icalcomponent_kind kind);
87 
88 /* Restricts the component returned by icaldirset_first, _next to those
89  that pass the gauge. _clear removes the gauge. */
90 LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_select(icalset *store, icalgauge *gauge);
91 
92 LIBICAL_ICALSS_EXPORT void icaldirset_clear(icalset *store);
93 
94 /* Gets a component by uid */
95 LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_fetch(icalset *store,
96  icalcomponent_kind kind, const char *uid);
97 
98 LIBICAL_ICALSS_EXPORT int icaldirset_has_uid(icalset *store, const char *uid);
99 
100 LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_fetch_match(icalset *set, icalcomponent *c);
101 
102 /* Modifies components according to the MODIFY method of CAP. Works on
103  the currently selected components. */
104 LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_modify(icalset *store,
105  icalcomponent *oldc, icalcomponent *newc);
106 
107 /* Iterates through the components. If a gauge has been defined, these
108  will skip over components that do not pass the gauge */
109 
110 LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_get_current_component(icalset *store);
111 
112 LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_get_first_component(icalset *store);
113 
114 LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_get_next_component(icalset *store);
115 
116 /* External iterator for thread safety */
117 LIBICAL_ICALSS_EXPORT icalsetiter icaldirset_begin_component(icalset *set,
118  icalcomponent_kind kind,
119  icalgauge *gauge, const char *tzid);
120 
121 LIBICAL_ICALSS_EXPORT icalcomponent *icaldirsetiter_to_next(icalset *set, icalsetiter *i);
122 
123 LIBICAL_ICALSS_EXPORT icalcomponent *icaldirsetiter_to_prior(icalset *set, icalsetiter *i);
124 
125 typedef struct icaldirset_options
126 {
127  int flags;
129 
130 #endif /* !ICALDIRSET_H */
icalerrorenum icaldirset_add_component(icalset *store, icalcomponent *comp)
Definition: icaldirset.c:297
icalerrorenum icaldirset_remove_component(icalset *store, icalcomponent *comp)
Definition: icaldirset.c:384
icalerrorenum
Represents the different types of errors that can be triggered in libical.
Definition: icalerror.h:76
Definition: icalcomponent.c:36
Definition: icaldirsetimpl.h:31
icaldirset_options options
Definition: icaldirsetimpl.h:34
icalgauge * gauge
Definition: icaldirsetimpl.h:36
Definition: icaldirset.h:126
int flags
Definition: icaldirset.h:127
Definition: icalgaugeimpl.h:55
Definition: icalset.h:61
Definition: icalset.h:52