Libical API Documentation 4.0 UNRELEASED Go to the stable 3.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
145LIBICAL_ICAL_EXPORT icalcomponent *icalparser_add_line(icalparser *parser, char *line);
146
166LIBICAL_ICAL_EXPORT icalcomponent *icalparser_clean(icalparser *parser);
167
188LIBICAL_ICAL_EXPORT icalparser_state icalparser_get_state(const icalparser *parser);
189
203LIBICAL_ICAL_EXPORT void icalparser_free(icalparser *parser);
204
257LIBICAL_ICAL_EXPORT icalcomponent *icalparser_parse(icalparser *parser,
258 icalparser_line_gen_func line_gen_func);
259
270LIBICAL_ICAL_EXPORT void icalparser_set_gen_data(icalparser *parser, void *data);
271
299LIBICAL_ICAL_EXPORT icalcomponent *icalparser_parse_string(const char *str);
300
314
319LIBICAL_ICAL_EXPORT enum icalparser_ctrl icalparser_get_ctrl(void);
320
325LIBICAL_ICAL_EXPORT void icalparser_set_ctrl(enum icalparser_ctrl ctrl);
326
327/***********************************************************************
328 * Parser support functions
329 ***********************************************************************/
330
345LIBICAL_ICAL_EXPORT char *icalparser_get_line(icalparser *parser,
346 icalparser_line_gen_func line_gen_func);
347
357LIBICAL_ICAL_EXPORT char *icalparser_string_line_generator(char *out, size_t buf_size, void *d);
358
359#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:588
icalcomponent * icalparser_add_line(icalparser *parser, char *line)
Adds a single line to be parsed by the icalparser.
Definition icalparser.c:650
void icalparser_free(icalparser *parser)
Frees an icalparser object.
Definition icalparser.c:112
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_ctrl
Defines how to handle invalid CONTROL characters in content lines.
Definition icalparser.h:306
@ ICALPARSER_CTRL_OMIT
Definition icalparser.h:310
@ ICALPARSER_CTRL_KEEP
Definition icalparser.h:308
@ ICALPARSER_CTRL_ERROR
Definition icalparser.h:312
icalparser * icalparser_new(void)
Creates a new icalparser.
Definition icalparser.c:89
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:129
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:437
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
icalparser_state icalparser_get_state(const icalparser *parser)
Returns current state of the icalparser.