[master] 3cd5a9934 Add VCS_String() public function, which depending on the argument returns version related strings.
Poul-Henning Kamp
phk at phk.freebsd.dk
Tue May 21 08:46:23 UTC 2019
--------
In message <CABoVN9CtzyT02NMO_=ux+uwrz+9hxEjdfuZ8p6DW2cuZCS17dQ at mail.gmail.com>, Dridi Boukelmoune writes:
>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.
I would probably use a single static buffer. It would
not be a facility very applicable to multithreaded usage.
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
More information about the varnish-commit
mailing list