[master] 3cd5a9934 Add VCS_String() public function, which depending on the argument returns version related strings.

Dridi Boukelmoune dridi at varni.sh
Tue May 21 08:43:36 UTC 2019


On Tue, May 21, 2019 at 10:36 AM Dridi Boukelmoune <dridi at varni.sh> wrote:
>
> On Tue, May 21, 2019 at 10:34 AM Poul-Henning Kamp <phk at phk.freebsd.dk> wrote:
> >
> > --------
> > In message <CABoVN9C2WXuBP3t56y_3nUevk5N+inRfJXyEtmR9X5OaMC3xnQ at mail.gmail.com>, Dridi Boukelmoune writes:
> >
> > >> +const char *
> > >> +VCS_String(const char *which)
> > >> +{
> > >> +       AN(which);
> > >> +       assert(which[1] == '\0');
> > >
> > >Why not simply take a char here?
> >
> > Because I want to keep the door open for a printf-like
> > specification down the road.
>
> Good call!

On second thought, having a dynamic version string format would likely
force the return value to drop the const qualifier. You might as well
introduce a VCS_Printf function if we ever want to generalize to that
extent.

Dridi


More information about the varnish-commit mailing list