summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.krazy2
-rw-r--r--ReleaseNotes.txt19
-rw-r--r--config.h.cmake15
-rw-r--r--doc/Doxyfile.cmake3
-rw-r--r--doc/UsingLibical.md15
-rw-r--r--doc/UsingLibical.txt14
-rw-r--r--examples/access_properties_and_parameters.c2
-rw-r--r--src/Net-ICal-Libical/lib/Net/ICal/Libical/Time.pm2
-rw-r--r--src/Net-ICal-Libical/netical.i2
-rw-r--r--src/Net-ICal-Libical/netical_wrap.c11
-rw-r--r--src/Net-ICal-Libical/netical_wrap.doc2
-rw-r--r--src/libical-glib/api/i-cal-component.xml4
-rw-r--r--src/libical-glib/api/i-cal-parameter.xml4
-rw-r--r--src/libical-glib/api/i-cal-property.xml4
-rw-r--r--src/libical-glib/api/i-cal-value.xml2
-rw-r--r--src/libical/CMakeLists.txt1
-rw-r--r--src/libical/astime.h6
-rw-r--r--src/libical/icalcomponent.c11
-rw-r--r--src/libical/icalcomponent.h23
-rw-r--r--src/libical/icalparameter.c7
-rw-r--r--src/libical/icalparameter.h19
-rw-r--r--src/libical/icalparameter_cxx.cpp4
-rw-r--r--src/libical/icalparser.c2
-rw-r--r--src/libical/icalproperty.c11
-rw-r--r--src/libical/icalproperty.h14
-rw-r--r--src/libical/icalproperty_cxx.cpp4
-rw-r--r--src/libical/icalvalue.c7
-rw-r--r--src/libical/icalvalue.h14
-rw-r--r--src/libical/icalvalue_cxx.cpp4
-rw-r--r--src/libical/libical_deprecated.h19
-rw-r--r--src/libical/vcomponent_cxx.cpp4
-rw-r--r--src/libicalss/icalclassify.c2
-rw-r--r--src/libicalss/icalcluster.c16
-rw-r--r--src/libicalss/icalcluster.h15
-rw-r--r--src/libicalss/icalfileset.c2
-rw-r--r--src/libicalss/icalmessage.c6
-rw-r--r--src/test/copycluster.c2
-rw-r--r--src/test/process.c4
-rw-r--r--src/test/regression-storage.c8
-rw-r--r--src/test/regression.c34
-rw-r--r--src/test/stow.c8
41 files changed, 227 insertions, 121 deletions
diff --git a/.krazy b/.krazy
index fb370667..04647656 100644
--- a/.krazy
+++ b/.krazy
@@ -7,6 +7,8 @@ EXTRA style
#Skip foo_export.h
SKIP libical_.*_export\.h
+#Skip installed macro headers
+SKIP libical_deprecated\.h
#Skip examples
SKIP /examples/
diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt
index a9a5f277..8577ade0 100644
--- a/ReleaseNotes.txt
+++ b/ReleaseNotes.txt
@@ -4,16 +4,27 @@ Release Highlights
Version 3.1.0 (NOT RELEASED YET):
--------------------------------
* Requires CMake v3.11.0 or higher
+ * All ical*_new_clone() functions have been deprecated in favour of ical*_clone()
* New publicly available functions:
+ icalrecurrencetype_encode_day
+ icalrecurrencetype_encode_month
+ icaltzutil_set_zone_directory
+ + icalcomponent_clone
+ + icalproperty_clone
+ + icalparameter_clone
+ + icalvalue_clone
+ + icalcluster_clone
* icaltzutil_get_zone_directory() can use the TZDIR environment to find system zoneinfo
* Deprecated functions:
- + caldat
- + juldat
+ + caldat (replaced by internal function icaldat_int())
+ + juldat (replaced by internal function juldat_int())
+ + icalcomponent_new_clone
+ + icalproperty_new_clone
+ + icalparameter_new_clone
+ + icalvalue_new_clone
+ + icalcluster_new_clone
* Removed unused declarations:
- (in the public headers but not used at all)
+ (were in the public headers but not used at all)
+ struct icaltimezonetype
+ struct icaltimezonephase
* Improved performance of recurrence iterators
@@ -30,7 +41,7 @@ Version 3.0.5 (14 May 2019):
including <libical-glib/libical-glib.h> to be able to use it.
* Built-in timezones updated to tzdata2019a
* De-fuzzifications and Coverity fixes
-
+
Version 3.0.4 (14 Aug 2018):
----------------------------
* Silently fail RSCALE recurrence clauses when RSCALE is disabled
diff --git a/config.h.cmake b/config.h.cmake
index 77a1ae11..8fd3421b 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -546,18 +546,3 @@ typedef ssize_t IO_SSIZE_T;
#define _unused(x) (void)x
#endif
#endif
-
-#/* Deprecated function macro */
-#if defined(NO_DEPRECATION_WARNINGS)
-#define _deprecated(x) x
-#else
-#if !defined(_deprecated)
-#ifdef __GNUC__
-#define _deprecated(x) x __attribute__((deprecated))
-#elif defined(_MSC_VER)
-#define _deprecated(x) __declspec(deprecated) x
-#else
-#define _deprecated(x) x
-#endif
-#endif
-#endif
diff --git a/doc/Doxyfile.cmake b/doc/Doxyfile.cmake
index 54981ef1..6e2d5e39 100644
--- a/doc/Doxyfile.cmake
+++ b/doc/Doxyfile.cmake
@@ -160,7 +160,8 @@ PREDEFINED = LIBICAL_ICAL_EXPORT="" \
LIBICAL_VCAL_EXPORT="" \
LIBICAL_ICAL_NO_EXPORT="" \
LIBICAL_ICALS_NO_EXPORT="" \
- LIBICAL_VCAL_NO_EXPORT=""
+ LIBICAL_VCAL_NO_EXPORT="" \
+ LIBICAL_DEPRECATED=
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
diff --git a/doc/UsingLibical.md b/doc/UsingLibical.md
index 5ef6457f..0655a3a9 100644
--- a/doc/UsingLibical.md
+++ b/doc/UsingLibical.md
@@ -1225,13 +1225,14 @@ caller owns and must free, and some of the memory is managed by the
library. Here is a summary of the memory rules.
1. If the function name has "new" in it (such as `icalcomponent_new()`,
- or `icalpropert_new_clone()`), the caller gets control
- of the memory.
-
-2. If you got the memory from a routine with new in it, you must
- call the corresponding `*_free()` routine to free the memory, for
- example use `icalcomponent_free()` to free objects created with
- `icalcomponent_new()`)
+ or `icalproperty_new_from_string()`), the caller gets control
+ of the memory. The caller also gets control over an object that is
+ cloned via a function that ends with "_clone" (like `icalcomponent_clone()`)
+
+2. If you got the memory from a routine with "clone" or "new" in it, you
+ must call the corresponding `*_free()` routine to free the memory,
+ for example use `icalcomponent_free()` to free objects created with
+ `icalcomponent_new()` or `icalcomponent_clone()`
3. If the function name has "add" in it, the caller is transferring
control of the memory to the routine, for example the function
diff --git a/doc/UsingLibical.txt b/doc/UsingLibical.txt
index ab409697..9eb73ce1 100644
--- a/doc/UsingLibical.txt
+++ b/doc/UsingLibical.txt
@@ -1146,12 +1146,14 @@ caller owns and must free, and some of the memory is managed by the
library. Here is a summary of the memory rules.
1) If the function name has "new" in it (such as icalcomponent_new(),
- or icalpropert_new_clone()), the caller gets control
- of the memory.
-
-2) If you got the memory from a routine with new in it, you must
- call the corresponding *_free routine to free the memory. ( Use
- icalcomponent_free() to free objects created with icalcomponent_new())
+ or icalproperty_new_from_string()), the caller gets control of the
+ memory. The caller also gets control over an object that is cloned via
+ a function that ends with "_clone" (like icalcomponent_clone())
+
+2) If you got the memory from a routine with "clone" or "new" in it, you
+ must call the corresponding *_free() routine to free the memory, for
+ example use icalcomponent_free() to free objects created with
+ icalcomponent_new() or icalcomponent_clone().
3) If the function name has "add" in it, the caller is transferring
control of the memory to the routine. ( icalproperty_add_parameter() )
diff --git a/examples/access_properties_and_parameters.c b/examples/access_properties_and_parameters.c
index d17d91c0..f36367d2 100644
--- a/examples/access_properties_and_parameters.c
+++ b/examples/access_properties_and_parameters.c
@@ -134,7 +134,7 @@ void test_properties()
free(str);
/* Make a copy of the property. Caller owns the memory */
- clone = icalproperty_new_clone(prop);
+ clone = icalproperty_clone(prop);
/* Get a reference to the value within the clone property */
value = icalproperty_get_value(clone);
diff --git a/src/Net-ICal-Libical/lib/Net/ICal/Libical/Time.pm b/src/Net-ICal-Libical/lib/Net/ICal/Libical/Time.pm
index cbae5f67..630219e5 100644
--- a/src/Net-ICal-Libical/lib/Net/ICal/Libical/Time.pm
+++ b/src/Net-ICal-Libical/lib/Net/ICal/Libical/Time.pm
@@ -144,7 +144,7 @@ sub clone {
bless( {%$self},ref($self));
- $self->{'ref'} = Net::ICal::Libical::icalproperty_new_clone($self->{'ref'});
+ $self->{'ref'} = Net::ICal::Libical::icalproperty_clone($self->{'ref'});
}
diff --git a/src/Net-ICal-Libical/netical.i b/src/Net-ICal-Libical/netical.i
index 6a6c6f1b..495c0724 100644
--- a/src/Net-ICal-Libical/netical.i
+++ b/src/Net-ICal-Libical/netical.i
@@ -40,7 +40,7 @@ icalcomponent* icalparser_parse_string(char* str);
icalcomponent* icalcomponent_new(icalcomponent_kind kind);
-icalcomponent* icalcomponent_new_clone(icalcomponent* component);
+icalcomponent* icalcomponent_clone(icalcomponent* component);
icalcomponent* icalcomponent_new_from_string(char* str);
char* icalcomponent_as_ical_string(icalcomponent* component);
diff --git a/src/Net-ICal-Libical/netical_wrap.c b/src/Net-ICal-Libical/netical_wrap.c
index 4fcb0925..667bd44f 100644
--- a/src/Net-ICal-Libical/netical_wrap.c
+++ b/src/Net-ICal-Libical/netical_wrap.c
@@ -515,7 +515,7 @@ XS(_wrap_icalcomponent_new) {
XSRETURN(argvi);
}
-XS(_wrap_icalcomponent_new_clone) {
+XS(_wrap_icalcomponent_clone) {
icalcomponent * _result;
icalcomponent * _arg0;
@@ -524,12 +524,12 @@ XS(_wrap_icalcomponent_new_clone) {
cv = cv;
if ((items < 1) || (items > 1))
- croak("Usage: icalcomponent_new_clone(component);");
+ croak("Usage: icalcomponent_clone(component);");
if (SWIG_GetPtr(ST(0),(void **) &_arg0,(char *) 0 )) {
- croak("Type error in argument 1 of icalcomponent_new_clone. Expected icalcomponentPtr.");
+ croak("Type error in argument 1 of icalcomponent_clone. Expected icalcomponentPtr.");
XSRETURN(1);
}
- _result = (icalcomponent *)icalcomponent_new_clone(_arg0);
+ _result = (icalcomponent *)icalcomponent_clone(_arg0);
ST(argvi) = sv_newmortal();
sv_setref_pv(ST(argvi++),"icalcomponentPtr", (void *) _result);
XSRETURN(argvi);
@@ -2901,7 +2901,8 @@ XS(boot_Net__ICal__Libical) {
newXS("Net::ICal::Libical::var_Net__ICal__Libical_init", _wrap_perl5_Net__ICal__Libical_var_init, file);
newXS("Net::ICal::Libical::icalparser_parse_string", _wrap_icalparser_parse_string, file);
newXS("Net::ICal::Libical::icalcomponent_new", _wrap_icalcomponent_new, file);
- newXS("Net::ICal::Libical::icalcomponent_new_clone", _wrap_icalcomponent_new_clone, file);
+ newXS("Net::ICal::Libical::icalcomponent_new_clone", _wrap_icalcomponent_clone, file);
+ newXS("Net::ICal::Libical::icalcomponent_clone", _wrap_icalcomponent_clone, file);
newXS("Net::ICal::Libical::icalcomponent_new_from_string", _wrap_icalcomponent_new_from_string, file);
newXS("Net::ICal::Libical::icalcomponent_as_ical_string", _wrap_icalcomponent_as_ical_string, file);
newXS("Net::ICal::Libical::icalcomponent_free", _wrap_icalcomponent_free, file);
diff --git a/src/Net-ICal-Libical/netical_wrap.doc b/src/Net-ICal-Libical/netical_wrap.doc
index 41616c00..d74e59ca 100644
--- a/src/Net-ICal-Libical/netical_wrap.doc
+++ b/src/Net-ICal-Libical/netical_wrap.doc
@@ -9,7 +9,7 @@ icalparser_parse_string(str);
icalcomponent_new(kind);
[ returns icalcomponent * ]
-icalcomponent_new_clone(component);
+icalcomponent_clone(component);
[ returns icalcomponent * ]
icalcomponent_new_from_string(str);
diff --git a/src/libical-glib/api/i-cal-component.xml b/src/libical-glib/api/i-cal-component.xml
index 1e104d59..ad4e360c 100644
--- a/src/libical-glib/api/i-cal-component.xml
+++ b/src/libical-glib/api/i-cal-component.xml
@@ -19,8 +19,8 @@
<returns type="ICalComponent *" annotation="transfer full" comment="The newly created #ICalComponent."/>
<comment xml:space="preserve">Create a new #ICalComponent with specific type.</comment>
</method>
- <method name="i_cal_component_clone" corresponds="icalcomponent_new_clone" kind="clone" since="1.0">
- <parameter type="ICalComponent *" name="component" comment="The #ICalComponent to be created."/>
+ <method name="i_cal_component_clone" corresponds="icalcomponent_clone" kind="clone" since="3.1">
+ <parameter type="const ICalComponent *" name="component" comment="The #ICalComponent to be created."/>
<returns type="ICalComponent *" annotation="transfer full" comment="The newly deeply cloned #ICalComponent."/>
<comment xml:space="preserve">Deeply clone a #ICalComponent.</comment>
</method>
diff --git a/src/libical-glib/api/i-cal-parameter.xml b/src/libical-glib/api/i-cal-parameter.xml
index 9f0ee414..951fdf31 100644
--- a/src/libical-glib/api/i-cal-parameter.xml
+++ b/src/libical-glib/api/i-cal-parameter.xml
@@ -19,8 +19,8 @@
<returns type="ICalParameter *" annotation="transfer full" comment="The newly created #ICalParameter." />
<comment xml:space="preserve">Create a new #ICalParameter according to the kind type</comment>
</method>
- <method name="i_cal_parameter_clone" corresponds="icalparameter_new_clone" kind="clone" since="1.0">
- <parameter type="ICalParameter *" name="p" annotation="in" comment="The #ICalParameter to be cloned"/>
+ <method name="i_cal_parameter_clone" corresponds="icalparameter_clone" kind="clone" since="3.1">
+ <parameter type="const ICalParameter *" name="p" annotation="in" comment="The #ICalParameter to be cloned"/>
<returns type="ICalParameter *" annotation="transfer full" comment="The newly created #ICalParameter with the same properties as the @p." />
<comment xml:space="preserve">Deep clone a #ICalParameter</comment>
</method>
diff --git a/src/libical-glib/api/i-cal-property.xml b/src/libical-glib/api/i-cal-property.xml
index 16845ae2..a1be7ac3 100644
--- a/src/libical-glib/api/i-cal-property.xml
+++ b/src/libical-glib/api/i-cal-property.xml
@@ -19,8 +19,8 @@
<returns type="ICalProperty *" annotation="transfer full" comment="The newly created #ICalProperty with the type @kind."/>
<comment xml:space="preserve">Create a #ICalProperty of the target type.</comment>
</method>
- <method name="i_cal_property_clone" corresponds="icalproperty_new_clone" kind="clone" since="1.0">
- <parameter type="ICalProperty *" name="prop" comment="The #ICalProperty to be cloned."/>
+ <method name="i_cal_property_clone" corresponds="icalproperty_clone" kind="clone" since="3.1">
+ <parameter type="const ICalProperty *" name="prop" comment="The #ICalProperty to be cloned."/>
<returns type="ICalProperty *" annotation="transfer full" comment="The newly created #ICalProperty deeply cloned from @prop."/>
<comment xml:space="preserve">Deeply clone a #ICalProperty.</comment>
</method>
diff --git a/src/libical-glib/api/i-cal-value.xml b/src/libical-glib/api/i-cal-value.xml
index 6320a961..ee0d31bb 100644
--- a/src/libical-glib/api/i-cal-value.xml
+++ b/src/libical-glib/api/i-cal-value.xml
@@ -19,7 +19,7 @@
<returns type="ICalValue *" annotation="transfer full" comment="The newly created #ICalValue."/>
<comment xml:space="preserve">Create a new #ICalValue with specific kind.</comment>
</method>
- <method name="i_cal_value_clone" corresponds="icalvalue_new_clone" kind="clone" since="1.0">
+ <method name="i_cal_value_clone" corresponds="icalvalue_clone" kind="clone" since="3.1">
<parameter type="const ICalValue *" name="value" comment="The #ICalValue to be cloned."/>
<returns type="ICalValue *" annotation="transfer full" comment="The newly created #ICalValue with the same property as @value."/>
<comment xml:space="preserve">Deeply clone a #ICalValue.</comment>
diff --git a/src/libical/CMakeLists.txt b/src/libical/CMakeLists.txt
index eadc995f..f5922f18 100644
--- a/src/libical/CMakeLists.txt
+++ b/src/libical/CMakeLists.txt
@@ -399,6 +399,7 @@ install(FILES
icaltimezone.h
icaltypes.h
icalvalue.h
+ libical_deprecated.h
libical_ical_export.h
pvl.h
sspm.h
diff --git a/src/libical/astime.h b/src/libical/astime.h
index 2b95d6d1..f7b8367a 100644
--- a/src/libical/astime.h
+++ b/src/libical/astime.h
@@ -67,8 +67,8 @@
#ifndef ICAL_ASTIME_H
#define ICAL_ASTIME_H
+#include "libical_deprecated.h"
#include "libical_ical_export.h"
-#include <config.h>
typedef struct ut_instant
{
@@ -91,12 +91,12 @@ typedef struct ut_instant
/** converts julian date to year,mo,da
* @deprecated use caldat_int() instead
*/
-LIBICAL_ICAL_EXPORT _deprecated(long caldat(UTinstantPtr));
+LIBICAL_ICAL_EXPORT LIBICAL_DEPRECATED(long caldat(UTinstantPtr));
/** returns julian day from year,mo,da
* @deprecated use juldat_int() instead
*/
-LIBICAL_ICAL_EXPORT _deprecated(double juldat(UTinstantPtr));
+LIBICAL_ICAL_EXPORT LIBICAL_DEPRECATED(double juldat(UTinstantPtr));
typedef struct ut_instant_int
{
diff --git a/src/libical/icalcomponent.c b/src/libical/icalcomponent.c
index 41c21239..15b4180c 100644
--- a/src/libical/icalcomponent.c
+++ b/src/libical/icalcomponent.c
@@ -145,7 +145,7 @@ icalcomponent *icalcomponent_new_from_string(const char *str)
/** @brief Constructor
*/
-icalcomponent *icalcomponent_new_clone(icalcomponent *old)
+icalcomponent *icalcomponent_clone(const icalcomponent *old)
{
icalcomponent *new;
icalproperty *p;
@@ -162,17 +162,22 @@ icalcomponent *icalcomponent_new_clone(icalcomponent *old)
for (itr = pvl_head(old->properties); itr != 0; itr = pvl_next(itr)) {
p = (icalproperty *) pvl_data(itr);
- icalcomponent_add_property(new, icalproperty_new_clone(p));
+ icalcomponent_add_property(new, icalproperty_clone(p));
}
for (itr = pvl_head(old->components); itr != 0; itr = pvl_next(itr)) {
c = (icalcomponent *) pvl_data(itr);
- icalcomponent_add_component(new, icalcomponent_new_clone(c));
+ icalcomponent_add_component(new, icalcomponent_clone(c));
}
return new;
}
+icalcomponent *icalcomponent_new_clone(icalcomponent *old)
+{
+ return icalcomponent_clone(old);
+}
+
/** @brief Constructor
*/
icalcomponent *icalcomponent_new_x(const char *x_name)
diff --git a/src/libical/icalcomponent.h b/src/libical/icalcomponent.h
index dbedf08e..7b3b4755 100644
--- a/src/libical/icalcomponent.h
+++ b/src/libical/icalcomponent.h
@@ -20,6 +20,7 @@
#ifndef ICALCOMPONENT_H
#define ICALCOMPONENT_H
+#include "libical_deprecated.h"
#include "libical_ical_export.h"
#include "icalenums.h" /* defines icalcomponent_kind */
#include "icalproperty.h"
@@ -36,9 +37,14 @@ typedef struct icalcompiter
} icalcompiter;
+/**
+ * Deeply clone an icalcomponent.
+ * Returns a pointer to the memory for the newly cloned icalcomponent.
+ * @since 3.1.0
+ */
LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new(icalcomponent_kind kind);
-LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_clone(icalcomponent *component);
+LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_clone(const icalcomponent *component);
LIBICAL_ICAL_EXPORT icalcomponent *icalcomponent_new_from_string(const char *str);
@@ -58,9 +64,14 @@ LIBICAL_ICAL_EXPORT icalcomponent_kind icalcomponent_isa(const icalcomponent *co
LIBICAL_ICAL_EXPORT int icalcomponent_isa_component(void *component);
-/*
- * Working with properties
+/**
+ * @copydoc icalcomponent_clone()
+ * @deprecated use icalcomponent_clone() instead
*/
+LIBICAL_ICAL_EXPORT LIBICAL_DEPRECATED(icalcomponent *icalcomponent_new_clone(
+ icalcomponent *component));
+
+/***** Working with Properties *****/
LIBICAL_ICAL_EXPORT void icalcomponent_add_property(icalcomponent *component,
icalproperty *property);
@@ -91,9 +102,7 @@ LIBICAL_ICAL_EXPORT icalproperty *icalcomponent_get_first_property(icalcomponent
LIBICAL_ICAL_EXPORT icalproperty *icalcomponent_get_next_property(icalcomponent *component,
icalproperty_kind kind);
-/*
- * Working with components
- */
+/***** Working with Components *****/
/* Return the first VEVENT, VTODO or VJOURNAL sub-component of cop, or
comp if it is one of those types */
@@ -141,7 +150,7 @@ LIBICAL_ICAL_EXPORT icalcomponent *icalcompiter_prior(icalcompiter * i);
LIBICAL_ICAL_EXPORT icalcomponent *icalcompiter_deref(icalcompiter * i);
-/* Working with embedded error properties */
+/***** Working with embedded error properties *****/
/* Check the component against itip rules and insert error properties*/
/* Working with embedded error properties */
diff --git a/src/libical/icalparameter.c b/src/libical/icalparameter.c
index 39a907cc..95dd88b4 100644
--- a/src/libical/icalparameter.c
+++ b/src/libical/icalparameter.c
@@ -82,7 +82,7 @@ void icalparameter_free(icalparameter *param)
free(param);
}
-icalparameter *icalparameter_new_clone(icalparameter *old)
+icalparameter *icalparameter_clone(const icalparameter *old)
{
struct icalparameter_impl *new;
@@ -117,6 +117,11 @@ icalparameter *icalparameter_new_clone(icalparameter *old)
return new;
}
+icalparameter *icalparameter_new_clone(icalparameter *old)
+{
+ return icalparameter_clone(old);
+}
+
icalparameter *icalparameter_new_from_string(const char *str)
{
char *eq;
diff --git a/src/libical/icalparameter.h b/src/libical/icalparameter.h
index d4e5d1ed..687c7d1c 100644
--- a/src/libical/icalparameter.h
+++ b/src/libical/icalparameter.h
@@ -27,6 +27,7 @@
#ifndef ICALPARAMETER_H
#define ICALPARAMETER_H
+#include "libical_deprecated.h"
#include "libical_ical_export.h"
#include "icalderivedparameter.h"
@@ -82,7 +83,7 @@ LIBICAL_ICAL_EXPORT icalparameter *icalparameter_new(icalparameter_kind kind);
* icalparameter *param = icalparameter_new_from_string("ROLE=CHAIR");
*
* // clone the parameter
- * icalparameter *clone = icalparameter_new_clone(param);
+ * icalparameter *clone = icalparameter_clone(param);
*
* if(clone) {
* // use clone ...
@@ -92,8 +93,15 @@ LIBICAL_ICAL_EXPORT icalparameter *icalparameter_new(icalparameter_kind kind);
* icalparameter_free(param);
* icalparameter_free(clone);
* ```
+ * @since 3.1.0
*/
-LIBICAL_ICAL_EXPORT icalparameter *icalparameter_new_clone(icalparameter *p);
+LIBICAL_ICAL_EXPORT icalparameter *icalparameter_clone(const icalparameter *p);
+
+/**
+ * @copydoc icalparameter_clone()
+ * @deprecated use icalparameter_clone() instead
+ */
+LIBICAL_ICAL_EXPORT LIBICAL_DEPRECATED(icalparameter *icalparameter_new_clone(icalparameter *p));
/**
* @brief Create ::icalparameter object from string
@@ -158,9 +166,10 @@ LIBICAL_ICAL_EXPORT icalparameter *icalparameter_new_from_value_string(icalparam
* @param parameter The icalparameter to free
*
* This method needs to be used on all parameter objects returned
- * from any of the `_new()` methods including icalparameter_new(), icalparameter_new_clone(),
- * icalparameter_new_from_string() and icalparameter_new_from_value_string(),
- * when they are not needed anymore and to be released.
+ * from any of the `_new()` methods including icalparameter_new(),
+ * icalparameter_new_from_string() and icalparameter_new_from_value_string()
+ * and on cloned parameter objects returned by icalparameter_clone()
+ * when these object are not needed anymore and to be released.
*
* ### Usage
* ```c
diff --git a/src/libical/icalparameter_cxx.cpp b/src/libical/icalparameter_cxx.cpp
index c672d9da..0f6e69d1 100644
--- a/src/libical/icalparameter_cxx.cpp
+++ b/src/libical/icalparameter_cxx.cpp
@@ -24,7 +24,7 @@ ICalParameter::ICalParameter() : imp(icalparameter_new(ICAL_ANY_PARAMETER))
{
}
-ICalParameter::ICalParameter(const ICalParameter &v) : imp(icalparameter_new_clone(v.imp))
+ICalParameter::ICalParameter(const ICalParameter &v) : imp(icalparameter_clone(v.imp))
{
if (imp == NULL) {
throw icalerrno;
@@ -39,7 +39,7 @@ ICalParameter &ICalParameter::operator=(const ICalParameter &v)
if (imp != NULL) {
icalparameter_free(imp);
- imp = icalparameter_new_clone(v.imp);
+ imp = icalparameter_clone(v.imp);
if (imp == NULL) {
throw icalerrno;
}
diff --git a/src/libical/icalparser.c b/src/libical/icalparser.c
index fa71e8bd..0dd913ff 100644
--- a/src/libical/icalparser.c
+++ b/src/libical/icalparser.c
@@ -1146,7 +1146,7 @@ icalcomponent *icalparser_add_line(icalparser *parser, char *line)
if (vcount > 0) {
/* Actually, only clone after the second value */
- icalproperty *clone = icalproperty_new_clone(prop);
+ icalproperty *clone = icalproperty_clone(prop);
icalcomponent *tail = pvl_data(pvl_tail(parser->components));
icalcomponent_add_property(tail, clone);
diff --git a/src/libical/icalproperty.c b/src/libical/icalproperty.c
index 64b50268..b84867a9 100644
--- a/src/libical/icalproperty.c
+++ b/src/libical/icalproperty.c
@@ -92,7 +92,7 @@ icalproperty *icalproperty_new(icalproperty_kind kind)
return (icalproperty *) icalproperty_new_impl(kind);
}
-icalproperty *icalproperty_new_clone(icalproperty *old)
+icalproperty *icalproperty_clone(const icalproperty *old)
{
icalproperty *new;
pvl_elem p;
@@ -102,7 +102,7 @@ icalproperty *icalproperty_new_clone(icalproperty *old)
icalerror_check_arg_rz((new != 0), "new");
if (old->value != 0) {
- new->value = icalvalue_new_clone(old->value);
+ new->value = icalvalue_clone(old->value);
}
if (old->x_name != 0) {
@@ -117,7 +117,7 @@ icalproperty *icalproperty_new_clone(icalproperty *old)
}
for (p = pvl_head(old->parameters); p != 0; p = pvl_next(p)) {
- icalparameter *param = icalparameter_new_clone(pvl_data(p));
+ icalparameter *param = icalparameter_clone(pvl_data(p));
if (param == 0) {
icalproperty_free(new);
@@ -131,6 +131,11 @@ icalproperty *icalproperty_new_clone(icalproperty *old)
return new;
}
+icalproperty *icalproperty_new_clone(icalproperty *old)
+{
+ return icalproperty_clone(old);
+}
+
icalproperty *icalproperty_new_from_string(const char *str)
{
size_t buf_size = 1024;
diff --git a/src/libical/icalproperty.h b/src/libical/icalproperty.h
index 70daba98..210b0c81 100644
--- a/src/libical/icalproperty.h
+++ b/src/libical/icalproperty.h
@@ -20,6 +20,7 @@
#ifndef ICALPROPERTY_H
#define ICALPROPERTY_H
+#include "libical_deprecated.h"
#include "libical_ical_export.h"
#include "icalderivedproperty.h" /* To get icalproperty_kind enumerations */
@@ -29,7 +30,12 @@ LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new(icalproperty_kind kind);
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_impl(icalproperty_kind kind);
-LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_clone(icalproperty *prop);
+/**
+ * Deeply clone an icalproperty.
+ * Returns a pointer to the memory for the newly cloned icalproperty.
+ * @since 3.1.0
+ */
+LIBICAL_ICAL_EXPORT icalproperty *icalproperty_clone(const icalproperty *prop);
LIBICAL_ICAL_EXPORT icalproperty *icalproperty_new_from_string(const char *str);
@@ -147,4 +153,10 @@ LIBICAL_ICAL_EXPORT int icalproperty_enum_belongs_to_property(icalproperty_kind
*/
LIBICAL_ICAL_EXPORT void icalproperty_normalize(icalproperty *prop);
+/**
+ * @copydoc icalproperty_clone()
+ * @deprecated use icalproperty_clone() instead
+ */
+LIBICAL_ICAL_EXPORT LIBICAL_DEPRECATED(icalproperty *icalproperty_new_clone(icalproperty *prop));
+
#endif /*ICALPROPERTY_H */
diff --git a/src/libical/icalproperty_cxx.cpp b/src/libical/icalproperty_cxx.cpp
index 16cedf47..58d81fe9 100644
--- a/src/libical/icalproperty_cxx.cpp
+++ b/src/libical/icalproperty_cxx.cpp
@@ -26,7 +26,7 @@ ICalProperty::ICalProperty() : imp(icalproperty_new(ICAL_ANY_PROPERTY))
{
}
-ICalProperty::ICalProperty(const ICalProperty &v) : imp(icalproperty_new_clone(v.imp))
+ICalProperty::ICalProperty(const ICalProperty &v) : imp(icalproperty_clone(v.imp))
{
if (imp == NULL) {
throw icalerrno;
@@ -41,7 +41,7 @@ ICalProperty &ICalProperty::operator=(const ICalProperty &v)
if (imp != NULL) {
icalproperty_free(imp);
- imp = icalproperty_new_clone(v.imp);
+ imp = icalproperty_clone(v.imp);
if (imp == NULL) {
throw icalerrno;
}
diff --git a/src/libical/icalvalue.c b/src/libical/icalvalue.c
index 44541498..976a0f9d 100644
--- a/src/libical/icalvalue.c
+++ b/src/libical/icalvalue.c
@@ -64,7 +64,7 @@ icalvalue *icalvalue_new(icalvalue_kind kind)
return (icalvalue *) icalvalue_new_impl(kind);
}
-icalvalue *icalvalue_new_clone(const icalvalue *old)
+icalvalue *icalvalue_clone(const icalvalue *old)
{
struct icalvalue_impl *new;
@@ -167,6 +167,11 @@ icalvalue *icalvalue_new_clone(const icalvalue *old)
return new;
}
+icalvalue *icalvalue_new_clone(const icalvalue *old)
+{
+ return icalvalue_clone(old);
+}
+
static char *icalmemory_strdup_and_dequote(const char *str)
{
const char *p;
diff --git a/src/libical/icalvalue.h b/src/libical/icalvalue.h
index 4060b047..c7470cfb 100644
--- a/src/libical/icalvalue.h
+++ b/src/libical/icalvalue.h
@@ -20,15 +20,21 @@
#ifndef ICALVALUE_H
#define ICALVALUE_H
+#include "libical_deprecated.h"
#include "libical_ical_export.h"
#include "icalvalueimpl.h"
#define ICAL_BOOLEAN_TRUE 1
#define ICAL_BOOLEAN_FALSE 0
+/**
+ * Deeply clone an icalvalue.
+ * Returns a pointer to the memory for the newly cloned icalvalue.
+ * @since 3.1.0
+ */
LIBICAL_ICAL_EXPORT icalvalue *icalvalue_new(icalvalue_kind kind);
-LIBICAL_ICAL_EXPORT icalvalue *icalvalue_new_clone(const icalvalue *value);
+LIBICAL_ICAL_EXPORT icalvalue *icalvalue_clone(const icalvalue *value);
LIBICAL_ICAL_EXPORT icalvalue *icalvalue_new_from_string(icalvalue_kind kind, const char *str);
@@ -47,6 +53,12 @@ LIBICAL_ICAL_EXPORT int icalvalue_isa_value(void *);
LIBICAL_ICAL_EXPORT icalparameter_xliccomparetype icalvalue_compare(const icalvalue *a,
const icalvalue *b);
+/**
+ * @copydoc icalvalue_clone()
+ * @deprecated use icalvalue_clone() instead
+ */
+LIBICAL_ICAL_EXPORT LIBICAL_DEPRECATED(icalvalue *icalvalue_new_clone(const icalvalue *value));
+
/* Special, non autogenerated value accessors */
/* Defined in icalderivedvalue.h */
diff --git a/src/libical/icalvalue_cxx.cpp b/src/libical/icalvalue_cxx.cpp
index 3575fc2f..e04b7fb3 100644
--- a/src/libical/icalvalue_cxx.cpp
+++ b/src/libical/icalvalue_cxx.cpp
@@ -26,7 +26,7 @@ ICalValue::ICalValue() : imp(icalvalue_new(ICAL_ANY_VALUE))
{
}
-ICalValue::ICalValue(const ICalValue &v) : imp(icalvalue_new_clone(v.imp))
+ICalValue::ICalValue(const ICalValue &v) : imp(icalvalue_clone(v.imp))
{
if (imp == NULL) {
throw icalerrno;
@@ -41,7 +41,7 @@ ICalValue &ICalValue::operator=(const ICalValue &v)
if (imp != NULL) {
icalvalue_free(imp);
- imp = icalvalue_new_clone(v.imp);
+ imp = icalvalue_clone(v.imp);
if (imp == NULL) {
throw icalerrno;
}
diff --git a/src/libical/libical_deprecated.h b/src/libical/libical_deprecated.h
new file mode 100644
index 00000000..d1fa9dad
--- /dev/null
+++ b/src/libical/libical_deprecated.h
@@ -0,0 +1,19 @@
+#ifndef LIBICAL_DEPRECATED_H
+#define LIBICAL_DEPRECATED_H
+
+/* Deprecated function macro */
+#if defined(NO_DEPRECATION_WARNINGS)
+#define LIBICAL_DEPRECATED(x) x
+#else
+#if !defined(LIBICAL_DEPRECATED)
+#ifdef __GNUC__
+#define LIBICAL_DEPRECATED(x) x __attribute__((deprecated))
+#elif defined(_MSC_VER)
+#define LIBICAL_DEPRECATED(x) __declspec(deprecated) x
+#else
+#define LIBICAL_DEPRECATED(x) x
+#endif
+#endif
+#endif
+
+#endif
diff --git a/src/libical/vcomponent_cxx.cpp b/src/libical/vcomponent_cxx.cpp
index 3c7860c4..857ead66 100644
--- a/src/libical/vcomponent_cxx.cpp
+++ b/src/libical/vcomponent_cxx.cpp
@@ -37,7 +37,7 @@ VComponent::VComponent() : imp(icalcomponent_new(ICAL_ANY_COMPONENT))
{
}
-VComponent::VComponent(const VComponent &v) : imp(icalcomponent_new_clone(v.imp))
+VComponent::VComponent(const VComponent &v) : imp(icalcomponent_clone(v.imp))
{
if (imp == NULL) {
throw icalerrno;
@@ -52,7 +52,7 @@ VComponent &VComponent::operator=(const VComponent &v)
if (imp != NULL) {
icalcomponent_free(imp);
- imp = icalcomponent_new_clone(v.imp);
+ imp = icalcomponent_clone(v.imp);
if (imp == NULL) {
throw icalerrno;
}
diff --git a/src/libicalss/icalclassify.c b/src/libicalss/icalclassify.c
index 17bce19d..f19b6cca 100644
--- a/src/libicalss/icalclassify.c
+++ b/src/libicalss/icalclassify.c
@@ -90,7 +90,7 @@ icalcomponent *icalclassify_find_overlaps(icalset *set, icalcomponent *comp)
if (compspan.start < span.end && compspan.end > span.start) {
- icalcomponent *clone = icalcomponent_new_clone(c);
+ icalcomponent *clone = icalcomponent_clone(c);
icalcomponent_add_component(return_set, clone);
}
diff --git a/src/libicalss/icalcluster.c b/src/libicalss/icalcluster.c
index a11046e4..a0824a50 100644
--- a/src/libicalss/icalcluster.c
+++ b/src/libicalss/icalcluster.c
@@ -56,7 +56,6 @@ static icalcluster *icalcluster_new_impl(void)
*
* @todo Always do a deep copy.
*/
-
icalcluster *icalcluster_new(const char *key, icalcomponent *data)
{
struct icalcluster_impl *impl = icalcluster_new_impl();
@@ -72,7 +71,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 +84,27 @@ icalcluster *icalcluster_new(const char *key, icalcomponent *data)
* 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;
}
+/**
+ * Deprecated function to clone a cluster
+ * @deprecated use ucalcluster_clone() instead
+ */
+icalcluster *icalcluster_new_clone(const icalcluster *data)
+{
+ return icalcluster_clone(data);
+}
+
void icalcluster_free(icalcluster *impl)
{
icalerror_check_arg_rv((impl != 0), "cluster");
diff --git a/src/libicalss/icalcluster.h b/src/libicalss/icalcluster.h
index 8116012b..fea99ef3 100644
--- a/src/libicalss/icalcluster.h
+++ b/src/libicalss/icalcluster.h
@@ -19,6 +19,7 @@
#ifndef ICALCLUSTER_H
#define ICALCLUSTER_H
+#include "libical_deprecated.h"
#include "libical_icalss_export.h"
#include "icalcomponent.h"
#include "icalerror.h"
@@ -27,7 +28,12 @@ typedef struct icalcluster_impl icalcluster;
LIBICAL_ICALSS_EXPORT icalcluster *icalcluster_new(const char *key, icalcomponent *data);
-LIBICAL_ICALSS_EXPORT icalcluster *icalcluster_new_clone(const icalcluster *cluster);
+/**
+ * Deeply clone an icalcluster.
+ * Returns a pointer to the memory for the newly cloned icalcluster.
+ * @since 3.1.0
+*/
+LIBICAL_ICALSS_EXPORT icalcluster *icalcluster_clone(const icalcluster *cluster);
LIBICAL_ICALSS_EXPORT void icalcluster_free(icalcluster *cluster);
@@ -56,4 +62,11 @@ LIBICAL_ICALSS_EXPORT icalcomponent *icalcluster_get_first_component(icalcluster
LIBICAL_ICALSS_EXPORT icalcomponent *icalcluster_get_next_component(icalcluster *cluster);
+/**
+ * @copydoc icalcluster_new()
+ * @deprecated use icalcluster_clone() instead
+ */
+LIBICAL_ICALSS_EXPORT LIBICAL_DEPRECATED(icalcluster *icalcluster_new_clone(
+ const icalcluster *cluster));
+
#endif /* !ICALCLUSTER_H */
diff --git a/src/libicalss/icalfileset.c b/src/libicalss/icalfileset.c
index b35b90bb..6eb4600a 100644
--- a/src/libicalss/icalfileset.c
+++ b/src/libicalss/icalfileset.c
@@ -113,7 +113,7 @@ icalset *icalfileset_init(icalset *set, const char *path, void *options_in)
}
if (options->cluster) {
- fset->cluster = icalcomponent_new_clone(icalcluster_get_component(options->cluster));
+ fset->cluster = icalcomponent_clone(icalcluster_get_component(options->cluster));
fset->changed = 1;
}
diff --git a/src/libicalss/icalmessage.c b/src/libicalss/icalmessage.c
index 4cd9e1d2..79d3cdde 100644
--- a/src/libicalss/icalmessage.c
+++ b/src/libicalss/icalmessage.c
@@ -100,7 +100,7 @@ static void icalmessage_copy_properties(icalcomponent *to, icalcomponent *from,
icalcomponent_add_property(
to_inner,
- icalproperty_new_clone(icalcomponent_get_first_property(from_inner, kind)));
+ icalproperty_clone(icalcomponent_get_first_property(from_inner, kind)));
}
static icalcomponent *icalmessage_new_reply_base(icalcomponent *c,
@@ -144,7 +144,7 @@ static icalcomponent *icalmessage_new_reply_base(icalcomponent *c,
return 0;
}
- icalcomponent_add_property(inner, icalproperty_new_clone(attendee));
+ icalcomponent_add_property(inner, icalproperty_clone(attendee));
/* Add PRODID and VERSION */
@@ -309,7 +309,7 @@ icalcomponent *icalmessage_new_error_reply(icalcomponent *c,
for (p = icalcomponent_get_first_property(cinner, ICAL_REQUESTSTATUS_PROPERTY);
p != 0;
p = icalcomponent_get_next_property(cinner, ICAL_REQUESTSTATUS_PROPERTY)) {
- icalcomponent_add_property(inner, icalproperty_new_clone(p));
+ icalcomponent_add_property(inner, icalproperty_clone(p));
}
}
diff --git a/src/test/copycluster.c b/src/test/copycluster.c
index 258c556f..b16a3c3c 100644
--- a/src/test/copycluster.c
+++ b/src/test/copycluster.c
@@ -104,7 +104,7 @@ int main(int c, char *argv[])
if (tostdout) {
printf("--------------\n%s\n", icalcomponent_as_ical_string(itr));
} else {
- (void)icalfileset_add_component(clusterout, icalcomponent_new_clone(itr));
+ (void)icalfileset_add_component(clusterout, icalcomponent_clone(itr));
}
count++;
}
diff --git a/src/test/process.c b/src/test/process.c
index f4734219..a5038b90 100644
--- a/src/test/process.c
+++ b/src/test/process.c
@@ -151,7 +151,7 @@ int main(int argc, char *argv[])
if (overlaps == 0) {
/* No overlaps, book the meeting */
-/* icalset_add_component(cal,icalcomponent_new_clone(c));*/
+/* icalset_add_component(cal,icalcomponent_clone(c));*/
/* Return a reply */
reply =
@@ -187,7 +187,7 @@ int main(int argc, char *argv[])
next_time =
icalspanlist_next_free_time(spanl, icalcomponent_get_dtstart(c));
- newc = icalcomponent_new_clone(c);
+ newc = icalcomponent_clone(c);
icalcomponent_set_dtstart(newc, next_time.start);
diff --git a/src/test/regression-storage.c b/src/test/regression-storage.c
index 6051e82a..1bc9a4dc 100644
--- a/src/test/regression-storage.c
+++ b/src/test/regression-storage.c
@@ -168,7 +168,7 @@ void test_fileset_extended(void)
start.month = month;
end.month = month;
- clone = icalcomponent_new_clone(c);
+ clone = icalcomponent_clone(c);
ok("Making clone of output file", (clone != 0));
assert(clone != 0);
@@ -349,7 +349,7 @@ void test_bdbset()
start.month = month;
end.month = month;
- clone = icalcomponent_new_clone(c);
+ clone = icalcomponent_clone(c);
assert(clone != 0);
event = icalcomponent_get_first_component(clone, ICAL_VEVENT_COMPONENT);
assert(event != 0);
@@ -670,7 +670,7 @@ void test_dirset_extended(void)
/* Change the dtstart and dtend times in the component
pointed to by Itr */
- (void)icalcomponent_new_clone(itr);
+ (void)icalcomponent_clone(itr);
inner = icalcomponent_get_first_component(itr, ICAL_VEVENT_COMPONENT);
ok("Duplicating component...", (icalerrno == ICAL_NO_ERROR) && (inner != 0));
@@ -710,7 +710,7 @@ void test_dirset_extended(void)
if (VERBOSE)
printf("\n----------\n%s\n---------\n", icalcomponent_as_ical_string(inner));
- error = icaldirset_add_component(s, icalcomponent_new_clone(itr));
+ error = icaldirset_add_component(s, icalcomponent_clone(itr));
ok("Adding component to dirset", (icalerrno == ICAL_NO_ERROR));
assert(error == ICAL_NO_ERROR);
diff --git a/src/test/regression.c b/src/test/regression.c
index 8febe757..020627a4 100644
--- a/src/test/regression.c
+++ b/src/test/regression.c
@@ -190,9 +190,9 @@ void test_values()
str_is("icalvalue_as_ical_string()", icalvalue_as_ical_string(v), "cap://value/2");
- copy = icalvalue_new_clone(v);
+ copy = icalvalue_clone(v);
- str_is("icalvalue_new_clone()", icalvalue_as_ical_string(copy), "cap://value/2");
+ str_is("icalvalue_clone()", icalvalue_as_ical_string(copy), "cap://value/2");
icalvalue_free(v);
icalvalue_free(copy);
@@ -203,8 +203,8 @@ void test_values()
ok("icalvalue_set_boolean(2)", (2 == icalvalue_get_boolean(v)));
str_is("icalvalue_as_ical_string()", icalvalue_as_ical_string(v), "TRUE");
- copy = icalvalue_new_clone(v);
- str_is("icalvalue_new_clone()", icalvalue_as_ical_string(copy), "TRUE");
+ copy = icalvalue_clone(v);
+ str_is("icalvalue_clone()", icalvalue_as_ical_string(copy), "TRUE");
icalvalue_free(v);
icalvalue_free(copy);
@@ -215,8 +215,8 @@ void test_values()
str_is("icalvalue_set_x(test2)", icalvalue_get_x(v), "test2");
str_is("icalvalue_as_ical_string()", icalvalue_as_ical_string(v), "test2");
- copy = icalvalue_new_clone(v);
- str_is("icalvalue_new_clone()", icalvalue_as_ical_string(copy), "test2");
+ copy = icalvalue_clone(v);
+ str_is("icalvalue_clone()", icalvalue_as_ical_string(copy), "test2");
icalvalue_free(v);
icalvalue_free(copy);
@@ -226,8 +226,8 @@ void test_values()
icalvalue_set_datetime(v, icaltime_from_timet_with_zone(1023404802 - 3600, 0, NULL));
str_is("icalvalue_set_datetime()", icalvalue_as_ical_string(v), "20020606T220642");
- copy = icalvalue_new_clone(v);
- str_is("icalvalue_new_clone()", icalvalue_as_ical_string(v), "20020606T220642");
+ copy = icalvalue_clone(v);
+ str_is("icalvalue_clone()", icalvalue_as_ical_string(v), "20020606T220642");
icalvalue_free(v);
icalvalue_free(copy);
@@ -323,12 +323,12 @@ void test_properties()
}
str_is("icalproperty_as_ical_string()", icalproperty_as_ical_string(prop), test_ical_str_good);
- clone = icalproperty_new_clone(prop);
+ clone = icalproperty_clone(prop);
if (VERBOSE) {
printf("Clone:\n %s\n", icalproperty_as_ical_string(prop));
}
- str_is("icalproperty_new_clone()", icalproperty_as_ical_string(prop), test_ical_str_good);
+ str_is("icalproperty_clone()", icalproperty_as_ical_string(prop), test_ical_str_good);
icalproperty_free(clone);
icalproperty_free(prop);
@@ -954,7 +954,7 @@ void test_dirset()
/* Change the dtstart and dtend times in the component
pointed to by Itr */
- clone = icalcomponent_new_clone(itr);
+ clone = icalcomponent_clone(itr);
assert(icalerrno == ICAL_NO_ERROR);
assert(clone != 0);
@@ -1026,7 +1026,7 @@ void test_compare()
icalvalue *v1, *v2;
v1 = icalvalue_new_caladdress("cap://value/1");
- v2 = icalvalue_new_clone(v1);
+ v2 = icalvalue_clone(v1);
ok("compare value and clone", (icalvalue_compare(v1, v2) == ICAL_XLICCOMPARETYPE_EQUAL));
@@ -1194,7 +1194,7 @@ void test_calendar()
c = icalcalendar_get_properties(calendar);
- error = icalfileset_add_component(c, icalcomponent_new_clone(comp));
+ error = icalfileset_add_component(c, icalcomponent_clone(comp));
ok("Adding Clone Component to dirset", (error == ICAL_NO_ERROR));
@@ -2247,7 +2247,7 @@ void test_icalset()
icalcomponent *clone;
- clone = icalcomponent_new_clone(c);
+ clone = icalcomponent_clone(c);
(void)icalset_add_component(d, clone);
@@ -3403,7 +3403,7 @@ void test_file_locks()
(void)icalfileset_add_component(fs, c);
- c2 = icalcomponent_new_clone(c);
+ c2 = icalcomponent_clone(c);
(void)icalfileset_add_component(fs, c2);
@@ -3439,7 +3439,7 @@ void test_file_locks()
icalcomponent_set_duration(c, d);
icalcomponent_set_summary(c, "Child");
- c2 = icalcomponent_new_clone(c);
+ c2 = icalcomponent_clone(c);
icalcomponent_set_summary(c2, "Child");
(void)icalfileset_add_component(fs, c2);
@@ -3472,7 +3472,7 @@ void test_file_locks()
icalcomponent_set_duration(c, d);
icalcomponent_set_summary(c, "Parent");
- c2 = icalcomponent_new_clone(c);
+ c2 = icalcomponent_clone(c);
icalcomponent_set_summary(c2, "Parent");
(void)icalfileset_add_component(fs, c2);
diff --git a/src/test/stow.c b/src/test/stow.c
index f425288a..1d15b59d 100644
--- a/src/test/stow.c
+++ b/src/test/stow.c
@@ -290,11 +290,11 @@ icalcomponent *make_reply(icalcomponent *comp, icalproperty *return_status,
icalproperty_new_method(ICAL_METHOD_REPLY),
icalcomponent_vanew(
ICAL_VEVENT_COMPONENT,
- icalproperty_new_clone(
+ icalproperty_clone(
icalcomponent_get_first_property(inner, ICAL_DTSTAMP_PROPERTY)),
- icalproperty_new_clone(
+ icalproperty_clone(
icalcomponent_get_first_property(inner, ICAL_ORGANIZER_PROPERTY)),
- icalproperty_new_clone(
+ icalproperty_clone(
icalcomponent_get_first_property(inner, ICAL_UID_PROPERTY)),
icalproperty_new_attendee(attendee),
0),
@@ -310,7 +310,7 @@ icalcomponent *make_reply(icalcomponent *comp, icalproperty *return_status,
for (p = icalcomponent_get_first_property(inner, ICAL_REQUESTSTATUS_PROPERTY);
p != 0;
p = icalcomponent_get_next_property(inner, ICAL_REQUESTSTATUS_PROPERTY)) {
- icalcomponent_add_property(rinner, icalproperty_new_clone(p));
+ icalcomponent_add_property(rinner, icalproperty_clone(p));
}
if (return_status != 0) {