Libical API Documentation 4.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 SPDX-FileCopyrightText: 2000, Eric Busboom <eric@civicknowledge.com>
6
7 SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
8
9 The original code is icalparser.h
10======================================================================*/
11
12#ifndef ICALPARSER_H
13#define ICALPARSER_H
14
15#include "libical_ical_export.h"
16#include "icalcomponent.h"
17
30
40
63
64typedef char *(*icalparser_line_gen_func)(char *s, size_t size, void *d);
65
89LIBICAL_ICAL_EXPORT icalparser *icalparser_new(void);
90
150LIBICAL_ICAL_EXPORT icalcomponent *icalparser_add_line(icalparser *parser, char *str);
151
171LIBICAL_ICAL_EXPORT icalcomponent *icalparser_clean(icalparser *parser);
172
193LIBICAL_ICAL_EXPORT icalparser_state icalparser_get_state(icalparser *parser);
194
208LIBICAL_ICAL_EXPORT void icalparser_free(icalparser *parser);
209
262LIBICAL_ICAL_EXPORT icalcomponent *icalparser_parse(icalparser *parser,
263 icalparser_line_gen_func line_gen_func);
264
275LIBICAL_ICAL_EXPORT void icalparser_set_gen_data(icalparser *parser, void *data);
276
304LIBICAL_ICAL_EXPORT icalcomponent *icalparser_parse_string(const char *str);
305
319
324LIBICAL_ICAL_EXPORT enum icalparser_ctrl icalparser_get_ctrl(void);
325
330LIBICAL_ICAL_EXPORT void icalparser_set_ctrl(enum icalparser_ctrl ctrl);
331
332/***********************************************************************
333 * Parser support functions
334 ***********************************************************************/
335
350LIBICAL_ICAL_EXPORT char *icalparser_get_line(icalparser *parser,
351 icalparser_line_gen_func line_gen_func);
352
353LIBICAL_ICAL_EXPORT char *icalparser_string_line_generator(char *out, size_t buf_size, void *d);
354
355#endif /* !ICALPARSE_H */
icalcomponent * icalparser_parse(icalparser *parser, icalparser_line_gen_func line_gen_func)
Message oriented parsing.
Definition icalparser.c:625
void icalparser_free(icalparser *parser)
Frees an icalparser object.
Definition icalparser.c:104
void icalparser_set_ctrl(enum icalparser_ctrl ctrl)
Set the parser setting how to handle CONTROL characters.
Definition icalparser.c:1414
struct icalparser_impl icalparser
Definition icalparser.h:39
enum icalparser_ctrl icalparser_get_ctrl(void)
Get the current parser setting how to handle CONTROL characters.
Definition icalparser.c:1409
icalcomponent * icalparser_parse_string(const char *str)
Parses a string and returns the parsed icalcomponent.
Definition icalparser.c:1381
icalparser_ctrl
Defines how to handle invalid CONTROL characters in content lines.
Definition icalparser.h:311
@ ICALPARSER_CTRL_OMIT
Definition icalparser.h:315
@ ICALPARSER_CTRL_KEEP
Definition icalparser.h:313
@ ICALPARSER_CTRL_ERROR
Definition icalparser.h:317
icalparser * icalparser_new(void)
Creates a new icalparser.
Definition icalparser.c:81
icalcomponent * icalparser_add_line(icalparser *parser, char *str)
Adds a single line to be parsed by the icalparser.
Definition icalparser.c:684
icalparser_state icalparser_get_state(icalparser *parser)
Returns current state of the icalparser.
Definition icalparser.c:1277
icalcomponent * icalparser_clean(icalparser *parser)
Cleans out an icalparser and returns whatever it has parsed so far.
Definition icalparser.c:1282
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:121
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:474
icalparser_state
Represents the current state of the parser.
Definition icalparser.h:47
@ ICALPARSER_BEGIN_COMP
Definition icalparser.h:55
@ ICALPARSER_SUCCESS
Definition icalparser.h:52
@ ICALPARSER_END_COMP
Definition icalparser.h:58
@ ICALPARSER_IN_PROGRESS
Definition icalparser.h:61
@ ICALPARSER_ERROR
Definition icalparser.h:49
Definition icalparser.c:33