Libical API Documentation 4.0 UNRELEASED Go to the stable 3.0 documentation
Loading...
Searching...
No Matches
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 "icalmemory.h"
22
23vcardstrarray *vcardtextlist_new_from_string(const char *str, char sep)
24{
25 icalerror_check_arg_rz(str != 0, "str");
26 icalerror_check_arg_rz(sep != 0, "sep");
27
28 vcardstrarray *array = vcardstrarray_new(2);
29 const char sep_str[2] = {sep, 0};
30
31 do {
32 char *dequoted_str = vcardvalue_strdup_and_dequote_text(&str, sep_str);
33 vcardstrarray_append(array, dequoted_str);
34 icalmemory_free_buffer(dequoted_str);
35 } while (*str++ != '\0');
36
37 return array;
38}
void icalmemory_free_buffer(void *buf)
Releases a buffer.
Definition icalmemory.c:353
Common memory management routines.
Defines functions for creating vCard text lists.
Defines the data structure representing vCard values.