Commit 25ea4541 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Namespace cleanup: Collect version-related stuff under VCS_

parent 50002cc1
...@@ -495,7 +495,7 @@ main(int argc, char * const *argv) ...@@ -495,7 +495,7 @@ main(int argc, char * const *argv)
break; break;
case 'V': case 'V':
/* XXX: we should print the ident here */ /* XXX: we should print the ident here */
varnish_version("varnishd"); VCS_Message("varnishd");
exit(0); exit(0);
case 'x': case 'x':
#ifdef DIAGNOSTICS #ifdef DIAGNOSTICS
......
...@@ -334,7 +334,7 @@ main(int argc, char **argv) ...@@ -334,7 +334,7 @@ main(int argc, char **argv)
while ((o = getopt(argc, argv, VSL_ARGS "Vw:")) != -1) { while ((o = getopt(argc, argv, VSL_ARGS "Vw:")) != -1) {
switch (o) { switch (o) {
case 'V': case 'V':
varnish_version("varnishhist"); VCS_Message("varnishhist");
exit(0); exit(0);
case 'w': case 'w':
delay = atoi(optarg); delay = atoi(optarg);
......
...@@ -311,7 +311,7 @@ main(int argc, char * const *argv) ...@@ -311,7 +311,7 @@ main(int argc, char * const *argv)
u_flag = 1; u_flag = 1;
break; break;
case 'V': case 'V':
varnish_version("varnishlog"); VCS_Message("varnishlog");
exit(0); exit(0);
case 'w': case 'w':
w_arg = optarg; w_arg = optarg;
......
...@@ -757,7 +757,7 @@ main(int argc, char *argv[]) ...@@ -757,7 +757,7 @@ main(int argc, char *argv[])
P_arg = optarg; P_arg = optarg;
break; break;
case 'V': case 'V':
varnish_version("varnishncsa"); VCS_Message("varnishncsa");
exit(0); exit(0);
case 'w': case 'w':
w_arg = optarg; w_arg = optarg;
......
...@@ -335,7 +335,7 @@ main(int argc, char **argv) ...@@ -335,7 +335,7 @@ main(int argc, char **argv)
while ((o = getopt(argc, argv, VSL_ARGS "Vw:")) != -1) { while ((o = getopt(argc, argv, VSL_ARGS "Vw:")) != -1) {
switch (o) { switch (o) {
case 'V': case 'V':
varnish_version("varnishsizes"); VCS_Message("varnishsizes");
exit(0); exit(0);
case 'w': case 'w':
delay = atoi(optarg); delay = atoi(optarg);
......
...@@ -209,7 +209,7 @@ main(int argc, char * const *argv) ...@@ -209,7 +209,7 @@ main(int argc, char * const *argv)
list_fields(vd); list_fields(vd);
exit(0); exit(0);
case 'V': case 'V':
varnish_version("varnishstat"); VCS_Message("varnishstat");
exit(0); exit(0);
case 'w': case 'w':
delay = atoi(optarg); delay = atoi(optarg);
......
...@@ -333,7 +333,7 @@ main(int argc, char **argv) ...@@ -333,7 +333,7 @@ main(int argc, char **argv)
} }
break; break;
case 'V': case 'V':
varnish_version("varnishtop"); VCS_Message("varnishtop");
exit(0); exit(0);
case 'm': case 'm':
fprintf(stderr, "-m is not supported\n"); fprintf(stderr, "-m is not supported\n");
......
...@@ -96,14 +96,14 @@ struct timespec TIM_timespec(double t); ...@@ -96,14 +96,14 @@ struct timespec TIM_timespec(double t);
struct timeval TIM_timeval(double t); struct timeval TIM_timeval(double t);
/* from libvarnish/version.c */ /* from libvarnish/version.c */
void varnish_version(const char *); void VCS_Message(const char *);
/* from libvarnish/vtmpfile.c */ /* from libvarnish/vtmpfile.c */
int vtmpfile(char *); int vtmpfile(char *);
char *vreadfile(const char *pfx, const char *fn, ssize_t *sz); char *vreadfile(const char *pfx, const char *fn, ssize_t *sz);
char *vreadfd(int fd, ssize_t *sz); char *vreadfd(int fd, ssize_t *sz);
const char* vcs_version(void); const char* VCS_Version(void);
/* Safe printf into a fixed-size buffer */ /* Safe printf into a fixed-size buffer */
#define bprintf(buf, fmt, ...) \ #define bprintf(buf, fmt, ...) \
......
...@@ -49,10 +49,9 @@ vcs_version.c: FORCE ...@@ -49,10 +49,9 @@ vcs_version.c: FORCE
echo ' */' ;\ echo ' */' ;\
echo '' ;\ echo '' ;\
echo "#include <libvarnish.h>" ;\ echo "#include <libvarnish.h>" ;\
echo "const char* vcs_version(void)" ;\ echo "const char* VCS_Version(void)" ;\
echo "{" ;\ echo "{" ;\
echo " const char* VCS_Version = \"$$V\";" ;\ echo " return (\"$$V\");" ;\
echo " return VCS_Version;" ;\
echo "}" ;\ echo "}" ;\
) > vcs_version.c ; \ ) > vcs_version.c ; \
fi \ fi \
......
...@@ -36,10 +36,10 @@ ...@@ -36,10 +36,10 @@
#include "libvarnish.h" #include "libvarnish.h"
void void
varnish_version(const char *progname) VCS_Message(const char *progname)
{ {
fprintf(stderr, "%s (%s-%s revision %s)\n", progname, fprintf(stderr, "%s (%s-%s revision %s)\n", progname,
PACKAGE_TARNAME, PACKAGE_VERSION, vcs_version()); PACKAGE_TARNAME, PACKAGE_VERSION, VCS_Version());
fprintf(stderr, fprintf(stderr,
"Copyright (c) 2006-2009 Linpro AS / Verdens Gang AS\n"); "Copyright (c) 2006-2009 Linpro AS / Verdens Gang AS\n");
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment