aboutsummaryrefslogtreecommitdiffstats
path: root/libical
diff options
context:
space:
mode:
authorDamon Chaplin <damon@helixcode.com>2000-10-12 02:06:28 +0800
committerDamon Chaplin <damon@src.gnome.org>2000-10-12 02:06:28 +0800
commitc865d05f0f66f61975c69ae7acb4bc8878d3e47b (patch)
tree4b349fe222e1d24b1285d51030681c22b24951aa /libical
parentfb19241a191ae47984e19ae43f0e6acff96cbb1a (diff)
downloadgsoc2013-evolution-c865d05f0f66f61975c69ae7acb4bc8878d3e47b.tar
gsoc2013-evolution-c865d05f0f66f61975c69ae7acb4bc8878d3e47b.tar.gz
gsoc2013-evolution-c865d05f0f66f61975c69ae7acb4bc8878d3e47b.tar.bz2
gsoc2013-evolution-c865d05f0f66f61975c69ae7acb4bc8878d3e47b.tar.lz
gsoc2013-evolution-c865d05f0f66f61975c69ae7acb4bc8878d3e47b.tar.xz
gsoc2013-evolution-c865d05f0f66f61975c69ae7acb4bc8878d3e47b.tar.zst
gsoc2013-evolution-c865d05f0f66f61975c69ae7acb4bc8878d3e47b.zip
add support for 'X-' parameters.
2000-10-11 Damon Chaplin <damon@helixcode.com> * src/libical/icalparameter.c (icalparameter_as_ical_string): (icalparameter_new_from_string): * src/libical/icalparser.c (icalparser_add_line): add support for 'X-' parameters. svn path=/trunk/; revision=5855
Diffstat (limited to 'libical')
-rw-r--r--libical/ChangeLog7
-rw-r--r--libical/src/libical/icalparameter.c8
-rw-r--r--libical/src/libical/icalparser.c7
3 files changed, 18 insertions, 4 deletions
diff --git a/libical/ChangeLog b/libical/ChangeLog
index 577da04a9b..4b077f01ee 100644
--- a/libical/ChangeLog
+++ b/libical/ChangeLog
@@ -1,3 +1,10 @@
+2000-10-11 Damon Chaplin <damon@helixcode.com>
+
+ * src/libical/icalparameter.c (icalparameter_as_ical_string):
+ (icalparameter_new_from_string):
+ * src/libical/icalparser.c (icalparser_add_line): add support for
+ 'X-' parameters.
+
2000-10-07 Dan Winship <danw@helixcode.com>
* src/libical/icalyacc.y (weekday_list): Fix the semicolons in
diff --git a/libical/src/libical/icalparameter.c b/libical/src/libical/icalparameter.c
index c77c223f1c..5bbaff68ef 100644
--- a/libical/src/libical/icalparameter.c
+++ b/libical/src/libical/icalparameter.c
@@ -578,8 +578,7 @@ icalparameter* icalparameter_new_from_string(icalparameter_kind kind, char* val)
case ICAL_X_PARAMETER:
{
- param = icalparameter_new(ICAL_FBTYPE_PARAMETER);
- icalparameter_set_xvalue(param,val);
+ param = icalparameter_new_x(val);
break;
}
@@ -657,7 +656,10 @@ icalparameter_as_ical_string (icalparameter* parameter)
buf_ptr = buf;
impl = (struct icalparameter_impl*)parameter;
- kind_string = icalenum_parameter_kind_to_string(impl->kind);
+ if (impl->kind == ICAL_X_PARAMETER)
+ kind_string = impl->x_name;
+ else
+ kind_string = icalenum_parameter_kind_to_string(impl->kind);
if (impl->kind == ICAL_NO_PARAMETER ||
impl->kind == ICAL_ANY_PARAMETER ||
diff --git a/libical/src/libical/icalparser.c b/libical/src/libical/icalparser.c
index b4563e23c9..11a505244f 100644
--- a/libical/src/libical/icalparser.c
+++ b/libical/src/libical/icalparser.c
@@ -732,10 +732,15 @@ icalcomponent* icalparser_add_line(icalparser* parser,
break;
}
- kind = icalenum_string_to_parameter_kind(name);
+ if (name[0] == 'X' && name[1] == '-')
+ kind = ICAL_X_PARAMETER;
+ else
+ kind = icalenum_string_to_parameter_kind(name);
if (kind != ICAL_NO_PARAMETER){
param = icalparameter_new_from_string(kind,pvalue);
+ if (kind == ICAL_X_PARAMETER)
+ icalparameter_set_xname (param, name);
} else {
/* Error. Failed to parse the parameter*/
/* 'tail' defined above */