Libical API Documentation 4.0 UNRELEASED Go to the stable 3.0 documentation
Loading...
Searching...
No Matches
icalset.h
Go to the documentation of this file.
1
14
15/*
16
17 SPDX-FileCopyrightText: 2000, Eric Busboom <eric@civicknowledge.com>
18 SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
19
20 The Original Code is eric. The Initial Developer of the Original
21 Code is Eric Busboom
22======================================================================*/
23
24#ifndef ICALSET_H
25#define ICALSET_H
26
27#include "libical_icalss_export.h"
28#include "icalgauge.h"
29#include "icalcomponent.h"
30#include "icalerror.h"
31
32typedef struct icalset_impl icalset;
33
34typedef enum icalset_kind
35{
36 ICAL_FILE_SET,
37 ICAL_DIR_SET,
38 ICAL_BDB_SET
39} icalset_kind;
40
41typedef struct icalsetiter {
42 icalcompiter iter; /* icalcomponent_kind, icalpvl_elem iter */
43 icalgauge *gauge;
44 icalrecur_iterator *ritr; /*the last iterator */
45 icalcomponent *last_component; /*the pending recurring component to be processed */
46 const char *tzid; /* the calendar's timezone id */
48
50 icalset_kind kind;
51 size_t size;
52 char *dsn;
53 icalset *(*init)(icalset *set, const char *dsn, void *options);
54 void (*free)(icalset *set);
55 const char *(*path)(icalset *set);
56 void (*mark)(icalset *set);
57 icalerrorenum (*commit)(icalset *set);
58 icalerrorenum (*add_component)(icalset *set, icalcomponent *comp);
59 icalerrorenum (*remove_component)(icalset *set, icalcomponent *comp);
60 int (*count_components)(icalset *set, icalcomponent_kind kind);
61 icalerrorenum (*select)(icalset *set, icalgauge *gauge);
62 void (*clear)(icalset *set);
63 icalcomponent *(*fetch)(icalset *set, icalcomponent_kind kind, const char *uid);
64 icalcomponent *(*fetch_match)(icalset *set, const icalcomponent *comp);
65 int (*has_uid)(icalset *set, const char *uid);
66 icalerrorenum (*modify)(icalset *set, icalcomponent *old, icalcomponent *newc);
67 icalcomponent *(*get_current_component)(icalset *set);
68 icalcomponent *(*get_first_component)(icalset *set);
69 icalcomponent *(*get_next_component)(icalset *set);
70 icalsetiter (*icalset_begin_component)(icalset *set,
71 icalcomponent_kind kind, icalgauge *gauge,
72 const char *tzid);
73 icalcomponent *(*icalsetiter_to_next)(icalset *set, icalsetiter *i);
74 icalcomponent *(*icalsetiter_to_prior)(icalset *set, icalsetiter *i);
75};
76
78LIBICAL_ICALSS_EXPORT bool icalset_register_class(icalset *set);
79
90
91LIBICAL_ICALSS_EXPORT icalset *icalset_new(icalset_kind kind, const char *dsn, void *options);
92
93LIBICAL_ICALSS_EXPORT icalset *icalset_new_file(const char *path);
94
95LIBICAL_ICALSS_EXPORT icalset *icalset_new_file_reader(const char *path);
96
97LIBICAL_ICALSS_EXPORT icalset *icalset_new_file_writer(const char *path);
98
99LIBICAL_ICALSS_EXPORT icalset *icalset_new_dir(const char *path);
100
105LIBICAL_ICALSS_EXPORT void icalset_free(icalset *set);
106
107LIBICAL_ICALSS_EXPORT const char *icalset_path(icalset *set);
108
111LIBICAL_ICALSS_EXPORT void icalset_mark(icalset *set);
112
114LIBICAL_ICALSS_EXPORT icalerrorenum icalset_commit(icalset *set);
115
116LIBICAL_ICALSS_EXPORT icalerrorenum icalset_add_component(icalset *set, icalcomponent *comp);
117
118LIBICAL_ICALSS_EXPORT icalerrorenum icalset_remove_component(icalset *set, icalcomponent *comp);
119
120LIBICAL_ICALSS_EXPORT int icalset_count_components(icalset *set, icalcomponent_kind kind);
121
124LIBICAL_ICALSS_EXPORT icalerrorenum icalset_select(icalset *set, icalgauge *gauge);
125
127LIBICAL_ICALSS_EXPORT icalcomponent *icalset_fetch(icalset *set, const char *uid);
128
129LIBICAL_ICALSS_EXPORT int icalset_has_uid(icalset *set, const char *uid);
130
131LIBICAL_ICALSS_EXPORT icalcomponent *icalset_fetch_match(icalset *set, const icalcomponent *c);
132
135LIBICAL_ICALSS_EXPORT icalerrorenum icalset_modify(icalset *set,
136 icalcomponent *oldc, icalcomponent *newc);
137
140
141LIBICAL_ICALSS_EXPORT icalcomponent *icalset_get_current_component(icalset *set);
142
143LIBICAL_ICALSS_EXPORT icalcomponent *icalset_get_first_component(icalset *set);
144
145LIBICAL_ICALSS_EXPORT icalcomponent *icalset_get_next_component(icalset *set);
146
148LIBICAL_ICALSS_EXPORT extern icalsetiter icalsetiter_null;
149
150LIBICAL_ICALSS_EXPORT icalsetiter icalset_begin_component(icalset *set,
151 icalcomponent_kind kind,
152 icalgauge *gauge, const char *tzid);
153
155LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_next(icalsetiter *i);
156
157LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_prior(icalsetiter *i);
158
159LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_deref(icalsetiter *i);
160
162LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_to_next(icalset *set, icalsetiter *i);
163
164LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_to_prior(icalset *set, icalsetiter *i);
165
166#endif /* !ICALSET_H */
Error handling for libical.
icalerrorenum
Represents the different types of errors that can be triggered in libical.
Definition icalerror.h:64
Routines implementing a filter for ical components.
icalerrorenum icalset_select(icalset *set, icalgauge *gauge)
Definition icalset.c:362
void icalset_free(icalset *set)
Definition icalset.c:319
icalerrorenum icalset_commit(icalset *set)
Definition icalset.c:342
void icalset_mark(icalset *set)
Definition icalset.c:337
icalcomponent * icalsetiter_next(icalsetiter *i)
Definition icalset.c:415
icalcomponent * icalset_get_current_component(icalset *set)
Definition icalset.c:392
icalcomponent * icalsetiter_to_next(icalset *set, icalsetiter *i)
Definition icalset.c:454
bool icalset_register_class(icalset *set)
Registers a new derived class.
icalcomponent * icalset_fetch(icalset *set, const char *uid)
Definition icalset.c:372
icalset * icalset_new(icalset_kind kind, const char *dsn, void *options)
Generic icalset constructor.
Definition icalset.c:187
icalerrorenum icalset_modify(icalset *set, icalcomponent *oldc, icalcomponent *newc)
Definition icalset.c:387
Definition icalcomponent.h:26
Definition icalset.h:49
Definition icalset.h:41