rem: icalerror_set_error_state(ICAL_PARSE_ERROR,es);
add: icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,es);
context: icalcomponent* icalparser_parse_string(const char* str){    icalcomponent *c;    struct slg_data d;    icalparser *p;    icalerrorstate es = icalerror_get_error_state(ICAL_PARSE_ERROR);    d.pos = 0;    d.str = str;    p = icalparser_new();    icalparser_set_gen_data(p,&d);    icalerror_set_error_state(ICAL_PARSE_ERROR,ICAL_ERROR_NONFATAL);    c = icalparser_parse(p,string_line_generator);    icalerror_set_error_state(ICAL_PARSE_ERROR,es);    icalparser_free(p);    return c;}