Add "sc" suffix to version number

This commit is contained in:
Lassi Kortela 2023-02-15 19:37:37 +02:00
parent b4e5414a11
commit 4d6110812c
4 changed files with 12 additions and 1 deletions

View File

@ -23,6 +23,7 @@
#define MAJOR_VERSION 1
#define MINOR_VERSION 0
#define VERSION_SUFFIX "sc" /* Scheme Conservatory */
/* Hack: __GNUC_MINOR__ was introduced together with __attribute__ */

View File

@ -53,7 +53,7 @@ Object p_substitute(int ac, Object *av) {
} else if (strcmp(t, "tmpname") == 0) {
s = tmpnam(0);
} else if (strcmp(t, "version") == 0) {
sprintf(buf, "%d.%d", MAJOR_VERSION, MINOR_VERSION);
sprintf(buf, "%s", get_version_string());
s = buf;
} else if (strcmp(t, "weekday") == 0) {
fmt = "%a";

View File

@ -17,6 +17,14 @@ static int got_filename;
static int did_ev_start;
static int tflag;
const char *get_version_string(void) {
static char buf[8];
snprintf(buf, sizeof(buf), "%d.%d%s",
MAJOR_VERSION, MINOR_VERSION, VERSION_SUFFIX);
return buf;
}
static void usage(void) {
fprintf(stderr, "Usage: %s [options] [file...]\n\n", get_progname());
fprintf(stderr, " -mname name of troff macro package (e.g. -ms)\n");

View File

@ -58,3 +58,5 @@ extern void Load_Source_Port(Object);
#include "scmtable.h"
#include "stream.h"
#include "subst.h"
const char *get_version_string(void);