rem: assert(0);
add: icalerror_set_errno(ICAL_UNIMPLEMENTED_ERROR);
context: int expand_year_days(struct icalrecur_iterator_impl* impl,short year){    int j,k;    int days_index=0;    struct icaltimetype t;    int flags;#define HBD(x) has_by_data(impl,x)    t.is_date = 1; /* Needed to make day_of_year routines work property */    memset(&t,0,sizeof(t));    memset(impl->days,ICAL_RECURRENCE_ARRAY_MAX_BYTE,sizeof(impl->days));        flags = (HBD(BY_DAY) ? 1<<BY_DAY : 0) +         (HBD(BY_WEEK_NO) ? 1<<BY_WEEK_NO : 0) +         (HBD(BY_MONTH_DAY) ? 1<<BY_MONTH_DAY : 0) +         (HBD(BY_MONTH) ? 1<<BY_MONTH : 0) +         (HBD(BY_YEAR_DAY) ? 1<<BY_YEAR_DAY : 0);    switch(flags) {    case 0: {        /* FREQ=YEARLY; */        break;    }    case 1<<BY_MONTH: {        /* FREQ=YEARLY; BYMONTH=3,11*/	        for(j=0;impl->by_ptrs[BY_MONTH][j]!=ICAL_RECURRENCE_ARRAY_MAX;j++){	    struct icaltimetype t;	    short month = impl->by_ptrs[BY_MONTH][j];	                short doy;	    t = impl->dtstart;	    t.year = year;	    t.month = month;	    t.is_date = 1;	    doy = icaltime_day_of_year(t);	                impl->days[days_index++] = doy;        }        break;    }    case 1<<BY_MONTH_DAY:  {        /* FREQ=YEARLY; BYMONTHDAY=1,15*/        assert(0);        break;    }    case (1<<BY_MONTH_DAY) + (1<<BY_MONTH): {        /* FREQ=YEARLY; BYMONTHDAY=1,15; BYMONTH=10 */        for(j=0;impl->by_ptrs[BY_MONTH][j]!=ICAL_RECURRENCE_ARRAY_MAX;j++){            for(k=0;impl->by_ptrs[BY_MONTH_DAY][k]!=ICAL_RECURRENCE_ARRAY_MAX;k++)           {                short month = impl->by_ptrs[BY_MONTH][j];                short month_day = impl->by_ptrs[BY_MONTH_DAY][k];                short doy;		t.day = month_day;		t.month = month;		t.year = year;		t.is_date = 1;		doy = icaltime_day_of_year(t);		impl->days[days_index++] = doy;            }        }        break;    }    case 1<<BY_WEEK_NO: {        /* FREQ=YEARLY; BYWEEKNO=20,50 */	struct icaltimetype t;	short dow;	t.day = impl->dtstart.day;	t.month = impl->dtstart.month;	t.year = year;	t.is_date = 1;        dow = icaltime_day_of_week(t);	/* HACK Not finished */ 	        break;    }    case (1<<BY_WEEK_NO) + (1<<BY_MONTH_DAY): {        /*FREQ=YEARLY; WEEKNO=20,50; BYMONTH= 6,11 */        assert(0);        break;    }    case 1<<BY_DAY: {        /*FREQ=YEARLY; BYDAY=TH,20MO,-10FR*/        int days_index = 0;        pvl_elem i;        pvl_list days = expand_by_day(impl,year);        for(i=pvl_head(days);i!=0;i=pvl_next(i)){            short day = (short)(int)pvl_data(i);            impl->days[days_index++] = day;        }        break;    }    case (1<<BY_DAY)+(1<<BY_MONTH): {        /*FREQ=YEARLY; BYDAY=TH,20MO,-10FR; BYMONTH = 12*/        for(j=0;impl->by_ptrs[BY_MONTH][j]!=ICAL_RECURRENCE_ARRAY_MAX;j++){	    short month = impl->by_ptrs[BY_MONTH][j];	    short days_in_month = icaltime_days_in_month(month,year);			    struct icaltimetype t;	    memset(&t,0,sizeof(struct icaltimetype));	    t.day = 1;	    t.year = year;	    t.month = month;	    t.is_date = 1;	    	    for(t.day = 1; t.day <=days_in_month; t.day++){				short current_dow = icaltime_day_of_week(t);				for(k=0;impl->by_ptrs[BY_DAY][k]!=ICAL_RECURRENCE_ARRAY_MAX;k++){		    		    enum icalrecurrencetype_weekday dow =			icalrecurrencetype_day_day_of_week(impl->by_ptrs[BY_DAY][k]);		    		    if(current_dow == dow){			short doy = icaltime_day_of_year(t);			/* HACK, incomplete Nth day of week handling */			impl->days[days_index++] = doy;					    }		}            }        }        break;    }    case (1<<BY_DAY) + (1<<BY_MONTH_DAY) : {        /*FREQ=YEARLY; BYDAY=TH,20MO,-10FR; BYMONTHDAY=1,15*/        assert(0);        break;    }    case (1<<BY_DAY) + (1<<BY_MONTH_DAY) + (1<<BY_MONTH): {        /*FREQ=YEARLY; BYDAY=TH,20MO,-10FR; BYMONTHDAY=10; MYMONTH=6,11*/        int days_index = 0;        pvl_elem itr;        pvl_list days = expand_by_day(impl,year);        for(itr=pvl_head(days);itr!=0;itr=pvl_next(itr)){            short day = (short)(int)pvl_data(itr);            struct icaltimetype tt;             short i,j;                        tt = icaltime_from_day_of_year(day,year);                        for(i = 0; BYMONPTR[i] != ICAL_RECURRENCE_ARRAY_MAX; i++){                for(j = 0; BYMDPTR[j]!=ICAL_RECURRENCE_ARRAY_MAX; j++){                    short mday = BYMDPTR[j];                    short month = BYMONPTR[i];                                        if(tt.month == month  && tt.day == mday){                        impl->days[days_index++] = day;                    }                }            }        }       break;    }    case (1<<BY_DAY) + (1<<BY_WEEK_NO) : {        /*FREQ=YEARLY; BYDAY=TH,20MO,-10FR;  WEEKNO=20,50*/               int days_index = 0;        pvl_elem itr;        pvl_list days = expand_by_day(impl,year);        for(itr=pvl_head(days);itr!=0;itr=pvl_next(itr)){            short day = (short)(int)pvl_data(itr);            struct icaltimetype tt;             short i;                        tt = icaltime_from_day_of_year(day,year);                        for(i = 0; BYWEEKPTR[i] != ICAL_RECURRENCE_ARRAY_MAX; i++){                    short weekno = BYWEEKPTR[i];                                        if(weekno== icaltime_week_number(tt)){                        impl->days[days_index++] = day;                    }            }                            }        break;    }    case (1<<BY_DAY) + (1<<BY_WEEK_NO) + (1<<BY_MONTH_DAY): {        /*FREQ=YEARLY; BYDAY=TH,20MO,-10FR;  WEEKNO=20,50; BYMONTHDAY=1,15*/        assert(0);        break;    }    case 1<<BY_YEAR_DAY: {	for(j=0;impl->by_ptrs[BY_YEAR_DAY][j]!=ICAL_RECURRENCE_ARRAY_MAX;j++){	    short doy = impl->by_ptrs[BY_YEAR_DAY][j];	    impl->days[days_index++] = doy;        }        break;    }    default: {        assert(0);        break;    }    }    return 0;}                                  