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
36typedef struct icalparser_impl icalparser;
37
60
61typedef char *(*icalparser_line_gen_func)(char *s, size_t size, void *d);
62
86LIBICAL_ICAL_EXPORT icalparser *icalparser_new(void);
87
147LIBICAL_ICAL_EXPORT icalcomponent *icalparser_add_line(icalparser *parser, char *line);
148
168LIBICAL_ICAL_EXPORT icalcomponent *icalparser_clean(icalparser *parser);
169
190LIBICAL_ICAL_EXPORT icalparser_state icalparser_get_state(const icalparser *parser);
191
205LIBICAL_ICAL_EXPORT void icalparser_free(icalparser *parser);
206
259LIBICAL_ICAL_EXPORT icalcomponent *icalparser_parse(icalparser *parser,
260 icalparser_line_gen_func line_gen_func);
261
272LIBICAL_ICAL_EXPORT void icalparser_set_gen_data(icalparser *parser, void *data);
273
301LIBICAL_ICAL_EXPORT icalcomponent *icalparser_parse_string(const char *str);
302
316
321LIBICAL_ICAL_EXPORT enum icalparser_ctrl icalparser_get_ctrl(void);
322
327LIBICAL_ICAL_EXPORT void icalparser_set_ctrl(enum icalparser_ctrl ctrl);
328
329/***********************************************************************
330 * Parser support functions
331 ***********************************************************************/
332
347LIBICAL_ICAL_EXPORT char *icalparser_get_line(icalparser *parser,
348 icalparser_line_gen_func line_gen_func);
349
350LIBICAL_ICAL_EXPORT char *icalparser_string_line_generator(char *out, size_t buf_size, void *d);
351
352#endif /* !ICALPARSE_H */
icalcomponent * icalparser_parse(icalparser *parser, icalparser_line_gen_func line_gen_func)
Message oriented parsing.
Definition icalparser.c:579
icalcomponent * icalparser_add_line(icalparser *parser, char *line)
Adds a single line to be parsed by the icalparser.
Definition icalparser.c:641
void icalparser_free(icalparser *parser)
Frees an icalparser object.
Definition icalparser.c:103
void icalparser_set_ctrl(enum icalparser_ctrl ctrl)
Set the parser setting how to handle CONTROL characters.
Definition icalparser.c:1356
struct icalparser_impl icalparser
Definition icalparser.h:36
enum icalparser_ctrl icalparser_get_ctrl(void)
Get the current parser setting how to handle CONTROL characters.
Definition icalparser.c:1351
icalcomponent * icalparser_parse_string(const char *str)
Parses a string and returns the parsed icalcomponent.
Definition icalparser.c:1322
icalparser_ctrl
Defines how to handle invalid CONTROL characters in content lines.
Definition icalparser.h:308
@ ICALPARSER_CTRL_OMIT
Definition icalparser.h:312
@ ICALPARSER_CTRL_KEEP
Definition icalparser.h:310
@ ICALPARSER_CTRL_ERROR
Definition icalparser.h:314
icalparser * icalparser_new(void)
Creates a new icalparser.
Definition icalparser.c:80
icalcomponent * icalparser_clean(icalparser *parser)
Cleans out an icalparser and returns whatever it has parsed so far.
Definition icalparser.c:1222
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:120
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:428
icalparser_state
Represents the current state of the parser.
Definition icalparser.h:44
@ ICALPARSER_BEGIN_COMP
Definition icalparser.h:52
@ ICALPARSER_SUCCESS
Definition icalparser.h:49
@ ICALPARSER_END_COMP
Definition icalparser.h:55
@ ICALPARSER_IN_PROGRESS
Definition icalparser.h:58
@ ICALPARSER_ERROR
Definition icalparser.h:46
icalparser_state icalparser_get_state(const icalparser *parser)
Returns current state of the icalparser.
Definition icalparser.c:1217