Libical API Documentation 3.0

icalparser.h
Go to the documentation of this file.
1/*======================================================================
2 FILE: icalparser.h
3 CREATOR: eric 20 April 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 icalparser.h
19======================================================================*/
20
21#ifndef ICALPARSER_H
22#define ICALPARSER_H
23
24#include "libical_ical_export.h"
25#include "icalcomponent.h"
26
48 typedef struct icalparser_impl icalparser;
49
55 typedef enum icalparser_state
56{
58 ICALPARSER_ERROR,
59
61 ICALPARSER_SUCCESS,
62
64 ICALPARSER_BEGIN_COMP,
65
67 ICALPARSER_END_COMP,
68
70 ICALPARSER_IN_PROGRESS
71} icalparser_state;
72
73 typedef char *(*icalparser_line_gen_func) (char *s, size_t size, void *d);
74
98LIBICAL_ICAL_EXPORT icalparser *icalparser_new(void);
99
159LIBICAL_ICAL_EXPORT icalcomponent *icalparser_add_line(icalparser *parser, char *str);
160
180LIBICAL_ICAL_EXPORT icalcomponent *icalparser_clean(icalparser *parser);
181
202LIBICAL_ICAL_EXPORT icalparser_state icalparser_get_state(icalparser *parser);
203
217LIBICAL_ICAL_EXPORT void icalparser_free(icalparser *parser);
218
271LIBICAL_ICAL_EXPORT icalcomponent *icalparser_parse(icalparser *parser,
272 icalparser_line_gen_func line_gen_func);
273
284LIBICAL_ICAL_EXPORT void icalparser_set_gen_data(icalparser *parser, void *data);
285
313LIBICAL_ICAL_EXPORT icalcomponent *icalparser_parse_string(const char *str);
314
315/***********************************************************************
316 * Parser support functions
317 ***********************************************************************/
318
333LIBICAL_ICAL_EXPORT char *icalparser_get_line(icalparser *parser,
334 icalparser_line_gen_func line_gen_func);
335
336LIBICAL_ICAL_EXPORT char *icalparser_string_line_generator(char *out, size_t buf_size, void *d);
337
338#endif /* !ICALPARSE_H */
icalcomponent.h
icalparser_parse
icalcomponent * icalparser_parse(icalparser *parser, icalparser_line_gen_func line_gen_func)
Message oriented parsing.
Definition: icalparser.c:625
icalparser_free
void icalparser_free(icalparser *parser)
Frees an icalparser object.
Definition: icalparser.c:121
icalparser_parse_string
icalcomponent * icalparser_parse_string(const char *str)
Parses a string and returns the parsed ::icalcomponent.
Definition: icalparser.c:1335
icalparser_new
icalparser * icalparser_new(void)
Creates a new icalparser.
Definition: icalparser.c:99
icalparser_add_line
icalcomponent * icalparser_add_line(icalparser *parser, char *str)
Adds a single line to be parsed by the icalparser.
Definition: icalparser.c:685
icalparser_get_state
icalparser_state icalparser_get_state(icalparser *parser)
Returns current state of the icalparser.
Definition: icalparser.c:1237
icalparser_clean
icalcomponent * icalparser_clean(icalparser *parser)
Cleans out an icalparser and returns whatever it has parsed so far.
Definition: icalparser.c:1242
icalparser_set_gen_data
void icalparser_set_gen_data(icalparser *parser, void *data)
Sets the data that icalparser_parse will give to the line_gen_func as the parameter 'd'.
Definition: icalparser.c:138
icalparser_get_line
char * icalparser_get_line(icalparser *parser, icalparser_line_gen_func line_gen_func)
Given a line generator function, returns a single iCal content line.
Definition: icalparser.c:476
icalparser_state
icalparser_state
Represents the current state of the parser.
Definition: icalparser.h:56
ICALPARSER_BEGIN_COMP
@ ICALPARSER_BEGIN_COMP
Definition: icalparser.h:64
ICALPARSER_SUCCESS
@ ICALPARSER_SUCCESS
Definition: icalparser.h:61
ICALPARSER_END_COMP
@ ICALPARSER_END_COMP
Definition: icalparser.h:67
ICALPARSER_IN_PROGRESS
@ ICALPARSER_IN_PROGRESS
Definition: icalparser.h:70
ICALPARSER_ERROR
@ ICALPARSER_ERROR
Definition: icalparser.h:58
icalcomponent_impl
Definition: icalcomponent.c:36
icalparser_impl
Definition: icalparser.c:51