$darkmode
Libical API Documentation 4.0 STABLE VERSION Visit the v3.0 documentation
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 
32 typedef struct icalparser_impl icalparser;
33 
39 typedef enum icalparser_state
40 {
43 
46 
49 
52 
56 
58 typedef char *(*icalparser_line_gen_func)(char *s, size_t size, void *d);
60 
84 LIBICAL_ICAL_EXPORT icalparser *icalparser_new(void);
85 
145 LIBICAL_ICAL_EXPORT icalcomponent *icalparser_add_line(icalparser *parser, char *line);
146 
166 LIBICAL_ICAL_EXPORT icalcomponent *icalparser_clean(icalparser *parser);
167 
188 LIBICAL_ICAL_EXPORT icalparser_state icalparser_get_state(const icalparser *parser);
189 
203 LIBICAL_ICAL_EXPORT void icalparser_free(icalparser *parser);
204 
257 LIBICAL_ICAL_EXPORT icalcomponent *icalparser_parse(icalparser *parser,
258  icalparser_line_gen_func line_gen_func);
259 
270 LIBICAL_ICAL_EXPORT void icalparser_set_gen_data(icalparser *parser, void *data);
271 
299 LIBICAL_ICAL_EXPORT icalcomponent *icalparser_parse_string(const char *str);
300 
305 typedef enum icalparser_ctrl
306 {
314 
319 LIBICAL_ICAL_EXPORT enum icalparser_ctrl icalparser_get_ctrl(void);
320 
325 LIBICAL_ICAL_EXPORT void icalparser_set_ctrl(enum icalparser_ctrl ctrl);
326 
327 /***********************************************************************
328  * Parser support functions
329  ***********************************************************************/
330 
345 LIBICAL_ICAL_EXPORT char *icalparser_get_line(icalparser *parser,
346  icalparser_line_gen_func line_gen_func);
347 
357 LIBICAL_ICAL_EXPORT char *icalparser_string_line_generator(char *out, size_t buf_size, void *d);
358 
359 #endif /* !ICALPARSE_H */
void icalparser_set_ctrl(enum icalparser_ctrl ctrl)
Set the parser setting how to handle CONTROL characters.
Definition: icalparser.c:1365
icalparser_state icalparser_get_state(const icalparser *parser)
Returns current state of the icalparser.
Definition: icalparser.c:1226
icalparser_state
Represents the current state of the parser.
Definition: icalparser.h:39
icalcomponent * icalparser_parse(icalparser *parser, icalparser_line_gen_func line_gen_func)
Message oriented parsing.
Definition: icalparser.c:588
icalparser * icalparser_new(void)
Creates a new icalparser.
Definition: icalparser.c:89
icalcomponent * icalparser_parse_string(const char *str)
Parses a string and returns the parsed icalcomponent.
Definition: icalparser.c:1331
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
Defines the data structure for iCalendar components.
icalcomponent * icalparser_add_line(icalparser *parser, char *line)
Adds a single line to be parsed by the icalparser.
Definition: icalparser.c:650
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
void icalparser_free(icalparser *parser)
Frees an icalparser object.
Definition: icalparser.c:112
icalcomponent * icalparser_clean(icalparser *parser)
Cleans out an icalparser and returns whatever it has parsed so far.
Definition: icalparser.c:1231
char * icalparser_string_line_generator(char *out, size_t buf_size, void *d)
Definition: icalparser.c:1266
icalparser_ctrl
Defines how to handle invalid CONTROL characters in content lines.
Definition: icalparser.h:305
enum icalparser_ctrl icalparser_get_ctrl(void)
Get the current parser setting how to handle CONTROL characters.
Definition: icalparser.c:1360