diff options
Diffstat (limited to 'src/libicalss/icalcluster.c')
-rw-r--r-- | src/libicalss/icalcluster.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/src/libicalss/icalcluster.c b/src/libicalss/icalcluster.c index 06597fbb..27861fe8 100644 --- a/src/libicalss/icalcluster.c +++ b/src/libicalss/icalcluster.c @@ -2,18 +2,10 @@ FILE: icalcluster.c CREATOR: acampi 13 March 2002 - Copyright (C) 2002 Andrea Campi <a.campi@inet.it> + SPDX-FileCopyrightText: 2002 Andrea Campi <a.campi@inet.it> - This library is free software; you can redistribute it and/or modify - it under the terms of either: + SPDX-License-Identifier: LGPL-2.1-only OR MPL-2.0 - The LGPL as published by the Free Software Foundation, version - 2.1, available at: https://www.gnu.org/licenses/lgpl-2.1.html - - Or: - - The Mozilla Public License Version 2.0. You may obtain a copy of - the License at https://www.mozilla.org/MPL/ ======================================================================*/ /** @@ -51,12 +43,6 @@ static icalcluster *icalcluster_new_impl(void) return impl; } -/** - * @brief Create a cluster with a key/value pair. - * - * @todo Always do a deep copy. - */ - icalcluster *icalcluster_new(const char *key, icalcomponent *data) { struct icalcluster_impl *impl = icalcluster_new_impl(); @@ -72,7 +58,7 @@ icalcluster *icalcluster_new(const char *key, icalcomponent *data) impl->data = icalcomponent_new(ICAL_XROOT_COMPONENT); icalcomponent_add_component(impl->data, data); } else { - impl->data = icalcomponent_new_clone(data); + impl->data = icalcomponent_clone(data); } } else { impl->data = icalcomponent_new(ICAL_XROOT_COMPONENT); @@ -85,18 +71,23 @@ icalcluster *icalcluster_new(const char *key, icalcomponent *data) * @brief Deep clone an icalcluster to a new one */ -icalcluster *icalcluster_new_clone(const icalcluster *data) +icalcluster *icalcluster_clone(const icalcluster *data) { struct icalcluster_impl *old = (struct icalcluster_impl *)data; struct icalcluster_impl *impl = icalcluster_new_impl(); impl->key = strdup(old->key); - impl->data = icalcomponent_new_clone(old->data); + impl->data = icalcomponent_clone(old->data); impl->changed = 0; return impl; } +icalcluster *icalcluster_new_clone(const icalcluster *data) +{ + return icalcluster_clone(data); +} + void icalcluster_free(icalcluster *impl) { icalerror_check_arg_rv((impl != 0), "cluster"); |