home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mega CD-ROM 1
/
megacd_rom_1.zip
/
megacd_rom_1
/
GNUISH
/
INDENT11.ZIP
/
PATCHES
< prev
next >
Wrap
Text File
|
1990-09-23
|
52KB
|
1,833 lines
diff -cBdNp e:/gnu/indent/gnu/args.c ./args.c
*** e:/gnu/indent/gnu/args.c Mon Jul 02 20:39:16 1990
--- ./args.c Mon Jul 02 20:39:26 1990
***************
*** 18,23 ****
--- 18,40 ----
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
+ /*
+ * MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
+ *
+ * To this port, the same copying conditions apply as to the
+ * original release.
+ *
+ * IMPORTANT:
+ * This file is not identical to the original GNU release!
+ * You should have received this code as patch to the official
+ * GNU release.
+ *
+ * MORE IMPORTANT:
+ * This port comes with ABSOLUTELY NO WARRANTY.
+ *
+ * $Header: e:/gnu/indent/RCS/args.c'v 1.1.0.2 90/07/02 10:32:18 tho Exp $
+ */
+
#ifndef lint
static char sccsid[] = "@(#)args.c 5.8 (Berkeley) 5/15/89";
#endif /* not lint */
*************** struct pro {
*** 157,166 ****
--- 174,190 ----
struct pro pro[] = {
{"T", PRO_KEY, 0, ONOFF_NA, 0, &exp_T},
+ #ifdef MSDOS
+ {"bacc", PRO_BOOL, false, ON,
+ &blanklines_around_cond_comp, &exp_bacc},
+ {"badp", PRO_BOOL, false, ON,
+ &blanklin_after_decl_proctop, &exp_badp},
+ #else
{"bacc", PRO_BOOL, false, ON,
&blanklines_around_conditional_compilation, &exp_bacc},
{"badp", PRO_BOOL, false, ON,
&blanklines_after_declarations_at_proctop, &exp_badp},
+ #endif /* MSDOS */
{"bad", PRO_BOOL, false, ON, &blanklines_after_declarations, &exp_bad},
{"bap", PRO_BOOL, false, ON, &blanklines_after_procs, &exp_bap},
{"bbb", PRO_BOOL, false, ON, &blanklines_before_blockcomments, &exp_bbb},
*************** struct pro pro[] = {
*** 203,212 ****
--- 227,243 ----
{"lc", PRO_INT, 0, ONOFF_NA, &block_comment_max_col, &exp_lc},
{"lp", PRO_BOOL, true, ON, &lineup_to_parens, &exp_lp},
{"l", PRO_INT, 78, ONOFF_NA, &max_col, &exp_l},
+ #ifdef MSDOS
{"nbacc", PRO_BOOL, false, OFF,
+ &blanklines_around_cond_comp, &exp_bacc},
+ {"nbadp", PRO_BOOL, false, OFF,
+ &blanklin_after_decl_proctop, &exp_badp},
+ #else
+ {"nbacc", PRO_BOOL, false, OFF,
&blanklines_around_conditional_compilation, &exp_bacc},
{"nbadp", PRO_BOOL, false, OFF,
&blanklines_after_declarations_at_proctop, &exp_badp},
+ #endif /* MSDOS */
{"nbad", PRO_BOOL, false, OFF, &blanklines_after_declarations, &exp_bad},
{"nbap", PRO_BOOL, false, OFF, &blanklines_after_procs, &exp_bap},
{"nbbb", PRO_BOOL, false, OFF, &blanklines_before_blockcomments, &exp_bbb},
*************** struct pro pro[] = {
*** 249,257 ****
--- 280,300 ----
* set_profile reads $HOME/.indent.pro and ./.indent.pro and handles arguments
* given in these files.
*/
+ void
set_profile()
{
register FILE *f;
+ #ifdef MSDOS
+ static char prof[] = "indent.pro";
+ char fname[_MAX_PATH],
+ device[_MAX_DRIVE],
+ homedir[_MAX_DIR],
+ filename[_MAX_FNAME],
+ ext[_MAX_EXT];
+ /* look for profile in indent's dir */
+ _splitpath( my_name, device, homedir, filename, ext);
+ _makepath( fname, device, homedir, prof, "");
+ #else
char *fname;
static char prof[] = ".indent.pro";
char *homedir;
*************** set_profile()
*** 259,264 ****
--- 302,309 ----
homedir = getenv("HOME");
fname = xmalloc(strlen(homedir) + 10 + sizeof prof);
sprintf(fname, "%s/%s", homedir, prof);
+ #endif
+
if ((f = fopen(option_source = fname, "r")) != NULL) {
scan_profile(f);
(void) fclose(f);
*************** set_profile()
*** 271,276 ****
--- 316,322 ----
free (fname);
}
+ void
scan_profile(f)
register FILE *f;
{
*************** scan_profile(f)
*** 279,285 ****
char buf[BUFSIZ];
while (1) {
! for (p = buf; (i = getc(f)) != EOF && (*p = i) > ' '; ++p);
if (p != buf) {
*p++ = 0;
if (verbose)
--- 325,331 ----
char buf[BUFSIZ];
while (1) {
! for (p = buf; (i = getc(f)) != EOF && (*p = (char) i) > ' '; ++p);
if (p != buf) {
*p++ = 0;
if (verbose)
*************** eqin(s1, s2, start_param)
*** 311,316 ****
--- 357,363 ----
/*
* Set the defaults.
*/
+ void
set_defaults()
{
register struct pro *p;
*************** set_defaults()
*** 325,330 ****
--- 372,378 ----
specified (as opposed to being taken from a PRO_SETTINGS group of
settings). */
+ void
set_option (arg, explicit)
char *arg;
int explicit;
diff -cBdNp e:/gnu/indent/gnu/globs.c ./globs.c
*** e:/gnu/indent/gnu/globs.c Mon Jul 02 20:39:18 1990
--- ./globs.c Mon Jul 02 20:39:26 1990
***************
*** 15,24 ****
--- 15,53 ----
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
+ /*
+ * MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
+ *
+ * To this port, the same copying conditions apply as to the
+ * original release.
+ *
+ * IMPORTANT:
+ * This file is not identical to the original GNU release!
+ * You should have received this code as patch to the official
+ * GNU release.
+ *
+ * MORE IMPORTANT:
+ * This port comes with ABSOLUTELY NO WARRANTY.
+ *
+ * $Header: e:/gnu/indent/RCS/globs.c'v 1.1.0.4 90/07/02 20:25:09 tho Exp $
+ */
+
#include "indent_globs.h"
/* Like malloc but get error if no storage available. */
+ #ifdef MSDOS
+ void *xmalloc (size_t size) /* cleaner anyway ... */
+ {
+ register void *val = malloc (size);
+ if (!val)
+ {
+ fprintf (stderr,"indent: Virtual memory exhausted.\n");
+ exit (1);
+ }
+ return val;
+ }
+ #else /* not MSDOS */
char *
xmalloc (size)
long size;
*************** xmalloc (size)
*** 31,39 ****
--- 60,81 ----
}
return val;
}
+ #endif /* not MSDOS */
/* Like realloc but get error if no storage available. */
+ #ifdef MSDOS
+ void *xrealloc (void *ptr, size_t size) /* cleaner anyway ... */
+ {
+ register void *val = realloc (ptr, size);
+ if (!val)
+ {
+ fprintf (stderr,"indent: Virtual memory exhausted.\n");
+ exit (1);
+ }
+ return val;
+ }
+ #else /* not MSDOS */
char *
xrealloc (ptr, size)
char *ptr;
*************** xrealloc (ptr, size)
*** 47,52 ****
--- 89,95 ----
}
return val;
}
+ #endif /* not MSDOS */
/* Some systems lack memcpy so this does the same thing.
If your system-supplied memcpy is more efficient, you might want
*************** xrealloc (ptr, size)
*** 54,59 ****
--- 97,103 ----
Copy LEN bytes starting at SRCADDR to DESTADDR. Result undefined
if the source overlaps with the destination. */
+ #ifndef MSDOS
char *
mymemcpy (destaddr, srcaddr, len)
char *destaddr;
*************** mymemcpy (destaddr, srcaddr, len)
*** 64,66 ****
--- 108,229 ----
*destaddr++ = *srcaddr++;
return destaddr;
}
+ #endif /* not MSDOS */
+
+
+ /* malloc a block of memory, with fatal error message if we can't do it. */
+
+ #ifdef M_I86HM
+
+ #include <dos.h>
+
+ void huge *
+ xhalloc (long size)
+ {
+ void huge *value = (void huge *) halloc (size, (size_t)1 );
+
+ if (!value)
+ {
+ fprintf (stderr, "indent: Virtual memory exhausted.\n");
+ exit (1);
+ }
+ return value;
+ }
+
+ /* Here we do a huge "realloc" by allocating a new block and
+ moving the old block afterwards. This is *slow*, but should
+ be reliable. */
+
+ void huge *
+ xhrealloc (void huge *ptr, long new_size, long old_size)
+ {
+ void huge *value = (void huge *) halloc (new_size, (size_t)1 );
+
+ if (!value)
+ {
+ fprintf (stderr,"indent: Virtual memory exhausted.\n");
+ exit (1);
+ }
+ else
+ {
+ char huge *dest = value;
+ char huge *src = ptr;
+
+ while (old_size > 0L)
+ {
+ unsigned int bytes = (unsigned int) min (0x8000L, old_size);
+ memcpy (dest, src, bytes);
+ old_size -= (long) bytes;
+ dest += (long) bytes;
+ src += (long) bytes;
+ }
+ }
+ hfree (ptr);
+ return value;
+ }
+
+ long /* doesn't belong here, but is also a 'huge' pointer kludge */
+ hread (int fd, void huge *buffer, long bytes)
+ {
+ long bytes_read = 0L;
+
+ while (1)
+ {
+ int n = read (fd, buffer, (unsigned int) min (0x4000L, bytes));
+
+ if (n > 0)
+ {
+ bytes_read += (long) n;
+ bytes -= (long) n;
+ /* we can't say buffer += n here, because we have to make
+ sure that the offset of BUFFER doesn't overflow during
+ the read() system call. Therefore we add what we read
+ to the segment of BUFFER. */
+ FP_SEG(buffer) += (n >> 4);
+ FP_OFF(buffer) += (n & 0x0F);
+ }
+ else if (n == 0)
+ return bytes_read; /* done */
+ else
+ {
+ perror ("indent: Error while reading input");
+ exit (1);
+ }
+ }
+ }
+
+
+ long
+ hwrite (int fd, void huge *buffer, long bytes)
+ {
+ long bytes_written = 0L;
+
+ while (1)
+ {
+ unsigned int n = (unsigned int) min (0x4000L, bytes);
+ unsigned int m = write (fd, buffer, n);
+
+ if (m == n)
+ {
+ bytes_written += (long) m;
+ bytes -= (long) m;
+
+ if (bytes <= 0)
+ return bytes_written;
+
+ /* we can't say buffer += n here, because we have to make
+ sure that the offset of BUFFER doesn't overflow during
+ the read() system call. Therefore we add what we read
+ to the segment of BUFFER. */
+ FP_SEG(buffer) += (m >> 4);
+ FP_OFF(buffer) += (m & 0x0F);
+ }
+ else
+ {
+ perror ("indent: Error while reading input");
+ exit (1);
+ }
+ }
+ }
+
+ #endif /* M_I86HM */
diff -cBdNp e:/gnu/indent/gnu/indent.c ./indent.c
*** e:/gnu/indent/gnu/indent.c Mon Jul 02 20:39:20 1990
--- ./indent.c Mon Jul 02 20:39:34 1990
***************
*** 18,23 ****
--- 18,40 ----
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
+ /*
+ * MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
+ *
+ * To this port, the same copying conditions apply as to the
+ * original release.
+ *
+ * IMPORTANT:
+ * This file is not identical to the original GNU release!
+ * You should have received this code as patch to the official
+ * GNU release.
+ *
+ * MORE IMPORTANT:
+ * This port comes with ABSOLUTELY NO WARRANTY.
+ *
+ * $Header: e:/gnu/indent/RCS/indent.c'v 1.1.0.3 90/07/02 20:25:11 tho Exp $
+ */
+
#ifndef lint
char copyright[] =
"@(#) Copyright (c) 1985 Sun Microsystems, Inc.\n\
*************** char *out_name = 0; /* will always
*** 41,46 ****
--- 58,64 ----
/* The following variables are documented in indent_globs.h. */
int else_or_endif = false;
+ void
main(argc, argv)
int argc;
char **argv;
*************** main(argc, argv)
*** 54,60 ****
int *di_stack;
/* Currently allocated size of di_stack. */
int di_stack_alloc;
!
int flushed_nl; /* used when buffering up comments to remember
* that a newline was passed over */
int force_nl; /* when true, code must be broken */
--- 72,78 ----
int *di_stack;
/* Currently allocated size of di_stack. */
int di_stack_alloc;
!
int flushed_nl; /* used when buffering up comments to remember
* that a newline was passed over */
int force_nl; /* when true, code must be broken */
*************** main(argc, argv)
*** 72,78 ****
decremented at the beginning of the loop, so it will reach zero
when the second token after the ')' is read. */
int last_token_ends_sp = 0;
!
int squest; /* when this is positive, we have seen a ?
* without the matching : in a <c>?<s>:<s>
* construct */
--- 90,96 ----
decremented at the beginning of the loop, so it will reach zero
when the second token after the ')' is read. */
int last_token_ends_sp = 0;
!
int squest; /* when this is positive, we have seen a ?
* without the matching : in a <c>?<s>:<s>
* construct */
*************** main(argc, argv)
*** 86,93 ****
--- 104,121 ----
| INITIALIZATION |
\*-----------------------------------------------*/
+ #ifdef MSDOS
+ my_name = xmalloc( strlen(argv[0]) + 1 ); /* who am I? */
+ strcpy( my_name, argv[0] );
+ #endif /* MSDOS */
+
parser_state_tos = (struct parser_state *)
xmalloc(sizeof(struct parser_state));
+
+ #ifdef MSDOS
+ memset(parser_state_tos,'\0',sizeof(struct parser_state)); /* tidy */
+ #endif /* MSDOS */
+
parser_state_tos->next = 0;
/* Allocate initial stacks for the parser. */
parser_state_tos->p_stack_size = INITIAL_STACK_SIZE;
*************** main(argc, argv)
*** 101,107 ****
parser_state_tos->paren_indents_size = 1;
parser_state_tos->paren_indents = (short *) xmalloc
(parser_state_tos->paren_indents_size * sizeof (short));
!
parser_state_tos->p_stack[0] = stmt; /* this is the parser's stack */
parser_state_tos->last_nl = true; /* this is true if the last thing scanned was
* a newline */
--- 129,135 ----
parser_state_tos->paren_indents_size = 1;
parser_state_tos->paren_indents = (short *) xmalloc
(parser_state_tos->paren_indents_size * sizeof (short));
!
parser_state_tos->p_stack[0] = stmt; /* this is the parser's stack */
parser_state_tos->last_nl = true; /* this is true if the last thing scanned was
* a newline */
*************** main(argc, argv)
*** 127,138 ****
sp_sw = force_nl = false;
parser_state_tos->in_or_st = false;
parser_state_tos->bl_line = true;
!
dec_ind = 0;
di_stack_alloc = 2;
di_stack = (int *)xmalloc (di_stack_alloc * sizeof (*di_stack));
di_stack[parser_state_tos->dec_nest = 0] = 0;
!
parser_state_tos->want_blank = parser_state_tos->in_stmt = parser_state_tos->ind_stmt = false;
parser_state_tos->procname = parser_state_tos->procname_end = "\0";
--- 155,166 ----
sp_sw = force_nl = false;
parser_state_tos->in_or_st = false;
parser_state_tos->bl_line = true;
!
dec_ind = 0;
di_stack_alloc = 2;
di_stack = (int *)xmalloc (di_stack_alloc * sizeof (*di_stack));
di_stack[parser_state_tos->dec_nest = 0] = 0;
!
parser_state_tos->want_blank = parser_state_tos->in_stmt = parser_state_tos->ind_stmt = false;
parser_state_tos->procname = parser_state_tos->procname_end = "\0";
*************** main(argc, argv)
*** 296,302 ****
necessary to keep track of the text between the if() and
the start of the statement which follows. Use save_com
to do so. */
!
switch (type_code) {
case newline:
++line_no;
--- 324,330 ----
necessary to keep track of the text between the if() and
the start of the statement which follows. Use save_com
to do so. */
!
switch (type_code) {
case newline:
++line_no;
*************** main(argc, argv)
*** 318,324 ****
if (foo) {
/ * comment here * /
*/
!
save_com.ptr[0] = '{';
else
--- 346,352 ----
if (foo) {
/ * comment here * /
*/
!
save_com.ptr[0] = '{';
else
*************** check_type:
*** 543,549 ****
/* Do not put a space before the '{'. */
parser_state_tos->want_blank = false;
}
!
/* Count parens so we know how deep we are. */
if (++parser_state_tos->p_l_follow
>= parser_state_tos->paren_indents_size)
--- 571,577 ----
/* Do not put a space before the '{'. */
parser_state_tos->want_blank = false;
}
!
/* Count parens so we know how deep we are. */
if (++parser_state_tos->p_l_follow
>= parser_state_tos->paren_indents_size)
*************** check_type:
*** 891,897 ****
--- 919,929 ----
* a declaration, so dont do
* special indentation of
* comments */
+ #ifdef MSDOS
+ if (blanklin_after_decl_proctop
+ #else
if (blanklines_after_declarations_at_proctop
+ #endif /* MSDOS */
&& parser_state_tos->in_parameter_declaration)
postfix_blankline_requested = 1;
parser_state_tos->in_parameter_declaration = 0;
*************** check_type:
*** 902,908 ****
Needed so that the '=' in "enum bar {a = 1" does not
get interpreted as the start of an initializer. */
parser_state_tos->in_or_st = false;
!
parse(lbrace); /* let parser know about this */
if (parser_state_tos->want_blank) /* put a blank before '{' if '{' is not at
* start of line */
--- 934,940 ----
Needed so that the '=' in "enum bar {a = 1" does not
get interpreted as the start of an initializer. */
parser_state_tos->in_or_st = false;
!
parse(lbrace); /* let parser know about this */
if (parser_state_tos->want_blank) /* put a blank before '{' if '{' is not at
* start of line */
*************** check_type:
*** 1103,1109 ****
check_code_size;
*e_code++ = *t_ptr;
}
! }
parser_state_tos->want_blank = true;
/* If the token is va_dcl, it appears without a semicolon,
--- 1135,1141 ----
check_code_size;
*e_code++ = *t_ptr;
}
! }
parser_state_tos->want_blank = true;
/* If the token is va_dcl, it appears without a semicolon,
*************** check_type:
*** 1245,1251 ****
--- 1277,1287 ----
}
if (strncmp(s_lab + 1, "if", 2) == 0) {
+ #ifdef MSDOS
+ if (blanklines_around_cond_comp) {
+ #else
if (blanklines_around_conditional_compilation) {
+ #endif /* MSDOS */
register c;
prefix_blankline_requested++;
while ((c = *in_prog_pos++) == '\n');
*************** check_type:
*** 1286,1292 ****
(parser_state_tos->paren_indents_size * sizeof (short));
mymemcpy (new->paren_indents, parser_state_tos->paren_indents,
parser_state_tos->paren_indents_size * sizeof (short));
!
new->next = parser_state_tos;
parser_state_tos = new;
}
--- 1322,1328 ----
(parser_state_tos->paren_indents_size * sizeof (short));
mymemcpy (new->paren_indents, parser_state_tos->paren_indents,
parser_state_tos->paren_indents_size * sizeof (short));
!
new->next = parser_state_tos;
parser_state_tos = new;
}
*************** check_type:
*** 1316,1322 ****
mymemcpy (parser_state_tos, second,
sizeof(struct parser_state));
parser_state_tos->next = second;
!
/* Now copy the arrays from the second to top of
stack to the top of stack. */
/* Since the p_stack, etc. arrays only grow, never
--- 1352,1358 ----
mymemcpy (parser_state_tos, second,
sizeof(struct parser_state));
parser_state_tos->next = second;
!
/* Now copy the arrays from the second to top of
stack to the top of stack. */
/* Since the p_stack, etc. arrays only grow, never
*************** check_type:
*** 1369,1375 ****
--- 1405,1415 ----
}
else
diag(1, "Unmatched #endif");
+ #ifdef MSDOS
+ if (blanklines_around_cond_comp) {
+ #else
if (blanklines_around_conditional_compilation) {
+ #endif /* MSDOS */
postfix_blankline_requested++;
n_real_blanklines = 0;
}
*************** check_type:
*** 1403,1408 ****
--- 1443,1449 ----
* backup file will be "file.BAK" then make the backup file the input and
* original input file the output
*/
+ void
bakcopy()
{
/* file descriptor for the output file */
*************** bakcopy()
*** 1410,1433 ****
/* Used to walk around file names */
register char *p;
/* Buffer for error message. */
char *errbuf;
/* Backup file name. */
char *bakfile;
!
/* construct name of backup file */
for (p = in_name; *p; p++); /* skip to end of string */
while (p > in_name && *p != '/') /* find last '/' */
p--;
if (*p == '/')
p++;
bakfile = xmalloc(40 + strlen(p));
sprintf(bakfile, "%s.BAK", p);
errbuf = xmalloc(80 + strlen(p));
sprintf(errbuf,"indent: %s",bakfile);
!
/* copy in_name to backup file */
/* permissions 0666 means rw-rw-rw- (modified by umask). */
bakchn = creat(bakfile, 0666);
--- 1451,1495 ----
/* Used to walk around file names */
register char *p;
+ #ifdef MSDOS
+ char *p_no_ext,
+ *p_ext;
+ #endif /* MSDOS */
/* Buffer for error message. */
char *errbuf;
/* Backup file name. */
char *bakfile;
!
/* construct name of backup file */
for (p = in_name; *p; p++); /* skip to end of string */
+ #ifdef MSDOS
+ while (p > in_name && *p != '/' && *p != '\\' )
+ p--;
+ if (*p == '/' || *p == '\\' )
+ p++;
+ #else
while (p > in_name && *p != '/') /* find last '/' */
p--;
if (*p == '/')
p++;
+ #endif /* MSDOS */
+
bakfile = xmalloc(40 + strlen(p));
+ #ifdef MSDOS /* strip extension! */
+ p_no_ext = xmalloc(strlen(p)+1);
+ strcpy(p_no_ext,p);
+ if( p_ext = strrchr(p_no_ext,'.'))
+ *p_ext = '\0';
+ sprintf(bakfile, "%s.BAK", p_no_ext);
+ free(p_no_ext);
+ #else
sprintf(bakfile, "%s.BAK", p);
+ #endif /* MSDOS */
errbuf = xmalloc(80 + strlen(p));
sprintf(errbuf,"indent: %s",bakfile);
!
/* copy in_name to backup file */
/* permissions 0666 means rw-rw-rw- (modified by umask). */
bakchn = creat(bakfile, 0666);
*************** bakcopy()
*** 1437,1443 ****
--- 1499,1509 ----
exit(1);
}
+ #ifdef M_I86HM
+ if (hwrite(bakchn, in_prog, in_prog_size) != in_prog_size)
+ #else
if (write(bakchn, in_prog, in_prog_size) != in_prog_size)
+ #endif
{
perror(errbuf);
exit(1);
*************** bakcopy()
*** 1444,1450 ****
}
close(bakchn);
!
/* now the original input file will be the output */
output = fopen(in_name, "w");
if (output == 0) {
--- 1510,1516 ----
}
close(bakchn);
!
/* now the original input file will be the output */
output = fopen(in_name, "w");
if (output == 0) {
diff -cBdNp e:/gnu/indent/gnu/indent_g.h ./indent_g.h
*** e:/gnu/indent/gnu/indent_g.h Mon Jul 02 20:39:20 1990
--- ./indent_g.h Mon Jul 02 20:39:38 1990
***************
*** 20,26 ****
--- 20,64 ----
* @(#)indent_globs.h 5.7 (Berkeley) 9/15/88
*/
+ /*
+ * MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
+ *
+ * To this port, the same copying conditions apply as to the
+ * original release.
+ *
+ * IMPORTANT:
+ * This file is not identical to the original GNU release!
+ * You should have received this code as patch to the official
+ * GNU release.
+ *
+ * MORE IMPORTANT:
+ * This port comes with ABSOLUTELY NO WARRANTY.
+ *
+ * $Header: e:/gnu/indent/RCS/indent_g.h'v 1.1.0.4 90/07/02 20:25:28 tho Exp $
+ */
+
#include <stdio.h>
+
+ #ifdef MSDOS
+
+ #include <stdlib.h>
+ #include <string.h>
+ #include <malloc.h>
+ #include <io.h>
+
+ #define mymemcpy memcpy
+
+ #ifdef M_I86HM
+ /* This symbol is predefined by the Microsoft C Compiler,
+ when it is creating "huge memory model" code.
+ In that case we need long offsets and buffer lengths. */
+ #define LONG long
+ #else
+ #define LONG unsigned int
+ #endif
+
+ #else /* not MSDOS */
+
#include <strings.h>
/* Standard memory allocation routines. */
*************** char *realloc ();
*** 31,41 ****
char *xmalloc ();
char *xrealloc ();
/* Because some systems lack memcpy, I have provided one, called
mymemcpy. If you system memcpy is more efficient, you might
want to use it by uncommenting the following line. */
/* #define mymemcpy memcpy */
! char *mymemcpy ();
#define BACKSLASH '\\'
#define label_offset 2 /* number of levels a label is placed to left
--- 69,83 ----
char *xmalloc ();
char *xrealloc ();
+ #define LONG unsigned int
+
+ #endif /* not MSDOS */
+
/* Because some systems lack memcpy, I have provided one, called
mymemcpy. If you system memcpy is more efficient, you might
want to use it by uncommenting the following line. */
/* #define mymemcpy memcpy */
! /* char *mymemcpy (); see below, [tho] Mon Nov 13 01:12:02 1989 */
#define BACKSLASH '\\'
#define label_offset 2 /* number of levels a label is placed to left
*************** enum codes {code_eof = 0, /* end of fil
*** 61,70 ****
sp_nparen, ifstmt, whilestmt,
forstmt, stmt, stmtl, elselit, dolit, dohead, ifhead,
elsehead, period };
!
#define false 0
#define true 1
/* Name of input file. */
extern char *in_name;
--- 103,116 ----
sp_nparen, ifstmt, whilestmt,
forstmt, stmt, stmtl, elselit, dolit, dohead, ifhead,
elsehead, period };
!
#define false 0
#define true 1
+ #ifdef MSDOS
+ char *my_name; /* argv[0] */
+ #endif /* MSDOS */
+
/* Name of input file. */
extern char *in_name;
*************** char *in_prog_pos;
*** 78,84 ****
char *cur_line;
/* Size of the input program, not including the ' \n\0' we add at the end */
! int in_prog_size;
FILE *output; /* the output file */
--- 124,131 ----
char *cur_line;
/* Size of the input program, not including the ' \n\0' we add at the end */
! LONG in_prog_size;
!
FILE *output; /* the output file */
*************** int pointer_as_binop;
*** 177,183 ****
--- 224,234 ----
int blanklines_after_declarations;
int blanklines_before_blockcomments;
extern int blanklines_after_procs;
+ #ifdef MSDOS
+ int blanklines_around_cond_comp;
+ #else /* not MSDOS */
int blanklines_around_conditional_compilation;
+ #endif /* not MSDOS */
int swallow_optional_blanklines;
int n_real_blanklines;
int prefix_blankline_requested;
*************** extern int paren_target;
*** 241,247 ****
int Bill_Shannon; /* true iff a blank should always be inserted
* after sizeof */
! int blanklines_after_declarations_at_proctop; /* This is vaguely
* similar to
* blanklines_after_decla
* rations except that
--- 292,303 ----
int Bill_Shannon; /* true iff a blank should always be inserted
* after sizeof */
! #ifdef MSDOS
! int blanklin_after_decl_proctop;
! #else /* not MSDOS */
! int blanklines_after_declarations_at_proctop;
! #endif /* not MSDOS */
! /* This is vaguely
* similar to
* blanklines_after_decla
* rations except that
*************** extern int use_stdinout;
*** 294,299 ****
--- 350,358 ----
struct fstate {
char font[4];
char size;
+ #ifdef MSDOS
+ unsigned
+ #endif /* MSDOS */
int allcaps:1;
};
char *chfont();
*************** extern struct parser_state *parser_state
*** 415,417 ****
--- 474,516 ----
/* The column in which comments to the right of #else and #endif should
start. */
extern int else_endif_col;
+
+ #ifdef MSDOS
+ char *chfont (struct fstate *, struct fstate *, char *);
+ enum codes lexi (void);
+ int compute_code_target (void);
+ int compute_label_target (void);
+ int count_spaces (int, char *);
+ int eqin (char *, char *, char * *);
+ void fill_buffer (void);
+ int pad_output (int, int);
+ struct templ *is_reserved (char *, int);
+ void *mymemcpy (void *, const void *, size_t);
+ void *xmalloc (size_t);
+ void *xrealloc (void *, size_t);
+ void addkey (char *, enum rwcodes);
+ void bakcopy (void);
+ void diag (int, char *,...);
+ void dump_line (void);
+ void fill_buffer (void);
+ void main (int, char * *);
+ void parse (enum codes);
+ void parsefont (struct fstate *, char *);
+ void pr_comment (void);
+ void read_file (char *);
+ void read_stdin (void);
+ void reduce (void);
+ void scan_profile (FILE *);
+ void set_defaults (void);
+ void set_option (char *, int);
+ void set_profile (void);
+ void writefdef (struct fstate *, int);
+
+ #ifdef M_I86HM
+ void huge *xhalloc (long size);
+ void huge *xhrealloc (void huge *ptr, long new_size, long old_size);
+ long hread (int fd, void huge *buffer, long bytes);
+ long hwrite (int fd, void huge *buffer, long bytes);
+ #endif /* M_I86HM */
+
+ #endif /* MSDOS */
diff -cBdNp e:/gnu/indent/gnu/io.c ./io.c
*** e:/gnu/indent/gnu/io.c Mon Jul 02 20:39:22 1990
--- ./io.c Mon Jul 02 20:39:42 1990
***************
*** 18,23 ****
--- 18,40 ----
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
+ /*
+ * MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
+ *
+ * To this port, the same copying conditions apply as to the
+ * original release.
+ *
+ * IMPORTANT:
+ * This file is not identical to the original GNU release!
+ * You should have received this code as patch to the official
+ * GNU release.
+ *
+ * MORE IMPORTANT:
+ * This port comes with ABSOLUTELY NO WARRANTY.
+ *
+ * $Header: e:/gnu/indent/RCS/io.c'v 1.1.0.5 90/07/02 20:28:47 tho Exp $
+ */
+
#ifndef lint
static char sccsid[] = "@(#)io.c 5.10 (Berkeley) 9/15/88";
#endif /* not lint */
*************** int paren_target;
*** 39,44 ****
--- 56,62 ----
/* true if INDENT OFF is in effect */
static int inhibit_formatting;
+ void
dump_line()
{ /* dump_line is the routine that actually
* effects the printing of the new source. It
*************** dump_line()
*** 142,148 ****
fprintf(output, ".*/\n");
}
target_col = compute_code_target();
! /* If a line ends in an lparen character, the following
line should not line up with the parenthesis, but
should be indented by the usual amount. */
if (parser_state_tos->last_token == lparen)
--- 160,166 ----
fprintf(output, ".*/\n");
}
target_col = compute_code_target();
! /* If a line ends in an lparen character, the following
line should not line up with the parenthesis, but
should be indented by the usual amount. */
if (parser_state_tos->last_token == lparen)
*************** dump_line()
*** 225,231 ****
--- 243,253 ----
}
}
else { /* print comment, if any */
+ #ifdef MSDOS
+ register int target = parser_state_tos->com_col;
+ #else
register target = parser_state_tos->com_col;
+ #endif
register char *com_st = s_com;
target += parser_state_tos->comment_delta;
*************** inhibit_newline:
*** 301,314 ****
--- 323,345 ----
int
compute_code_target()
{
+ #ifdef MSDOS
+ register int target_col = parser_state_tos->ind_level + 1;
+ #else
register target_col = parser_state_tos->ind_level + 1;
+ #endif /* MSDOS */
if (parser_state_tos->paren_level)
if (!lineup_to_parens)
target_col += continuation_indent * parser_state_tos->paren_level;
else {
+ #ifdef MSDOS
+ register int w;
+ register int t = paren_target;
+ #else
register w;
register t = paren_target;
+ #endif /* MSDOS */
if ((w = count_spaces(t, s_code) - max_col) > 0
&& count_spaces(target_col, s_code) <= max_col) {
*************** compute_label_target()
*** 333,340 ****
: parser_state_tos->ind_level - label_offset + 1;
}
! /* Allocate space for FILENAME, read in the file, and set in_prog and
! in_prog_pos to point to the buffer. If any errors occur, report an
error message and abort. */
void
read_file(filename)
--- 364,371 ----
: parser_state_tos->ind_level - label_offset + 1;
}
! /* Allocate space for FILENAME, read in the file, and set in_prog and
! in_prog_pos to point to the buffer. If any errors occur, report an
error message and abort. */
void
read_file(filename)
*************** read_file(filename)
*** 345,350 ****
--- 376,382 ----
/* File status for the input file */
struct stat in_stat;
+ LONG bytes_read;
/* buffer used for error messages */
char *errbuf;
*************** read_file(filename)
*** 364,378 ****
perror(errbuf);
exit(1);
}
in_prog_size = in_stat.st_size;
in_prog = xmalloc(in_prog_size + 3); /* 3 for ' ','\n','\0' */
! if (read(in_fd,in_prog,in_prog_size) < 0)
{
perror(errbuf);
exit(1);
}
if (close(in_fd) < 0)
{
perror(errbuf);
--- 396,448 ----
perror(errbuf);
exit(1);
}
+
+ #ifdef MSDOS
+
+ #ifdef M_I86HM
in_prog_size = in_stat.st_size;
+ in_prog = xhalloc(in_prog_size + 3); /* 3 for ' ','\n','\0' */
+
+ if ( (bytes_read=hread(in_fd,in_prog,in_prog_size)) < 0)
+ {
+ perror(errbuf);
+ exit(1);
+ }
+ #else /* not M_I86HM */
+ if (in_stat.st_size >= 0xfff0)
+ {
+ fprintf (stderr, "Can't handle large files (> 64k) under MS-DOS, "
+ "if not compiled with huge pointers.\nSorry.\n");
+ exit (1);
+ }
+ in_prog_size = (unsigned int) in_stat.st_size;
in_prog = xmalloc(in_prog_size + 3); /* 3 for ' ','\n','\0' */
! if ( (bytes_read=read(in_fd,in_prog,in_prog_size)) < 0)
! {
! perror(errbuf);
! exit(1);
! }
! #endif /* not M_I86HM */
!
! if (close(in_fd) < 0)
{
perror(errbuf);
exit(1);
}
+ in_prog_size = bytes_read; /* the crlf story ... */
+
+ #else /* not MSDOS */
+
+ in_prog_size = in_stat.st_size;
+ in_prog = xmalloc(in_prog_size + 3); /* 3 for ' ','\n','\0' */
+
+ if ( (bytes_read=read(in_fd,in_prog,in_prog_size)) < 0)
+ {
+ perror(errbuf);
+ exit(1);
+ }
if (close(in_fd) < 0)
{
perror(errbuf);
*************** read_file(filename)
*** 379,387 ****
exit(1);
}
in_prog[in_prog_size] = ' ';
in_prog[in_prog_size+1] = '\n';
! in_prog[in_prog_size+2] = 0;
in_prog_pos = in_prog;
free (errbuf);
--- 449,459 ----
exit(1);
}
+ #endif /* not MSDOS */
+
in_prog[in_prog_size] = ' ';
in_prog[in_prog_size+1] = '\n';
! in_prog[in_prog_size+2] = '\0';
in_prog_pos = in_prog;
free (errbuf);
*************** read_file(filename)
*** 391,396 ****
--- 464,523 ----
void
read_stdin()
{
+ #ifdef MSDOS
+
+ LONG alloc_size = 10000;
+ int ch;
+
+ in_prog_pos = in_prog
+ #ifdef M_I86HM
+ = xhalloc (alloc_size);
+ #else /* not M_I86HM */
+ = xmalloc (alloc_size);
+ #endif /* not M_I86HM */
+
+ in_prog_size = 0;
+ do
+ {
+ /* Copy up until 3 bytes before the end of the buffer,
+ (the 3 is for ' \n\0')... */
+ for (; in_prog_size < alloc_size - 3; in_prog_size++)
+ {
+ ch = getc(stdin);
+ if (ch == EOF)
+ break;
+ in_prog[in_prog_size] = (char) ch;
+ }
+ /* ...and if that's not enough allocate more. */
+ if (ch != EOF) {
+ #ifdef M_I86HM
+
+ LONG old_alloc_size = alloc_size;
+ alloc_size *= 2;
+ in_prog = xhrealloc (in_prog, alloc_size, old_alloc_size);
+
+ #else /* not M_I86HM */
+
+ if (alloc_size >= 0xFFE0)
+ {
+ fprintf (stderr, "Can't handle large files (> 64k) under MS-DOS, "
+ "if not compiled with huge pointers.\nSorry.\n");
+ exit (1);
+ }
+ else if (alloc_size >= 0x7FF0)
+ alloc_size = 0xFFE0;
+ else
+ alloc_size *= 2;
+
+ in_prog = xrealloc(in_prog,alloc_size);
+
+ #endif /* not M_I86HM */
+ }
+ }
+ while (ch != EOF);
+
+ #else /* not MSDOS */
+
unsigned int alloc_size = 10000;
int ch;
*************** read_stdin()
*** 405,411 ****
ch = getc(stdin);
if (ch == EOF)
break;
! in_prog[in_prog_size] = ch;
}
/* ...and if that's not enough allocate more. */
if (ch != EOF) {
--- 532,538 ----
ch = getc(stdin);
if (ch == EOF)
break;
! in_prog[in_prog_size] = (char) ch;
}
/* ...and if that's not enough allocate more. */
if (ch != EOF) {
*************** read_stdin()
*** 414,432 ****
}
}
while (ch != EOF);
!
in_prog[in_prog_size] = ' ';
in_prog[in_prog_size+1] = '\n';
in_prog[in_prog_size+2] = 0;
! in_prog_pos = in_prog;
}
! /* Advance buf_ptr so that it points to the next line of input. Skip
over indent errors (comments beginning with *INDENT**), ignoring
them. Process INDENT ON and INDENT OFF. (Note: the name of this
function is a historical artifact from before the time that indent
kept the whole source file in memory). */
fill_buffer()
{
/* Point various places in the buffer. */
--- 541,562 ----
}
}
while (ch != EOF);
!
! #endif /* not MSDOS */
!
in_prog[in_prog_size] = ' ';
in_prog[in_prog_size+1] = '\n';
in_prog[in_prog_size+2] = 0;
! in_prog_pos = in_prog;
}
! /* Advance buf_ptr so that it points to the next line of input. Skip
over indent errors (comments beginning with *INDENT**), ignoring
them. Process INDENT ON and INDENT OFF. (Note: the name of this
function is a historical artifact from before the time that indent
kept the whole source file in memory). */
+ void
fill_buffer()
{
/* Point various places in the buffer. */
*************** fill_buffer()
*** 434,440 ****
/* Have we found INDENT ON or INDENT OFF ? */
enum {None,Indent_on,Indent_off} com;
!
if (bp_save != 0)
{ /* there is a partly filled input buffer left */
buf_ptr = bp_save; /* dont read anything, just switch buffers */
--- 564,570 ----
/* Have we found INDENT ON or INDENT OFF ? */
enum {None,Indent_on,Indent_off} com;
!
if (bp_save != 0)
{ /* there is a partly filled input buffer left */
buf_ptr = bp_save; /* dont read anything, just switch buffers */
*************** fill_buffer()
*** 451,457 ****
buf_ptr = in_prog_pos;
for (p = buf_ptr; *p && *p++ != '\n';)
;
!
buf_end = p;
if (!*p)
had_eof = true;
--- 581,587 ----
buf_ptr = in_prog_pos;
for (p = buf_ptr; *p && *p++ != '\n';)
;
!
buf_end = p;
if (!*p)
had_eof = true;
*************** fill_buffer()
*** 458,464 ****
p = buf_ptr;
in_prog_pos = buf_end;
!
while (*p == ' ' || *p == '\t')
p++;
if (*p == '/' && p[1] == '*')
--- 588,594 ----
p = buf_ptr;
in_prog_pos = buf_end;
!
while (*p == ' ' || *p == '\t')
p++;
if (*p == '/' && p[1] == '*')
*************** fill_buffer()
*** 502,539 ****
putc(*p,output);
while (*p++ != '\n');
}
!
}
!
!
!
/*
* Copyright (C) 1976 by the Board of Trustees of the University of Illinois
! *
* All rights reserved
! *
! *
* NAME: pad_output
! *
* FUNCTION: Writes tabs and spaces to move the current column up to the desired
* position.
! *
* ALGORITHM: Put tabs and/or blanks into pobuf, then write pobuf.
! *
* PARAMETERS: current integer The current column target
* nteger The desired column
! *
* RETURNS: Integer value of the new column. (If current >= target, no action is
* taken, and current is returned.
! *
* GLOBALS: None
! *
* CALLS: write (sys)
! *
* CALLED BY: dump_line
! *
* HISTORY: initial coding November 1976 D A Willcox of CAC
! *
*/
pad_output(current, target) /* writes tabs and blanks (if necessary) to
* get the current output position up to the
--- 633,670 ----
putc(*p,output);
while (*p++ != '\n');
}
!
}
!
!
!
/*
* Copyright (C) 1976 by the Board of Trustees of the University of Illinois
! *
* All rights reserved
! *
! *
* NAME: pad_output
! *
* FUNCTION: Writes tabs and spaces to move the current column up to the desired
* position.
! *
* ALGORITHM: Put tabs and/or blanks into pobuf, then write pobuf.
! *
* PARAMETERS: current integer The current column target
* nteger The desired column
! *
* RETURNS: Integer value of the new column. (If current >= target, no action is
* taken, and current is returned.
! *
* GLOBALS: None
! *
* CALLS: write (sys)
! *
* CALLED BY: dump_line
! *
* HISTORY: initial coding November 1976 D A Willcox of CAC
! *
*/
pad_output(current, target) /* writes tabs and blanks (if necessary) to
* get the current output position up to the
*************** pad_output(current, target) /* writes ta
*** 562,584 ****
/*
* Copyright (C) 1976 by the Board of Trustees of the University of Illinois
! *
* All rights reserved
! *
! *
* NAME: count_spaces
! *
* FUNCTION: Find out where printing of a given string will leave the current
* character position on output.
! *
* ALGORITHM: Run thru input string and add appropriate values to current
* position.
! *
* RETURNS: Integer value of position after printing "buffer" starting in column
* "current".
! *
* HISTORY: initial coding November 1976 D A Willcox of CAC
! *
*/
int
count_spaces(current, buffer)
--- 693,715 ----
/*
* Copyright (C) 1976 by the Board of Trustees of the University of Illinois
! *
* All rights reserved
! *
! *
* NAME: count_spaces
! *
* FUNCTION: Find out where printing of a given string will leave the current
* character position on output.
! *
* ALGORITHM: Run thru input string and add appropriate values to current
* position.
! *
* RETURNS: Integer value of position after printing "buffer" starting in column
* "current".
! *
* HISTORY: initial coding November 1976 D A Willcox of CAC
! *
*/
int
count_spaces(current, buffer)
*************** count_spaces(current, buffer)
*** 621,630 ****
/* Nonzero if we have found an error (not a warning). */
int found_err;
! /* Signal an error. LEVEL is nonzero if it is an error (as opposed to
! a warning. MSG is a printf-style format string. Additional
arguments are additional arguments for printf. */
/* VARARGS2 */
diag(level, msg, a, b)
char *msg;
{
--- 752,762 ----
/* Nonzero if we have found an error (not a warning). */
int found_err;
! /* Signal an error. LEVEL is nonzero if it is an error (as opposed to
! a warning. MSG is a printf-style format string. Additional
arguments are additional arguments for printf. */
/* VARARGS2 */
+ void
diag(level, msg, a, b)
char *msg;
{
*************** diag(level, msg, a, b)
*** 642,647 ****
--- 774,780 ----
}
}
+ void
writefdef(f, nm)
register struct fstate *f;
{
*************** chfont(of, nf, s)
*** 685,691 ****
return s;
}
!
parsefont(f, s0)
register struct fstate *f;
char *s0;
--- 818,824 ----
return s;
}
! void
parsefont(f, s0)
register struct fstate *f;
char *s0;
*************** parsefont(f, s0)
*** 693,704 ****
register char *s = s0;
int sizedelta = 0;
int i;
!
f->size = 0;
f->allcaps = 1;
for (i = 0; i < 4; i++)
f->font[i] = 0;
!
while (*s) {
if (isdigit(*s))
f->size = f->size * 10 + *s - '0';
--- 826,837 ----
register char *s = s0;
int sizedelta = 0;
int i;
!
f->size = 0;
f->allcaps = 1;
for (i = 0; i < 4; i++)
f->font[i] = 0;
!
while (*s) {
if (isdigit(*s))
f->size = f->size * 10 + *s - '0';
diff -cBdNp e:/gnu/indent/gnu/lexi.c ./lexi.c
*** e:/gnu/indent/gnu/lexi.c Mon Jul 02 20:39:22 1990
--- ./lexi.c Mon Jul 02 20:39:44 1990
***************
*** 18,23 ****
--- 18,40 ----
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
+ /*
+ * MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
+ *
+ * To this port, the same copying conditions apply as to the
+ * original release.
+ *
+ * IMPORTANT:
+ * This file is not identical to the original GNU release!
+ * You should have received this code as patch to the official
+ * GNU release.
+ *
+ * MORE IMPORTANT:
+ * This port comes with ABSOLUTELY NO WARRANTY.
+ *
+ * $Header: e:/gnu/indent/RCS/lexi.c'v 1.1.0.1 90/07/02 10:32:29 tho Exp $
+ */
+
#ifndef lint
static char sccsid[] = "@(#)lexi.c 5.11 (Berkeley) 9/15/88";
#endif /* not lint */
*************** static char sccsid[] = "@(#)lexi.c 5.11
*** 31,36 ****
--- 48,57 ----
#include "indent_globs.h"
#include <ctype.h>
+ #ifdef MSDOS
+ static int hash (char *, int);
+ #endif
+
#define alphanum 1
#define opchar 3
*************** lexi()
*** 582,587 ****
--- 603,609 ----
/*
* Add the given keyword to the keyword table, using val as the keyword type
*/
+ void
addkey(key, val)
char *key;
enum rwcodes val;
diff -cBdNp e:/gnu/indent/gnu/makefile ./makefile
*** e:/gnu/indent/gnu/makefile Mon Jul 02 20:40:01 1990
--- ./makefile Mon Jul 02 20:39:48 1990
***************
*** 0 ****
--- 1,62 ----
+ # Copyright (c) 1987 Regents of the University of California.
+ # All rights reserved.
+ #
+ # Redistribution and use in source and binary forms are permitted
+ # provided that the above copyright notice and this paragraph are
+ # duplicated in all such forms and that any documentation,
+ # advertising materials, and other materials related to such
+ # distribution and use acknowledge that the software was developed
+ # by the University of California, Berkeley. The name of the
+ # University may not be used to endorse or promote products derived
+ # from this software without specific prior written permission.
+ # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ #
+ # @(#)Makefile 5.9 (Berkeley) 9/15/88
+ #
+ # $Header: e:/gnu/indent/RCS/makefile.'v 1.1.0.3 90/07/02 20:22:49 tho Exp $
+ #
+
+ BINDIR = c:/bin
+
+ # MSC 5.1 bombs with -Oailt -Gs, we have not yet taken pains to spot
+ # the faulty module.
+ # Floating point makes no sense, pretending to use the alternate library
+ # prevents the dumb linker from loading to much floating point code.
+
+ CFLAGS = -AH -FPa -Oilt -Gs -W3
+ LDFLAGS = /e/st:0x2000
+
+ SRCS = indent.c io.c lexi.c parse.c pr_comment.c args.c globs.c
+ OBJS = indent.obj io.obj lexi.obj parse.obj pr_comment.obj \
+ args.obj globs.obj
+ HEADERS = indent_g.h version.h
+
+ all: indent.exe
+
+ indent.exe: $(OBJS)
+ $(LINK) $(LDFLAGS) $(OBJS), $@;
+
+ zip:
+ pkzip -f indent'v
+
+ disk:
+ cp indent'v.zip b:/indent'v.zip
+ pkunzip -t b:/indent'v | grep -vw OK
+
+ $(OBJS): indent_globs.h
+ args.obj: version.h
+
+ install:
+ cp indent.exe $(BINDIR)
+
+ clean:
+ rm -f *.exe *.obj errs tags
+ rcsclean *.c *.h
+
+ tags: $(SRCS) $(HEADERS)
+ etags -t *.h *.c
+
+
+
diff -cBdNp e:/gnu/indent/gnu/parse.c ./parse.c
*** e:/gnu/indent/gnu/parse.c Mon Jul 02 20:39:22 1990
--- ./parse.c Mon Jul 02 20:39:46 1990
***************
*** 18,23 ****
--- 18,40 ----
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
+ /*
+ * MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
+ *
+ * To this port, the same copying conditions apply as to the
+ * original release.
+ *
+ * IMPORTANT:
+ * This file is not identical to the original GNU release!
+ * You should have received this code as patch to the official
+ * GNU release.
+ *
+ * MORE IMPORTANT:
+ * This port comes with ABSOLUTELY NO WARRANTY.
+ *
+ * $Header: e:/gnu/indent/RCS/parse.c'v 1.1.0.1 90/07/02 10:32:31 tho Exp $
+ */
+
#ifndef lint
static char sccsid[] = "@(#)parse.c 5.8 (Berkeley) 9/15/88";
#endif /* not lint */
*************** static char sccsid[] = "@(#)parse.c 5.8
*** 24,29 ****
--- 41,50 ----
#include "indent_globs.h"
+ #ifdef MSDOS
+ static int inc_pstack (void);
+ #endif
+
struct parser_state *parser_state_tos;
/* like ++parser_state_tos->tos but checks for stack overflow and extends
*************** parse(tk)
*** 280,285 ****
--- 301,307 ----
/*----------------------------------------------*\
| REDUCTION PHASE |
\*----------------------------------------------*/
+ void
reduce()
{
diff -cBdNp e:/gnu/indent/gnu/pr_comme.c ./pr_comme.c
*** e:/gnu/indent/gnu/pr_comme.c Mon Jul 02 20:39:24 1990
--- ./pr_comme.c Mon Jul 02 20:39:46 1990
***************
*** 18,23 ****
--- 18,40 ----
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
+ /*
+ * MS-DOS port (c) 1990 by Thorsten Ohl, td12@ddagsi3.bitnet
+ *
+ * To this port, the same copying conditions apply as to the
+ * original release.
+ *
+ * IMPORTANT:
+ * This file is not identical to the original GNU release!
+ * You should have received this code as patch to the official
+ * GNU release.
+ *
+ * MORE IMPORTANT:
+ * This port comes with ABSOLUTELY NO WARRANTY.
+ *
+ * $Header: e:/gnu/indent/RCS/pr_comme.c'v 1.1.0.1 90/07/02 10:32:33 tho Exp $
+ */
+
#ifndef lint
static char sccsid[] = "@(#)pr_comment.c 5.9 (Berkeley) 9/15/88";
#endif /* not lint */
*************** static char sccsid[] = "@(#)pr_comment.c
*** 56,62 ****
#include "indent_globs.h"
!
pr_comment()
{
int now_col; /* column we are in now */
--- 73,79 ----
#include "indent_globs.h"
! void
pr_comment()
{
int now_col; /* column we are in now */
diff -cBdNp e:/gnu/indent/gnu/version.h ./version.h
*** e:/gnu/indent/gnu/version.h Mon Jul 02 20:39:24 1990
--- ./version.h Mon Jul 02 20:39:48 1990
***************
*** 1,5 ****
#define VERSION_STRING \
! "GNU indent 1.1. Based on Berkeley indent 5.11 (9/15/88)."
/* Not strictly true, because I've merged in a bunch of changes
from the BSD version of Sep 89, but it wouldn't really be correct
--- 1,6 ----
#define VERSION_STRING \
! "GNU indent 1.1. Based on Berkeley indent 5.11 (9/15/88).\n"\
! "$Header: e:/gnu/indent/RCS/version.h'v 1.1.0.1 90/01/16 22:09:21 tho Exp $"
/* Not strictly true, because I've merged in a bunch of changes
from the BSD version of Sep 89, but it wouldn't really be correct