Re: [PATCH 12/13] cal: use month contents structure for --three printing

Karel Zak
2013-12-06T10:07:27Z

> + struct cal_month m1, m2, m3, *i;
> + int first_month;
> + long first_year;
> +
> + m1.next = &m2;
> + m2.next = &m3;
> + m3.next = NULL;
...
> + set_consecutive_months(&m1, first_month, first_year);

Maybe you can add something like:

m1 = cal_new_months(clt->req);

to allocate and initialize all necessary months and join all to the
list according to the user's request (where should be info if whole year
or 1 or 3 months are requested).

And then ... cal_free_months()

Karel

--
Karel Zak <kzak@redhat.com>