-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathversion.c
59 lines (49 loc) · 1.58 KB
/
version.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/********************************************
version.c
copyright 2008-2018,2019 Thomas E. Dickey
copyright 1991-1996,2014 Michael D. Brennan
This is a source file for mawk, an implementation of
the AWK programming language.
Mawk is distributed without warranty under the terms of
the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: version.c,v 1.26 2019/01/29 02:23:07 tom Exp $
*/
#include "mawk.h"
#include "init.h"
#include "patchlev.h"
#define VERSION_STRING \
"mawk %d.%d%s %s\n\
Copyright 2008-2018,2019, Thomas E. Dickey\n\
Copyright 1991-1996,2014, Michael D. Brennan\n\n"
#define FMT_N "%-20s%.0f\n"
#define FMT_S "%-20s%s\n"
/* print VERSION and exit */
void
print_version(void)
{
printf(VERSION_STRING, PATCH_BASE, PATCH_LEVEL, PATCH_STRING, DATE_STRING);
fflush(stdout);
#define SHOW_RANDOM "random-funcs:"
#if defined(NAME_RANDOM)
fprintf(stderr, FMT_S, SHOW_RANDOM, NAME_RANDOM);
#else
fprintf(stderr, FMT_S, SHOW_RANDOM, "internal");
#endif
#define SHOW_REGEXP "regex-funcs:"
#ifdef LOCAL_REGEXP
fprintf(stderr, FMT_S, SHOW_REGEXP, "internal");
#else
fprintf(stderr, FMT_S, SHOW_REGEXP, "external");
#endif
fprintf(stderr, "compiled limits:\n");
fprintf(stderr, FMT_N, "sprintf buffer", (double) SPRINTF_LIMIT);
fprintf(stderr, FMT_N, "maximum-integer", (double) MAX__INT);
#if 0
/* we could show these, but for less benefit: */
fprintf(stderr, FMT_N, "maximum-unsigned", (double) MAX__UINT);
fprintf(stderr, FMT_N, "maximum-long", (double) MAX__LONG);
#endif
mawk_exit(0);
}