aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 */