Libical API Documentation
4.0 STABLE VERSION
[Visit the v3.0 documentation]
Toggle main menu visibility
Loading...
Searching...
No Matches
src
libicalvcard
vcardtextlist.c
Go to the documentation of this file.
1
/*======================================================================
2
FILE: vcardtextlist.c
3
CREATOR: Robert Stepanek 1 Feb 2026
4
5
SPDX-FileCopyrightText: 2026, Fastmail Pty. Ltd. (https://fastmail.com)
6
SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0
7
======================================================================*/
8
13
14
#ifdef HAVE_CONFIG_H
15
#include <config.h>
16
#endif
17
18
#include "
vcardtextlist.h
"
19
#include "
vcardvalue.h
"
20
#include "icalerror_p.h"
21
#include "
icallimits.h
"
22
#include "
icalmemory.h
"
23
24
vcardstrarray
*
vcardtextlist_new_from_string
(
const
char
*str,
char
sep)
25
{
26
icalerror_check_arg_rz(str != 0,
"str"
);
27
icalerror_check_arg_rz(sep != 0,
"sep"
);
28
29
vcardstrarray
*array =
vcardstrarray_new
(2);
30
const
char
sep_str[2] = {sep, 0};
31
32
size_t
cnt = 0;
33
const
size_t
max_list_length =
icallimit_get
(
ICAL_LIMIT_PROPERTIES
);
//TODO 4.1 add separate limit for vCard text list length
34
do
{
35
char
*dequoted_str =
vcardvalue_strdup_and_dequote_text
(&str, sep_str);
36
vcardstrarray_append
(array, dequoted_str);
37
icalmemory_free_buffer
(dequoted_str);
38
}
while
(*str++ !=
'\0'
&& cnt++ < max_list_length);
39
40
return
array;
41
}
icallimit_get
size_t icallimit_get(icallimits_kind kind)
Definition
icallimits.c:29
icallimits.h
Defines the interface for getting/setting internal library limits.
ICAL_LIMIT_PROPERTIES
@ ICAL_LIMIT_PROPERTIES
Definition
icallimits.h:30
icalmemory_free_buffer
void icalmemory_free_buffer(void *buf)
Releases a buffer.
Definition
icalmemory.c:355
icalmemory.h
Common memory management routines.
vcardstrarray_new
#define vcardstrarray_new(increment_size)
Definition
vcardstrarray.h:22
vcardstrarray_append
#define vcardstrarray_append(array, elem)
Definition
vcardstrarray.h:34
vcardstrarray
icalstrarray vcardstrarray
Definition
vcardstrarray.h:20
vcardtextlist_new_from_string
vcardstrarray * vcardtextlist_new_from_string(const char *str, char sep)
Definition
vcardtextlist.c:24
vcardtextlist.h
Defines functions for creating vCard text lists.
vcardvalue_strdup_and_dequote_text
char * vcardvalue_strdup_and_dequote_text(const char **str, const char *sep)
Definition
vcardvalue.c:141
vcardvalue.h
Defines the data structure representing vCard values.
Generated on
for Libical API Documentation by
1.18.0