From a63cdcd16b006f7978ae496f6338c8b18d269974 Mon Sep 17 00:00:00 2001 From: "Ralf S. Engelschall" Date: Fri, 19 Jan 2001 15:01:19 +0000 Subject: [PATCH] First step in GNu shtool version support: Add version.c and use it for "petidomo --version". Support for handling version.c in Makefile.in is coming later. --- Makefile.in | 2 +- main.c | 6 +++++- version.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 version.c diff --git a/Makefile.in b/Makefile.in index fa64e66..ccc1f33 100644 --- a/Makefile.in +++ b/Makefile.in @@ -32,7 +32,7 @@ OBJS = acl.o archive.o authen.o config.o generate_cookie.o \ filter.o handleacl.o help.o hermes.o index.o io.o \ listserv.o mailer.o members.o parsearray.o password.o \ rfcparse.o subscribe.o tool.o unsubscribe.o main.o \ - queue_command.o queue_posting.o approve.o address-db.o + queue_command.o queue_posting.o approve.o address-db.o version.o LIBS = librfc822/librfc822.a libmpools/libmpools.a \ liblists/liblists.a libargv/libargv.a \ libconfigfile/libconfigfile.a libtext/libtext.a diff --git a/main.c b/main.c index 1ea356b..fa5e228 100644 --- a/main.c +++ b/main.c @@ -27,6 +27,10 @@ #include "libtext/text.h" #include "petidomo.h" +#define _VERSION_C_AS_HEADER_ +#include "version.c" +#undef _VERSION_C_AS_HEADER_ + #ifndef LOG_PERROR # define LOG_PERROR 0 #endif @@ -83,7 +87,7 @@ main(int argc, char * argv[]) /* Parse the command line. */ argv_help_string = "Petidomo Mailing List Server"; - argv_version_string = "Petidomo"; + argv_version_string = (char *)petidomo_version.v_gnu; argv_process(args, argc, argv); /* Log a few helpful facts about this Petidomo instance. */ diff --git a/version.c b/version.c new file mode 100644 index 0000000..26a531b --- /dev/null +++ b/version.c @@ -0,0 +1,46 @@ +/* +** version.c -- Version Information for Petidomo (syntax: C/C++) +** [automatically generated and maintained by GNU shtool] +*/ + +#ifdef _VERSION_C_AS_HEADER_ + +#ifndef _VERSION_C_ +#define _VERSION_C_ + +#define PETIDOMO_VERSION 0x400101 + +typedef struct { + const int v_hex; + const char *v_short; + const char *v_long; + const char *v_tex; + const char *v_gnu; + const char *v_web; + const char *v_sccs; + const char *v_rcs; +} petidomo_version_t; + +extern petidomo_version_t petidomo_version; + +#endif /* _VERSION_C_ */ + +#else /* _VERSION_C_AS_HEADER_ */ + +#define _VERSION_C_AS_HEADER_ +#include "version.c" +#undef _VERSION_C_AS_HEADER_ + +petidomo_version_t petidomo_version = { + 0x400101, + "4.0b1", + "4.0b1 (18-Jan-2001)", + "This is Petidomo, Version 4.0b1 (18-Jan-2001)", + "Petidomo 4.0b1 (18-Jan-2001)", + "Petidomo/4.0b1", + "@(#)Petidomo 4.0b1 (18-Jan-2001)", + "$Id$" +}; + +#endif /* _VERSION_C_AS_HEADER_ */ +