summaryrefslogtreecommitdiff
path: root/apidocs/icalduration_8h.html
blob: 62c0fe54ec1585130bffb9c9a692969b51ed2f14 (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
<!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=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Libical API Documentation: icalduration.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 style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Libical API Documentation
   &#160;<span id="projectnumber">3.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'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:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(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="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">icalduration.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Methods for working with durations in iCal.  
<a href="#details">More...</a></p>

<p><a href="icalduration_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 name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structicaldurationtype.html">icaldurationtype</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A struct representing a duration.  <a href="structicaldurationtype.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ae903a80c43b72c1f157d7709e08d05ae"><td class="memItemLeft" align="right" valign="top"><a id="ae903a80c43b72c1f157d7709e08d05ae"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>ICALDURATIONTYPE_INITIALIZER</b>&#160;&#160;&#160;{ 0, 0, 0, 0, 0, 0 }</td></tr>
<tr class="separator:ae903a80c43b72c1f157d7709e08d05ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a7ebae580ab5bab4e9ffe822ff1dee9c8"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalduration_8h.html#a7ebae580ab5bab4e9ffe822ff1dee9c8">icaldurationtype_as_ical_string</a> (struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a> d)</td></tr>
<tr class="separator:a7ebae580ab5bab4e9ffe822ff1dee9c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a758d27dc5433c570f5ea5995c5001e79"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalduration_8h.html#a758d27dc5433c570f5ea5995c5001e79">icaldurationtype_as_ical_string_r</a> (struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a> d)</td></tr>
<tr class="separator:a758d27dc5433c570f5ea5995c5001e79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1828c484b9efb3cb1f08ec5eb58c7a18"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalduration_8h.html#a1828c484b9efb3cb1f08ec5eb58c7a18">icaldurationtype_as_int</a> (struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a> duration)</td></tr>
<tr class="memdesc:a1828c484b9efb3cb1f08ec5eb58c7a18"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts an <a class="el" href="structicaldurationtype.html" title="A struct representing a duration.">icaldurationtype</a> into the duration in seconds as <code>int</code>.  <a href="icalduration_8h.html#a1828c484b9efb3cb1f08ec5eb58c7a18">More...</a><br /></td></tr>
<tr class="separator:a1828c484b9efb3cb1f08ec5eb58c7a18"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2578535a23fc5c6d4d61c09c880f03fd"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalduration_8h.html#a2578535a23fc5c6d4d61c09c880f03fd">icaldurationtype_bad_duration</a> (void)</td></tr>
<tr class="memdesc:a2578535a23fc5c6d4d61c09c880f03fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a bad duration (used to indicate error).  <a href="icalduration_8h.html#a2578535a23fc5c6d4d61c09c880f03fd">More...</a><br /></td></tr>
<tr class="separator:a2578535a23fc5c6d4d61c09c880f03fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a88157a8ae61263ea15af92a416889301"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalduration_8h.html#a88157a8ae61263ea15af92a416889301">icaldurationtype_from_int</a> (int t)</td></tr>
<tr class="memdesc:a88157a8ae61263ea15af92a416889301"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new <a class="el" href="structicaldurationtype.html" title="A struct representing a duration.">icaldurationtype</a> from a duration in seconds.  <a href="icalduration_8h.html#a88157a8ae61263ea15af92a416889301">More...</a><br /></td></tr>
<tr class="separator:a88157a8ae61263ea15af92a416889301"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0d6d8cc773e19242448eaffb1368fef4"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalduration_8h.html#a0d6d8cc773e19242448eaffb1368fef4">icaldurationtype_from_string</a> (const char *dur)</td></tr>
<tr class="memdesc:a0d6d8cc773e19242448eaffb1368fef4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new <a class="el" href="structicaldurationtype.html" title="A struct representing a duration.">icaldurationtype</a> from a duration given as a string.  <a href="icalduration_8h.html#a0d6d8cc773e19242448eaffb1368fef4">More...</a><br /></td></tr>
<tr class="separator:a0d6d8cc773e19242448eaffb1368fef4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a88c5b90b57f9e1f79c00a544746687d6"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalduration_8h.html#a88c5b90b57f9e1f79c00a544746687d6">icaldurationtype_is_bad_duration</a> (struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a> d)</td></tr>
<tr class="memdesc:a88c5b90b57f9e1f79c00a544746687d6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if a duration is a bad duration.  <a href="icalduration_8h.html#a88c5b90b57f9e1f79c00a544746687d6">More...</a><br /></td></tr>
<tr class="separator:a88c5b90b57f9e1f79c00a544746687d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afcdeddc439488d8f586db0702593c270"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalduration_8h.html#afcdeddc439488d8f586db0702593c270">icaldurationtype_is_null_duration</a> (struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a> d)</td></tr>
<tr class="memdesc:afcdeddc439488d8f586db0702593c270"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if a duration is a null duration.  <a href="icalduration_8h.html#afcdeddc439488d8f586db0702593c270">More...</a><br /></td></tr>
<tr class="separator:afcdeddc439488d8f586db0702593c270"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad716774a6570e0be2eb11868deb86595"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalduration_8h.html#ad716774a6570e0be2eb11868deb86595">icaldurationtype_null_duration</a> (void)</td></tr>
<tr class="memdesc:ad716774a6570e0be2eb11868deb86595"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a duration with zero length.  <a href="icalduration_8h.html#ad716774a6570e0be2eb11868deb86595">More...</a><br /></td></tr>
<tr class="separator:ad716774a6570e0be2eb11868deb86595"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aacc4e7db2c4b8dd96fd428edee73acf5"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structicaltimetype.html">icaltimetype</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalduration_8h.html#aacc4e7db2c4b8dd96fd428edee73acf5">icaltime_add</a> (struct <a class="el" href="structicaltimetype.html">icaltimetype</a> t, struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a> d)</td></tr>
<tr class="memdesc:aacc4e7db2c4b8dd96fd428edee73acf5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a duration to an icaltime object and returns the result.  <a href="icalduration_8h.html#aacc4e7db2c4b8dd96fd428edee73acf5">More...</a><br /></td></tr>
<tr class="separator:aacc4e7db2c4b8dd96fd428edee73acf5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaafcb16e5d2aaa6eb0e20fdac419fc0d"><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="icalduration_8h.html#aaafcb16e5d2aaa6eb0e20fdac419fc0d">icaltime_subtract</a> (struct <a class="el" href="structicaltimetype.html">icaltimetype</a> t1, struct <a class="el" href="structicaltimetype.html">icaltimetype</a> t2)</td></tr>
<tr class="memdesc:aaafcb16e5d2aaa6eb0e20fdac419fc0d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the difference between two <a class="el" href="structicaltimetype.html">icaltimetype</a> as a duration.  <a href="icalduration_8h.html#aaafcb16e5d2aaa6eb0e20fdac419fc0d">More...</a><br /></td></tr>
<tr class="separator:aaafcb16e5d2aaa6eb0e20fdac419fc0d"><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>Methods for working with durations in iCal. </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="a7ebae580ab5bab4e9ffe822ff1dee9c8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7ebae580ab5bab4e9ffe822ff1dee9c8">&#9670;&nbsp;</a></span>icaldurationtype_as_ical_string()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* icaldurationtype_as_ical_string </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a>&#160;</td>
          <td class="paramname"><em>d</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Converts an icaldurationtype into the iCal format as string. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">d</td><td>is the icaldurationtype to convert to iCal format </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A string representing duration <code>d</code> in iCal format </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="icalduration_8h.html#a758d27dc5433c570f5ea5995c5001e79">icaldurationtype_as_ical_string_r()</a></dd></dl>
<dl class="section user"><dt>Ownership</dt><dd>The string returned by this function is owned by the caller and needs to be released with <code>free()</code> after it's no longer needed.</dd></dl>
<dl class="section user"><dt>Usage</dt><dd><div class="fragment"><div class="line"><span class="comment">// create new duration</span></div>
<div class="line"><span class="keyword">struct </span><a class="code" href="structicaldurationtype.html">icaldurationtype</a> duration;</div>
<div class="line">duration = <a class="code" href="icalduration_8h.html#a88157a8ae61263ea15af92a416889301">icaldurationtype_from_int</a>(3424224);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// print as ical-formatted string</span></div>
<div class="line"><span class="keywordtype">char</span> *ical = <a class="code" href="icalduration_8h.html#a7ebae580ab5bab4e9ffe822ff1dee9c8">icaldurationtype_as_ical_string</a>(duration);</div>
<div class="line">printf(<span class="stringliteral">&quot;%s\n&quot;</span>, ical);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// release string</span></div>
<div class="line">free(ical);</div>
<div class="ttc" id="aicalduration_8h_html_a7ebae580ab5bab4e9ffe822ff1dee9c8"><div class="ttname"><a href="icalduration_8h.html#a7ebae580ab5bab4e9ffe822ff1dee9c8">icaldurationtype_as_ical_string</a></div><div class="ttdeci">char * icaldurationtype_as_ical_string(struct icaldurationtype d)</div><div class="ttdef"><b>Definition:</b> icalduration.c:211</div></div>
<div class="ttc" id="aicalduration_8h_html_a88157a8ae61263ea15af92a416889301"><div class="ttname"><a href="icalduration_8h.html#a88157a8ae61263ea15af92a416889301">icaldurationtype_from_int</a></div><div class="ttdeci">struct icaldurationtype icaldurationtype_from_int(int t)</div><div class="ttdoc">Creates a new icaldurationtype from a duration in seconds.</div><div class="ttdef"><b>Definition:</b> icalduration.c:32</div></div>
<div class="ttc" id="astructicaldurationtype_html"><div class="ttname"><a href="structicaldurationtype.html">icaldurationtype</a></div><div class="ttdoc">A struct representing a duration.</div><div class="ttdef"><b>Definition:</b> icalduration.h:37</div></div>
</div><!-- fragment --> </dd></dl>

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

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* icaldurationtype_as_ical_string_r </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a>&#160;</td>
          <td class="paramname"><em>d</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Converts an icaldurationtype into the iCal format as string. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">d</td><td>is the icaldurationtype to convert to iCal format </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A string representing duration <code>d</code> in iCal format </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="icalduration_8h.html#a7ebae580ab5bab4e9ffe822ff1dee9c8">icaldurationtype_as_ical_string()</a></dd></dl>
<dl class="section user"><dt>Ownership</dt><dd>The string returned by this function is owned by libical and must not be released by the caller of the function.</dd></dl>
<dl class="section user"><dt>Usage</dt><dd><div class="fragment"><div class="line"><span class="comment">// create new duration</span></div>
<div class="line"><span class="keyword">struct </span><a class="code" href="structicaldurationtype.html">icaldurationtype</a> duration;</div>
<div class="line">duration = <a class="code" href="icalduration_8h.html#a88157a8ae61263ea15af92a416889301">icaldurationtype_from_int</a>(3424224);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// print as ical-formatted string</span></div>
<div class="line">printf(<span class="stringliteral">&quot;%s\n&quot;</span>, <a class="code" href="icalduration_8h.html#a7ebae580ab5bab4e9ffe822ff1dee9c8">icaldurationtype_as_ical_string</a>(duration));</div>
</div><!-- fragment --> </dd></dl>

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

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int icaldurationtype_as_int </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a>&#160;</td>
          <td class="paramname"><em>duration</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Converts an <a class="el" href="structicaldurationtype.html" title="A struct representing a duration.">icaldurationtype</a> into the duration in seconds as <code>int</code>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">duration</td><td>The duration to convert to seconds </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>An <code>int</code> representing the duration in seconds</dd></dl>
<dl class="section user"><dt>Usage</dt><dd><div class="fragment"><div class="line"><span class="comment">// create icaldurationtype with given duration</span></div>
<div class="line"><span class="keyword">struct </span><a class="code" href="structicaldurationtype.html">icaldurationtype</a> duration;</div>
<div class="line">duration = <a class="code" href="icalduration_8h.html#a88157a8ae61263ea15af92a416889301">icaldurationtype_from_int</a>(3532342);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// get the duration in seconds and verify it</span></div>
<div class="line">assert(<a class="code" href="icalduration_8h.html#a1828c484b9efb3cb1f08ec5eb58c7a18">icaldurationtype_as_int</a>(duration) == 3532342);</div>
<div class="ttc" id="aicalduration_8h_html_a1828c484b9efb3cb1f08ec5eb58c7a18"><div class="ttname"><a href="icalduration_8h.html#a1828c484b9efb3cb1f08ec5eb58c7a18">icaldurationtype_as_int</a></div><div class="ttdeci">int icaldurationtype_as_int(struct icaldurationtype duration)</div><div class="ttdoc">Converts an icaldurationtype into the duration in seconds as int.</div><div class="ttdef"><b>Definition:</b> icalduration.c:270</div></div>
</div><!-- fragment --> </dd></dl>

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

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a> icaldurationtype_bad_duration </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 bad duration (used to indicate error). </p>
<dl class="section return"><dt>Returns</dt><dd>A bad duration </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="icalduration_8h.html#a88c5b90b57f9e1f79c00a544746687d6" title="Checks if a duration is a bad duration.">icaldurationtype_is_bad_duration()</a></dd></dl>
<dl class="section user"><dt>Usage</dt><dd><div class="fragment"><div class="line"><span class="comment">// create bad duration</span></div>
<div class="line"><span class="keyword">struct </span><a class="code" href="structicaldurationtype.html">icaldurationtype</a> duration;</div>
<div class="line">duration = <a class="code" href="icalduration_8h.html#a2578535a23fc5c6d4d61c09c880f03fd">icaldurationtype_bad_duration</a>();</div>
<div class="line"> </div>
<div class="line"><span class="comment">// make sure it&#39;s bad</span></div>
<div class="line">assert(<a class="code" href="icalduration_8h.html#a88c5b90b57f9e1f79c00a544746687d6">icaldurationtype_is_bad_duration</a>(duration));</div>
<div class="ttc" id="aicalduration_8h_html_a2578535a23fc5c6d4d61c09c880f03fd"><div class="ttname"><a href="icalduration_8h.html#a2578535a23fc5c6d4d61c09c880f03fd">icaldurationtype_bad_duration</a></div><div class="ttdeci">struct icaldurationtype icaldurationtype_bad_duration(void)</div><div class="ttdoc">Creates a bad duration (used to indicate error).</div><div class="ttdef"><b>Definition:</b> icalduration.c:304</div></div>
<div class="ttc" id="aicalduration_8h_html_a88c5b90b57f9e1f79c00a544746687d6"><div class="ttname"><a href="icalduration_8h.html#a88c5b90b57f9e1f79c00a544746687d6">icaldurationtype_is_bad_duration</a></div><div class="ttdeci">int icaldurationtype_is_bad_duration(struct icaldurationtype d)</div><div class="ttdoc">Checks if a duration is a bad duration.</div><div class="ttdef"><b>Definition:</b> icalduration.c:313</div></div>
</div><!-- fragment --> </dd></dl>

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

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a> icaldurationtype_from_int </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>t</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates a new <a class="el" href="structicaldurationtype.html" title="A struct representing a duration.">icaldurationtype</a> from a duration in seconds. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">t</td><td>The duration in seconds </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>An <a class="el" href="structicaldurationtype.html" title="A struct representing a duration.">icaldurationtype</a> representing the duration <em>t</em> in seconds</dd></dl>
<dl class="section user"><dt>Example</dt><dd><div class="fragment"><div class="line"><span class="comment">// create a new icaldurationtype with a duration of 60 seconds</span></div>
<div class="line"><span class="keyword">struct </span><a class="code" href="structicaldurationtype.html">icaldurationtype</a> duration;</div>
<div class="line">duration = <a class="code" href="icalduration_8h.html#a88157a8ae61263ea15af92a416889301">icaldurationtype_from_int</a>(60);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// verify that the duration is one minute</span></div>
<div class="line">assert(duration.minutes == 1);</div>
</div><!-- fragment --> </dd></dl>

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

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a> icaldurationtype_from_string </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>dur</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates a new <a class="el" href="structicaldurationtype.html" title="A struct representing a duration.">icaldurationtype</a> from a duration given as a string. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dur</td><td>The duration as a string </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>An <a class="el" href="structicaldurationtype.html" title="A struct representing a duration.">icaldurationtype</a> representing the duration <em>dur</em> </dd></dl>
<dl class="section user"><dt>Error handling</dt><dd>When given bad input, it 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#a601c122fcea522513b1b7732fa23e833a6ba07679ac440358c3090a351d27f0d8">ICAL_MALFORMEDDATA_ERROR</a> and returns <a class="el" href="icalduration_8h.html#a2578535a23fc5c6d4d61c09c880f03fd" title="Creates a bad duration (used to indicate error).">icaldurationtype_bad_duration()</a>.</dd></dl>
<dl class="section user"><dt>Usage</dt><dd><div class="fragment"><div class="line"><span class="comment">// create a new icaldurationtype</span></div>
<div class="line"><span class="keyword">struct </span><a class="code" href="structicaldurationtype.html">icaldurationtype</a> duration;</div>
<div class="line">duration = <a class="code" href="icalduration_8h.html#a0d6d8cc773e19242448eaffb1368fef4">icaldurationtype_from_string</a>(<span class="stringliteral">&quot;+PT05M&quot;</span>);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// verify that it&#39;s 5 minutes</span></div>
<div class="line">assert(duration.minutes == 5);</div>
<div class="ttc" id="aicalduration_8h_html_a0d6d8cc773e19242448eaffb1368fef4"><div class="ttname"><a href="icalduration_8h.html#a0d6d8cc773e19242448eaffb1368fef4">icaldurationtype_from_string</a></div><div class="ttdeci">struct icaldurationtype icaldurationtype_from_string(const char *dur)</div><div class="ttdoc">Creates a new icaldurationtype from a duration given as a string.</div><div class="ttdef"><b>Definition:</b> icalduration.c:62</div></div>
</div><!-- fragment --> </dd></dl>

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

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int icaldurationtype_is_bad_duration </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a>&#160;</td>
          <td class="paramname"><em>d</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Checks if a duration is a bad duration. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">d</td><td>The duration to check </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 if the duration is a bad duration, 0 otherwise </dd></dl>
<dl class="section see"><dt>See also</dt><dd>icalduration_bad_duration()</dd></dl>
<dl class="section user"><dt>Usage</dt><dd><div class="fragment"><div class="line"><span class="comment">// make bad duration</span></div>
<div class="line"><span class="keyword">struct </span><a class="code" href="structicaldurationtype.html">icaldurationtype</a> duration;</div>
<div class="line">duration = <a class="code" href="icalduration_8h.html#a2578535a23fc5c6d4d61c09c880f03fd">icaldurationtype_bad_duration</a>();</div>
<div class="line"> </div>
<div class="line"><span class="comment">// check bad duration</span></div>
<div class="line">assert(<a class="code" href="icalduration_8h.html#a88c5b90b57f9e1f79c00a544746687d6">icaldurationtype_is_bad_duration</a>(duration));</div>
</div><!-- fragment --> </dd></dl>

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

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int icaldurationtype_is_null_duration </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a>&#160;</td>
          <td class="paramname"><em>d</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Checks if a duration is a null duration. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">d</td><td>The duration to check </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 if the duration is a null duration, 0 otherwise </dd></dl>
<dl class="section see"><dt>See also</dt><dd>icalduration_null_duration()</dd></dl>
<dl class="section user"><dt>Usage</dt><dd><div class="fragment"><div class="line"><span class="comment">// make null duration</span></div>
<div class="line"><span class="keyword">struct </span><a class="code" href="structicaldurationtype.html">icaldurationtype</a> duration;</div>
<div class="line">duration = <a class="code" href="icalduration_8h.html#ad716774a6570e0be2eb11868deb86595">icaldurationtype_null_duration</a>();</div>
<div class="line"> </div>
<div class="line"><span class="comment">// check null duration</span></div>
<div class="line">assert(<a class="code" href="icalduration_8h.html#afcdeddc439488d8f586db0702593c270">icaldurationtype_is_null_duration</a>(duration));</div>
<div class="ttc" id="aicalduration_8h_html_ad716774a6570e0be2eb11868deb86595"><div class="ttname"><a href="icalduration_8h.html#ad716774a6570e0be2eb11868deb86595">icaldurationtype_null_duration</a></div><div class="ttdeci">struct icaldurationtype icaldurationtype_null_duration(void)</div><div class="ttdoc">Creates a duration with zero length.</div><div class="ttdef"><b>Definition:</b> icalduration.c:279</div></div>
<div class="ttc" id="aicalduration_8h_html_afcdeddc439488d8f586db0702593c270"><div class="ttname"><a href="icalduration_8h.html#afcdeddc439488d8f586db0702593c270">icaldurationtype_is_null_duration</a></div><div class="ttdeci">int icaldurationtype_is_null_duration(struct icaldurationtype d)</div><div class="ttdoc">Checks if a duration is a null duration.</div><div class="ttdef"><b>Definition:</b> icalduration.c:288</div></div>
</div><!-- fragment --> </dd></dl>

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

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a> icaldurationtype_null_duration </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 duration with zero length. </p>
<dl class="section return"><dt>Returns</dt><dd>An <a class="el" href="structicaldurationtype.html" title="A struct representing a duration.">icaldurationtype</a> with a zero length </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="icalduration_8h.html#afcdeddc439488d8f586db0702593c270" title="Checks if a duration is a null duration.">icaldurationtype_is_null_duration()</a></dd></dl>
<dl class="section user"><dt>Usage</dt><dd><div class="fragment"><div class="line"><span class="comment">// create null duration</span></div>
<div class="line"><span class="keyword">struct </span><a class="code" href="structicaldurationtype.html">icaldurationtype</a> duration;</div>
<div class="line">duration = <a class="code" href="icalduration_8h.html#ad716774a6570e0be2eb11868deb86595">icaldurationtype_null_duration</a>();</div>
<div class="line"> </div>
<div class="line"><span class="comment">// make sure it&#39;s zero length</span></div>
<div class="line">assert(duration.days     == 0);</div>
<div class="line">assert(duration.weeks    == 0);</div>
<div class="line">assert(duration.hours    == 0);</div>
<div class="line">assert(duration.minutes  == 0);</div>
<div class="line">assert(duration.seconds  == 0);</div>
<div class="line">assert(icalduration_is_null_duration(duration));</div>
<div class="line">assert(icalduration_as_int(duration) == 0);</div>
</div><!-- fragment --> </dd></dl>

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

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structicaltimetype.html">icaltimetype</a> icaltime_add </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structicaltimetype.html">icaltimetype</a>&#160;</td>
          <td class="paramname"><em>t</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a>&#160;</td>
          <td class="paramname"><em>d</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Adds a duration to an icaltime object and returns the result. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">t</td><td>The time object to add the duration to </td></tr>
    <tr><td class="paramname">d</td><td>The duration to add to the time object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The new <a class="el" href="structicaltimetype.html">icaltimetype</a> which has been added the duration to</dd></dl>
<dl class="section user"><dt>Example</dt><dd><div class="fragment"><div class="line"><span class="keyword">struct </span><a class="code" href="structicaltimetype.html">icaltimetype</a> time;</div>
<div class="line"><span class="keyword">struct </span><a class="code" href="structicaldurationtype.html">icaldurationtype</a> duration;</div>
<div class="line"> </div>
<div class="line"><span class="comment">// create time and duration objects</span></div>
<div class="line">time = <a class="code" href="icaltime_8h.html#a78f4440633835d80c182488b11df9372">icaltime_today</a>();</div>
<div class="line">duration = <a class="code" href="icalduration_8h.html#a88157a8ae61263ea15af92a416889301">icaldurationtype_from_int</a>(60);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// add the duration to the time object</span></div>
<div class="line">time = <a class="code" href="icalduration_8h.html#aacc4e7db2c4b8dd96fd428edee73acf5">icaltime_add</a>(time, duration);</div>
<div class="ttc" id="aicalduration_8h_html_aacc4e7db2c4b8dd96fd428edee73acf5"><div class="ttname"><a href="icalduration_8h.html#aacc4e7db2c4b8dd96fd428edee73acf5">icaltime_add</a></div><div class="ttdeci">struct icaltimetype icaltime_add(struct icaltimetype t, struct icaldurationtype d)</div><div class="ttdoc">Adds a duration to an icaltime object and returns the result.</div><div class="ttdef"><b>Definition:</b> icalduration.c:318</div></div>
<div class="ttc" id="aicaltime_8h_html_a78f4440633835d80c182488b11df9372"><div class="ttname"><a href="icaltime_8h.html#a78f4440633835d80c182488b11df9372">icaltime_today</a></div><div class="ttdeci">struct icaltimetype icaltime_today(void)</div><div class="ttdoc">Convenience constructor.</div><div class="ttdef"><b>Definition:</b> icaltime.c:232</div></div>
<div class="ttc" id="astructicaltimetype_html"><div class="ttname"><a href="structicaltimetype.html">icaltimetype</a></div><div class="ttdef"><b>Definition:</b> icaltime.h:105</div></div>
</div><!-- fragment --> </dd></dl>

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

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct <a class="el" href="structicaldurationtype.html">icaldurationtype</a> icaltime_subtract </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="structicaltimetype.html">icaltimetype</a>&#160;</td>
          <td class="paramname"><em>t1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct <a class="el" href="structicaltimetype.html">icaltimetype</a>&#160;</td>
          <td class="paramname"><em>t2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the difference between two <a class="el" href="structicaltimetype.html">icaltimetype</a> as a duration. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">t1</td><td>The first point in time </td></tr>
    <tr><td class="paramname">t2</td><td>The second point in time </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>An <a class="el" href="structicaldurationtype.html" title="A struct representing a duration.">icaldurationtype</a> representing the duration the elapsed between <em>t1</em> and <em>t2</em> </dd></dl>
<dl class="section user"><dt>Usage</dt><dd><div class="fragment"><div class="line"><span class="keyword">struct </span><a class="code" href="structicaltimetype.html">icaltimetype</a> t1 = <a class="code" href="icaltime_8h.html#a2915233b392cc2a68aa5a9acf39e2307">icaltime_from_day_of_year</a>(111, 2018);</div>
<div class="line"><span class="keyword">struct </span><a class="code" href="structicaltimetype.html">icaltimetype</a> t2 = <a class="code" href="icaltime_8h.html#a2915233b392cc2a68aa5a9acf39e2307">icaltime_from_day_of_year</a>(112, 2018);</div>
<div class="line"><span class="keyword">struct </span><a class="code" href="structicaldurationtype.html">icaldurationtype</a> duration;</div>
<div class="line"> </div>
<div class="line"><span class="comment">// calculate duration between time points</span></div>
<div class="line">duration = <a class="code" href="icalduration_8h.html#aaafcb16e5d2aaa6eb0e20fdac419fc0d">icaltime_subtract</a>(t1, t2);</div>
<div class="ttc" id="aicalduration_8h_html_aaafcb16e5d2aaa6eb0e20fdac419fc0d"><div class="ttname"><a href="icalduration_8h.html#aaafcb16e5d2aaa6eb0e20fdac419fc0d">icaltime_subtract</a></div><div class="ttdeci">struct icaldurationtype icaltime_subtract(struct icaltimetype t1, struct icaltimetype t2)</div><div class="ttdoc">Returns the difference between two icaltimetype as a duration.</div><div class="ttdef"><b>Definition:</b> icalduration.c:339</div></div>
<div class="ttc" id="aicaltime_8h_html_a2915233b392cc2a68aa5a9acf39e2307"><div class="ttname"><a href="icaltime_8h.html#a2915233b392cc2a68aa5a9acf39e2307">icaltime_from_day_of_year</a></div><div class="ttdeci">struct icaltimetype icaltime_from_day_of_year(const int doy, const int year)</div><div class="ttdoc">Constructor.</div><div class="ttdef"><b>Definition:</b> icaltime.c:535</div></div>
</div><!-- fragment --> </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Oct 6 2022 14:47:01 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.1
</small></address>
</body>
</html>