661 icalerror_check_arg_rz((parser != 0),
"parser");
668 if (line_is_blank(line)) {
673 static const unsigned char is_icalctrl[256] = {
674 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1,
675 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
676 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
677 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
678 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
679 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
680 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
681 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
682 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
683 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
684 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
685 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
686 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
687 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
688 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
689 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
692 for (c = d = line; *c; c++) {
693 if (!is_icalctrl[(
unsigned char)*c]) {
698 icalcomponent *tail = icalpvl_data(icalpvl_tail(parser->components));
702 "Content line contains invalid CONTROL characters",
718 str = parser_get_prop_name(line, &end);
720 if (
str == 0 || *
str ==
'\0') {
722 icalcomponent *tail = icalpvl_data(icalpvl_tail(parser->components));
727 "Got a data line, but could not find a property name or component begin tag",
742 if (strcasecmp(
str,
"BEGIN") == 0) {
743 icalcomponent *c = NULL;
748 str = parser_get_next_value(end, &end, value_kind);
767 insert_error(parser, c,
str,
"Parse error in component name",
771 icalpvl_push(parser->components, c);
779 }
else if (strcasecmp(
str,
"END") == 0) {
784 str = parser_get_next_value(end, &end, value_kind);
787 parser->root_component = icalpvl_pop(parser->components);
789 tail = icalpvl_data(icalpvl_tail(parser->components));
798 if (parser->level < 0) {
800 icalerror_warn(
"Encountered END before BEGIN");
804 }
else if (parser->level == 0) {
808 if (icalpvl_count(parser->components) != 0) {
811 icalpvl_push(parser->components, parser->root_component);
815 icalassert(icalpvl_count(parser->components) == 0);
818 rtrn = parser->root_component;
819 parser->root_component = 0;
831 if (icalpvl_data(icalpvl_tail(parser->components)) == 0) {
856 icalcomponent *tail = icalpvl_data(icalpvl_tail(parser->components));
871 icalcomponent *tail = icalpvl_data(icalpvl_tail(parser->components));
873 insert_error(parser, tail,
str,
"Parse error in property name",
891 while (pcount < maximum_allowed_parameters) {
892 if (*(end - 1) ==
':') {
900 str = parser_get_next_parameter(end, &end);
904 char *pvalue_heap = 0;
907 const char *name = name_stack;
908 const char *pvalue = pvalue_stack;
912 icalcomponent *tail = icalpvl_data(icalpvl_tail(parser->components));
914 if (!parser_get_param_name_stack(
str, name_stack,
sizeof(name_stack),
915 pvalue_stack,
sizeof(pvalue_stack))) {
916 name_heap = parser_get_param_name_heap(
str, &pvalue_heap);
919 pvalue = pvalue_heap;
921 if (name_heap == 0) {
923 insert_error(parser, tail,
str,
"Can't parse parameter name",
965 insert_error(parser, tail,
str,
"Can't parse parameter name",
993 insert_error(parser, tail,
str,
"Can't parse parameter value",
1011 if (!icalproperty_value_kind_is_valid(prop_kind, value_kind)) {
1014 const char *err_str =
"Invalid VALUE type for property";
1016 size_t tmp_buf_len = strlen(err_str) + strlen(prop_str) + 2;
1018 snprintf(tmp_buf, tmp_buf_len,
"%s %s", err_str, prop_str);
1020 insert_error(parser, tail,
str, tmp_buf,
1059 while (vcount < maximum_property_values) {
1068 if (icalproperty_value_kind_is_multivalued(prop_kind, &value_kind)) {
1069 str = parser_get_next_value(end, &end, value_kind);
1071 str = icalparser_get_value(end, &end, value_kind);
1079 icalcomponent *tail = icalpvl_data(icalpvl_tail(parser->components));
1092 icalcomponent *tail = icalpvl_data(icalpvl_tail(parser->components));
1094 snprintf(temp,
sizeof(temp),
1095 "Can't parse as %s value in %s property. Removing entire property",
1130 icalcomponent *tail = icalpvl_data(icalpvl_tail(parser->components));
1132 snprintf(temp,
sizeof(temp),
"No value for %s property. Removing entire property",
1153 if (icalpvl_data(icalpvl_tail(parser->components)) == 0 && parser->level == 0) {
1157 return parser->root_component;