Libical API Documentation 3.0
Loading...
Searching...
No Matches
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
49
55typedef enum icalparser_state
56{
59
62
65
68
72
73typedef 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
327
332LIBICAL_ICAL_EXPORT enum icalparser_ctrl icalparser_get_ctrl(void);
333
338LIBICAL_ICAL_EXPORT void icalparser_set_ctrl(enum icalparser_ctrl ctrl);
339
340/***********************************************************************
341 * Parser support functions
342 ***********************************************************************/
343
358LIBICAL_ICAL_EXPORT char *icalparser_get_line(icalparser *parser,
359 icalparser_line_gen_func line_gen_func);
360
361LIBICAL_ICAL_EXPORT char *icalparser_string_line_generator(char *out, size_t buf_size, void *d);
362
363#endif /* !ICALPARSE_H */
icalcomponent * icalparser_parse(icalparser *parser, icalparser_line_gen_func line_gen_func)
Message oriented parsing.
Definition icalparser.c:634
void icalparser_free(icalparser *parser)
Frees an icalparser object.
Definition icalparser.c:123
void icalparser_set_ctrl(enum icalparser_ctrl ctrl)
Set the parser setting how to handle CONTROL characters.
Definition icalparser.c:1422
enum icalparser_ctrl icalparser_get_ctrl(void)
Get the current parser setting how to handle CONTROL characters.
Definition icalparser.c:1417
icalcomponent * icalparser_parse_string(const char *str)
Parses a string and returns the parsed icalcomponent.
Definition icalparser.c:1392
icalparser_ctrl
Defines how to handle invalid CONTROL characters in content lines.
Definition icalparser.h:319
@ ICALPARSER_CTRL_OMIT
Definition icalparser.h:323
@ ICALPARSER_CTRL_KEEP
Definition icalparser.h:321
@ ICALPARSER_CTRL_ERROR
Definition icalparser.h:325
icalparser * icalparser_new(void)
Creates a new icalparser.
Definition icalparser.c:101
icalcomponent * icalparser_add_line(icalparser *parser, char *str)
Adds a single line to be parsed by the icalparser.
Definition icalparser.c:694
icalparser_state icalparser_get_state(icalparser *parser)
Returns current state of the icalparser.
Definition icalparser.c:1287
icalcomponent * icalparser_clean(icalparser *parser)
Cleans out an icalparser and returns whatever it has parsed so far.
Definition icalparser.c:1292
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:140
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:485
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:53