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 {
59 
62 
65 
68 
72 
73 typedef char *(*icalparser_line_gen_func) (char *s, size_t size, void *d);
74 
98 LIBICAL_ICAL_EXPORT icalparser *icalparser_new(void);
99 
159 LIBICAL_ICAL_EXPORT icalcomponent *icalparser_add_line(icalparser *parser, char *str);
160 
180 LIBICAL_ICAL_EXPORT icalcomponent *icalparser_clean(icalparser *parser);
181 
202 LIBICAL_ICAL_EXPORT icalparser_state icalparser_get_state(icalparser *parser);
203 
217 LIBICAL_ICAL_EXPORT void icalparser_free(icalparser *parser);
218 
271 LIBICAL_ICAL_EXPORT icalcomponent *icalparser_parse(icalparser *parser,
272  icalparser_line_gen_func line_gen_func);
273 
284 LIBICAL_ICAL_EXPORT void icalparser_set_gen_data(icalparser *parser, void *data);
285 
313 LIBICAL_ICAL_EXPORT icalcomponent *icalparser_parse_string(const char *str);
314 
315 /***********************************************************************
316  * Parser support functions
317  ***********************************************************************/
318 
333 LIBICAL_ICAL_EXPORT char *icalparser_get_line(icalparser *parser,
334  icalparser_line_gen_func line_gen_func);
335 
336 LIBICAL_ICAL_EXPORT char *icalparser_string_line_generator(char *out, size_t buf_size, void *d);
337 
338 #endif /* !ICALPARSE_H */
icalcomponent * icalparser_add_line(icalparser *parser, char *str)
Adds a single line to be parsed by the icalparser.
Definition: icalparser.c:691
void icalparser_free(icalparser *parser)
Frees an icalparser object.
Definition: icalparser.c:121
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:480
icalparser * icalparser_new(void)
Creates a new icalparser.
Definition: icalparser.c:99
icalcomponent * icalparser_parse_string(const char *str)
Parses a string and returns the parsed icalcomponent.
Definition: icalparser.c:1341
icalparser_state icalparser_get_state(icalparser *parser)
Returns current state of the icalparser.
Definition: icalparser.c:1243
icalcomponent * icalparser_clean(icalparser *parser)
Cleans out an icalparser and returns whatever it has parsed so far.
Definition: icalparser.c:1248
icalcomponent * icalparser_parse(icalparser *parser, icalparser_line_gen_func line_gen_func)
Message oriented parsing.
Definition: icalparser.c:629
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_state
Represents the current state of the parser.
Definition: icalparser.h:56
@ ICALPARSER_BEGIN_COMP
Definition: icalparser.h:64
@ ICALPARSER_SUCCESS
Definition: icalparser.h:61
@ ICALPARSER_END_COMP
Definition: icalparser.h:67
@ ICALPARSER_IN_PROGRESS
Definition: icalparser.h:70
@ ICALPARSER_ERROR
Definition: icalparser.h:58
Definition: icalcomponent.c:36
Definition: icalparser.c:51