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@softwarestudio.org>
6  http://www.softwarestudio.org
7 
8  This library is free software; you can redistribute it and/or modify
9  it under the terms of either:
10 
11  The LGPL as published by the Free Software Foundation, version
12  2.1, available at: http://www.gnu.org/licenses/lgpl-2.1.html
13 
14  Or:
15 
16  The Mozilla Public License Version 2.0. You may obtain a copy of
17  the License at http://www.mozilla.org/MPL/
18 
19  The original code is icalparser.h
20 ======================================================================*/
21 
22 #ifndef ICALPARSER_H
23 #define ICALPARSER_H
24 
25 #include "libical_ical_export.h"
26 #include "icalcomponent.h"
27 
49 typedef struct icalparser_impl icalparser;
50 
56 typedef enum icalparser_state
57 {
60 
63 
66 
69 
73 
97 LIBICAL_ICAL_EXPORT icalparser *icalparser_new(void);
98 
158 LIBICAL_ICAL_EXPORT icalcomponent *icalparser_add_line(icalparser *parser, char *str);
159 
179 LIBICAL_ICAL_EXPORT icalcomponent *icalparser_clean(icalparser *parser);
180 
201 LIBICAL_ICAL_EXPORT icalparser_state icalparser_get_state(icalparser *parser);
202 
216 LIBICAL_ICAL_EXPORT void icalparser_free(icalparser *parser);
217 
270 LIBICAL_ICAL_EXPORT icalcomponent *icalparser_parse(icalparser *parser,
271  char *(*line_gen_func) (char *s,
272  size_t size, void *d));
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 
332 LIBICAL_ICAL_EXPORT char *icalparser_get_line(icalparser *parser,
333  char *(*line_gen_func) (char *s,
334  size_t size, void *d));
335 
336 LIBICAL_ICAL_EXPORT char *icalparser_string_line_generator(char *out, size_t buf_size, void *d);
337 
338 #endif /* !ICALPARSE_H */
Definition: icalparser.h:65
icalparser_state
Represents the current state of the parser.
Definition: icalparser.h:56
icalcomponent * icalparser_parse(icalparser *parser, char *(*line_gen_func)(char *s, size_t size, void *d))
Message oriented parsing.
Definition: icalparser.c:628
icalparser * icalparser_new(void)
Creates a new icalparser.
Definition: icalparser.c:98
icalcomponent * icalparser_parse_string(const char *str)
Parse a string and return the parsed ::icalcomponent.
Definition: icalparser.c:1316
Definition: icalparser.h:59
Definition: icalparser.c:49
Definition: icalparser.h:62
icalparser_state icalparser_get_state(icalparser *parser)
Returns current state of the icalparser.
Definition: icalparser.c:1225
Definition: icalparser.h:68
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 &#39;d&#39;...
Definition: icalparser.c:137
icalcomponent * icalparser_add_line(icalparser *parser, char *str)
Adds a single line to be parsed by the icalparser.
Definition: icalparser.c:688
Definition: icalcomponent.c:33
void icalparser_free(icalparser *parser)
Frees an icalparser object.
Definition: icalparser.c:120
char * icalparser_get_line(icalparser *parser, char *(*line_gen_func)(char *s, size_t size, void *d))
Given a line generator function, return a single iCal content line.
Definition: icalparser.c:479
icalcomponent * icalparser_clean(icalparser *parser)
Cleans out an icalparser and returns whatever it has parsed so far.
Definition: icalparser.c:1230
Definition: icalparser.h:71