Libical API Documentation 3.0
Loading...
Searching...
No Matches
icalset.h
Go to the documentation of this file.
1
15/*
16
17 (C) COPYRIGHT 2000, Eric Busboom <eric@civicknowledge.com>
18
19 This library is free software; you can redistribute it and/or modify
20 it under the terms of either:
21
22 The LGPL as published by the Free Software Foundation, version
23 2.1, available at: https://www.gnu.org/licenses/lgpl-2.1.html
24
25 Or:
26
27 The Mozilla Public License Version 2.0. You may obtain a copy of
28 the License at https://www.mozilla.org/MPL/
29
30 The Original Code is eric. The Initial Developer of the Original
31 Code is Eric Busboom
32======================================================================*/
33
34#ifndef ICALSET_H
35#define ICALSET_H
36
37#include "libical_icalss_export.h"
38#include "icalgauge.h"
39#include "icalcomponent.h"
40#include "icalerror.h"
41
42typedef struct icalset_impl icalset;
43
44typedef enum icalset_kind
45{
46 ICAL_FILE_SET,
47 ICAL_DIR_SET,
48 ICAL_BDB_SET
49} icalset_kind;
50
51typedef struct icalsetiter
52{
53 icalcompiter iter; /* icalcomponent_kind, pvl_elem iter */
54 icalgauge *gauge;
55 icalrecur_iterator *ritr; /*the last iterator */
56 icalcomponent *last_component; /*the pending recurring component to be processed */
57 const char *tzid; /* the calendar's timezone id */
59
61{
62 icalset_kind kind;
63 size_t size;
64 char *dsn;
65 icalset *(*init) (icalset *set, const char *dsn, void *options);
66 void (*free) (icalset *set);
67 const char *(*path) (icalset *set);
68 void (*mark) (icalset *set);
69 icalerrorenum(*commit) (icalset *set);
70 icalerrorenum(*add_component) (icalset *set, icalcomponent *comp);
71 icalerrorenum(*remove_component) (icalset *set, icalcomponent *comp);
72 int (*count_components) (icalset *set, icalcomponent_kind kind);
73 icalerrorenum(*select) (icalset *set, icalgauge *gauge);
74 void (*clear) (icalset *set);
75 icalcomponent *(*fetch) (icalset *set, icalcomponent_kind kind, const char *uid);
76 icalcomponent *(*fetch_match) (icalset *set, icalcomponent *comp);
77 int (*has_uid) (icalset *set, const char *uid);
78 icalerrorenum(*modify) (icalset *set, icalcomponent *old, icalcomponent *newc);
79 icalcomponent *(*get_current_component) (icalset *set);
80 icalcomponent *(*get_first_component) (icalset *set);
81 icalcomponent *(*get_next_component) (icalset *set);
82 icalsetiter(*icalset_begin_component) (icalset *set,
83 icalcomponent_kind kind, icalgauge *gauge,
84 const char *tzid);
85 icalcomponent *(*icalsetiter_to_next) (icalset *set, icalsetiter *i);
86 icalcomponent *(*icalsetiter_to_prior) (icalset *set, icalsetiter *i);
87};
88
90LIBICAL_ICALSS_EXPORT int icalset_register_class(icalset *set);
91
103LIBICAL_ICALSS_EXPORT icalset *icalset_new(icalset_kind kind, const char *dsn, void *options);
104
105LIBICAL_ICALSS_EXPORT icalset *icalset_new_file(const char *path);
106
107LIBICAL_ICALSS_EXPORT icalset *icalset_new_file_reader(const char *path);
108
109LIBICAL_ICALSS_EXPORT icalset *icalset_new_file_writer(const char *path);
110
111LIBICAL_ICALSS_EXPORT icalset *icalset_new_dir(const char *path);
112
117LIBICAL_ICALSS_EXPORT void icalset_free(icalset *set);
118
119LIBICAL_ICALSS_EXPORT const char *icalset_path(icalset *set);
120
123LIBICAL_ICALSS_EXPORT void icalset_mark(icalset *set);
124
126LIBICAL_ICALSS_EXPORT icalerrorenum icalset_commit(icalset *set);
127
128LIBICAL_ICALSS_EXPORT icalerrorenum icalset_add_component(icalset *set, icalcomponent *comp);
129
130LIBICAL_ICALSS_EXPORT icalerrorenum icalset_remove_component(icalset *set, icalcomponent *comp);
131
132LIBICAL_ICALSS_EXPORT int icalset_count_components(icalset *set, icalcomponent_kind kind);
133
136LIBICAL_ICALSS_EXPORT icalerrorenum icalset_select(icalset *set, icalgauge *gauge);
137
139LIBICAL_ICALSS_EXPORT icalcomponent *icalset_fetch(icalset *set, const char *uid);
140
141LIBICAL_ICALSS_EXPORT int icalset_has_uid(icalset *set, const char *uid);
142
143LIBICAL_ICALSS_EXPORT icalcomponent *icalset_fetch_match(icalset *set, icalcomponent *c);
144
147LIBICAL_ICALSS_EXPORT icalerrorenum icalset_modify(icalset *set,
148 icalcomponent *oldc, icalcomponent *newc);
149
153LIBICAL_ICALSS_EXPORT icalcomponent *icalset_get_current_component(icalset *set);
154
155LIBICAL_ICALSS_EXPORT icalcomponent *icalset_get_first_component(icalset *set);
156
157LIBICAL_ICALSS_EXPORT icalcomponent *icalset_get_next_component(icalset *set);
158
160LIBICAL_ICALSS_EXPORT extern icalsetiter icalsetiter_null;
161
162LIBICAL_ICALSS_EXPORT icalsetiter icalset_begin_component(icalset *set,
163 icalcomponent_kind kind,
164 icalgauge *gauge, const char *tzid);
165
167LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_next(icalsetiter *i);
168
169LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_prior(icalsetiter *i);
170
171LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_deref(icalsetiter *i);
172
174LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_to_next(icalset *set, icalsetiter *i);
175
176LIBICAL_ICALSS_EXPORT icalcomponent *icalsetiter_to_prior(icalset *set, icalsetiter *i);
177
178#endif /* !ICALSET_H */
Error handling for libical.
icalerrorenum
Represents the different types of errors that can be triggered in libical.
Definition icalerror.h:76
Routines implementing a filter for ical components.
icalerrorenum icalset_select(icalset *set, icalgauge *gauge)
Definition icalset.c:414
void icalset_free(icalset *set)
Definition icalset.c:371
icalerrorenum icalset_commit(icalset *set)
Definition icalset.c:394
void icalset_mark(icalset *set)
Definition icalset.c:389
icalcomponent * icalsetiter_next(icalsetiter *i)
Definition icalset.c:468
int icalset_register_class(icalset *set)
Registers a new derived class.
icalcomponent * icalset_get_current_component(icalset *set)
Definition icalset.c:444
icalcomponent * icalsetiter_to_next(icalset *set, icalsetiter *i)
Definition icalset.c:507
icalsetiter icalsetiter_null
Definition icalset.c:459
icalcomponent * icalset_fetch(icalset *set, const char *uid)
Definition icalset.c:424
icalset * icalset_new(icalset_kind kind, const char *dsn, void *options)
Generic icalset constructor.
Definition icalset.c:240
icalerrorenum icalset_modify(icalset *set, icalcomponent *oldc, icalcomponent *newc)
Definition icalset.c:439
Definition icalcomponent.h:36
Definition icalcomponent.c:36
Definition icalgaugeimpl.h:55
Definition icalrecur.c:925
Definition icalset.h:61
Definition icalset.h:52