Libical API Documentation 4.0 STABLE VERSION [Visit the v3.0 documentation]
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 SPDX-FileCopyrightText: 2000, Eric Busboom <eric@civicknowledge.com>
6 SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
7======================================================================*/
8
9#ifndef ICALPARSER_H
10#define ICALPARSER_H
11
12#include "libical_ical_export.h"
13#include "icalcomponent.h"
14
27
32typedef struct icalparser_impl icalparser;
33
56
58typedef char *(*icalparser_line_gen_func)(char *s, size_t size, void *d);
60
84LIBICAL_ICAL_EXPORT icalparser *icalparser_new(void);
85
154LIBICAL_ICAL_EXPORT icalcomponent *icalparser_add_line(icalparser *parser, char *line);
155
175LIBICAL_ICAL_EXPORT icalcomponent *icalparser_clean(icalparser *parser);
176
197LIBICAL_ICAL_EXPORT icalparser_state icalparser_get_state(const icalparser *parser);
198
212LIBICAL_ICAL_EXPORT void icalparser_free(icalparser *parser);
213
266LIBICAL_ICAL_EXPORT icalcomponent *icalparser_parse(icalparser *parser,
267 icalparser_line_gen_func line_gen_func);
268
279LIBICAL_ICAL_EXPORT void icalparser_set_gen_data(icalparser *parser, void *data);
280
308LIBICAL_ICAL_EXPORT icalcomponent *icalparser_parse_string(const char *str);
309
323
328LIBICAL_ICAL_EXPORT enum icalparser_ctrl icalparser_get_ctrl(void);
329
334LIBICAL_ICAL_EXPORT void icalparser_set_ctrl(enum icalparser_ctrl ctrl);
335
336/***********************************************************************
337 * Parser support functions
338 ***********************************************************************/
339
358LIBICAL_ICAL_EXPORT char *icalparser_get_line(icalparser *parser,
359 icalparser_line_gen_func line_gen_func);
360
370LIBICAL_ICAL_EXPORT char *icalparser_string_line_generator(char *out, size_t buf_size, void *d);
371
372#endif /* !ICALPARSE_H */
Defines the data structure for iCalendar components.
icalcomponent * icalparser_parse(icalparser *parser, icalparser_line_gen_func line_gen_func)
Message oriented parsing.
Definition icalparser.c:590
icalcomponent * icalparser_add_line(icalparser *parser, char *line)
Adds a single line to be parsed by the icalparser.
Definition icalparser.c:649
void icalparser_free(icalparser *parser)
Frees an icalparser object.
Definition icalparser.c:114
void icalparser_set_ctrl(enum icalparser_ctrl ctrl)
Set the parser setting how to handle CONTROL characters.
enum icalparser_ctrl icalparser_get_ctrl(void)
Get the current parser setting how to handle CONTROL characters.
icalcomponent * icalparser_parse_string(const char *str)
Parses a string and returns the parsed icalcomponent.
char * icalparser_string_line_generator(char *out, size_t buf_size, void *d)
icalparser * icalparser_new(void)
Creates a new icalparser.
Definition icalparser.c:90
icalcomponent * icalparser_clean(icalparser *parser)
Cleans out an icalparser and returns whatever it has parsed so far.
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:131
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:439
icalparser_state icalparser_get_state(const icalparser *parser)
Returns current state of the icalparser.
icalparser_ctrl
Defines how to handle invalid CONTROL characters in content lines.
Definition icalparser.h:315
@ ICALPARSER_CTRL_OMIT
Definition icalparser.h:319
@ ICALPARSER_CTRL_KEEP
Definition icalparser.h:317
@ ICALPARSER_CTRL_ERROR
Definition icalparser.h:321
icalparser_state
Represents the current state of the parser.
Definition icalparser.h:40
@ ICALPARSER_BEGIN_COMP
Definition icalparser.h:48
@ ICALPARSER_SUCCESS
Definition icalparser.h:45
@ ICALPARSER_END_COMP
Definition icalparser.h:51
@ ICALPARSER_IN_PROGRESS
Definition icalparser.h:54
@ ICALPARSER_ERROR
Definition icalparser.h:42