summaryrefslogtreecommitdiff
path: root/apidocs/icalparser_8h.html
blob: e7d517a8f042d9f9184cca4556a656ede0239081 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Libical API Documentation: icalparser.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Libical API Documentation<span id="projectnumber">&#160;3.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.3 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_b7a0ea939f6e83384f3c571d31a84be9.html">libical</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">icalparser.h File Reference</div></div>
</div><!--header-->
<div class="contents">

<p>Line-oriented parsing.  
<a href="#details">More...</a></p>

<p><a href="icalparser_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a9332da05cc4922f68ae2b07f442c06fa"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structicalparser__impl.html">icalparser_impl</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalparser_8h.html#a9332da05cc4922f68ae2b07f442c06fa">icalparser</a></td></tr>
<tr class="separator:a9332da05cc4922f68ae2b07f442c06fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a69220c4ae4e2d8b576334ac8049f6a32"><td class="memItemLeft" align="right" valign="top"><a id="a69220c4ae4e2d8b576334ac8049f6a32" name="a69220c4ae4e2d8b576334ac8049f6a32"></a>
typedef char *(*&#160;</td><td class="memItemRight" valign="bottom"><b>icalparser_line_gen_func</b>) (char *s, size_t size, void *d)</td></tr>
<tr class="separator:a69220c4ae4e2d8b576334ac8049f6a32"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af8b34b2ce5d2982022e34e8a0ef32be0"><td class="memItemLeft" align="right" valign="top"><a id="af8b34b2ce5d2982022e34e8a0ef32be0" name="af8b34b2ce5d2982022e34e8a0ef32be0"></a>
typedef enum <a class="el" href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7">icalparser_state</a>&#160;</td><td class="memItemRight" valign="bottom"><b>icalparser_state</b></td></tr>
<tr class="separator:af8b34b2ce5d2982022e34e8a0ef32be0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:aeec42cd09dd789c699d7b6741cbec3e7"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7">icalparser_state</a> { <br />
&#160;&#160;<a class="el" href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7adc8fd0c6d697007e6b3fa12bd118a9c8">ICALPARSER_ERROR</a>
, <a class="el" href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7a2dc67ce9b2811c477a462025a9ed9090">ICALPARSER_SUCCESS</a>
, <a class="el" href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7a0bfd41070e190cb87f0e8385e0c8031e">ICALPARSER_BEGIN_COMP</a>
, <a class="el" href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7a5a29afa239e509cc9f45a61a2c10feb2">ICALPARSER_END_COMP</a>
, <br />
&#160;&#160;<a class="el" href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7a927206f107dfdc62cfd33a9115a997b2">ICALPARSER_IN_PROGRESS</a>
<br />
 }</td></tr>
<tr class="memdesc:aeec42cd09dd789c699d7b6741cbec3e7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Represents the current state of the parser.  <a href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7">More...</a><br /></td></tr>
<tr class="separator:aeec42cd09dd789c699d7b6741cbec3e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a987113ea951dc55e37a764af168caaca"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structicalcomponent__impl.html">icalcomponent</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalparser_8h.html#a987113ea951dc55e37a764af168caaca">icalparser_add_line</a> (<a class="el" href="icalparser_8h.html#a9332da05cc4922f68ae2b07f442c06fa">icalparser</a> *parser, char *str)</td></tr>
<tr class="memdesc:a987113ea951dc55e37a764af168caaca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a single line to be parsed by the icalparser.  <a href="icalparser_8h.html#a987113ea951dc55e37a764af168caaca">More...</a><br /></td></tr>
<tr class="separator:a987113ea951dc55e37a764af168caaca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6e4c9c494345c51adf49a7e30255fb7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structicalcomponent__impl.html">icalcomponent</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalparser_8h.html#aa6e4c9c494345c51adf49a7e30255fb7">icalparser_clean</a> (<a class="el" href="icalparser_8h.html#a9332da05cc4922f68ae2b07f442c06fa">icalparser</a> *parser)</td></tr>
<tr class="memdesc:aa6e4c9c494345c51adf49a7e30255fb7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Cleans out an icalparser and returns whatever it has parsed so far.  <a href="icalparser_8h.html#aa6e4c9c494345c51adf49a7e30255fb7">More...</a><br /></td></tr>
<tr class="separator:aa6e4c9c494345c51adf49a7e30255fb7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1cb8b8678b781d3d2ede0fbce613b90d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalparser_8h.html#a1cb8b8678b781d3d2ede0fbce613b90d">icalparser_free</a> (<a class="el" href="icalparser_8h.html#a9332da05cc4922f68ae2b07f442c06fa">icalparser</a> *parser)</td></tr>
<tr class="memdesc:a1cb8b8678b781d3d2ede0fbce613b90d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees an icalparser object.  <a href="icalparser_8h.html#a1cb8b8678b781d3d2ede0fbce613b90d">More...</a><br /></td></tr>
<tr class="separator:a1cb8b8678b781d3d2ede0fbce613b90d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ada2de638b68de5146ae860631709f4a3"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalparser_8h.html#ada2de638b68de5146ae860631709f4a3">icalparser_get_line</a> (<a class="el" href="icalparser_8h.html#a9332da05cc4922f68ae2b07f442c06fa">icalparser</a> *parser, icalparser_line_gen_func line_gen_func)</td></tr>
<tr class="memdesc:ada2de638b68de5146ae860631709f4a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Given a line generator function, returns a single iCal content line.  <a href="icalparser_8h.html#ada2de638b68de5146ae860631709f4a3">More...</a><br /></td></tr>
<tr class="separator:ada2de638b68de5146ae860631709f4a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a27d19ac53219bb65aeb9a031dbf027"><td class="memItemLeft" align="right" valign="top"><a class="el" href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7">icalparser_state</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalparser_8h.html#a9a27d19ac53219bb65aeb9a031dbf027">icalparser_get_state</a> (<a class="el" href="icalparser_8h.html#a9332da05cc4922f68ae2b07f442c06fa">icalparser</a> *parser)</td></tr>
<tr class="memdesc:a9a27d19ac53219bb65aeb9a031dbf027"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns current state of the icalparser.  <a href="icalparser_8h.html#a9a27d19ac53219bb65aeb9a031dbf027">More...</a><br /></td></tr>
<tr class="separator:a9a27d19ac53219bb65aeb9a031dbf027"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9848e4dc69f814f49a5ece028c43be57"><td class="memItemLeft" align="right" valign="top"><a class="el" href="icalparser_8h.html#a9332da05cc4922f68ae2b07f442c06fa">icalparser</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalparser_8h.html#a9848e4dc69f814f49a5ece028c43be57">icalparser_new</a> (void)</td></tr>
<tr class="memdesc:a9848e4dc69f814f49a5ece028c43be57"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new icalparser.  <a href="icalparser_8h.html#a9848e4dc69f814f49a5ece028c43be57">More...</a><br /></td></tr>
<tr class="separator:a9848e4dc69f814f49a5ece028c43be57"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00330df647417bb017a7daaaffafddec"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structicalcomponent__impl.html">icalcomponent</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalparser_8h.html#a00330df647417bb017a7daaaffafddec">icalparser_parse</a> (<a class="el" href="icalparser_8h.html#a9332da05cc4922f68ae2b07f442c06fa">icalparser</a> *parser, icalparser_line_gen_func line_gen_func)</td></tr>
<tr class="memdesc:a00330df647417bb017a7daaaffafddec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Message oriented parsing.  <a href="icalparser_8h.html#a00330df647417bb017a7daaaffafddec">More...</a><br /></td></tr>
<tr class="separator:a00330df647417bb017a7daaaffafddec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e1268344c61e44a0ec18085688f07fd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structicalcomponent__impl.html">icalcomponent</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalparser_8h.html#a5e1268344c61e44a0ec18085688f07fd">icalparser_parse_string</a> (const char *str)</td></tr>
<tr class="memdesc:a5e1268344c61e44a0ec18085688f07fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parses a string and returns the parsed icalcomponent.  <a href="icalparser_8h.html#a5e1268344c61e44a0ec18085688f07fd">More...</a><br /></td></tr>
<tr class="separator:a5e1268344c61e44a0ec18085688f07fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aae6d08b4084610e225621a25dddd7689"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalparser_8h.html#aae6d08b4084610e225621a25dddd7689">icalparser_set_gen_data</a> (<a class="el" href="icalparser_8h.html#a9332da05cc4922f68ae2b07f442c06fa">icalparser</a> *parser, void *data)</td></tr>
<tr class="memdesc:aae6d08b4084610e225621a25dddd7689"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the data that icalparser_parse will give to the line_gen_func as the parameter 'd'.  <a href="icalparser_8h.html#aae6d08b4084610e225621a25dddd7689">More...</a><br /></td></tr>
<tr class="separator:aae6d08b4084610e225621a25dddd7689"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6429fdd3d61babc95a3851d78c16ae66"><td class="memItemLeft" align="right" valign="top"><a id="a6429fdd3d61babc95a3851d78c16ae66" name="a6429fdd3d61babc95a3851d78c16ae66"></a>
char *&#160;</td><td class="memItemRight" valign="bottom"><b>icalparser_string_line_generator</b> (char *out, size_t buf_size, void *d)</td></tr>
<tr class="separator:a6429fdd3d61babc95a3851d78c16ae66"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >Line-oriented parsing. </p>
<p >This file provides methods to parse iCalendar-formatted data into the structures provided by this library.</p>
<dl class="section user"><dt>Usage</dt><dd>Create a new parser via icalparser_new_parser(), then add lines one at a time with <a class="el" href="icalparser_8h.html#a987113ea951dc55e37a764af168caaca" title="Adds a single line to be parsed by the icalparser.">icalparser_add_line()</a>. <a class="el" href="icalparser_8h.html#a987113ea951dc55e37a764af168caaca" title="Adds a single line to be parsed by the icalparser.">icalparser_add_line()</a> will return non-zero when it has finished with a component. </dd></dl>
</div><h2 class="groupheader">Typedef Documentation</h2>
<a id="a9332da05cc4922f68ae2b07f442c06fa" name="a9332da05cc4922f68ae2b07f442c06fa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9332da05cc4922f68ae2b07f442c06fa">&#9670;&nbsp;</a></span>icalparser</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="icalparser_8h.html#a9332da05cc4922f68ae2b07f442c06fa">icalparser</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p >Implementation of the icalparser struct, which holds the state for the current parsing operation. </p>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="aeec42cd09dd789c699d7b6741cbec3e7" name="aeec42cd09dd789c699d7b6741cbec3e7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeec42cd09dd789c699d7b6741cbec3e7">&#9670;&nbsp;</a></span>icalparser_state</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7">icalparser_state</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Represents the current state of the parser. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="aeec42cd09dd789c699d7b6741cbec3e7adc8fd0c6d697007e6b3fa12bd118a9c8" name="aeec42cd09dd789c699d7b6741cbec3e7adc8fd0c6d697007e6b3fa12bd118a9c8"></a>ICALPARSER_ERROR&#160;</td><td class="fielddoc"><p >An error occurred while parsing. </p>
</td></tr>
<tr><td class="fieldname"><a id="aeec42cd09dd789c699d7b6741cbec3e7a2dc67ce9b2811c477a462025a9ed9090" name="aeec42cd09dd789c699d7b6741cbec3e7a2dc67ce9b2811c477a462025a9ed9090"></a>ICALPARSER_SUCCESS&#160;</td><td class="fielddoc"><p >Parsing was successful. </p>
</td></tr>
<tr><td class="fieldname"><a id="aeec42cd09dd789c699d7b6741cbec3e7a0bfd41070e190cb87f0e8385e0c8031e" name="aeec42cd09dd789c699d7b6741cbec3e7a0bfd41070e190cb87f0e8385e0c8031e"></a>ICALPARSER_BEGIN_COMP&#160;</td><td class="fielddoc"><p >Currently parsing the begin of a component. </p>
</td></tr>
<tr><td class="fieldname"><a id="aeec42cd09dd789c699d7b6741cbec3e7a5a29afa239e509cc9f45a61a2c10feb2" name="aeec42cd09dd789c699d7b6741cbec3e7a5a29afa239e509cc9f45a61a2c10feb2"></a>ICALPARSER_END_COMP&#160;</td><td class="fielddoc"><p >Currently parsing the end of the component. </p>
</td></tr>
<tr><td class="fieldname"><a id="aeec42cd09dd789c699d7b6741cbec3e7a927206f107dfdc62cfd33a9115a997b2" name="aeec42cd09dd789c699d7b6741cbec3e7a927206f107dfdc62cfd33a9115a997b2"></a>ICALPARSER_IN_PROGRESS&#160;</td><td class="fielddoc"><p >Parsing is currently in progress. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a987113ea951dc55e37a764af168caaca" name="a987113ea951dc55e37a764af168caaca"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a987113ea951dc55e37a764af168caaca">&#9670;&nbsp;</a></span>icalparser_add_line()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structicalcomponent__impl.html">icalcomponent</a> * icalparser_add_line </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="icalparser_8h.html#a9332da05cc4922f68ae2b07f442c06fa">icalparser</a> *&#160;</td>
          <td class="paramname"><em>parser</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>str</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Adds a single line to be parsed by the icalparser. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">parser</td><td>The parser to use </td></tr>
    <tr><td class="paramname">str</td><td>A string representing a single line of RFC5545-formatted iCalendar data </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>When this was the last line of the component to be parsed, it returns the icalcomponent, otherwise it returns <code>NULL</code>. </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="icalparser_8h.html#a00330df647417bb017a7daaaffafddec" title="Message oriented parsing.">icalparser_parse()</a></dd></dl>
<dl class="section user"><dt>Error handling</dt><dd><ul>
<li>If <em>parser</em> is <code>NULL</code>, it returns <code>NULL</code> and sets <a class="el" href="icalerror_8h.html#ad2562706150f5c5a4d9b0ca149d78e37" title="Access the current icalerrno value.">icalerrno</a> to <a class="el" href="icalerror_8h.html#a601c122fcea522513b1b7732fa23e833a2cc8bbcd8c07fc9a16e36f7aae5757b1">ICAL_BADARG_ERROR</a>.</li>
<li>If <em>line</em> is empty, if returns <code>NULL</code></li>
<li>If <em>line</em> is <code>NULL</code>, it returns <code>NULL</code> and sets the <em>parser's</em> <a class="el" href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7" title="Represents the current state of the parser.">icalparser_state</a> to <a class="el" href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7adc8fd0c6d697007e6b3fa12bd118a9c8">ICALPARSER_ERROR</a>.</li>
<li>For errors during parsing, the functions can set the <a class="el" href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7" title="Represents the current state of the parser.">icalparser_state</a> to <a class="el" href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7adc8fd0c6d697007e6b3fa12bd118a9c8">ICALPARSER_ERROR</a> and/or return components of the type ICAL_XLICINVALID_COMPONENT, or components with properties of the type ICAL_XLICERROR_PROPERTY.</li>
</ul>
</dd></dl>
<dl class="section user"><dt>Ownership</dt><dd>Ownership of the <em>str</em> is transferred to libical upon calling this method. The returned icalcomponent is owned by the caller and needs to be <code>free()</code>d with the appropriate method after it's no longer needed.</dd></dl>
<dl class="section user"><dt>Example</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">char</span>* read_stream(<span class="keywordtype">char</span> *s, <span class="keywordtype">size_t</span> size, <span class="keywordtype">void</span> *d)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordflow">return</span> fgets(s, (<span class="keywordtype">int</span>)size, (FILE*)d);</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> parse()</div>
<div class="line">{</div>
<div class="line">    <span class="keywordtype">char</span>* line;</div>
<div class="line">    FILE* stream;</div>
<div class="line">    <a class="code hl_struct" href="structicalcomponent__impl.html">icalcomponent</a> *component;</div>
<div class="line"> </div>
<div class="line">    <a class="code hl_struct" href="structicalparser__impl.html">icalparser</a> *parser = <a class="code hl_function" href="icalparser_8h.html#a9848e4dc69f814f49a5ece028c43be57">icalparser_new</a>();</div>
<div class="line">    stream = fopen(argv[1],<span class="stringliteral">&quot;r&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <a class="code hl_function" href="icalparser_8h.html#aae6d08b4084610e225621a25dddd7689">icalparser_set_gen_data</a>(parser, stream);</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">do</span>{</div>
<div class="line">        <span class="comment">// get a single content line</span></div>
<div class="line">        line = <a class="code hl_function" href="icalparser_8h.html#ada2de638b68de5146ae860631709f4a3">icalparser_get_line</a>(parser, read_stream);</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// add that line to the parser</span></div>
<div class="line">        c = <a class="code hl_function" href="icalparser_8h.html#a987113ea951dc55e37a764af168caaca">icalparser_add_line</a>(parser,line);</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// once we parsed a component, print it</span></div>
<div class="line">        <span class="keywordflow">if</span> (c != 0) {</div>
<div class="line">            printf(<span class="stringliteral">&quot;%s&quot;</span>, icalcomponent_as_ical_string(c));</div>
<div class="line">            icalcomponent_free(c);</div>
<div class="line">        }</div>
<div class="line">    } <span class="keywordflow">while</span> (line != 0);</div>
<div class="line"> </div>
<div class="line">    <a class="code hl_function" href="icalparser_8h.html#a1cb8b8678b781d3d2ede0fbce613b90d">icalparser_free</a>(parser);</div>
<div class="line">}</div>
<div class="ttc" id="aicalparser_8h_html_a1cb8b8678b781d3d2ede0fbce613b90d"><div class="ttname"><a href="icalparser_8h.html#a1cb8b8678b781d3d2ede0fbce613b90d">icalparser_free</a></div><div class="ttdeci">void icalparser_free(icalparser *parser)</div><div class="ttdoc">Frees an icalparser object.</div><div class="ttdef"><b>Definition:</b> icalparser.c:104</div></div>
<div class="ttc" id="aicalparser_8h_html_a9848e4dc69f814f49a5ece028c43be57"><div class="ttname"><a href="icalparser_8h.html#a9848e4dc69f814f49a5ece028c43be57">icalparser_new</a></div><div class="ttdeci">icalparser * icalparser_new(void)</div><div class="ttdoc">Creates a new icalparser.</div><div class="ttdef"><b>Definition:</b> icalparser.c:81</div></div>
<div class="ttc" id="aicalparser_8h_html_a987113ea951dc55e37a764af168caaca"><div class="ttname"><a href="icalparser_8h.html#a987113ea951dc55e37a764af168caaca">icalparser_add_line</a></div><div class="ttdeci">icalcomponent * icalparser_add_line(icalparser *parser, char *str)</div><div class="ttdoc">Adds a single line to be parsed by the icalparser.</div><div class="ttdef"><b>Definition:</b> icalparser.c:682</div></div>
<div class="ttc" id="aicalparser_8h_html_aae6d08b4084610e225621a25dddd7689"><div class="ttname"><a href="icalparser_8h.html#aae6d08b4084610e225621a25dddd7689">icalparser_set_gen_data</a></div><div class="ttdeci">void icalparser_set_gen_data(icalparser *parser, void *data)</div><div class="ttdoc">Sets the data that icalparser_parse will give to the line_gen_func as the parameter 'd'.</div><div class="ttdef"><b>Definition:</b> icalparser.c:121</div></div>
<div class="ttc" id="aicalparser_8h_html_ada2de638b68de5146ae860631709f4a3"><div class="ttname"><a href="icalparser_8h.html#ada2de638b68de5146ae860631709f4a3">icalparser_get_line</a></div><div class="ttdeci">char * icalparser_get_line(icalparser *parser, icalparser_line_gen_func line_gen_func)</div><div class="ttdoc">Given a line generator function, returns a single iCal content line.</div><div class="ttdef"><b>Definition:</b> icalparser.c:467</div></div>
<div class="ttc" id="astructicalcomponent__impl_html"><div class="ttname"><a href="structicalcomponent__impl.html">icalcomponent_impl</a></div><div class="ttdef"><b>Definition:</b> icalcomponent.c:28</div></div>
<div class="ttc" id="astructicalparser__impl_html"><div class="ttname"><a href="structicalparser__impl.html">icalparser_impl</a></div><div class="ttdef"><b>Definition:</b> icalparser.c:32</div></div>
</div><!-- fragment --> </dd></dl>

</div>
</div>
<a id="aa6e4c9c494345c51adf49a7e30255fb7" name="aa6e4c9c494345c51adf49a7e30255fb7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa6e4c9c494345c51adf49a7e30255fb7">&#9670;&nbsp;</a></span>icalparser_clean()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structicalcomponent__impl.html">icalcomponent</a> * icalparser_clean </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="icalparser_8h.html#a9332da05cc4922f68ae2b07f442c06fa">icalparser</a> *&#160;</td>
          <td class="paramname"><em>parser</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Cleans out an icalparser and returns whatever it has parsed so far. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">parser</td><td>The icalparser to clean </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The parsed icalcomponent</dd></dl>
<dl class="section user"><dt>Error handling</dt><dd>If <em>parser</em> is <code>NULL</code>, it returns <code>NULL</code> and sets <a class="el" href="icalerror_8h.html#ad2562706150f5c5a4d9b0ca149d78e37" title="Access the current icalerrno value.">icalerrno</a> to <a class="el" href="icalerror_8h.html#a601c122fcea522513b1b7732fa23e833a2cc8bbcd8c07fc9a16e36f7aae5757b1">ICAL_BADARG_ERROR</a>. For parsing errors, it inserts an <code>X-LIC-ERROR</code> property into the affected components.</dd></dl>
<dl class="section user"><dt>Ownership</dt><dd>The returned icalcomponent is property of the caller and needs to be free'd with icalcomponent_free() after use.</dd></dl>
<p>This will parse components even if it hasn't encountered a proper <code>END</code> tag for it yet and return them, as well as clearing any intermediate state resulting from being in the middle of parsing something so the parser can be used to parse something new. </p>

</div>
</div>
<a id="a1cb8b8678b781d3d2ede0fbce613b90d" name="a1cb8b8678b781d3d2ede0fbce613b90d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1cb8b8678b781d3d2ede0fbce613b90d">&#9670;&nbsp;</a></span>icalparser_free()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void icalparser_free </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="icalparser_8h.html#a9332da05cc4922f68ae2b07f442c06fa">icalparser</a> *&#160;</td>
          <td class="paramname"><em>parser</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Frees an icalparser object. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">parser</td><td>The icalparser to be freed.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Example</dt><dd><div class="fragment"><div class="line"><a class="code hl_struct" href="structicalparser__impl.html">icalparser</a> *parser = <a class="code hl_function" href="icalparser_8h.html#a9848e4dc69f814f49a5ece028c43be57">icalparser_new</a>();</div>
<div class="line"> </div>
<div class="line"><span class="comment">// use parser ...</span></div>
<div class="line"> </div>
<div class="line"><a class="code hl_function" href="icalparser_8h.html#a1cb8b8678b781d3d2ede0fbce613b90d">icalparser_free</a>(parser);</div>
</div><!-- fragment --> </dd></dl>

</div>
</div>
<a id="ada2de638b68de5146ae860631709f4a3" name="ada2de638b68de5146ae860631709f4a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ada2de638b68de5146ae860631709f4a3">&#9670;&nbsp;</a></span>icalparser_get_line()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char * icalparser_get_line </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="icalparser_8h.html#a9332da05cc4922f68ae2b07f442c06fa">icalparser</a> *&#160;</td>
          <td class="paramname"><em>parser</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">icalparser_line_gen_func&#160;</td>
          <td class="paramname"><em>line_gen_func</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Given a line generator function, returns a single iCal content line. </p>
<dl class="section return"><dt>Returns</dt><dd>A pointer to a single line of data or <code>NULL</code> if it reached end of file reading from the <em>line_gen_func</em>. Note that the pointer returned is owned by libical and must not be <code>free()</code>d by the user. </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">parser</td><td>The parser object to use </td></tr>
    <tr><td class="paramname">line_gen_func</td><td>The function to use for reading data</td></tr>
  </table>
  </dd>
</dl>
<p>This function uses the supplied <em>line_gen_func</em> to read data in, until it has read a full line, and returns the full line. It includes any continuation lines, which start with a space after a newline. To supply arbitrary data (as the parameter <em>d</em>) to your <em>line_gen_func</em>, call <a class="el" href="icalparser_8h.html#aae6d08b4084610e225621a25dddd7689" title="Sets the data that icalparser_parse will give to the line_gen_func as the parameter &#39;d&#39;.">icalparser_set_gen_data()</a>. </p>

</div>
</div>
<a id="a9a27d19ac53219bb65aeb9a031dbf027" name="a9a27d19ac53219bb65aeb9a031dbf027"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9a27d19ac53219bb65aeb9a031dbf027">&#9670;&nbsp;</a></span>icalparser_get_state()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7">icalparser_state</a> icalparser_get_state </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="icalparser_8h.html#a9332da05cc4922f68ae2b07f442c06fa">icalparser</a> *&#160;</td>
          <td class="paramname"><em>parser</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns current state of the icalparser. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">parser</td><td>The (valid, non-<code>NULL</code>) parser object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The current state of the icalparser, as an <a class="el" href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7" title="Represents the current state of the parser.">icalparser_state</a></dd></dl>
<dl class="section user"><dt>Example</dt><dd><div class="fragment"><div class="line"><a class="code hl_struct" href="structicalparser__impl.html">icalparser</a> *parser = <a class="code hl_function" href="icalparser_8h.html#a9848e4dc69f814f49a5ece028c43be57">icalparser_new</a>();</div>
<div class="line"> </div>
<div class="line"><span class="comment">// use icalparser...</span></div>
<div class="line"> </div>
<div class="line"><span class="keywordflow">if</span>(<a class="code hl_function" href="icalparser_8h.html#a9a27d19ac53219bb65aeb9a031dbf027">icalparser_get_state</a>(parser) == <a class="code hl_enumvalue" href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7adc8fd0c6d697007e6b3fa12bd118a9c8">ICALPARSER_ERROR</a>) {</div>
<div class="line">    <span class="comment">// handle error</span></div>
<div class="line">} <span class="keywordflow">else</span> {</div>
<div class="line">    <span class="comment">// ...</span></div>
<div class="line">}</div>
<div class="ttc" id="aicalparser_8h_html_a9a27d19ac53219bb65aeb9a031dbf027"><div class="ttname"><a href="icalparser_8h.html#a9a27d19ac53219bb65aeb9a031dbf027">icalparser_get_state</a></div><div class="ttdeci">icalparser_state icalparser_get_state(icalparser *parser)</div><div class="ttdoc">Returns current state of the icalparser.</div><div class="ttdef"><b>Definition:</b> icalparser.c:1238</div></div>
<div class="ttc" id="aicalparser_8h_html_aeec42cd09dd789c699d7b6741cbec3e7adc8fd0c6d697007e6b3fa12bd118a9c8"><div class="ttname"><a href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7adc8fd0c6d697007e6b3fa12bd118a9c8">ICALPARSER_ERROR</a></div><div class="ttdeci">@ ICALPARSER_ERROR</div><div class="ttdef"><b>Definition:</b> icalparser.h:49</div></div>
</div><!-- fragment --></dd></dl>
<p>icalparser_free(parser); </p>

</div>
</div>
<a id="a9848e4dc69f814f49a5ece028c43be57" name="a9848e4dc69f814f49a5ece028c43be57"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9848e4dc69f814f49a5ece028c43be57">&#9670;&nbsp;</a></span>icalparser_new()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="icalparser_8h.html#a9332da05cc4922f68ae2b07f442c06fa">icalparser</a> * icalparser_new </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates a new icalparser. </p>
<dl class="section return"><dt>Returns</dt><dd>An icalparser object</dd></dl>
<dl class="section user"><dt>Error handling</dt><dd>On error, it returns <code>NULL</code> and sets <a class="el" href="icalerror_8h.html#ad2562706150f5c5a4d9b0ca149d78e37" title="Access the current icalerrno value.">icalerrno</a> to <a class="el" href="icalerror_8h.html#a601c122fcea522513b1b7732fa23e833a055394ffaf6701aa12491dc10767f07d">ICAL_NEWFAILED_ERROR</a>.</dd></dl>
<dl class="section user"><dt>Ownership</dt><dd>All icalparser objects created with this function need to be freed using the <a class="el" href="icalparser_8h.html#a1cb8b8678b781d3d2ede0fbce613b90d" title="Frees an icalparser object.">icalparser_free()</a> function.</dd></dl>
<dl class="section user"><dt>Usage</dt><dd><div class="fragment"><div class="line"><span class="comment">// create new parser</span></div>
<div class="line"><a class="code hl_struct" href="structicalparser__impl.html">icalparser</a> *parser = <a class="code hl_function" href="icalparser_8h.html#a9848e4dc69f814f49a5ece028c43be57">icalparser_new</a>();</div>
<div class="line"> </div>
<div class="line"><span class="comment">// do something with it...</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">// free parser</span></div>
<div class="line"><a class="code hl_function" href="icalparser_8h.html#a1cb8b8678b781d3d2ede0fbce613b90d">icalparser_free</a>(parser);</div>
</div><!-- fragment --> </dd></dl>

</div>
</div>
<a id="a00330df647417bb017a7daaaffafddec" name="a00330df647417bb017a7daaaffafddec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a00330df647417bb017a7daaaffafddec">&#9670;&nbsp;</a></span>icalparser_parse()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structicalcomponent__impl.html">icalcomponent</a> * icalparser_parse </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="icalparser_8h.html#a9332da05cc4922f68ae2b07f442c06fa">icalparser</a> *&#160;</td>
          <td class="paramname"><em>parser</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">icalparser_line_gen_func&#160;</td>
          <td class="paramname"><em>line_gen_func</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Message oriented parsing. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">parser</td><td>The parser to use </td></tr>
    <tr><td class="paramname">line_gen_func</td><td>A function that returns one content line per invocation </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The parsed icalcomponent </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="icalparser_8h.html#a5e1268344c61e44a0ec18085688f07fd" title="Parses a string and returns the parsed icalcomponent.">icalparser_parse_string()</a></dd></dl>
<p>Reads an icalcomponent using the supplied <em>line_gen_func</em>, returning the parsed component (or <code>NULL</code> on error).</p>
<dl class="section user"><dt>Error handling</dt><dd><ul>
<li>If <em>parser</em> is <code>NULL</code>, it returns <code>NULL</code> and sets <a class="el" href="icalerror_8h.html#ad2562706150f5c5a4d9b0ca149d78e37" title="Access the current icalerrno value.">icalerrno</a> to <a class="el" href="icalerror_8h.html#a601c122fcea522513b1b7732fa23e833a2cc8bbcd8c07fc9a16e36f7aae5757b1">ICAL_BADARG_ERROR</a>.</li>
<li>If data read by <em>line_gen_func</em> is empty, if returns <code>NULL</code></li>
<li>If data read by <em>line_gen_func</em> is <code>NULL</code>, it returns <code>NULL</code> and sets the <em>parser's</em> <a class="el" href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7" title="Represents the current state of the parser.">icalparser_state</a> to <a class="el" href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7adc8fd0c6d697007e6b3fa12bd118a9c8">ICALPARSER_ERROR</a>.</li>
<li>For errors during parsing, the functions can set the <a class="el" href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7" title="Represents the current state of the parser.">icalparser_state</a> to <a class="el" href="icalparser_8h.html#aeec42cd09dd789c699d7b6741cbec3e7adc8fd0c6d697007e6b3fa12bd118a9c8">ICALPARSER_ERROR</a> and/or return components of the type ICAL_XLICINVALID_COMPONENT, or components with properties of the type ICAL_XLICERROR_PROPERTY.</li>
</ul>
</dd></dl>
<dl class="section user"><dt>Ownership</dt><dd>The returned icalcomponent is owned by the caller of the function, and needs to be <code>free()</code>d with the appropriate method when no longer needed.</dd></dl>
<dl class="section user"><dt>Example</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">char</span>* read_stream(<span class="keywordtype">char</span> *s, <span class="keywordtype">size_t</span> size, <span class="keywordtype">void</span> *d)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordflow">return</span> fgets(s, (<span class="keywordtype">int</span>)size, (FILE*)d);</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> parse()</div>
<div class="line">{</div>
<div class="line">    <span class="keywordtype">char</span>* line;</div>
<div class="line">    FILE* stream;</div>
<div class="line">    <a class="code hl_struct" href="structicalcomponent__impl.html">icalcomponent</a> *component;</div>
<div class="line"> </div>
<div class="line">    <a class="code hl_struct" href="structicalparser__impl.html">icalparser</a> *parser = <a class="code hl_function" href="icalparser_8h.html#a9848e4dc69f814f49a5ece028c43be57">icalparser_new</a>();</div>
<div class="line">    stream = fopen(argv[1],<span class="stringliteral">&quot;r&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <a class="code hl_function" href="icalparser_8h.html#aae6d08b4084610e225621a25dddd7689">icalparser_set_gen_data</a>(parser, stream);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// use the parse method to parse the input data</span></div>
<div class="line">    component = <a class="code hl_function" href="icalparser_8h.html#a00330df647417bb017a7daaaffafddec">icalparser_parse</a>(parser, read_stream);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// once we parsed a component, print it</span></div>
<div class="line">    printf(<span class="stringliteral">&quot;%s&quot;</span>, icalcomponent_as_ical_string(c));</div>
<div class="line">    icalcomponent_free(c);</div>
<div class="line"> </div>
<div class="line">    <a class="code hl_function" href="icalparser_8h.html#a1cb8b8678b781d3d2ede0fbce613b90d">icalparser_free</a>(parser);</div>
<div class="line">}</div>
<div class="ttc" id="aicalparser_8h_html_a00330df647417bb017a7daaaffafddec"><div class="ttname"><a href="icalparser_8h.html#a00330df647417bb017a7daaaffafddec">icalparser_parse</a></div><div class="ttdeci">icalcomponent * icalparser_parse(icalparser *parser, icalparser_line_gen_func line_gen_func)</div><div class="ttdoc">Message oriented parsing.</div><div class="ttdef"><b>Definition:</b> icalparser.c:622</div></div>
</div><!-- fragment --> </dd></dl>

</div>
</div>
<a id="a5e1268344c61e44a0ec18085688f07fd" name="a5e1268344c61e44a0ec18085688f07fd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5e1268344c61e44a0ec18085688f07fd">&#9670;&nbsp;</a></span>icalparser_parse_string()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structicalcomponent__impl.html">icalcomponent</a> * icalparser_parse_string </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>str</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Parses a string and returns the parsed icalcomponent. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">str</td><td>The iCal formatted data to be parsed </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>An icalcomponent representing the iCalendar</dd></dl>
<dl class="section user"><dt>Error handling</dt><dd>On error, returns <code>NULL</code> and sets <a class="el" href="icalerror_8h.html#ad2562706150f5c5a4d9b0ca149d78e37" title="Access the current icalerrno value.">icalerrno</a></dd></dl>
<dl class="section user"><dt>Ownership</dt><dd>The returned icalcomponent is owned by the caller of the function, and needs to be free'd with the appropriate functions after use.</dd></dl>
<dl class="section user"><dt>Example</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">char</span> *ical_string;</div>
<div class="line"> </div>
<div class="line"><span class="comment">// parse ical_string</span></div>
<div class="line"><a class="code hl_struct" href="structicalcomponent__impl.html">icalcomponent</a> *component = <a class="code hl_function" href="icalparser_8h.html#a5e1268344c61e44a0ec18085688f07fd">icalparser_parse_string</a>(ical_string);</div>
<div class="line"> </div>
<div class="line"><span class="keywordflow">if</span>(!<a class="code hl_define" href="icalerror_8h.html#ad2562706150f5c5a4d9b0ca149d78e37">icalerrno</a> || component == NULL) {</div>
<div class="line">    <span class="comment">// use component ...</span></div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="comment">// release component</span></div>
<div class="line">icalcomponent_free(component);</div>
<div class="ttc" id="aicalerror_8h_html_ad2562706150f5c5a4d9b0ca149d78e37"><div class="ttname"><a href="icalerror_8h.html#ad2562706150f5c5a4d9b0ca149d78e37">icalerrno</a></div><div class="ttdeci">#define icalerrno</div><div class="ttdoc">Access the current icalerrno value.</div><div class="ttdef"><b>Definition:</b> icalerror.h:135</div></div>
<div class="ttc" id="aicalparser_8h_html_a5e1268344c61e44a0ec18085688f07fd"><div class="ttname"><a href="icalparser_8h.html#a5e1268344c61e44a0ec18085688f07fd">icalparser_parse_string</a></div><div class="ttdeci">icalcomponent * icalparser_parse_string(const char *str)</div><div class="ttdoc">Parses a string and returns the parsed icalcomponent.</div><div class="ttdef"><b>Definition:</b> icalparser.c:1336</div></div>
</div><!-- fragment --> </dd></dl>

</div>
</div>
<a id="aae6d08b4084610e225621a25dddd7689" name="aae6d08b4084610e225621a25dddd7689"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aae6d08b4084610e225621a25dddd7689">&#9670;&nbsp;</a></span>icalparser_set_gen_data()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void icalparser_set_gen_data </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="icalparser_8h.html#a9332da05cc4922f68ae2b07f442c06fa">icalparser</a> *&#160;</td>
          <td class="paramname"><em>parser</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the data that icalparser_parse will give to the line_gen_func as the parameter 'd'. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">parser</td><td>The icalparser this applies to </td></tr>
    <tr><td class="paramname">data</td><td>The pointer which will be passed to the line_gen_func as argument <code>d</code></td></tr>
  </table>
  </dd>
</dl>
<p>If you use any of the icalparser_parser() or <a class="el" href="icalparser_8h.html#ada2de638b68de5146ae860631709f4a3" title="Given a line generator function, returns a single iCal content line.">icalparser_get_line()</a> functions, the <em>line_gen_func</em> that they expect has a third <code>void* d</code> argument. This function sets what will be passed to your <em>line_gen_function</em> as such argument. </p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Jun 25 2022 08:55:43 for Libical API Documentation by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.3
</small></address>
</body>
</html>