2 /********************************************
4 copyright 1991-95. Michael D. Brennan
6 This is a source file for mawk, an implementation of
7 the AWK programming language.
9 Mawk is distributed without warranty under the terms of
10 the GNU General Public License, version 2, 1991.
11 ********************************************/
14 *Revision 1.10 1996/07/28 21:47:07 mike
17 * Revision 1.9 1996/02/01 04:44:15 mike
20 * Revision 1.8 1995/08/20 17:40:45 mike
21 * changed _stackavail to stackavail for MSC
23 * Revision 1.7 1995/06/10 17:04:10 mike
24 * "largest field" replaced by "max NF"
31 static char mawkid[] = MAWK_ID ;
33 #define VERSION_STRING \
34 "mawk 1.3%s%s %s, Copyright (C) Michael D. Brennan\n\n"
36 /* If use different command line syntax for MSDOS
37 mark that in VERSION */
40 #if MSDOS && ! HAVE_REARGV
41 #define DOS_STRING "MsDOS"
49 int print_compiler_id();
50 int print_aux_limits();
52 static char fmt[] = "%-14s%10lu\n" ;
54 /* print VERSION and exit */
59 printf(VERSION_STRING, PATCH_STRING, DOS_STRING, DATE_STRING) ;
63 fprintf(stderr, "compiled limits:\n") ;
64 fprintf(stderr, fmt, "max NF", (long) MAX_FIELD) ;
65 fprintf(stderr, fmt, "sprintf buffer", (long) SPRINTF_SZ) ;
72 Extra info for MSDOS. This code contributed by
77 #include <alloc.h> /* coreleft() */
82 #include <alloc.h> /* coreleft() */
87 extern unsigned _stklen = 16 * 1024U ;
88 /* 4K of stack is enough for a user function call
89 nesting depth of 75 so this is enough for 300 */
97 #include <dos.h> /* _chkstack */
106 fprintf(stderr, "MsDOS Turbo C++ %d.%d\n",
107 __TURBOC__ >> 8, __TURBOC__ & 0xff) ;
111 fprintf(stderr, "MS-DOS Borland C++ __BORLANDC__ %x\n",
116 fprintf(stderr, "Microsoft C/C++ _MSC_VER %u\n", _MSC_VER) ;
120 fprintf(stderr, "MS-DOS Zortech C++ __ZTC__ %x\n", __ZTC__) ;
123 return 0 ; /*shut up */
131 extern unsigned _stklen ;
132 fprintf(stderr, fmt, "stack size", (unsigned long) _stklen) ;
133 fprintf(stderr, fmt, "heap size", (unsigned long) coreleft()) ;
137 fprintf(stderr, fmt, "stack size", (unsigned long) stackavail()) ;
141 /* large memory model only with ztc */
142 fprintf(stderr, fmt, "stack size??", (unsigned long) _chkstack()) ;
143 fprintf(stderr, fmt, "heap size", farcoreleft()) ;