386BSD 0.1 development
[unix-history] / usr / src / usr.bin / awk / version.c
CommitLineData
d2713949
WJ
1
2/********************************************
3version.c
4copyright 1991, Michael D. Brennan
5
6This is a source file for mawk, an implementation of
7the AWK programming language.
8
9Mawk is distributed without warranty under the terms of
10the GNU General Public License, version 2, 1991.
11********************************************/
12
13/*$Log: version.c,v $
14 * Revision 5.3 92/03/03 16:42:23 brennan
15 * patch 1
16 *
17 * Revision 5.2 92/01/22 05:34:10 brennan
18 * version 1.1
19 *
20 * Revision 5.1 91/12/05 07:56:33 brennan
21 * 1.1 pre-release
22 *
23*/
24
25#include "mawk.h"
26#include "patchlev.h"
27
28#define VERSION_STRING \
29 "mawk 1.1%s%s Feb 1992, Copyright (C) Michael D. Brennan\n\n"
30
31#define DOS_STRING ""
32
33/* If use different command line syntax for MSDOS
34 mark that in VERSION */
35
36#if MSDOS
37#undef DOS_STRING
38
39#if SM_DOS
40
41#if HAVE_REARGV
42#define DOS_STRING "SM"
43#else
44#define DOS_STRING "SMDOS"
45#endif
46
47#else /* LM_DOS */
48
49#if HAVE_REARGV
50#define DOS_STRING "LM"
51#else
52#define DOS_STRING "LMDOS"
53#endif
54
55#endif
56#endif /* MSDOS */
57
58#ifdef THINK_C
59#undef DOS_STRING
60#define DOS_STRING ":Mac"
61#endif
62
63/* print VERSION and exit */
64void print_version()
65{ static char fmt[] = "%-14s%10u\n" ;
66
67 printf(VERSION_STRING, PATCH_STRING, DOS_STRING) ;
68 fflush(stdout) ;
69 fprintf(stderr, "compiled limits:\n") ;
70 fprintf(stderr, fmt, "largest field", MAX_FIELD) ;
71 fprintf(stderr, fmt, "sprintf buffer",SPRINTF_SZ) ;
72 exit(0) ;
73}