Libical API Documentation 4.0
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
19 SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
20
21 The Original Code is eric. The Initial Developer of the Original
22 Code is Eric Busboom
23======================================================================*/
24
25#ifndef ICALSET_H
26#define ICALSET_H
27
28#include "libical_icalss_export.h"
29#include "icalgauge.h"
30#include "icalcomponent.h"
31#include "icalerror.h"
32
33typedef struct icalset_impl icalset;
34
35typedef enum icalset_kind
36{
37 ICAL_FILE_SET,
38 ICAL_DIR_SET,
39 ICAL_BDB_SET
40} icalset_kind;
41
42typedef struct icalsetiter {
43 icalcompiter iter; /* icalcomponent_kind, pvl_elem iter */
44 icalgauge *gauge;
45 icalrecur_iterator *ritr; /*the last iterator */
46 icalcomponent *last_component; /*the pending recurring component to be processed */
47 const char *tzid; /* the calendar's timezone id */
49
51 icalset_kind kind;
52 size_t size;
53 char *dsn;
54 icalset *(*init)(icalset *set, const char *dsn, void *options);
55 void (*free)(icalset *set);
56 const char *(*path)(icalset *set);
57 void (*mark)(icalset *set);
58 icalerrorenum (*commit)(icalset *set);
59 icalerrorenum (*add_component)(icalset *set, icalcomponent *comp);
60 icalerrorenum (*remove_component)(icalset *set, icalcomponent *comp);
61 int (*count_components)(icalset *set, icalcomponent_kind kind);
62 icalerrorenum (*select)(icalset *set, icalgauge *gauge);
63 void (*clear)(icalset *set);
64 icalcomponent *(*fetch)(icalset *set, icalcomponent_kind kind, const char *uid);
65 icalcomponent *(*fetch_match)(icalset *set, icalcomponent *comp);
66 int (*has_uid)(icalset *set, const char *uid);
67 icalerrorenum (*modify)(icalset *set, icalcomponent *old, icalcomponent *newc);
68 icalcomponent *(*get_current_component)(icalset *set);
69 icalcomponent *(*get_first_component)(icalset *set);
70 icalcomponent *(*get_next_component)(icalset *set);
71 icalsetiter (*icalset_begin_component)(icalset *set,
72 icalcomponent_kind kind, icalgauge *gauge,
73 const char *tzid);
74 icalcomponent *(*icalsetiter_to_next)(icalset *set, icalsetiter *i);
75 icalcomponent *(*icalsetiter_to_prior)(icalset *set, icalsetiter *i);
76};
77
79LIBICAL_ICALSS_EXPORT bool icalset_register_class(icalset *set);
80
91
92LIBICAL_ICALSS_EXPORT icalset *icalset_new(icalset_kind kind, const char *dsn, void *options);
93
94LIBICAL_ICALSS_EXPORT icalset *icalset_new_file(const char *path);
95
96LIBICAL_ICALSS_EXPORT icalset *icalset_new_file_reader(const char *path);
97
98LIBICAL_ICALSS_EXPORT icalset *icalset_new_file_writer(const char *path);
99
100LIBICAL_ICALSS_EXPORT icalset *icalset_new_dir(const char *path);
101
106LIBICAL_ICALSS_EXPORT void icalset_free(icalset *set);
107
108LIBICAL_ICALSS_EXPORT const char *icalset_path(icalset *set);
109
112LIBICAL_ICALSS_EXPORT void icalset_mark(icalset *set);
113
115LIBICAL_ICALSS_EXPORT icalerrorenum icalset_commit(icalset *set);
116
117LIBICAL_ICALSS_EXPORT icalerrorenum icalset_add_component(icalset *set, icalcomponent *comp);
118
119LIBICAL_ICALSS_EXPORT icalerrorenum icalset_remove_component(icalset *set, icalcomponent *comp);
120
121LIBICAL_ICALSS_EXPORT int icalset_count_components(icalset *set, icalcomponent_kind kind);
122
125LIBICAL_ICALSS_EXPORT icalerrorenum icalset_select(icalset *set, icalgauge *gauge);
126
128LIBICAL_ICALSS_EXPORT icalcomponent *icalset_fetch(icalset *set, const char *uid);
129
130LIBICAL_ICALSS_EXPORT int icalset_has_uid(icalset *set, const char *uid);
131
132LIBICAL_ICALSS_EXPORT icalcomponent *icalset_fetch_match(icalset *set, icalcomponent *c);
133
136LIBICAL_ICALSS_EXPORT icalerrorenum icalset_modify(icalset *set,
137 icalcomponent *oldc, icalcomponent *newc);
138
141
142LIBICAL_ICALSS_EXPORT icalcomponent *icalset_get_current_component(icalset *set);
143
144LIBICAL_ICALSS_EXPORT icalcomponent *icalset_get_first_component(icalset *set);
145
146LIBICAL_ICALSS_EXPORT icalcomponent *icalset_get_next_component(icalset *set);
147
149LIBICAL_ICALSS_EXPORT extern icalsetiter icalsetiter_null;
150
151LIBICAL_ICALSS_EXPORT icalsetiter icalset_begin_component(icalset *set,
152 icalcomponent_kind kind,
153 icalgauge *gauge, const char *tzid);
154
156LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_next(icalsetiter *i);
157
158LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_prior(icalsetiter *i);
159
160LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_deref(icalsetiter *i);
161
163LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_to_next(icalset *set, icalsetiter *i);
164
165LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_to_prior(icalset *set, icalsetiter *i);
166
167#endif /* !ICALSET_H */
Error handling for libical.
icalerrorenum
Represents the different types of errors that can be triggered in libical.
Definition icalerror.h:67
Routines implementing a filter for ical components.
icalerrorenum icalset_select(icalset *set, icalgauge *gauge)
Definition icalset.c:402
void icalset_free(icalset *set)
Definition icalset.c:359
icalerrorenum icalset_commit(icalset *set)
Definition icalset.c:382
void icalset_mark(icalset *set)
Definition icalset.c:377
icalcomponent * icalsetiter_next(icalsetiter *i)
Definition icalset.c:455
icalcomponent * icalset_get_current_component(icalset *set)
Definition icalset.c:432
icalcomponent * icalsetiter_to_next(icalset *set, icalsetiter *i)
Definition icalset.c:494
bool icalset_register_class(icalset *set)
Registers a new derived class.
icalcomponent * icalset_fetch(icalset *set, const char *uid)
Definition icalset.c:412
icalset * icalset_new(icalset_kind kind, const char *dsn, void *options)
Generic icalset constructor.
Definition icalset.c:227
icalerrorenum icalset_modify(icalset *set, icalcomponent *oldc, icalcomponent *newc)
Definition icalset.c:427
Definition icalcomponent.h:28
Definition icalset.h:50
Definition icalset.h:42