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
59LIBICAL_ICALSS_EXPORT icalset *icaldirset_new(const char *path);
60
61LIBICAL_ICALSS_EXPORT icalset *icaldirset_new_reader(const char *path);
62
63LIBICAL_ICALSS_EXPORT icalset *icaldirset_new_writer(const char *path);
64
65LIBICAL_ICALSS_EXPORT icalset *icaldirset_init(icalset *set, const char *dsn, void *options);
66
67LIBICAL_ICALSS_EXPORT void icaldirset_free(icalset *set);
68
69LIBICAL_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*/
73LIBICAL_ICALSS_EXPORT void icaldirset_mark(icalset *set);
74
75LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_commit(icalset *set);
76
82LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_add_component(icalset *store, icalcomponent *comp);
83LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_remove_component(icalset *store,
84 icalcomponent *comp);
85
86LIBICAL_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. */
90LIBICAL_ICALSS_EXPORT icalerrorenum icaldirset_select(icalset *store, icalgauge *gauge);
91
92LIBICAL_ICALSS_EXPORT void icaldirset_clear(icalset *store);
93
94/* Gets a component by uid */
95LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_fetch(icalset *store,
96 icalcomponent_kind kind, const char *uid);
97
98LIBICAL_ICALSS_EXPORT int icaldirset_has_uid(icalset *store, const char *uid);
99
100LIBICAL_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. */
104LIBICAL_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
110LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_get_current_component(icalset *store);
111
112LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_get_first_component(icalset *store);
113
114LIBICAL_ICALSS_EXPORT icalcomponent *icaldirset_get_next_component(icalset *store);
115
116/* External iterator for thread safety */
117LIBICAL_ICALSS_EXPORT icalsetiter icaldirset_begin_component(icalset *set,
118 icalcomponent_kind kind,
119 icalgauge *gauge, const char *tzid);
120
121LIBICAL_ICALSS_EXPORT icalcomponent *icaldirsetiter_to_next(icalset *set, icalsetiter *i);
122
123LIBICAL_ICALSS_EXPORT icalcomponent *icaldirsetiter_to_prior(icalset *set, icalsetiter *i);
124
125 typedef struct icaldirset_options
126{
127 int flags;
128} icaldirset_options;
129
130#endif /* !ICALDIRSET_H */
icaldirset_add_component
icalerrorenum icaldirset_add_component(icalset *store, icalcomponent *comp)
Definition: icaldirset.c:297
icaldirset_remove_component
icalerrorenum icaldirset_remove_component(icalset *store, icalcomponent *comp)
Definition: icaldirset.c:384
icalerrorenum
icalerrorenum
Represents the different types of errors that can be triggered in libical.
Definition: icalerror.h:76
icalset.h
icalcomponent_impl
Definition: icalcomponent.c:36
icaldirset_impl
Definition: icaldirsetimpl.h:31
icaldirset_impl::options
icaldirset_options options
Definition: icaldirsetimpl.h:34
icaldirset_impl::gauge
icalgauge * gauge
Definition: icaldirsetimpl.h:36
icaldirset_options
Definition: icaldirset.h:126
icaldirset_options::flags
int flags
Definition: icaldirset.h:127
icalgauge_impl
Definition: icalgaugeimpl.h:55
icalset_impl
Definition: icalset.h:61
icalsetiter
Definition: icalset.h:52